KMultiTabBar Class

A Widget for horizontal and vertical tabs. (Note that in Qt4, QTabBar can be vertical as well). More...

Header: #include <KMultiTabBar>
CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
Inherits: QWidget

Public Types

enum KMultiTabBarPosition { Left, Right, Top, Bottom }
enum KMultiTabBarStyle { VSNET, KDEV3ICON }

Properties

Public Functions

(since 5.24) KMultiTabBar(QWidget *parent = nullptr)
KMultiTabBar(KMultiTabBar::KMultiTabBarPosition pos, QWidget *parent = nullptr)
(since 5.13) int appendButton(const QIcon &icon, int id = -1, QMenu *popup = nullptr, const QString &not_used_yet = QString())
(since 5.13) int appendTab(const QIcon &icon, int id = -1, const QString &text = QString())
bool isTabRaised(int id) const
KMultiTabBar::KMultiTabBarPosition position() const
void removeButton(int id)
void removeTab(int id)
void setPosition(KMultiTabBar::KMultiTabBarPosition pos)
void setStyle(KMultiTabBar::KMultiTabBarStyle style)
void setTab(int id, bool state)
KMultiTabBar::KMultiTabBarStyle tabStyle() const

Detailed Description

It is possible to add normal buttons to the top/left The handling if only one tab at a time or multiple tabs should be raisable is left to the "user".

[Missing image kmultitabbar.png]

Member Type Documentation

enum KMultiTabBar::KMultiTabBarPosition

ConstantValue
KMultiTabBar::Left0
KMultiTabBar::Right1
KMultiTabBar::Top2
KMultiTabBar::Bottom3

enum KMultiTabBar::KMultiTabBarStyle

The list of available styles for KMultiTabBar

ConstantValueDescription
KMultiTabBar::VSNET0Visual Studio .Net like, always shows icon, only show the text of active tabs
KMultiTabBar::KDEV3ICON2KDevelop 3 like, always shows the text and icons

Property Documentation

position : KMultiTabBarPosition

Access functions:

KMultiTabBar::KMultiTabBarPosition position() const
void setPosition(KMultiTabBar::KMultiTabBarPosition pos)

Member Function Documentation

[explicit, since 5.24] KMultiTabBar::KMultiTabBar(QWidget *parent = nullptr)

Create a KMultiTabBar with Left as KMultiTabBar position.

parent The parent of the widget.

This function was introduced in 5.24.

[explicit] KMultiTabBar::KMultiTabBar(KMultiTabBar::KMultiTabBarPosition pos, QWidget *parent = nullptr)

[since 5.13] int KMultiTabBar::appendButton(const QIcon &icon, int id = -1, QMenu *popup = nullptr, const QString &not_used_yet = QString())

append a new button to the button area. The button can later on be accessed with button(ID) eg for connecting signals to it

icon a icon for the button

id an arbitrary ID value. It will be emitted in the clicked signal for identifying the button if more than one button is connected to a signals.

popup A popup menu which should be displayed if the button is clicked

not_used_yet will be used for a popup text in the future

This function was introduced in 5.13.

[since 5.13] int KMultiTabBar::appendTab(const QIcon &icon, int id = -1, const QString &text = QString())

append a new tab to the tab area. It can be accessed lateron with tabb(id);

icon a icon for the tab

id an arbitrary ID which can be used later on to identify the tab

text if a mode with text is used it will be the tab text, otherwise a mouse over hint

This function was introduced in 5.13.

bool KMultiTabBar::isTabRaised(int id) const

return the state of a tab, identified by its ID

KMultiTabBar::KMultiTabBarPosition KMultiTabBar::position() const

Returns the tabbar position.

Note: Getter function for property position.

See also setPosition().

void KMultiTabBar::removeButton(int id)

remove a button with the given ID

void KMultiTabBar::removeTab(int id)

remove a tab with a given ID

void KMultiTabBar::setPosition(KMultiTabBar::KMultiTabBarPosition pos)

set the real position of the widget.

pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right

Note: Setter function for property position.

See also position().

void KMultiTabBar::setStyle(KMultiTabBar::KMultiTabBarStyle style)

set the display style of the tabs

Note: Setter function for property tabStyle.

void KMultiTabBar::setTab(int id, bool state)

set a tab to "raised"

id The ID of the tab to manipulate

state true == activated/raised, false == not active

KMultiTabBar::KMultiTabBarStyle KMultiTabBar::tabStyle() const

Returns the display style of the tabs

Note: Getter function for property tabStyle.