Salome HOME
gcc 4.9 compatibility
[modules/shaper.git] / src / NewGeom / NewGeom_NestedButton.h
1 /*
2  * NewGeom_NestedButton.h
3  *
4  *  Created on: Apr 13, 2015
5  *      Author: sbh
6  */
7
8 #ifndef SRC_NEWGEOM_NEWGEOM_NESTEDBUTTON_H_
9 #define SRC_NEWGEOM_NEWGEOM_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 NewGeom_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   NewGeom_NestedButton(QObject* theParent, const QList<QAction*>& theNestedActions);
30   virtual ~NewGeom_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  private:
45   QList<QAction*> myNestedActions; ///< list of nested actions
46   QWidget* myAdditionalButtonsWidget; ///< widget to precess additional buttons visibility
47   QFrame* myButtonFrame; ///< frame arround button representation
48   QToolButton* myThisButton; ///< main button
49 };
50
51 #endif /* SRC_NEWGEOM_NEWGEOM_NESTEDBUTTON_H_ */