TabBarΒΆ

Inherited: Widget

DescriptionΒΆ

TabBar is a widget that displays a list of tabs, allowing the user to select one. Each tab has a title and can be clicked to activate it. The TabBar automatically manages the layout and positioning of its tabs.

Public MethodsΒΆ

int

addTab (const TString & title)

int

count () const

void

currentChanged (int index)

int

currentIndex () const

int

indexOf (Button * button) const

int

insertTab (int index, const TString & title)

void

onCloseButtonClicked ()

void

onTabClicked ()

void

removeTab (int index)

void

removeTab (Button * button)

void

setCurrentIndex (int index)

void

setTabCornerRadius (const Vector4 & radius)

void

setTabTitle (int index, const TString & title)

void

setTabsClosable (bool closable)

Button *

tabButton (int index) const

void

tabCloseRequested (int index)

Vector4

tabCornerRadius () const

TString

tabTitle (int index) const

bool

tabsClosable () const

Static MethodsΒΆ

None

Methods DescriptionΒΆ

int TabBar::addTab (TString & title)

Adds a new tab with the specified title and returns its index.


int TabBar::count () const

Returns the number of tabs.


void TabBar::currentChanged (int index)

This signal is emitted when the tab bar’s current tab changes. The new current has the given index, or -1 if there isn’t a new one


int TabBar::currentIndex () const

Returns the index of the currently selected tab, or -1 if no tab is selected.

See also setCurrentIndex().


int TabBar::indexOf (Button * button) const

Returns the index of the tab that contains the specified button, or -1 if not found.


int TabBar::insertTab (int index, TString & title)

Inserts a new tab at the specified index with the given title.


void TabBar::onCloseButtonClicked ()

Called when a tab close button clicked.


void TabBar::onTabClicked ()

Called when a tab is clicked.


void TabBar::removeTab (int index)

Removes the tab at the specified index.


void TabBar::removeTab (Button * button)

Removes the tab associated with the given button.


void TabBar::setCurrentIndex (int index)

Sets the currently selected tab by index. Emits currentChanged signal if the selection changes.

See also currentIndex().


void TabBar::setTabCornerRadius (Vector4 & radius)

Sets the corner radius for tabs.

See also tabCornerRadius().


void TabBar::setTabTitle (int index, TString & title)

Sets the title of the tab at the specified index.

See also tabTitle().


void TabBar::setTabsClosable (bool closable)

Sets whether tabs can be closed by the user. Use parameter closable true if tabs can be closed, false otherwise.

See also tabsClosable().


Button * TabBar::tabButton (int index) const

Returns the button widget for the tab at the specified index.


void TabBar::tabCloseRequested (int index)

This signal is emitted when the close button on a tab is clicked. The index is the index that should be removed.


Vector4 TabBar::tabCornerRadius () const

Returns the corner radius for tabs.

See also setTabCornerRadius().


TString TabBar::tabTitle (int index) const

Returns the title of the tab at the specified index.

See also setTabTitle().


bool TabBar::tabsClosable () const

Returns true if tabs can be closed.

See also setTabsClosable().