]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_Command.h
Salome HOME
Refresh menu size after chnges in preferences
[modules/shaper.git] / src / XGUI / XGUI_Command.h
1 #ifndef XGUI_Command_H
2 #define XGUI_Command_H
3
4 #include "XGUI.h"
5 #include <QWidgetAction>
6
7
8 #define MIN_BUTTON_HEIGHT 25
9 #define MIN_BUTTON_WIDTH 60
10
11 /**\class XGUI_Command
12  * \ingroup GUI
13  * \brief Represents a command item in the application menu (Workbench)
14  */
15 class XGUI_EXPORT XGUI_Command: public QWidgetAction
16 {
17 Q_OBJECT
18 public:
19   XGUI_Command(const QString& theId, QObject * parent, bool isCheckable = false);
20   XGUI_Command(const QString& theId, const QIcon& icon, const QString& text, QObject* parent, bool isCheckable = false);
21   ~XGUI_Command();
22
23   //VSV: Don't use this method for compatibility with SALOME. Use the construction below
24   /*virtual QString id() const
25   {
26     return data().toString();
27   }*/
28
29   const QStringList& nestedCommands() const;
30   void setNestedCommands(const QStringList& myUnblockableCommands);
31
32   //! Connect the command to a slot
33   virtual void connectTo(const QObject* theResiver, const char* theSlot);
34
35 protected:
36   //! Creates a command representation widget dependently on parent widget type
37   virtual QWidget* createWidget(QWidget* theParent);
38
39 private:
40   bool myCheckable;
41   //! List of Ids of commands which WILL NOT be blocked when the command is on.
42   QStringList myNestedCommands;
43 };
44
45 #endif