Salome HOME
PAL10125 - by double click on reference original object becomes selected
[modules/gui.git] / src / GLViewer / GLViewer_ToolTip.h
1 // File:      GLViewer_ToolTip.h
2 // Created:   March, 2005
3 // Author:    OCC team
4 // Copyright (C) CEA 2005
5
6 #ifndef GLVIEWER_TOOLTIP_H
7 #define GLVIEWER_TOOLTIP_H
8
9 #include "GLViewer.h"
10
11 //#include <qtooltip.h>
12 //#include <QtxToolTip.h>
13 #include <qobject.h>
14
15 #define TIP_TIME            1000
16
17 class GLViewer_ViewPort2d;
18 class QLabel;
19 /***************************************************************************
20 **  Class:   GLViewer_ObjectTip
21 **  Descr:   ToolTip of GLViewer_Objects
22 **  Module:  GLViewer
23 **  Created: UI team, 28.03.05
24 ****************************************************************************/
25 class GLVIEWER_API GLViewer_ObjectTip: public QObject//QToolTip//QtxToolTip
26 {
27   Q_OBJECT
28 public:
29   GLViewer_ObjectTip( GLViewer_ViewPort2d* );
30   ~GLViewer_ObjectTip();
31
32 //protected:
33 //  virtual void    maybeTip( const QPoint& p );
34   virtual bool        eventFilter( QObject*, QEvent* );
35
36   virtual bool        maybeTip( const QPoint&);
37
38   void                setText( const QString& theText ){ myText = theText; }
39   QString             getText() const { return myText; }
40
41 protected:
42   void                timeIsOut();
43
44 private:
45
46   void                hideTipAndSleep();
47   void                wakeup( int mseconds = TIP_TIME );
48
49 private slots:
50   void                showTip();
51
52 private:
53   GLViewer_ViewPort2d*    mypViewPort;
54
55   QTimer*                 mypTimer;
56   QPoint                  myPoint;
57   QLabel*                 mypLabel;
58
59   QString                 myText;
60 };
61
62 #endif //GLVIEWER_TOOLTIP_H