KDDockWidgets API Documentation 2.1
|
#include <TitleBar.h>
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 |
FloatingWindow * | floatingWindow () const |
getter for m_floatingWindow | |
void | focus (Qt::FocusReason reason) |
Core::Group * | group () 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 |
MainWindow * | mainWindow () 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::DockWidget * | singleDockWidget () 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 | |
TabBar * | 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. | |
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. | |
View * | view () const |
Returns the view associated with this controller, if any. | |
int | width () const |
std::shared_ptr< View > | window () 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 |
Definition at line 31 of file core/TitleBar.h.
|
explicit |
Creates the TitleBar used by Floating windows.
Definition at line 68 of file core/TitleBar.cpp.
References KDDockWidgets::Core::FloatingWindow::dptr(), and updateButtons().
|
explicit |
Creates the TitleBar used by tab groups.
Definition at line 42 of file core/TitleBar.cpp.
References KDDockWidgets::Core::Group::dptr().
|
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
Definition at line 87 of file core/TitleBar.cpp.
|
overridevirtual |
Definition at line 116 of file core/TitleBar.cpp.
bool TitleBar::buttonHidesIfDisabled | ( | TitleBarButtonType | type | ) | const |
Definition at line 756 of file core/TitleBar.cpp.
References KDDockWidgets::Core::Controller::type().
Referenced by buttonIsUserHidden().
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().
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().
bool TitleBar::closeButtonEnabled | ( | ) | const |
Definition at line 570 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__closeButtonEnabled(), and KDDockWidgets::QtQuick::TitleBar::closeButtonEnabled().
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().
TitleBar::Private * TitleBar::dptr | ( | ) | const |
Definition at line 743 of file core/TitleBar.cpp.
Referenced by KDDockWidgets::flutter::TitleBar::init(), KDDockWidgets::QtQuick::TitleBar::init(), and KDDockWidgets::QtWidgets::TitleBar::init().
QString TitleBar::floatButtonToolTip | ( | ) | const |
Definition at line 687 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__floatButtonToolTip(), KDDockWidgets::QtQuick::TitleBar::floatButtonToolTip(), and KDDockWidgets::QtWidgets::TitleBar::init().
bool TitleBar::floatButtonVisible | ( | ) | const |
Definition at line 183 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__floatButtonVisible(), KDDockWidgets::QtQuick::TitleBar::floatButtonVisible(), and KDDockWidgets::QtWidgets::TitleBar::init().
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().
void TitleBar::focus | ( | Qt::FocusReason | reason | ) |
Will focus the last user widget (below this titlebar) that had focus Requires Config::Flag_TitleBarIsFocusable
Definition at line 275 of file core/TitleBar.cpp.
References KDDockWidgets::Config::Flag_TitleBarIsFocusable, KDDockWidgets::Core::FloatingWindow::focus(), and KDDockWidgets::Config::self().
Referenced by KDDockWidgets::QtQuick::TitleBar::event(), and KDDockWidgets::QtWidgets::TitleBar::focusInEvent().
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().
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 TitleBar::icon | ( | ) | const |
the icon
Definition at line 163 of file core/TitleBar.cpp.
Referenced by KDDockWidgets::Core::Group::icon(), KDDockWidgets::QtWidgets::TitleBar::iconRect(), KDDockWidgets::QtWidgets::TitleBar::init(), and setIcon().
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().
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().
|
override |
From Draggable interface.
Definition at line 139 of file core/TitleBar.cpp.
References KDDockWidgets::Core::View::asWrapper(), KDDockWidgets::Core::DropArea, KDDockWidgets::Core::MDILayout, and KDDockWidgets::Core::Controller::view().
Referenced by KDDockWidgets::QtWidgets::TitleBar::paintEvent().
|
protected |
Definition at line 351 of file core/TitleBar.cpp.
References KDDockWidgets::Core::Group::isOverlayed().
Referenced by onAutoHideClicked().
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().
|
override |
Definition at line 622 of file core/TitleBar.cpp.
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().
|
override |
Definition at line 575 of file core/TitleBar.cpp.
References KDDockWidgets::Core::Group::actualTitleBar(), KDDockWidgets::Config::Flag_ShowButtonsOnTabBarIfTitleBarHidden, floatingWindow(), KDDockWidgets::Core::View::geometry(), KDDockWidgets::Core::Group::isTheOnlyGroup(), KDDockWidgets::Core::Controller::isVisible(), KDDockWidgets::Core::Controller::mapToGlobal(), KDDockWidgets::Config::self(), KDDockWidgets::Core::FloatingWindow::setSuggestedGeometry(), KDDockWidgets::Core::View::show(), KDDockWidgets::SuggestedGeometryHint_GeometryIsFromDocked, KDDockWidgets::Core::FloatingWindow::titleBar(), and KDDockWidgets::Core::Controller::view().
Referenced by onFloatClicked(), and KDDockWidgets::Core::DockWidget::setFloating().
TitleBarButtonType TitleBar::maximizeButtonType | ( | ) | const |
Definition at line 709 of file core/TitleBar.cpp.
Referenced by KDDockWidgets::QtQuick::TitleBar::maximizeUsesRestoreIcon().
bool TitleBar::maximizeButtonVisible | ( | ) | const |
Definition at line 188 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__maximizeButtonVisible(), and KDDockWidgets::QtQuick::TitleBar::maximizeButtonVisible().
void TitleBar::onAutoHideClicked | ( | ) |
Definition at line 524 of file core/TitleBar.cpp.
References KDDockWidgets::Core::Group::currentDockWidget(), KDDockWidgets::Core::Group::dockWidgets(), KDDockWidgets::Config::Flag_AutoHideAsTabGroups, KDDockWidgets::Config::hasFlag(), isOverlayed(), mainWindow(), KDDockWidgets::MovedToSideBar, KDDockWidgets::Core::MainWindow::restoreFromSideBar(), and KDDockWidgets::DockRegistry::self().
Referenced by c_KDDockWidgets__Core__TitleBar__onAutoHideClicked(), KDDockWidgets::QtWidgets::TitleBar::init(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::onAutoHideClicked(), and KDDockWidgets::QtQuick::TitleBar::onAutoHideClicked().
void TitleBar::onCloseClicked | ( | ) |
Definition at line 403 of file core/TitleBar.cpp.
References KDDockWidgets::Core::View::close(), KDDockWidgets::Core::Group::currentDockWidget(), KDDockWidgets::Core::View::d, KDDockWidgets::Config::Flag_CloseOnlyCurrentTab, KDDockWidgets::Config::flags(), KDDockWidgets::Core::Group::isInFloatingWindow(), KDDockWidgets::Core::Group::isTheOnlyGroup(), KDDockWidgets::Config::self(), KDDockWidgets::Core::FloatingWindow::singleFrame(), KDDockWidgets::TitleBarCloseButton, and KDDockWidgets::Core::Controller::view().
Referenced by c_KDDockWidgets__Core__TitleBar__onCloseClicked(), KDDockWidgets::QtWidgets::TitleBar::init(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::onCloseClicked(), and KDDockWidgets::QtQuick::TitleBar::onCloseClicked().
bool TitleBar::onDoubleClicked | ( | ) |
Definition at line 168 of file core/TitleBar.cpp.
References KDDockWidgets::Config::Flag_DoubleClickMaximizes, onFloatClicked(), KDDockWidgets::Config::self(), and toggleMaximized().
Referenced by c_KDDockWidgets__Core__TitleBar__onDoubleClicked(), KDDockWidgets::QtWidgets::TitleBar::mouseDoubleClickEvent(), and KDDockWidgets::QtQuick::TitleBar::onDoubleClicked().
void TitleBar::onFloatClicked | ( | ) |
Definition at line 445 of file core/TitleBar.cpp.
References KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::constFirst(), dockWidgets(), KDDockWidgets::Core::DockWidget::isCurrentTab(), KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::isEmpty(), isFloating(), makeWindow(), KDDockWidgets::Core::Group::s_inFloatHack, KDDockWidgets::Core::DockWidget::setAsCurrentTab(), KDDockWidgets::Core::DockWidget::setFloating(), and KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::size().
Referenced by c_KDDockWidgets__Core__TitleBar__onFloatClicked(), KDDockWidgets::QtWidgets::TitleBar::init(), onDoubleClicked(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::onFloatClicked(), and KDDockWidgets::QtQuick::TitleBar::onFloatClicked().
void TitleBar::onMaximizeClicked | ( | ) |
Definition at line 505 of file core/TitleBar.cpp.
References toggleMaximized().
Referenced by c_KDDockWidgets__Core__TitleBar__onMaximizeClicked(), KDDockWidgets::QtWidgets::TitleBar::init(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::onMaximizeClicked(), and KDDockWidgets::QtQuick::TitleBar::onMaximizeClicked().
void TitleBar::onMinimizeClicked | ( | ) |
Definition at line 510 of file core/TitleBar.cpp.
References KDDockWidgets::Core::FloatingWindow::isUtilityWindow(), KDDockWidgets::Core::View::showMinimized(), and KDDockWidgets::Core::Controller::view().
Referenced by c_KDDockWidgets__Core__TitleBar__onMinimizeClicked(), KDDockWidgets::QtWidgets::TitleBar::init(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::onMinimizeClicked(), and KDDockWidgets::QtQuick::TitleBar::onMinimizeClicked().
void TitleBar::setCloseButtonEnabled | ( | bool | enabled | ) |
void TitleBar::setCloseButtonVisible | ( | bool | visible | ) |
Definition at line 364 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__setCloseButtonVisible_bool(), and KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::setCloseButtonVisible().
void TitleBar::setFloatButtonVisible | ( | bool | visible | ) |
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().
void TitleBar::setIcon | ( | const Icon & | icon | ) |
Definition at line 397 of file core/TitleBar.cpp.
References icon().
Referenced by KDDockWidgets::Core::FloatingWindow::updateTitleAndIcon(), and KDDockWidgets::Core::Group::updateTitleAndIcon().
void TitleBar::setTitle | ( | const QString & | title | ) |
Definition at line 388 of file core/TitleBar.cpp.
References title(), KDDockWidgets::Core::View::update(), and KDDockWidgets::Core::Controller::view().
Referenced by c_KDDockWidgets__Core__TitleBar__setTitle_QString(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::setTitle(), KDDockWidgets::Core::FloatingWindow::updateTitleAndIcon(), and KDDockWidgets::Core::Group::updateTitleAndIcon().
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().
|
finaloverride |
Definition at line 648 of file core/TitleBar.cpp.
References dockWidgets(), KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::first(), and KDToolBox::StlContainerAdaptor::StdVectorAdaptor< T, Args >::isEmpty().
Referenced by c_KDDockWidgets__Core__TitleBar__singleDockWidget().
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().
bool TitleBar::supportsFloatingButton | ( | ) | const |
returns whether this title bar supports a floating/docking button
Definition at line 209 of file core/TitleBar.cpp.
References KDDockWidgets::Config::Flag_TitleBarHasMaximizeButton, KDDockWidgets::Config::Flag_TitleBarNoFloatButton, KDDockWidgets::Config::flags(), and KDDockWidgets::Config::self().
Referenced by c_KDDockWidgets__Core__TitleBar__supportsFloatingButton().
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().
bool TitleBar::supportsMinimizeButton | ( | ) | const |
returns whether this title bar supports a minimize button
Definition at line 232 of file core/TitleBar.cpp.
References KDDockWidgets::Core::FloatingWindow::supportsMinimizeButton().
Referenced by c_KDDockWidgets__Core__TitleBar__supportsMinimizeButton(), KDDockWidgets::QtQuick::TitleBar::minimizeButtonVisible(), and updateButtons().
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().
QString TitleBar::title | ( | ) | const |
Definition at line 158 of file core/TitleBar.cpp.
Referenced by c_KDDockWidgets__Core__TitleBar__title(), KDDockWidgets::flutter::TitleBar::init(), KDDockWidgets::QtWidgets::TitleBar::paintEvent(), setTitle(), KDDockWidgets::Core::Group::title(), and KDDockWidgets::QtQuick::TitleBar::title().
bool TitleBar::titleBarIsFocusable | ( | ) | const |
Definition at line 121 of file core/TitleBar.cpp.
References KDDockWidgets::Config::Flag_TitleBarIsFocusable, KDDockWidgets::Config::flags(), and KDDockWidgets::Config::self().
Referenced by c_KDDockWidgets__Core__TitleBar__titleBarIsFocusable(), and KDDockWidgets::QtWidgets::TitleBar::init().
void TitleBar::toggleMaximized | ( | ) |
Definition at line 340 of file core/TitleBar.cpp.
References KDDockWidgets::Core::View::isMaximized(), KDDockWidgets::Core::View::showMaximized(), KDDockWidgets::Core::View::showNormal(), and KDDockWidgets::Core::Controller::view().
Referenced by c_KDDockWidgets__Core__TitleBar__toggleMaximized(), onDoubleClicked(), onMaximizeClicked(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::toggleMaximized(), and KDDockWidgets::QtQuick::TitleBar::toggleMaximized().
void TitleBar::updateButtons | ( | ) |
updates the close button enabled state
Definition at line 287 of file core/TitleBar.cpp.
References buttonIsUserHidden(), KDDockWidgets::Minimize, and supportsMinimizeButton().
Referenced by TitleBar(), c_KDDockWidgets__Core__TitleBar__updateButtons(), setHideDisabledButtons(), setUserHiddenButtons(), KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::TitleBar_wrapper::updateButtons(), and KDDockWidgets::Core::FloatingWindow::updateTitleBarVisibility().