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
- position : KMultiTabBarPosition
Public Functions
| KMultiTabBar(QWidget *parent = nullptr) | |
| KMultiTabBar(KMultiTabBar::KMultiTabBarPosition pos, QWidget *parent = nullptr) | |
| int | appendButton(const QIcon &icon, int id = -1, QMenu *popup = nullptr, const QString ¬_used_yet = QString()) | 
| 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
| Constant | Value | 
|---|---|
| KMultiTabBar::Left | 0 | 
| KMultiTabBar::Right | 1 | 
| KMultiTabBar::Top | 2 | 
| KMultiTabBar::Bottom | 3 | 
enum KMultiTabBar::KMultiTabBarStyle
The list of available styles for KMultiTabBar
| Constant | Value | Description | 
|---|---|---|
| KMultiTabBar::VSNET | 0 | Visual Studio .Net like, always shows icon, only show the text of active tabs | 
| KMultiTabBar::KDEV3ICON | 2 | KDevelop 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] KMultiTabBar::KMultiTabBar(QWidget *parent = nullptr)
Create a KMultiTabBar with Left as KMultiTabBar position.
parent The parent of the widget.
[explicit] KMultiTabBar::KMultiTabBar(KMultiTabBar::KMultiTabBarPosition pos, QWidget *parent = nullptr)
int KMultiTabBar::appendButton(const QIcon &icon, int id = -1, QMenu *popup = nullptr, const QString ¬_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
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
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.