Salome HOME
Different salome launchers for release and debug version (for proper environment).
[modules/shaper.git] / src / SHAPERGUI / SHAPERGUI_NestedButton.h
1 /*
2  * SHAPERGUI_NestedButton.h
3  *
4  *  Created on: Apr 13, 2015
5  *      Author: sbh
6  */
7
8 #ifndef SRC_SHAPERGUI_NESTEDBUTTON_H_
9 #define SRC_SHAPERGUI_NESTEDBUTTON_H_
10
11 #include <QWidgetAction>
12
13 class QFrame;
14 class QAction;
15 class QWidget;
16 class QToolButton;
17
18 /*!
19  * \ingroup Salome
20  * Custom (nested) button in salome mode.
21  */
22 class SHAPERGUI_NestedButton : public QWidgetAction
23 {
24   Q_OBJECT
25  public:
26    /// Constructor
27    /// \param theParent a parent objects
28    /// \param theNestedActions a list of nested actions
29   SHAPERGUI_NestedButton(QObject* theParent, const QList<QAction*>& theNestedActions);
30   virtual ~SHAPERGUI_NestedButton();
31
32  private slots:
33   /// Shows/hides the additional buttons widget
34   void showAdditionalButtons(bool);
35
36   /// Slot called on action state
37   void actionStateChanged();
38
39  protected:
40   /// Creates the button representation
41   /// \param theParent a parent widget
42   virtual QWidget * createWidget(QWidget * theParent);
43   
44   virtual bool event(QEvent* theEvent);
45
46  private:
47   QList<QAction*> myNestedActions; ///< list of nested actions
48   QWidget* myAdditionalButtonsWidget; ///< widget to precess additional buttons visibility
49   QFrame* myButtonFrame; ///< frame arround button representation
50   QToolButton* myThisButton; ///< main button
51 };
52
53 #endif /* SRC_SHAPERGUI_NESTEDBUTTON_H_ */