KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
KDDockWidgets::Core::TitleBar Class Reference

#include <TitleBar.h>

Inheritance diagram for KDDockWidgets::Core::TitleBar:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::Core::TitleBar:
Collaboration graph
[legend]

Public Member Functions

 TitleBar (Core::View *)
 
 TitleBar (FloatingWindow *parent)
 Creates the TitleBar used by Floating windows.
 
 TitleBar (Group *parent)
 Creates the TitleBar used by tab groups.
 
virtual ~TitleBar () override
 
bool buttonHidesIfDisabled (TitleBarButtonType) const
 
bool buttonIsUserHidden (TitleBarButtonType) const
 
bool buttonIsUserHidden (TitleBarButtonType, bool enabled) const
 Overload which also consults buttonHidesIfDisabled.
 
bool closeButtonEnabled () const
 
DockWidget::List dockWidgets () const
 the list of dockwidgets under this TitleBar. There should always be at least 1. If more than 1 then they are tabbed.
 
Private * dptr () const
 
QString floatButtonToolTip () const
 
bool floatButtonVisible () const
 
FloatingWindowfloatingWindow () const
 getter for m_floatingWindow
 
void focus (Qt::FocusReason reason)
 
Core::Groupgroup () const
 getter for m_group
 
bool hasIcon () const
 returns whether this title bar has an icon
 
Icon icon () const
 the icon
 
bool isFloating () const
 Returns true if this title-bar is the title bar of a floating window.
 
bool isFocused () const
 returns whether any of the DockWidgets this TitleBar controls has a child focus Not to be confused with QWidget::hasFocus(), which just refers to 1 widget. This works more like QtQuick's FocusScope
 
bool isMDI () const override
 From Draggable interface.
 
bool isStandalone () const
 Returns whether this titlebar is standalone. See comment in the ctor.
 
bool isWindow () const override
 
MainWindowmainWindow () const
 If this title bar belongs to a dock widget docked into the main window, returns the main window Returns nullptr otherwise.
 
std::unique_ptr< WindowBeingDragged > makeWindow () override
 
TitleBarButtonType maximizeButtonType () const
 
bool maximizeButtonVisible () const
 
void onAutoHideClicked ()
 
void onCloseClicked ()
 
bool onDoubleClicked ()
 
void onFloatClicked ()
 
void onMaximizeClicked ()
 
void onMinimizeClicked ()
 
void setCloseButtonEnabled (bool)
 
void setCloseButtonVisible (bool)
 
void setFloatButtonVisible (bool)
 
void setHideDisabledButtons (TitleBarButtonTypes)
 
void setIcon (const Icon &icon)
 
void setTitle (const QString &title)
 
void setUserHiddenButtons (TitleBarButtonTypes)
 Allows to override's KDDW's default visibility logic and force hide a button.
 
Core::DockWidgetsingleDockWidget () const override final
 
bool supportsAutoHideButton () const
 returns whether this title bar supports the auto-hide button
 
bool supportsFloatingButton () const
 returns whether this title bar supports a floating/docking button
 
bool supportsMaximizeButton () const
 returns whether this title bar supports a maximize/restore button
 
bool supportsMinimizeButton () const
 returns whether this title bar supports a minimize button
 
TabBartabBar () const
 Returns the tab bar which is under this title bar. It's only nullptr for the case of having a Floating Window with more than one nested Frame.
 
QString title () const
 
bool titleBarIsFocusable () const
 
void toggleMaximized ()
 
void updateButtons ()
 updates the close button enabled state
 
- Public Member Functions inherited from KDDockWidgets::Core::Controller
 Controller (ViewType type, View *)
 
virtual ~Controller ()
 
bool close ()
 
void destroyLater ()
 
Controller::Private * dptr () const
 
Rect geometry () const
 
int height () const
 
bool inDtor () const
 
bool is (ViewType) const
 Returns whether this controller is of the specified type.
 
bool isFixedHeight () const
 
bool isFixedWidth () const
 
bool isVisible () const
 
Point mapToGlobal (Point) const
 
Point pos () const
 
Rect rect () const
 
void setParentView (View *parent)
 
void setVisible (bool)
 
void show () const
 
Size size () const
 
ViewType type () const
 Returns the type of this controller.
 
Viewview () const
 Returns the view associated with this controller, if any.
 
int width () const
 
std::shared_ptr< Viewwindow () const
 
int x () const
 
int y () const
 

Protected Member Functions

bool isOverlayed () const
 
- Protected Member Functions inherited from KDDockWidgets::Core::Controller
virtual void setParentView_impl (View *parent)
 

Additional Inherited Members

- Protected Attributes inherited from KDDockWidgets::Core::Controller
bool m_inDtor = false
 

Detailed Description

Definition at line 31 of file core/TitleBar.h.

Constructor & Destructor Documentation

◆ TitleBar() [1/3]

TitleBar::TitleBar ( FloatingWindow parent)
explicit

Creates the TitleBar used by Floating windows.

Definition at line 68 of file core/TitleBar.cpp.

References KDDockWidgets::Core::FloatingWindow::dptr(), and updateButtons().

◆ TitleBar() [2/3]

TitleBar::TitleBar ( Group parent)
explicit

Creates the TitleBar used by tab groups.

Definition at line 42 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Group::dptr().

◆ TitleBar() [3/3]

TitleBar::TitleBar ( Core::View view)
explicit

Creates a standalone TitleBar That means it's not associated with any docking. To allow users to reuse it. For example, to add a title bar to a QMessageBox popup on EGLFS

See also
isStandalone()

Definition at line 87 of file core/TitleBar.cpp.

◆ ~TitleBar()

TitleBar::~TitleBar ( )
overridevirtual

Definition at line 116 of file core/TitleBar.cpp.

Member Function Documentation

◆ buttonHidesIfDisabled()

bool TitleBar::buttonHidesIfDisabled ( TitleBarButtonType  type) const

Definition at line 756 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Controller::type().

Referenced by buttonIsUserHidden().

◆ buttonIsUserHidden() [1/2]

bool TitleBar::buttonIsUserHidden ( TitleBarButtonType  type) const

Definition at line 719 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Controller::type().

Referenced by buttonIsUserHidden(), and updateButtons().

◆ buttonIsUserHidden() [2/2]

bool TitleBar::buttonIsUserHidden ( TitleBarButtonType  type,
bool  enabled 
) const

Overload which also consults buttonHidesIfDisabled.

Definition at line 724 of file core/TitleBar.cpp.

References buttonHidesIfDisabled(), buttonIsUserHidden(), and KDDockWidgets::Core::Controller::type().

◆ closeButtonEnabled()

bool TitleBar::closeButtonEnabled ( ) const

◆ dockWidgets()

Core::DockWidget::List TitleBar::dockWidgets ( ) const

the list of dockwidgets under this TitleBar. There should always be at least 1. If more than 1 then they are tabbed.

Definition at line 627 of file core/TitleBar.cpp.

References KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::append(), KDDockWidgets::Core::Group::dockWidgets(), group(), and KDDockWidgets::Core::FloatingWindow::groups().

Referenced by onFloatClicked(), and singleDockWidget().

◆ dptr()

TitleBar::Private * TitleBar::dptr ( ) const

◆ floatButtonToolTip()

QString TitleBar::floatButtonToolTip ( ) const

◆ floatButtonVisible()

bool TitleBar::floatButtonVisible ( ) const

◆ floatingWindow()

Core::FloatingWindow * TitleBar::floatingWindow ( ) const

getter for m_floatingWindow

Definition at line 270 of file core/TitleBar.cpp.

Referenced by c_KDDockWidgets__Core__TitleBar__floatingWindow(), and makeWindow().

◆ focus()

void TitleBar::focus ( Qt::FocusReason  reason)

◆ group()

Core::Group * TitleBar::group ( ) const

getter for m_group

Definition at line 265 of file core/TitleBar.cpp.

Referenced by c_KDDockWidgets__Core__TitleBar__group(), dockWidgets(), and tabBar().

◆ hasIcon()

bool TitleBar::hasIcon ( ) const

returns whether this title bar has an icon

Definition at line 260 of file core/TitleBar.cpp.

Referenced by c_KDDockWidgets__Core__TitleBar__hasIcon(), and KDDockWidgets::QtQuick::TitleBar::hasIcon().

◆ icon()

Icon TitleBar::icon ( ) const

◆ isFloating()

bool TitleBar::isFloating ( ) const

Returns true if this title-bar is the title bar of a floating window.

Definition at line 654 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Group::isFloating().

Referenced by c_KDDockWidgets__Core__TitleBar__isFloating(), KDDockWidgets::QtQuick::TitleBar::isFloating(), and onFloatClicked().

◆ isFocused()

bool TitleBar::isFocused ( ) const

returns whether any of the DockWidgets this TitleBar controls has a child focus Not to be confused with QWidget::hasFocus(), which just refers to 1 widget. This works more like QtQuick's FocusScope

Definition at line 669 of file core/TitleBar.cpp.

References KDDockWidgets::Core::View::isActiveWindow(), KDDockWidgets::Core::FocusScope::isFocused(), and KDDockWidgets::Core::Controller::view().

Referenced by c_KDDockWidgets__Core__TitleBar__isFocused(), and KDDockWidgets::QtQuick::TitleBar::isFocused().

◆ isMDI()

bool TitleBar::isMDI ( ) const
override

◆ isOverlayed()

bool TitleBar::isOverlayed ( ) const
protected

Definition at line 351 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Group::isOverlayed().

Referenced by onAutoHideClicked().

◆ isStandalone()

bool TitleBar::isStandalone ( ) const

Returns whether this titlebar is standalone. See comment in the ctor.

Definition at line 714 of file core/TitleBar.cpp.

Referenced by c_KDDockWidgets__Core__TitleBar__isStandalone().

◆ isWindow()

bool TitleBar::isWindow ( ) const
override

Definition at line 622 of file core/TitleBar.cpp.

◆ mainWindow()

MainWindow * TitleBar::mainWindow ( ) const

If this title bar belongs to a dock widget docked into the main window, returns the main window Returns nullptr otherwise.

Definition at line 127 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Group::mainWindow().

Referenced by c_KDDockWidgets__Core__TitleBar__mainWindow(), and onAutoHideClicked().

◆ makeWindow()

std::unique_ptr< WindowBeingDragged > TitleBar::makeWindow ( )
override

◆ maximizeButtonType()

TitleBarButtonType TitleBar::maximizeButtonType ( ) const

◆ maximizeButtonVisible()

bool TitleBar::maximizeButtonVisible ( ) const

◆ onAutoHideClicked()

void TitleBar::onAutoHideClicked ( )

◆ onCloseClicked()

void TitleBar::onCloseClicked ( )

◆ onDoubleClicked()

bool TitleBar::onDoubleClicked ( )

◆ onFloatClicked()

void TitleBar::onFloatClicked ( )

◆ onMaximizeClicked()

void TitleBar::onMaximizeClicked ( )

◆ onMinimizeClicked()

void TitleBar::onMinimizeClicked ( )

◆ setCloseButtonEnabled()

void TitleBar::setCloseButtonEnabled ( bool  enabled)

◆ setCloseButtonVisible()

void TitleBar::setCloseButtonVisible ( bool  visible)

◆ setFloatButtonVisible()

void TitleBar::setFloatButtonVisible ( bool  visible)

◆ setHideDisabledButtons()

void TitleBar::setHideDisabledButtons ( TitleBarButtonTypes  types)

The specified buttons, if disabled, will be hidden as well for example, with non-closable dock widgets we disable the close button this allows to hide it as well.

Definition at line 748 of file core/TitleBar.cpp.

References updateButtons().

◆ setIcon()

void TitleBar::setIcon ( const Icon &  icon)

◆ setTitle()

void TitleBar::setTitle ( const QString title)

◆ setUserHiddenButtons()

void TitleBar::setUserHiddenButtons ( TitleBarButtonTypes  types)

Allows to override's KDDW's default visibility logic and force hide a button.

Definition at line 735 of file core/TitleBar.cpp.

References updateButtons().

◆ singleDockWidget()

Core::DockWidget * TitleBar::singleDockWidget ( ) const
finaloverride

◆ supportsAutoHideButton()

bool TitleBar::supportsAutoHideButton ( ) const

returns whether this title bar supports the auto-hide button

Definition at line 237 of file core/TitleBar.cpp.

References KDDockWidgets::Core::Group::isInMainWindow(), and KDDockWidgets::Core::Group::isOverlayed().

Referenced by c_KDDockWidgets__Core__TitleBar__supportsAutoHideButton().

◆ supportsFloatingButton()

bool TitleBar::supportsFloatingButton ( ) const

◆ supportsMaximizeButton()

bool TitleBar::supportsMaximizeButton ( ) const

returns whether this title bar supports a maximize/restore button

Definition at line 227 of file core/TitleBar.cpp.

References KDDockWidgets::Core::FloatingWindow::supportsMaximizeButton().

Referenced by c_KDDockWidgets__Core__TitleBar__supportsMaximizeButton().

◆ supportsMinimizeButton()

bool TitleBar::supportsMinimizeButton ( ) const

◆ tabBar()

TabBar * TitleBar::tabBar ( ) const

Returns the tab bar which is under this title bar. It's only nullptr for the case of having a Floating Window with more than one nested Frame.

Definition at line 692 of file core/TitleBar.cpp.

References group(), KDDockWidgets::Core::FloatingWindow::hasSingleGroup(), KDDockWidgets::Core::FloatingWindow::singleFrame(), KDDockWidgets::Core::Group::stack(), and KDDockWidgets::Core::Stack::tabBar().

Referenced by c_KDDockWidgets__Core__TitleBar__tabBar().

◆ title()

QString TitleBar::title ( ) const

◆ titleBarIsFocusable()

bool TitleBar::titleBarIsFocusable ( ) const

◆ toggleMaximized()

void TitleBar::toggleMaximized ( )

◆ updateButtons()

void TitleBar::updateButtons ( )

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

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8