KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
core/TitleBar.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2020 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#include "TitleBar.h"
13#include "TitleBar_p.h"
14#include "Config.h"
15#include "ViewFactory.h"
16#include "View.h"
17#include "WindowBeingDragged_p.h"
18#include "Utils_p.h"
19#include "Logging_p.h"
20#include "Group_p.h"
21
23#include "DockWidget_p.h"
24#include "FloatingWindow.h"
25#include "DockRegistry.h"
26#include "FloatingWindow_p.h"
27#include "TabBar.h"
28#include "MainWindow.h"
29#include "MDILayout.h"
30#include "Stack.h"
31
32#ifdef KDDW_FRONTEND_QT
33#include <QTimer>
34#endif
35
36#include <utility>
37
38using namespace KDDockWidgets;
39using namespace KDDockWidgets::Core;
40
41
43 : Controller(
45 Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
46 , Draggable(view())
47 , d(new Private())
48 , m_group(parent)
49 , m_floatingWindow(nullptr)
50 , m_supportsAutoHide((Config::self().flags() & Config::Flag_AutoHideSupport) == Config::Flag_AutoHideSupport)
51 , m_isStandalone(false)
52{
53 init();
54 d->numDockWidgetsChangedConnection = m_group->dptr()->numDockWidgetsChanged.connect([this] {
55 updateCloseButton();
56 d->numDockWidgetsChanged.emit();
57 });
58
59 d->isFocusedChangedConnection = m_group->dptr()->isFocusedChanged.connect([this] {
60 d->isFocusedChanged.emit();
61 });
62
63 d->isInMainWindowChangedConnection = m_group->dptr()->isInMainWindowChanged.connect([this] {
64 updateAutoHideButton();
65 });
66}
67
69 : Controller(
71 Config::self().viewFactory()->createTitleBar(this, parent ? parent->view() : nullptr))
72 , Draggable(view())
73 , d(new Private())
74 , m_group(nullptr)
75 , m_floatingWindow(parent)
76 , m_supportsAutoHide((Config::self().flags() & Config::Flag_AutoHideSupport) == Config::Flag_AutoHideSupport)
77 , m_isStandalone(false)
78{
79 init();
80 auto fwPrivate = m_floatingWindow->dptr();
81 fwPrivate->numGroupsChanged.connect([this] { updateButtons(); });
82 fwPrivate->numDockWidgetsChanged.connect([this] { d->numDockWidgetsChanged.emit(); });
83 fwPrivate->windowStateChanged.connect([this] { updateMaximizeButton(); });
84 fwPrivate->activatedChanged.connect([this] { d->isFocusedChanged.emit(); });
85}
86
89 , Draggable(view, /*enabled=*/false)
90 , d(new Private())
91 , m_group(nullptr)
92 , m_floatingWindow(nullptr)
93 , m_supportsAutoHide(false)
94 , m_isStandalone(true)
95{
96}
97
98void TitleBar::init()
99{
100 view()->init();
101
102 d->isFocusedChanged.connect([this] {
103 // repaint
104 view()->update();
105 });
106
108
109#ifdef KDDW_FRONTEND_QT
110 // Auto-hide not supported in flutter yet
111 QTimer::singleShot(0, this, &TitleBar::updateAutoHideButton); // have to wait after the group is
112 // constructed
113#endif
114}
115
117{
118 delete d;
119}
120
125
126
128{
129 if (m_floatingWindow || m_isStandalone)
130 return nullptr;
131
132 if (m_group)
133 return m_group->mainWindow();
134
135 KDDW_ERROR("null group and null floating window");
136 return nullptr;
137}
138
139bool TitleBar::isMDI() const
140{
141 auto p = view()->asWrapper();
142 while (p) {
143 if (p->is(ViewType::MDILayout))
144 return true;
145
146 if (p->is(ViewType::DropArea)) {
147 // Note that the TitleBar can be inside a DropArea that's inside a MDIArea
148 // so we need this additional check
149 return false;
150 }
151
152 p = p->parentView();
153 }
154
155 return false;
156}
157
159{
160 return m_title;
161}
162
163Icon TitleBar::icon() const
164{
165 return m_icon;
166}
167
169{
170 if ((Config::self().flags() & Config::Flag_DoubleClickMaximizes) && m_floatingWindow) {
171 // Not using isFloating(), as that can be a dock widget nested in a floating window. By
172 // convention it's floating, but it's not the title bar of the top-level window.
174 return true;
175 } else if (supportsFloatUnfloat()) {
177 return true;
178 }
179
180 return false;
181}
182
184{
185 return m_floatButtonVisible;
186}
187
189{
190 return m_maximizeButtonVisible;
191}
192
193bool TitleBar::supportsFloatUnfloat() const
194{
195 if (m_isStandalone)
196 return false; // not applicable
197
198 if (DockWidget *dw = singleDockWidget()) {
199 // Don't show the dock/undock button if the window is not dockable
200 if (dw->options() & DockWidgetOption_NotDockable)
201 return false;
202 }
203
204 // If we have a floating window with nested dock widgets we can't re-attach, because we don't
205 // know where to
206 return !m_floatingWindow || m_floatingWindow->hasSingleGroup();
207}
208
210{
211 auto flags = Config::self().flags();
213 // Apps having a maximize/restore button traditionally don't have a floating one,
214 // QDockWidget style only has floating and no maximize/restore.
215 // We can add an option later if we need them to co-exist
216 return false;
217 }
218
220 // Was explicitly disabled
221 return false;
222 }
223
224 return supportsFloatUnfloat();
225}
226
228{
229 return m_floatingWindow && m_floatingWindow->supportsMaximizeButton();
230}
231
233{
234 return m_floatingWindow && m_floatingWindow->supportsMinimizeButton();
235}
236
238{
239 // Only dock widgets docked into the MainWindow can minimize
240 return m_supportsAutoHide && m_group && (m_group->isInMainWindow() || m_group->isOverlayed());
241}
242
243#ifdef DOCKS_TESTING_METHODS
244bool TitleBar::isFloatButtonVisible() const
245{
246 return dynamic_cast<Core::TitleBarViewInterface *>(view())->isFloatButtonVisible();
247}
248
249bool TitleBar::isCloseButtonVisible() const
250{
251 return dynamic_cast<Core::TitleBarViewInterface *>(view())->isCloseButtonVisible();
252}
253
254bool TitleBar::isCloseButtonEnabled() const
255{
256 return dynamic_cast<Core::TitleBarViewInterface *>(view())->isCloseButtonEnabled();
257}
258#endif
259
261{
262 return !m_icon.isNull();
263}
264
266{
267 return m_group;
268}
269
271{
272 return m_floatingWindow;
273}
274
276{
278 return;
279
280 if (m_group) {
281 m_group->FocusScope::focus(reason);
282 } else if (m_floatingWindow) {
283 m_floatingWindow->focus(reason);
284 }
285}
286
288{
289 updateCloseButton();
290 updateFloatButton();
291 updateMaximizeButton();
292
293 const bool isEnabled = true;
294 const bool minimizeVisible = supportsMinimizeButton() && !buttonIsUserHidden(TitleBarButtonType::Minimize, isEnabled);
295 d->minimizeButtonChanged.emit(minimizeVisible, isEnabled);
296
297 updateAutoHideButton();
298}
299
300void TitleBar::updateAutoHideButton()
301{
303
304 if (const Core::Group *group = this->group()) {
305 if (group->isOverlayed())
307 }
308
309 const bool isEnabled = true;
310 const bool visible = m_supportsAutoHide && !buttonIsUserHidden(type, isEnabled) && !m_floatingWindow;
311 d->autoHideButtonChanged.emit(visible, isEnabled, type);
312}
313
314void TitleBar::updateMaximizeButton()
315{
316 m_maximizeButtonVisible = false;
317 m_maximizeButtonType = TitleBarButtonType::Maximize;
318
319 if (auto fw = floatingWindow()) {
320 m_maximizeButtonType =
321 fw->view()->isMaximized() ? TitleBarButtonType::Normal : TitleBarButtonType::Maximize;
322 m_maximizeButtonVisible = supportsMaximizeButton();
323 }
324 const bool isEnabled = true;
325 m_maximizeButtonVisible = m_maximizeButtonVisible && !buttonIsUserHidden(m_maximizeButtonType, isEnabled);
326 d->maximizeButtonChanged.emit(m_maximizeButtonVisible, isEnabled, m_maximizeButtonType);
327}
328
329void TitleBar::updateCloseButton()
330{
331 const bool anyNonClosable = group()
332 ? group()->anyNonClosable()
333 : (floatingWindow() ? floatingWindow()->anyNonClosable() : false);
334
335 const bool isEnabled = !anyNonClosable;
336 setCloseButtonEnabled(isEnabled);
338}
339
341{
342 if (!m_floatingWindow)
343 return;
344
345 if (m_floatingWindow->view()->isMaximized())
346 m_floatingWindow->view()->showNormal();
347 else
348 m_floatingWindow->view()->showMaximized();
349}
350
352{
353 return m_group && m_group->isOverlayed();
354}
355
357{
358 if (enabled != m_closeButtonEnabled) {
359 m_closeButtonEnabled = enabled;
360 d->closeButtonChanged.emit(m_closeButtonVisible, enabled);
361 }
362}
363
365{
366 if (visible != m_closeButtonVisible) {
367 m_closeButtonVisible = visible;
368 d->closeButtonChanged.emit(m_closeButtonVisible, m_closeButtonEnabled);
369 }
370}
371
373{
374 if (visible != m_floatButtonVisible) {
375 m_floatButtonVisible = visible;
376 d->floatButtonVisibleChanged.emit(visible);
377 }
378}
379
380void TitleBar::setFloatButtonToolTip(const QString &tip)
381{
382 if (tip != m_floatButtonToolTip) {
383 m_floatButtonToolTip = tip;
384 d->floatButtonToolTipChanged.emit(tip);
385 }
386}
387
388void TitleBar::setTitle(const QString &title)
389{
390 if (title != m_title) {
391 m_title = title;
392 view()->update();
393 d->titleChanged.emit();
394 }
395}
396
397void TitleBar::setIcon(const Icon &icon)
398{
399 m_icon = icon;
400 d->iconChanged.emit();
401}
402
404{
406
407 const bool closeOnlyCurrentTab = Config::self().flags() & Config::Flag_CloseOnlyCurrentTab;
408
409 if (m_group) {
410 if (closeOnlyCurrentTab) {
411 if (auto dw = m_group->currentDockWidget()) {
412 dw->view()->close();
413 } else {
414 // Doesn't happen
415 KDDW_ERROR("Group with no dock widgets");
416 }
417 } else {
418 if (m_group->isTheOnlyGroup() && m_group->isInFloatingWindow()) {
419 m_group->view()->d->closeRootView();
420 } else {
421 m_group->view()->close();
422 }
423 }
424 } else if (m_floatingWindow) {
425
426 if (closeOnlyCurrentTab) {
427 if (Group *f = m_floatingWindow->singleFrame()) {
428 if (DockWidget *dw = f->currentDockWidget()) {
429 dw->view()->close();
430 } else {
431 // Doesn't happen
432 KDDW_ERROR("Group with no dock widgets");
433 }
434 } else {
435 m_floatingWindow->view()->close();
436 }
437 } else {
438 m_floatingWindow->view()->close();
439 }
440 } else if (m_isStandalone) {
441 view()->d->closeRootView();
442 }
443}
444
446{
448 if (isFloating()) {
449 // Let's dock it
450
451 if (dockWidgets.isEmpty()) {
452 KDDW_ERROR("TitleBar::onFloatClicked: empty list. Shouldn't happen");
453 return;
454 }
455
456 if (dockWidgets.size() == 1) {
457 // Case 1: Single dockwidget floating
458 dockWidgets[0]->setFloating(false);
459 } else {
460 // Case 2: Multiple dockwidgets are tabbed together and floating
461 // Possible improvement: Just reuse the whole group and put it back.
462 // The group currently doesn't remember the position in the main window
463 // so use an hack for now
464
465 if (!dockWidgets.isEmpty()) { // could be empty during destruction, maybe
466 if (!dockWidgets.constFirst()->hasPreviousDockedLocation()) {
467 // Don't attempt, there's no previous docked location
468 return;
469 }
470
471 // suppress "isFloatingChanged" signals, as we're doing the float/unfloat hack
473
474 int i = 0;
475 DockWidget *current = nullptr;
476 for (auto dock : std::as_const(dockWidgets)) {
477 if (!current && dock->isCurrentTab())
478 current = dock;
479
480 dock->setFloating(true);
481 dock->dptr()->m_lastPosition->m_tabIndex = i;
482 dock->setFloating(false);
483 ++i;
484 }
485 Group::s_inFloatHack = false;
486
487 // Restore the current tab
488 if (current)
489 current->setAsCurrentTab();
490 }
491 }
492 } else {
493 // Let's float it
494 if (dockWidgets.size() == 1) {
495 // If there's a single dock widget, just call DockWidget::setFloating(true). The only
496 // difference is that it has logic for using the last used geometry for the floating
497 // window
498 dockWidgets[0]->setFloating(true);
499 } else {
500 makeWindow();
501 }
502 }
503}
504
509
511{
512 if (!m_floatingWindow)
513 return;
514
515 if (m_floatingWindow->isUtilityWindow()) {
516 // Qt::Tool windows don't appear in the task bar.
517 // Unless someone tells me a good reason to allow this situation.
518 return;
519 }
520
521 m_floatingWindow->view()->showMinimized();
522}
523
525{
526 if (!m_group) {
527 // Doesn't happen
528 KDDW_ERROR("Minimize not supported on floating windows");
529 return;
530 }
531
532 const auto &dockwidgets = m_group->dockWidgets();
533 if (isOverlayed() && dockwidgets.size() != 1) {
534 // Doesn't happen
535 KDDW_ERROR("TitleBar::onAutoHideClicked: There can only be a single dock widget per titlebar overlayed");
536 return;
537 }
538
539 const bool groupedAutoHide = Config::hasFlag(Config::Flag_AutoHideAsTabGroups);
540 const auto currentDw = m_group->currentDockWidget();
541 auto registry = DockRegistry::self();
542
543 if (isOverlayed()) { // Restore it:
544 auto dw = dockwidgets.first();
545 MainWindow *mainWindow = dw->mainWindow();
546 auto sideBarGroup = groupedAutoHide ? registry->sideBarGroupingFor(dw) : DockWidget::List();
547 if (sideBarGroup.isEmpty()) {
549 } else {
550 // Config::Flag_AutoHideAsTabGroups case. Restore its friends too
551 for (auto it = sideBarGroup.rbegin(); it != sideBarGroup.rend(); ++it) {
553 }
554 dw->setAsCurrentTab();
555 registry->removeSideBarGrouping(sideBarGroup);
556 }
557 } else { // Send it to sidebar:
558 if (groupedAutoHide)
559 registry->addSideBarGrouping(dockwidgets);
560
561
563 for (DockWidget *dw : dockwidgets) {
564 if (groupedAutoHide || dw == currentDw)
565 dw->moveToSideBar();
566 }
567 }
568}
569
571{
572 return m_closeButtonEnabled;
573}
574
575std::unique_ptr<WindowBeingDragged> TitleBar::makeWindow()
576{
577 if (m_isStandalone)
578 return {}; // not applicable
579
580 if (!isVisible() && view()->rootView()->controller()->isVisible()
582
583 // When using Flag_ShowButtonsOnTabBarIfTitleBarHidden we forward the call from the tab
584 // bar's buttons to the title bar's buttons, just to reuse logic
585
586 KDDW_ERROR("TitleBar::makeWindow shouldn't be called on invisible title bar this={}, root.isVisible={}", ( void * )this, view()->rootView()->isVisible());
587 if (m_group) {
588 KDDW_ERROR("this={}; actual={}", ( void * )this, ( void * )m_group->actualTitleBar());
589 } else if (m_floatingWindow) {
590 KDDW_ERROR("Has floating window with titlebar={}, isVisible={}", ( void * )m_floatingWindow->titleBar(), m_floatingWindow->isVisible());
591 }
592
593 assert(false);
594 return {};
595 }
596
597 if (m_floatingWindow) {
598 // We're already a floating window, no detach needed
599 return std::make_unique<WindowBeingDragged>(m_floatingWindow, this);
600 }
601
602 if (FloatingWindow *fw = floatingWindow()) { // Already floating
603 if (m_group->isTheOnlyGroup()) { // We don't detach. This one drags the entire window
604 // instead.
605 KDDW_DEBUG("TitleBar::makeWindow no detach needed");
606 return std::make_unique<WindowBeingDragged>(fw, this);
607 }
608 }
609
610 Rect r = m_group->view()->geometry();
611 r.moveTopLeft(m_group->mapToGlobal(Point(0, 0)));
612
613 auto floatingWindow = new Core::FloatingWindow(m_group, {});
616
617 auto draggable = KDDockWidgets::usesNativeTitleBar() ? static_cast<Draggable *>(floatingWindow)
618 : static_cast<Draggable *>(this);
619 return std::make_unique<WindowBeingDragged>(floatingWindow, draggable);
620}
621
623{
624 return m_floatingWindow != nullptr;
625}
626
628{
629 if (m_floatingWindow) {
630 DockWidget::List result;
631 const auto groups = m_floatingWindow->groups();
632 for (Group *group : groups) {
633 result.append(group->dockWidgets());
634 }
635 return result;
636 }
637
638 if (m_group)
639 return m_group->dockWidgets();
640
641 if (m_isStandalone)
642 return {}; // not applicable
643
644 KDDW_ERROR("TitleBar::dockWidget: shouldn't happen");
645 return {};
646}
647
649{
651 return dockWidgets.isEmpty() ? nullptr : dockWidgets.first();
652}
653
655{
656 if (m_floatingWindow)
657 return true;
658
659 if (m_group)
660 return m_group->isFloating();
661
662 if (m_isStandalone)
663 return false; // not applicable
664
665 KDDW_ERROR("TitleBar::isFloating: shouldn't happen");
666 return false;
667}
668
670{
671 if (m_group)
672 return m_group->isFocused();
673 else if (m_floatingWindow)
674 return m_floatingWindow->view()->isActiveWindow();
675 else if (m_isStandalone)
676 return view()->isActiveWindow();
677
678 return false;
679}
680
681void TitleBar::updateFloatButton()
682{
683 setFloatButtonToolTip(floatingWindow() ? tr("Dock window") : tr("Undock window"));
685}
686
688{
689 return m_floatButtonToolTip;
690}
691
693{
694 if (m_floatingWindow && m_floatingWindow->hasSingleGroup()) {
695 if (Group *group = m_floatingWindow->singleFrame()) {
696 return group->stack()->tabBar();
697 } else {
698 // Shouldn't happen
699 KDDW_ERROR("Expected a group");
700 }
701
702 } else if (m_group) {
703 return m_group->stack()->tabBar();
704 }
705
706 return nullptr;
707}
708
710{
711 return m_maximizeButtonType;
712}
713
715{
716 return m_isStandalone;
717}
718
720{
721 return d->m_userHiddenButtonTypes & type;
722}
723
725{
727 return true;
728
729 if (!enabled)
731
732 return false;
733}
734
735void TitleBar::setUserHiddenButtons(TitleBarButtonTypes types)
736{
737 if (d->m_userHiddenButtonTypes != types) {
738 d->m_userHiddenButtonTypes = types;
740 }
741}
742
743TitleBar::Private *TitleBar::dptr() const
744{
745 return d;
746}
747
748void TitleBar::setHideDisabledButtons(TitleBarButtonTypes types)
749{
750 if (d->m_buttonsToHideIfDisabled != types) {
751 d->m_buttonsToHideIfDisabled = types;
753 }
754}
755
757{
758 return d->m_buttonsToHideIfDisabled & type;
759}
Application-wide config to tune certain behaviours of the framework.
Singleton to allow to choose certain behaviours of the framework.
Definition Config.h:64
static bool hasFlag(Flag)
Returns whether the specified flag is set or not.
Definition Config.cpp:144
static Config & self()
returns the singleton Config instance
Definition Config.cpp:88
Flags flags() const
returns the chosen flags
Definition Config.cpp:102
@ Flag_TitleBarNoFloatButton
The TitleBar won't show the float button.
Definition Config.h:113
@ Flag_ShowButtonsOnTabBarIfTitleBarHidden
Definition Config.h:125
@ Flag_TitleBarHasMaximizeButton
Definition Config.h:97
@ Flag_AutoHideAsTabGroups
If tabbed dockwidgets are sent to/from sidebar, they're all sent and restored together.
Definition Config.h:131
View * view() const
Returns the view associated with this controller, if any.
ViewType type() const
Returns the type of this controller.
Point mapToGlobal(Point) const
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
Vector< DockWidget * > List
bool setFloating(bool floats)
setter to make the dock widget float or dock.
void setAsCurrentTab()
Makes this dock widget current in its tab group.
bool isCurrentTab() const
Returns true if this dock widget is the current one in the tab widget that contains it....
bool supportsMaximizeButton() const
Returns whether this floating window supports showing a maximize button.
void setSuggestedGeometry(Rect suggestedRect, SuggestedGeometryHints=SuggestedGeometryHint_None)
Equivalent to setGeometry(), but the value might be adjusted.
bool isUtilityWindow() const
Returns whether this window is a tool window Tool windows don't usually appear in the task bar.
Core::Group * singleFrame() const
If this floating window has only one Frame, it's returned, otherwise nullptr.
bool hasSingleGroup() const
checks if this FloatingWindow only has one group. If true it means there's no side-by-side dock widge...
bool supportsMinimizeButton() const
Returns whether this floating window supports showing a minimize button.
Core::TitleBar * titleBar() const
Returns the title bar.
bool isFocused() const
Returns true if this FocusScope is focused. This is similar to the QWidget::hasFocus(),...
Vector< DockWidget * > dockWidgets() const
bool isInMainWindow() const
Returns whether this group is docked inside a MainWindow.
bool isFloating() const
Returns whether this group is floating. A floating group isn't attached to any other MainWindow,...
MainWindow * mainWindow() const
Returns the main window this group is in. nullptr if not inside a main window.
DockWidget * currentDockWidget() const
Returns the current dock widget.
Core::Stack * stack() const
returns the tab widget
bool isOverlayed() const
Returns whether this group is overlayed on top of the MainWindow (auto-hide feature);.
Core::TitleBar * actualTitleBar() const
bool isInFloatingWindow() const
Returns whether this group is in a FloatingWindow, as opposed to MainWindow.
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
void restoreFromSideBar(KDDockWidgets::Core::DockWidget *dw)
Removes the dock widget from the sidebar and docks it into the main window again.
Core::TabBar * tabBar() const
Returns the tab bar.
The interface that TitleBar views should implement.
void setUserHiddenButtons(TitleBarButtonTypes)
Allows to override's KDDW's default visibility logic and force hide a button.
TabBar * tabBar() const
Returns the tab bar which is under this title bar. It's only nullptr for the case of having a Floatin...
bool isFocused() const
returns whether any of the DockWidgets this TitleBar controls has a child focus Not to be confused wi...
bool supportsMinimizeButton() const
returns whether this title bar supports a minimize button
void setIcon(const Icon &icon)
bool isStandalone() const
Returns whether this titlebar is standalone. See comment in the ctor.
void setTitle(const QString &title)
Core::DockWidget * singleDockWidget() const override final
DockWidget::List dockWidgets() const
the list of dockwidgets under this TitleBar. There should always be at least 1. If more than 1 then t...
std::unique_ptr< WindowBeingDragged > makeWindow() override
Core::Group * group() const
getter for m_group
TitleBarButtonType maximizeButtonType() const
void setHideDisabledButtons(TitleBarButtonTypes)
bool buttonIsUserHidden(TitleBarButtonType) const
bool supportsAutoHideButton() const
returns whether this title bar supports the auto-hide button
friend class KDDockWidgets::QtWidgets::TitleBar
void focus(Qt::FocusReason reason)
bool isMDI() const override
From Draggable interface.
bool buttonHidesIfDisabled(TitleBarButtonType) const
void updateButtons()
updates the close button enabled state
bool supportsMaximizeButton() const
returns whether this title bar supports a maximize/restore button
bool isFloating() const
Returns true if this title-bar is the title bar of a floating window.
bool hasIcon() const
returns whether this title bar has an icon
bool supportsFloatingButton() const
returns whether this title bar supports a floating/docking button
FloatingWindow * floatingWindow() const
getter for m_floatingWindow
MainWindow * mainWindow() const
If this title bar belongs to a dock widget docked into the main window, returns the main window Retur...
bool isWindow() const override
virtual void update()=0
virtual void show()=0
virtual Rect geometry() const =0
virtual bool isMaximized() const =0
virtual void showMinimized()=0
virtual bool isActiveWindow() const =0
virtual bool close()=0
virtual std::shared_ptr< View > asWrapper()=0
Returns this view, but as a wrapper.
virtual void showMaximized()=0
virtual void showNormal()=0
static DockRegistry * self()
ViewType
Each View type also has a specific Controller associated with, except for ViewType::None.
Definition Controller.h:26
Class to abstract QAction, so code still works with QtQuick and Flutter.
@ SuggestedGeometryHint_GeometryIsFromDocked
@ DockWidgetOption_NotDockable
The DockWidget can't be docked, it's always floating.
TitleBarButtonType
describes a type of button you can have in the title bar
@ MovedToSideBar
User clicked menu with QAction.
@ TitleBarCloseButton
probably programmatically
FocusReason
A factory class for allowing the user to customize some internal widgets.
QMainWindow sub-class to enable KDDockWidgets support.

© 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