1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * ModuleBase_WidgetSwitch.h
6 * Created on: Apr 16, 2014
10 #ifndef ModuleBase_WidgetSwitch_H_
11 #define ModuleBase_WidgetSwitch_H_
13 #include <ModuleBase.h>
21 * Implements a model widget for swithch as a container widget. It can be defined in XML with "switch" keyword
23 class MODULEBASE_EXPORT ModuleBase_WidgetSwitch : public QFrame
28 /// \param parent a parent widget
29 ModuleBase_WidgetSwitch(QWidget* parent = NULL);
30 virtual ~ModuleBase_WidgetSwitch();
32 /// Add a page to the widget
33 /// \param theWidget a page widget
34 /// \param theName a name of page
35 int addPage(QWidget * theWidget, const QString & theName);
37 /// Returns count of pages
40 /// Returns index of current page
41 int currentIndex() const;
43 /// Returns current widget (page)
44 QWidget * currentWidget() const;
46 /// Returns index of widget (page)
47 /// \param theWidget a widget page
48 int indexOf(QWidget * theWidget) const;
51 /// \param index an index (position) to insert
52 /// \param theWidget a page widget
53 /// \param theName a name of the page
54 int insertPage(int index, QWidget * theWidget, const QString & theName);
56 /// Returns True if a page by given index is enabled
57 /// \param index index of the page
58 bool isPageEnabled(int index) const;
60 /// Returns text of the page by its id
61 /// \param index index of the page
62 QString pageText(int index) const;
64 /// Returns tooltip of the page by its id
65 /// \param index index of the page
66 QString pageToolTip(int index) const;
68 /// Remove page by its id
69 /// \param index index of the page
70 void removePage(int index);
72 /// Enale/disable a page by its Id
73 /// \param index index of the page
74 /// \param enabled an enable flag
75 void setPageEnabled(int index, bool enabled);
78 /// \param index index of the page
79 /// \param text a name of the page
80 void setPageName(int index, const QString & text);
83 /// \param index index of the page
84 /// \param toolTip a tooltip of the page
85 void setPageToolTip(int index, const QString & toolTip);
88 /// Set current page by index
89 /// \param index index of the page
90 void setCurrentIndex(int index);
93 /// Emitted on current page change
94 void currentPageChanged(int);
102 QVBoxLayout* myMainLay;
111 #endif /* ModuleBase_WidgetSwitch_H_ */