TabWidgetΒΆ
Inherited: Widget
DescriptionΒΆ
The TabWidget class is a container widget that organizes multiple pages into a tabbed interface. Each tab has a label and can contain any widget as its content.
Public MethodsΒΆ
int |
addTab (const TString & title, Widget * content) |
int |
count () const |
int |
currentIndex () const |
int |
insertTab (int index, const TString & title, Widget * content) |
void |
removeTab (int index) |
void |
setContentArea (Frame * area) |
void |
setCurrentIndex (int index) |
void |
setTabBar (TabBar * bar) |
void |
setTabTitle (int index, const TString & title) |
void |
setTabsClosable (bool closeable) |
Widget * |
tabContent (int index) const |
tabTitle (int index) const |
|
bool |
tabsClosable () const |
Static MethodsΒΆ
None
Methods DescriptionΒΆ
Adds a new tab with the specified title and returns its index. The content widget will be displayed when this tab is selected.
int TabWidget::count () const
Returns the number of tabs.
int TabWidget::currentIndex () const
Returns the index of the currently selected tab, or -1 if no tab is selected.
See also setCurrentIndex().
Inserts a new tab at the specified index with the given title and content.
void TabWidget::removeTab (int index)
Removes the tab at the specified index.
void TabWidget::setContentArea (Frame * area)
Sets the content area associated with TabWidget.
void TabWidget::setCurrentIndex (int index)
Sets the currently selected tab by index. Emits currentChanged signal if the selection changes.
See also currentIndex().
void TabWidget::setTabBar (TabBar * bar)
Sets the tab bar associated with TabWidget.
void TabWidget::setTabTitle (int index, TString & title)
Sets the title of the tab at the specified index.
See also tabTitle().
void TabWidget::setTabsClosable (bool closeable)
Sets whether tabs can be closed by the user. Use parameter closeable true if tabs can be closed, false otherwise.
See also tabsClosable().
Widget * TabWidget::tabContent (int index) const
Returns the content widget of the tab at the specified index.
TString TabWidget::tabTitle (int index) const
Returns the title of the tab at the specified index.
See also setTabTitle().
bool TabWidget::tabsClosable () const
Returns true if tabs can be closed.
See also setTabsClosable().