#include <DockAreaTabBar.h>
Public Types | |
using | Super = QScrollArea |
Public Slots | |
void | closeTab (int Index) |
void | setCurrentIndex (int Index) |
Signals | |
void | currentChanged (int Index) |
void | currentChanging (int Index) |
void | elidedChanged (bool elided) |
void | removingTab (int index) |
void | tabBarClicked (int index) |
void | tabClosed (int index) |
void | tabCloseRequested (int index) |
void | tabInserted (int index) |
void | tabMoved (int from, int to) |
void | tabOpened (int index) |
Public Member Functions | |
CDockAreaTabBar (CDockAreaWidget *parent) | |
int | count () const |
int | currentIndex () const |
CDockWidgetTab * | currentTab () const |
virtual bool | eventFilter (QObject *watched, QEvent *event) override |
void | insertTab (int Index, CDockWidgetTab *Tab) |
bool | isTabOpen (int Index) const |
virtual QSize | minimumSizeHint () const override |
void | removeTab (CDockWidgetTab *Tab) |
virtual QSize | sizeHint () const override |
CDockWidgetTab * | tab (int Index) const |
virtual | ~CDockAreaTabBar () |
Protected Member Functions | |
virtual void | wheelEvent (QWheelEvent *Event) override |
Private Slots | |
void | onCloseOtherTabsRequested () |
void | onTabClicked () |
void | onTabCloseRequested () |
void | onTabWidgetMoved (const QPoint &GlobalPos) |
Private Attributes | |
DockAreaTabBarPrivate * | d |
private data (pimpl) More... | |
Friends | |
class | CDockAreaTitleBar |
struct | DockAreaTabBarPrivate |
Custom tabbar implementation for tab area that is shown on top of a dock area widget. The tabbar displays the tab widgets of the contained dock widgets. We cannot use QTabBar here because it does a lot of fancy animations that will crash the application if a tab is removed while the animation has not finished. And we need to remove a tab, if the user drags a a dock widget out of a group of tabbed widgets
Definition at line 53 of file DockAreaTabBar.h.
using ads::CDockAreaTabBar::Super = QScrollArea |
Definition at line 72 of file DockAreaTabBar.h.
ads::CDockAreaTabBar::CDockAreaTabBar | ( | CDockAreaWidget * | parent | ) |
Default Constructor
Definition at line 121 of file DockAreaTabBar.cpp.
|
virtual |
Virtual Destructor
Definition at line 147 of file DockAreaTabBar.cpp.
|
slot |
This function will close the tab given in Index param. Closing a tab means, the tab will be hidden, it will not be removed
Definition at line 423 of file DockAreaTabBar.cpp.
int ads::CDockAreaTabBar::count | ( | ) | const |
Returns the number of tabs in this tabbar
Definition at line 192 of file DockAreaTabBar.cpp.
|
signal |
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
|
signal |
This signal is emitted when the tab bar's current tab is about to be changed. The new current has the given index, or -1 if there isn't a new one.
int ads::CDockAreaTabBar::currentIndex | ( | ) | const |
Returns the current index or -1 if no tab is selected
Definition at line 288 of file DockAreaTabBar.cpp.
CDockWidgetTab * ads::CDockAreaTabBar::currentTab | ( | ) | const |
Returns the current tab or a nullptr if no tab is selected.
Definition at line 295 of file DockAreaTabBar.cpp.
|
signal |
This signal is emitted when a tab title elide state has been changed
|
overridevirtual |
Filters the tab widget events
Definition at line 440 of file DockAreaTabBar.cpp.
void ads::CDockAreaTabBar::insertTab | ( | int | Index, |
CDockWidgetTab * | Tab | ||
) |
Inserts the given dock widget tab at the given position. Inserting a new tab at an index less than or equal to the current index will increment the current index, but keep the current tab.
Definition at line 200 of file DockAreaTabBar.cpp.
bool ads::CDockAreaTabBar::isTabOpen | ( | int | Index | ) | const |
This function returns true if the tab is open, that means if it is visible to the user. If the function returns false, the tab is closed
Definition at line 475 of file DockAreaTabBar.cpp.
|
overridevirtual |
Overrides the minimumSizeHint() function of QScrollArea The minimumSizeHint() is bigger than the sizeHint () for the scroll area because even if the scrollbars are invisible, the required speace is reserved in the minimumSizeHint(). This override simply returns sizeHint();
Definition at line 487 of file DockAreaTabBar.cpp.
|
privateslot |
Definition at line 337 of file DockAreaTabBar.cpp.
|
privateslot |
Definition at line 309 of file DockAreaTabBar.cpp.
|
privateslot |
Definition at line 328 of file DockAreaTabBar.cpp.
|
privateslot |
Definition at line 376 of file DockAreaTabBar.cpp.
void ads::CDockAreaTabBar::removeTab | ( | CDockWidgetTab * | Tab | ) |
Removes the given DockWidgetTab from the tabbar
Definition at line 224 of file DockAreaTabBar.cpp.
|
signal |
This signal is emitted, just before the tab with the given index is removed
|
slot |
This property sets the index of the tab bar's visible tab
Definition at line 170 of file DockAreaTabBar.cpp.
|
overridevirtual |
The function provides a sizeHint that matches the height of the internal viewport.
Definition at line 496 of file DockAreaTabBar.cpp.
CDockWidgetTab * ads::CDockAreaTabBar::tab | ( | int | Index | ) | const |
Returns the tab with the given index
Definition at line 365 of file DockAreaTabBar.cpp.
|
signal |
This signal is emitted when user clicks on a tab
|
signal |
This signal is emitted if a tab has been closed
|
signal |
This signal is emitted when the close button on a tab is clicked. The index is the index that should be closed.
|
signal |
This signal is emitted if a tab has been inserted
|
signal |
This signal is emitted when the tab has moved the tab at index position from to index position to.
|
signal |
This signal is emitted if a tab has been opened. A tab is opened if it has been made visible
|
overrideprotectedvirtual |
Definition at line 154 of file DockAreaTabBar.cpp.
|
friend |
Definition at line 59 of file DockAreaTabBar.h.
|
friend |
Definition at line 58 of file DockAreaTabBar.h.
|
private |
private data (pimpl)
Definition at line 57 of file DockAreaTabBar.h.