Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Attributes | Friends | List of all members
ads::CDockAreaTabBar Class Reference

#include <DockAreaTabBar.h>

Inheritance diagram for ads::CDockAreaTabBar:
Inheritance graph
[legend]

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
 
CDockWidgetTabcurrentTab () 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
 
CDockWidgetTabtab (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

DockAreaTabBarPrivated
 private data (pimpl) More...
 

Friends

class CDockAreaTitleBar
 
struct DockAreaTabBarPrivate
 

Detailed Description

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.

Member Typedef Documentation

using ads::CDockAreaTabBar::Super = QScrollArea

Definition at line 72 of file DockAreaTabBar.h.

Constructor & Destructor Documentation

ads::CDockAreaTabBar::CDockAreaTabBar ( CDockAreaWidget parent)

Default Constructor

Definition at line 121 of file DockAreaTabBar.cpp.

ads::CDockAreaTabBar::~CDockAreaTabBar ( )
virtual

Virtual Destructor

Definition at line 147 of file DockAreaTabBar.cpp.

Member Function Documentation

void ads::CDockAreaTabBar::closeTab ( int  Index)
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.

void ads::CDockAreaTabBar::currentChanged ( int  Index)
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

void ads::CDockAreaTabBar::currentChanging ( int  Index)
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.

void ads::CDockAreaTabBar::elidedChanged ( bool  elided)
signal

This signal is emitted when a tab title elide state has been changed

bool ads::CDockAreaTabBar::eventFilter ( QObject *  watched,
QEvent *  event 
)
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.

QSize ads::CDockAreaTabBar::minimumSizeHint ( ) const
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.

void ads::CDockAreaTabBar::onCloseOtherTabsRequested ( )
privateslot

Definition at line 337 of file DockAreaTabBar.cpp.

void ads::CDockAreaTabBar::onTabClicked ( )
privateslot

Definition at line 309 of file DockAreaTabBar.cpp.

void ads::CDockAreaTabBar::onTabCloseRequested ( )
privateslot

Definition at line 328 of file DockAreaTabBar.cpp.

void ads::CDockAreaTabBar::onTabWidgetMoved ( const QPoint &  GlobalPos)
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.

void ads::CDockAreaTabBar::removingTab ( int  index)
signal

This signal is emitted, just before the tab with the given index is removed

void ads::CDockAreaTabBar::setCurrentIndex ( int  Index)
slot

This property sets the index of the tab bar's visible tab

Definition at line 170 of file DockAreaTabBar.cpp.

QSize ads::CDockAreaTabBar::sizeHint ( ) const
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.

void ads::CDockAreaTabBar::tabBarClicked ( int  index)
signal

This signal is emitted when user clicks on a tab

void ads::CDockAreaTabBar::tabClosed ( int  index)
signal

This signal is emitted if a tab has been closed

void ads::CDockAreaTabBar::tabCloseRequested ( int  index)
signal

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

void ads::CDockAreaTabBar::tabInserted ( int  index)
signal

This signal is emitted if a tab has been inserted

void ads::CDockAreaTabBar::tabMoved ( int  from,
int  to 
)
signal

This signal is emitted when the tab has moved the tab at index position from to index position to.

void ads::CDockAreaTabBar::tabOpened ( int  index)
signal

This signal is emitted if a tab has been opened. A tab is opened if it has been made visible

void ads::CDockAreaTabBar::wheelEvent ( QWheelEvent *  Event)
overrideprotectedvirtual

Definition at line 154 of file DockAreaTabBar.cpp.

Friends And Related Function Documentation

friend class CDockAreaTitleBar
friend

Definition at line 59 of file DockAreaTabBar.h.

friend struct DockAreaTabBarPrivate
friend

Definition at line 58 of file DockAreaTabBar.h.

Member Data Documentation

DockAreaTabBarPrivate* ads::CDockAreaTabBar::d
private

private data (pimpl)

Definition at line 57 of file DockAreaTabBar.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 04:02:51