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 ModuleBase_ToolBox( QWidget* theParent );
32 virtual ~ModuleBase_ToolBox();
34 /// Add a new item to the tool box
35 /// \param thePage a widget of the new item
36 /// \param theName a name of the item
37 /// \param theIcon an icon of the item
38 void addItem( QWidget* thePage, const QString& theName, const QPixmap& theIcon );
40 /// \return number of items
43 /// \return index of current widget
44 int currentIndex() const;
47 /// \param theIdx an index
48 void setCurrentIndex( const int theIdx);
50 /// Found in the controls of the model widget parent in Stacked Widget
51 /// returns whether this controls are in the current widget of the stacked widgets
52 /// \param theWidget a model widget
53 /// \return boolean result
54 static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
57 /// A signal which is emited on current item changed
58 void currentChanged( int );
61 /// A slot called on button press
65 QButtonGroup* myButtonsGroup;
66 QFrame* myButtonsFrame;
67 QHBoxLayout* myButtonsLayout;
68 QStackedWidget* myStack;