Salome HOME
Fix for bug 10438: Crash during Explode on Blocks operation (Global selection on...
[modules/gui.git] / src / SUIT / SUIT_ToolButton.h
1 #ifndef SUIT_TOOLBUTTON_H
2 #define SUIT_TOOLBUTTON_H
3
4 #include <qtoolbutton.h>
5 #include <qaction.h>
6
7 #include "SUIT.h"
8
9 /*! To draw down arrow on toolbutton.*/
10 class SUIT_EXPORT SUIT_ToolButton : public QToolButton
11 {
12   Q_OBJECT
13
14 public:
15   /*! @name constructors*/
16   //@{
17   SUIT_ToolButton( QWidget *parent = 0, 
18                    const char *name = 0,
19                    bool changeItemAfterClick = true );
20   SUIT_ToolButton(  const QPixmap & pm, const QString &textLabel,
21                     const QString& grouptext,
22                     QObject * receiver, const char* slot,
23                     QToolBar * parent, const char* name = 0,
24                     bool changeItemAfterClick = true );
25   //@}
26
27   void drawButton( QPainter * pQPainter);
28
29   void AddAction(QAction* theAction);
30
31   void SetItem(int theIndex);
32
33 public slots:
34   void OnSelectAction(int theItemID);
35
36 protected:
37   void  mouseReleaseEvent (QMouseEvent * theEvent);
38
39 private:
40   void initialize();
41
42   QPopupMenu* myPopup;
43   QSignal* mySignal;
44   bool myChangeItemAfterClick;
45
46 };
47
48 #endif
49