SHAPER  9.12.0
ModuleBase_ToolBox.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef ModuleBase_ToolBox_H
21 #define ModuleBase_ToolBox_H
22 
23 #include <ModuleBase.h>
24 #include <QFrame>
25 
26 class QButtonGroup;
27 class QFrame;
28 class QHBoxLayout;
29 class QStackedWidget;
31 
37 class MODULEBASE_EXPORT ModuleBase_ToolBox : public QFrame
38 {
39  Q_OBJECT
40 
41 public:
46  ModuleBase_ToolBox(QWidget* theParent, const bool theUseFrameStyleBox = false);
47  virtual ~ModuleBase_ToolBox();
48 
53  void addItem(QWidget* thePage, const QString& theName, const QPixmap& theIcon);
54 
56  int count() const;
57 
59  int currentIndex() const;
60 
63  void setCurrentIndex(const int theIdx);
64 
69  static bool isOffToolBoxParent(ModuleBase_ModelWidget* theWidget);
70 
71 signals:
73  void currentChanged(int);
74 
75 private slots:
77  void onButton(int);
78 
79 private:
80  QButtonGroup* myButtonsGroup;
81  QFrame* myButtonsFrame;
82  QHBoxLayout* myButtonsLayout;
83  QStackedWidget* myStack;
84 };
85 #endif
An abstract custom widget class.
Definition: ModuleBase_ModelWidget.h:60
An extension of QFrame object.
Definition: ModuleBase_ToolBox.h:38
void currentChanged(int)
A signal which is emited on current item changed.