Isis 3 Programmer Reference
|
A TabBar is a QToolBar which is specifically designed to store and manage Tabs, which are specialized QToolButtons that can hide and show other QWidgets (see Tab). More...
#include <TabBar.h>
Public Member Functions | |
TabBar () | |
construct a TabBar More... | |
virtual | ~TabBar () |
destruct a TabBar More... | |
virtual void | addTab (Tab *newTab) |
Adds a Tab to the TabBar. More... | |
int | curSelectedTab () const |
void | setRadioStyle (const bool &radioStyle) |
If set to true then the effect is that Tabs in the same radio group can only be selected one at a time. More... | |
bool | radioStyle () |
int | size () const |
void | setSelected (const int &index, const bool &status) |
Sets whether the Tab at the specified index is selected or not. More... | |
bool | isSelected (const int &index) |
bool | noneSelected () |
void | setEnabled (bool) |
Custom setEnabled method that also calls setEnabled for each of our Tabs. More... | |
Private Slots | |
void | tabClicked (const int &index) |
SLOT which performs actions that need to be done when we get a SIGNAL from a Tab telling us that it has been clicked. More... | |
Private Member Functions | |
bool | noOthersInGrpSelected (const int &index) const |
void | deselectOthersInGrp (const int &index) |
Private Attributes | |
QVector< Tab *> * | tabs |
bool | radioStyleTabs |
A TabBar is a QToolBar which is specifically designed to store and manage Tabs, which are specialized QToolButtons that can hide and show other QWidgets (see Tab).
Isis::TabBar::TabBar | ( | ) |
construct a TabBar
Definition at line 18 of file TabBar.cpp.
|
virtual |
destruct a TabBar
Definition at line 28 of file TabBar.cpp.
|
virtual |
Note that The TabBar takes ownership of Tabs once they are added!
newTab | New Tab to be added |
Definition at line 44 of file TabBar.cpp.
References Isis::Tab::setPosition(), Isis::Tab::setSelected(), and tabClicked().
|
private |
index | Index of the Tab. The first Tab added to the bar has an index of 0. The last Tab added has an index of size() - 1. |
Deselects any other selected Tabs in the given Tab's radio group
Definition at line 206 of file TabBar.cpp.
Referenced by tabClicked().
bool Isis::TabBar::isSelected | ( | const int & | index | ) |
index | Index of the Tab. The first Tab added to the bar has an index of 0. The last Tab added has an index of size() - 1. |
Definition at line 111 of file TabBar.cpp.
References size().
Referenced by tabClicked().
bool Isis::TabBar::noneSelected | ( | ) |
Definition at line 123 of file TabBar.cpp.
|
private |
index | Index of the Tab. The first Tab added to the bar has an index of 0. The last Tab added has an index of size() - 1. |
Definition at line 184 of file TabBar.cpp.
Referenced by tabClicked().
bool Isis::TabBar::radioStyle | ( | ) |
Definition at line 75 of file TabBar.cpp.
Referenced by setRadioStyle().
void Isis::TabBar::setEnabled | ( | bool | newEnabledStatus | ) |
Custom setEnabled method that also calls setEnabled for each of our Tabs.
newEnabledStatus | The new enabled status that will be applied to the TabBar and all of its Tabs |
Definition at line 139 of file TabBar.cpp.
References size().
void Isis::TabBar::setRadioStyle | ( | const bool & | radioStyle | ) |
If set to true then the effect is that Tabs in the same radio group can only be selected one at a time.
When a Tab is selected all other Tabs in the same radio group would automatically be deselected. If set to false then all Tabs in the TabBar will behave independent from eachother regardless of how their radio groups are set.
radioStyle | True if radio style should be used, false otherwise |
Definition at line 66 of file TabBar.cpp.
References radioStyle().
void Isis::TabBar::setSelected | ( | const int & | index, |
const bool & | status | ||
) |
Sets whether the Tab at the specified index is selected or not.
index | Index of the Tab. The first Tab added to the bar has an index of 0. The last Tab added has an index of size() - 1 |
status | True if the Tab should be selected, false otherwise |
Definition at line 98 of file TabBar.cpp.
References size().
int Isis::TabBar::size | ( | ) | const |
Definition at line 84 of file TabBar.cpp.
Referenced by isSelected(), setEnabled(), and setSelected().
|
privateslot |
SLOT which performs actions that need to be done when we get a SIGNAL from a Tab telling us that it has been clicked.
What happens is that first the Tab is clicked. The Tab catches this signal and then emits its own clicked SIGNAL which contains its index. This SIGNAL is connected to this SLOT which then takes the appropriate action depending on a couple things. If radioStyle is not being used or if it is but there are no other Tabs in this Tab's radio group then we simply want to toggle the state of the Tab. If radio style is being used and there are others in this Tab's radio group which are selected then the other Tabs are first deselected before the Tab is set to be selected (We know it was not selected before since there was another Tab in its group which was).
index | Index of the Tab which emitted the clicked SIGNAL. |
Definition at line 163 of file TabBar.cpp.
References deselectOthersInGrp(), isSelected(), and noOthersInGrpSelected().
Referenced by addTab().