1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_ToolBox.h
4 // Created: 10 August 2015
5 // Author: Alexandre SOLOVYOV
7 #ifndef ModuleBase_ToolBox_H
8 #define ModuleBase_ToolBox_H
10 #include <ModuleBase.h>
17 class ModuleBase_ModelWidget;
20 * \class ModuleBase_ToolBox
22 * \brief An extension of QFrame object
24 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
30 /// \param theParent a parent widget
31 /// \param theUseFrameStyleBox a flag if the tool box should have box covered
32 /// buttons and current page
33 ModuleBase_ToolBox(QWidget* theParent, const bool theUseFrameStyleBox = false);
34 virtual ~ModuleBase_ToolBox();
36 /// Add a new item to the tool box
37 /// \param thePage a widget of the new item
38 /// \param theName a name of the item
39 /// \param theIcon an icon of the item
40 void addItem(QWidget* thePage, const QString& theName, const QPixmap& theIcon);
42 /// \return number of items
45 /// \return index of current widget
46 int currentIndex() const;
49 /// \param theIdx an index
50 void setCurrentIndex(const int theIdx);
52 /// Found in the controls of the model widget parent in Stacked Widget
53 /// returns whether this controls are in the current widget of the stacked widgets
54 /// \param theWidget a model widget
55 /// \return boolean result
56 static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
59 /// A signal which is emited on current item changed
60 void currentChanged(int);
63 /// A slot called on button press
67 QButtonGroup* myButtonsGroup;
68 QFrame* myButtonsFrame;
69 QHBoxLayout* myButtonsLayout;
70 QStackedWidget* myStack;