22 tabs =
new QVector< Tab * > ();
23 radioStyleTabs =
false;
46 const int & tabCountBeforeAddition = tabs->size();
47 newTab->setPosition(tabCountBeforeAddition);
48 connect(newTab, SIGNAL(clicked(
const int &)),
this,
50 tabs->push_back(newTab);
52 newTab->setSelected(
false);
77 return radioStyleTabs;
100 if (index >= 0 && index < tabs->
size())
101 (*tabs)[index]->setSelected(status);
113 if (index >= 0 && index < tabs->
size() && (*tabs)[index]->
isSelected())
125 for (
int i = 0; i < tabs->size(); i++)
141 QToolBar::setEnabled(newEnabledStatus);
143 for (
int i = 0; i <
size(); i++)
144 (*tabs)[i]->setEnabled(newEnabledStatus);
167 (*tabs)[index]->setSelected(!(*tabs)[index]->
isSelected());
172 (*tabs)[index]->setSelected(
true);
186 const int & thisGrp = tabs->at(index)->getRadioGroup();
187 for (
int i = 0; i < tabs->size(); i++)
191 const int & otherGrp = tabs->at(i)->getRadioGroup();
192 if (otherGrp == thisGrp && tabs->at(i)->isSelected())
208 const int & thisGrp = tabs->at(index)->getRadioGroup();
209 for (
int i = 0; i < tabs->size(); i++)
213 const int & otherGrp = tabs->at(i)->getRadioGroup();
214 if (otherGrp == thisGrp)
215 (*tabs)[i]->setSelected(
false);
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 h...
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 tim...
bool noOthersInGrpSelected(const int &index) const
void setSelected(const int &index, const bool &status)
Sets whether the Tab at the specified index is selected or not.
virtual ~TabBar()
destruct a TabBar
virtual void addTab(Tab *newTab)
Adds a Tab to the TabBar.
void deselectOthersInGrp(const int &index)
TabBar()
construct a TabBar
void setEnabled(bool)
Custom setEnabled method that also calls setEnabled for each of our Tabs.
bool isSelected(const int &index)
A Tab is a QAction which shows or hides some other QWidget, which we call associatedWidget.
This is free and unencumbered software released into the public domain.