Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmainwindowlayout_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QMAINWINDOWLAYOUT_P_H
6#define QMAINWINDOWLAYOUT_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include "qmainwindow.h"
21
22#include "QtWidgets/qlayout.h"
23#if QT_CONFIG(tabbar)
24#include "QtWidgets/qtabbar.h"
25#include "QtGui/qpainter.h"
26#include "QtGui/qevent.h"
27#endif
28#include "QtCore/qbasictimer.h"
29#include "QtCore/qlist.h"
30#include "QtCore/qset.h"
31#include "private/qlayoutengine_p.h"
32#include "private/qwidgetanimator_p.h"
33#if QT_CONFIG(dockwidget)
34#include "private/qdockwidget_p.h"
35
36#include "qdockarealayout_p.h"
37#include "qdockwidget.h"
38#else
39struct QDockWidgetPrivate {
40 enum class DragScope {
41 Group
42 };
43};
44#endif
45#if QT_CONFIG(toolbar)
46#include "qtoolbararealayout_p.h"
47#include "qtoolbar.h"
48#endif
49
50#include <QtCore/qloggingcategory.h>
51#include <QtCore/qpointer.h>
52
54
56
58
59class QToolBar;
60class QRubberBand;
61
62template <typename Layout> // Make use of the "Curiously recurring template pattern"
64{
65 Layout *layout() { return static_cast<Layout *>(this); }
66 const Layout *layout() const { return static_cast<const Layout *>(this); }
67 QWidget *window() { return layout()->parentWidget(); }
68
69public:
71
73
76
77#if QT_CONFIG(dockwidget)
78
79#if QT_CONFIG(cursor)
80 QCursor separatorCursor(const QList<int> &path);
81 void adjustCursor(const QPoint &pos);
84 bool hasOldCursor = false;
85 bool cursorAdjusted = false;
86#endif // QT_CONFIG(cursor)
87
91
92 bool startSeparatorMove(const QPoint &pos);
93 bool separatorMove(const QPoint &pos);
94 bool endSeparatorMove(const QPoint &pos);
95 bool windowEvent(QEvent *e);
96
97private:
98 QList<int> findSeparator(const QPoint &pos) const;
99
100#endif // QT_CONFIG(dockwidget)
101
102};
103
104#if QT_CONFIG(dockwidget)
105
106#if QT_CONFIG(cursor)
107template <typename Layout>
108QCursor QMainWindowLayoutSeparatorHelper<Layout>::separatorCursor(const QList<int> &path)
109{
110 const QDockAreaLayoutInfo *info = layout()->dockAreaLayoutInfo()->info(path);
111 Q_ASSERT(info != nullptr);
112 if (path.size() == 1) { // is this the "top-level" separator which separates a dock area
113 // from the central widget?
114 switch (path.first()) {
115 case QInternal::LeftDock:
116 case QInternal::RightDock:
117 return Qt::SplitHCursor;
118 case QInternal::TopDock:
119 case QInternal::BottomDock:
120 return Qt::SplitVCursor;
121 default:
122 break;
123 }
124 }
125
126 // no, it's a splitter inside a dock area, separating two dock widgets
127
128 return info->o == Qt::Horizontal ? Qt::SplitHCursor : Qt::SplitVCursor;
129}
130
131template <typename Layout>
132void QMainWindowLayoutSeparatorHelper<Layout>::adjustCursor(const QPoint &pos)
133{
134 QWidget *w = layout()->window();
135 hoverPos = pos;
136
137 if (pos == QPoint(0, 0)) {
138 if (!hoverSeparator.isEmpty())
139 w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
140 hoverSeparator.clear();
141
142 if (cursorAdjusted) {
143 cursorAdjusted = false;
144 if (hasOldCursor)
145 w->setCursor(oldCursor);
146 else
147 w->unsetCursor();
148 }
149 } else if (movingSeparator.isEmpty()) { // Don't change cursor when moving separator
150 QList<int> pathToSeparator = findSeparator(pos);
151
152 if (pathToSeparator != hoverSeparator) {
153 if (!hoverSeparator.isEmpty())
154 w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
155
156 hoverSeparator = pathToSeparator;
157
158 if (hoverSeparator.isEmpty()) {
159 if (cursorAdjusted) {
160 cursorAdjusted = false;
161 if (hasOldCursor)
162 w->setCursor(oldCursor);
163 else
164 w->unsetCursor();
165 }
166 } else {
167 w->update(layout()->dockAreaLayoutInfo()->separatorRect(hoverSeparator));
168 if (!cursorAdjusted) {
169 oldCursor = w->cursor();
170 hasOldCursor = w->testAttribute(Qt::WA_SetCursor);
171 }
172 adjustedCursor = separatorCursor(hoverSeparator);
173 w->setCursor(adjustedCursor);
174 cursorAdjusted = true;
175 }
176 }
177 }
178}
179#endif // QT_CONFIG(cursor)
180
181template <typename Layout>
182bool QMainWindowLayoutSeparatorHelper<Layout>::windowEvent(QEvent *event)
183{
184 QWidget *w = window();
185 switch (event->type()) {
186 case QEvent::Paint: {
187 QPainter p(w);
188 QRegion r = static_cast<QPaintEvent *>(event)->region();
189 layout()->dockAreaLayoutInfo()->paintSeparators(&p, w, r, hoverPos);
190 break;
191 }
192
193#if QT_CONFIG(cursor)
194 case QEvent::HoverMove: {
195 adjustCursor(static_cast<QHoverEvent *>(event)->position().toPoint());
196 break;
197 }
198
199 // We don't want QWidget to call update() on the entire QMainWindow
200 // on HoverEnter and HoverLeave, hence accept the event (return true).
201 case QEvent::HoverEnter:
202 return true;
203 case QEvent::HoverLeave:
204 adjustCursor(QPoint(0, 0));
205 return true;
206 case QEvent::ShortcutOverride: // when a menu pops up
207 adjustCursor(QPoint(0, 0));
208 break;
209#endif // QT_CONFIG(cursor)
210
211 case QEvent::MouseButtonPress: {
212 QMouseEvent *e = static_cast<QMouseEvent *>(event);
213 if (e->button() == Qt::LeftButton && startSeparatorMove(e->position().toPoint())) {
214 // The click was on a separator, eat this event
215 e->accept();
216 return true;
217 }
218 break;
219 }
220
221 case QEvent::MouseMove: {
222 QMouseEvent *e = static_cast<QMouseEvent *>(event);
223
224#if QT_CONFIG(cursor)
225 adjustCursor(e->position().toPoint());
226#endif
227 if (e->buttons() & Qt::LeftButton) {
228 if (separatorMove(e->position().toPoint())) {
229 // We're moving a separator, eat this event
230 e->accept();
231 return true;
232 }
233 }
234
235 break;
236 }
237
238 case QEvent::MouseButtonRelease: {
239 QMouseEvent *e = static_cast<QMouseEvent *>(event);
240 if (endSeparatorMove(e->position().toPoint())) {
241 // We've released a separator, eat this event
242 e->accept();
243 return true;
244 }
245 break;
246 }
247
248#if QT_CONFIG(cursor)
249 case QEvent::CursorChange:
250 // CursorChange events are triggered as mouse moves to new widgets even
251 // if the cursor doesn't actually change, so do not change oldCursor if
252 // the "changed" cursor has same shape as adjusted cursor.
253 if (cursorAdjusted && adjustedCursor.shape() != w->cursor().shape()) {
254 oldCursor = w->cursor();
255 hasOldCursor = w->testAttribute(Qt::WA_SetCursor);
256
257 // Ensure our adjusted cursor stays visible
258 w->setCursor(adjustedCursor);
259 }
260 break;
261#endif // QT_CONFIG(cursor)
262 case QEvent::Timer:
263 if (static_cast<QTimerEvent *>(event)->timerId() == separatorMoveTimer.timerId()) {
264 // let's move the separators
265 separatorMoveTimer.stop();
266 if (movingSeparator.isEmpty())
267 return true;
268 if (movingSeparatorOrigin == movingSeparatorPos)
269 return true;
270
271 // when moving the separator, we need to update the previous position
272 window()->update(layout()->dockAreaLayoutInfo()->separatorRegion());
273
274 layout()->layoutState = layout()->savedState;
275 layout()->dockAreaLayoutInfo()->separatorMove(movingSeparator, movingSeparatorOrigin,
276 movingSeparatorPos);
277 movingSeparatorPos = movingSeparatorOrigin;
278 return true;
279 }
280 break;
281 default:
282 break;
283 }
284 return false;
285}
286
287template <typename Layout>
288QList<int> QMainWindowLayoutSeparatorHelper<Layout>::findSeparator(const QPoint &pos) const
289{
290 Layout *layout = const_cast<Layout*>(this->layout());
291#if QT_CONFIG(toolbar)
292 QToolBarAreaLayout *toolBarAreaLayout = layout->toolBarAreaLayout();
293 if (toolBarAreaLayout && !toolBarAreaLayout->isEmpty()) {
294 // We might have a toolbar that is currently expanded, covering
295 // parts of the dock area, in which case we don't want the dock
296 // area layout to treat mouse events for the expanded toolbar as
297 // hitting a separator.
298 const QWidget *widget = layout->window();
299 QWidget *childWidget = widget->childAt(pos);
300 while (childWidget && childWidget != widget) {
301 if (auto *toolBar = qobject_cast<QToolBar*>(childWidget)) {
302 if (!toolBarAreaLayout->indexOf(toolBar).isEmpty())
303 return {};
304 }
305 childWidget = childWidget->parentWidget();
306 }
307 }
308#endif
309 return layout->dockAreaLayoutInfo()->findSeparator(pos);
310}
311
312template <typename Layout>
313bool QMainWindowLayoutSeparatorHelper<Layout>::startSeparatorMove(const QPoint &pos)
314{
315 movingSeparator = findSeparator(pos);
316
317 if (movingSeparator.isEmpty())
318 return false;
319
320 layout()->savedState = layout()->layoutState;
321 movingSeparatorPos = movingSeparatorOrigin = pos;
322
323 return true;
324}
325template <typename Layout>
326bool QMainWindowLayoutSeparatorHelper<Layout>::separatorMove(const QPoint &pos)
327{
328 if (movingSeparator.isEmpty())
329 return false;
330 movingSeparatorPos = pos;
331 separatorMoveTimer.start(0, window());
332 return true;
333}
334template <typename Layout>
335bool QMainWindowLayoutSeparatorHelper<Layout>::endSeparatorMove(const QPoint &)
336{
337 if (movingSeparator.isEmpty())
338 return false;
339 movingSeparator.clear();
340 layout()->savedState.clear();
341 return true;
342}
343
344class Q_AUTOTEST_EXPORT QDockWidgetGroupWindow : public QWidget
345{
346 Q_OBJECT
347public:
348 explicit QDockWidgetGroupWindow(QWidget *parent = nullptr, Qt::WindowFlags f = {})
349 : QWidget(parent, f)
350 {
351 }
352 QDockAreaLayoutInfo *layoutInfo() const;
353#if QT_CONFIG(tabbar)
354 const QDockAreaLayoutInfo *tabLayoutInfo() const;
355 QDockWidget *activeTabbedDockWidget() const;
356#endif
357 void destroyOrHideIfEmpty();
358 bool hasVisibleDockWidgets() const;
359 void adjustFlags();
360 bool hasNativeDecos() const;
361
362 bool hover(QLayoutItem *widgetItem, const QPoint &mousePos);
363 void updateCurrentGapRect();
364 void restore();
365 void apply();
366 void childEvent(QChildEvent *event) override;
367 void reparentToMainWindow(QDockWidget *dockWidget);
368 void destroyIfSingleItemLeft();
369 QList<QDockWidget *> dockWidgets() const { return findChildren<QDockWidget *>(); }
370
371 QRect currentGapRect;
372 QList<int> currentGapPos;
373
374signals:
375 void resized();
376
377protected:
378 bool event(QEvent *) override;
379 bool eventFilter(QObject *obj, QEvent *event) override;
380 void paintEvent(QPaintEvent*) override;
381
382private:
383 QSize m_removedFrameSize;
384};
385
386// This item will be used in the layout for the gap item. We cannot use QWidgetItem directly
387// because QWidgetItem functions return an empty size for widgets that are floating.
388class QDockWidgetGroupWindowItem : public QWidgetItem
389{
390public:
391 explicit QDockWidgetGroupWindowItem(QDockWidgetGroupWindow *parent) : QWidgetItem(parent) {}
392
393 // when the item contains a dock widget, obtain its size (to prevent infinite loop)
394 // ask the layout otherwise
395 QSize minimumSize() const override
396 {
397 if (auto dw = widget()->findChild<QDockWidget *>())
398 return dw->minimumSize();
399 return lay()->minimumSize();
400 }
401 QSize maximumSize() const override
402 {
403 auto dw = widget()->findChild<QDockWidget *>();
404 if (dw)
405 return dw->maximumSize();
406 return lay()->maximumSize();
407 }
408 QSize sizeHint() const override
409 {
410 auto dw = widget()->findChild<QDockWidget *>();
411 if (dw)
412 return dw->sizeHint();
413 return lay()->sizeHint();
414 }
415 QWidget* widget() const override { return wid; }
416
417private:
418 QLayout *lay() const { return const_cast<QDockWidgetGroupWindowItem *>(this)->widget()->layout(); }
419};
420#endif // QT_CONFIG(dockwidget)
421
422/* This data structure represents the state of all the tool-bars and dock-widgets. It's value based
423 so it can be easily copied into a temporary variable. All operations are performed without moving
424 any widgets. Only when we are sure we have the desired state, we call apply(), which moves the
425 widgets.
426*/
427
428class Q_AUTOTEST_EXPORT QMainWindowLayoutState
429{
430public:
431 QRect rect;
432 QMainWindow *mainWindow;
433
434 QMainWindowLayoutState(QMainWindow *win);
435
436#if QT_CONFIG(toolbar)
437 QToolBarAreaLayout toolBarAreaLayout;
438#endif
439
440#if QT_CONFIG(dockwidget)
441 QDockAreaLayout dockAreaLayout;
442#else
443 QLayoutItem *centralWidgetItem;
444 QRect centralWidgetRect;
445#endif
446
447 void apply(bool animated);
448 void deleteAllLayoutItems();
449 void deleteCentralWidgetItem();
450
451 QSize sizeHint() const;
452 QSize minimumSize() const;
453 bool fits() const;
454 void fitLayout();
455
456 QLayoutItem *itemAt(int index, int *x) const;
457 QLayoutItem *takeAt(int index, int *x);
458 QList<int> indexOf(QWidget *widget) const;
459 QLayoutItem *item(const QList<int> &path);
460 QRect itemRect(const QList<int> &path) const;
461 QRect gapRect(const QList<int> &path) const; // ### get rid of this, use itemRect() instead
462
463 bool contains(QWidget *widget) const;
464
465 void setCentralWidget(QWidget *widget);
466 QWidget *centralWidget() const;
467
468 QList<int> gapIndex(QWidget *widget, const QPoint &pos) const;
469 bool insertGap(const QList<int> &path, QLayoutItem *item);
470 void remove(const QList<int> &path);
471 void remove(QLayoutItem *item);
472 void clear();
473 bool isValid() const;
474
475 QLayoutItem *plug(const QList<int> &path);
476 QLayoutItem *unplug(const QList<int> &path, QMainWindowLayoutState *savedState = nullptr);
477
478 void saveState(QDataStream &stream) const;
479 bool checkFormat(QDataStream &stream);
480 bool restoreState(QDataStream &stream, const QMainWindowLayoutState &oldState);
481};
482
483class QMainWindowTabBar;
484class Q_AUTOTEST_EXPORT QMainWindowLayout
485 : public QLayout,
486 public QMainWindowLayoutSeparatorHelper<QMainWindowLayout>
487{
488 Q_OBJECT
489
490public:
491 QMainWindowLayoutState layoutState, savedState;
492 std::unique_ptr<QMainWindowLayoutState> restoredState;
493
494 QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLayout);
495 ~QMainWindowLayout();
496
497 QMainWindow::DockOptions dockOptions;
498 void setDockOptions(QMainWindow::DockOptions opts);
499
500 QLayoutItem *statusbar;
501
502 // status bar
503#if QT_CONFIG(statusbar)
504 QStatusBar *statusBar() const;
505 void setStatusBar(QStatusBar *sb);
506#endif
507
508 // central widget
509 QWidget *centralWidget() const;
510 void setCentralWidget(QWidget *cw);
511
512 // toolbars
513#if QT_CONFIG(toolbar)
514 void addToolBarBreak(Qt::ToolBarArea area);
515 void insertToolBarBreak(QToolBar *before);
516 void removeToolBarBreak(QToolBar *before);
517
518 void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar, bool needAddChildWidget = true);
519 void insertToolBar(QToolBar *before, QToolBar *toolbar);
520 Qt::ToolBarArea toolBarArea(const QToolBar *toolbar) const;
521 bool toolBarBreak(QToolBar *toolBar) const;
522 void getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar *toolBar) const;
523 void removeToolBar(QToolBar *toolbar);
524 void toggleToolBarsVisible();
525 void moveToolBar(QToolBar *toolbar, int pos);
526 QToolBarAreaLayout *toolBarAreaLayout() { return &layoutState.toolBarAreaLayout; }
527#endif
528
529 // dock widgets
530#if QT_CONFIG(dockwidget)
531 void setCorner(Qt::Corner corner, Qt::DockWidgetArea area);
532 Qt::DockWidgetArea corner(Qt::Corner corner) const;
533 enum DockWidgetAreaSize {Visible, Maximum};
534 QRect dockWidgetAreaRect(Qt::DockWidgetArea area, DockWidgetAreaSize size = Maximum) const;
535 void addDockWidget(Qt::DockWidgetArea area,
536 QDockWidget *dockwidget,
537 Qt::Orientation orientation);
538 void splitDockWidget(QDockWidget *after,
539 QDockWidget *dockwidget,
540 Qt::Orientation orientation);
541 Qt::DockWidgetArea dockWidgetArea(const QWidget* widget) const;
542 bool restoreDockWidget(QDockWidget *dockwidget);
543#if QT_CONFIG(tabbar)
544 void tabifyDockWidget(QDockWidget *first, QDockWidget *second);
545 void raise(QDockWidget *widget);
546 void setVerticalTabsEnabled(bool enabled);
547
548 QDockAreaLayoutInfo *dockInfo(QWidget *w);
549 bool _documentMode;
550 bool documentMode() const;
551 void setDocumentMode(bool enabled);
552
553 QTabBar *getTabBar();
554 void unuseTabBar(QTabBar *bar);
555 QSet<QTabBar*> usedTabBars;
556 bool verticalTabsEnabled;
557
558 QWidget *getSeparatorWidget();
559 QSet<QWidget*> usedSeparatorWidgets;
560 int sep; // separator extent
561
562#if QT_CONFIG(tabwidget)
563 QTabWidget::TabPosition tabPositions[QInternal::DockCount];
564 QTabWidget::TabShape _tabShape;
565
566 QTabWidget::TabShape tabShape() const;
567 void setTabShape(QTabWidget::TabShape tabShape);
568 QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const;
569 void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition);
570
571 QDockWidgetGroupWindow *createTabbedDockWindow();
572#endif // QT_CONFIG(tabwidget)
573#endif // QT_CONFIG(tabbar)
574
575 QDockAreaLayout *dockAreaLayoutInfo() { return &layoutState.dockAreaLayout; }
576 void keepSize(QDockWidget *w);
577#endif // QT_CONFIG(dockwidget)
578
579 // save/restore
580 enum VersionMarkers { // sentinel values used to validate state data
581 VersionMarker = 0xff
582 };
583 void saveState(QDataStream &stream) const;
584 bool restoreState(QDataStream &stream);
585 QBasicTimer discardRestoredStateTimer;
586
587 // QLayout interface
588 void addItem(QLayoutItem *item) override;
589 void setGeometry(const QRect &r) override;
590 QLayoutItem *itemAt(int index) const override;
591 QLayoutItem *takeAt(int index) override;
592 int count() const override;
593
594 QSize sizeHint() const override;
595 QSize minimumSize() const override;
596 mutable QSize szHint;
597 mutable QSize minSize;
598 void invalidate() override;
599
600 // animations
601 QWidgetAnimator widgetAnimator;
602 QList<int> currentGapPos;
603 QRect currentGapRect;
604 QWidget *pluggingWidget;
605#if QT_CONFIG(rubberband)
606 QPointer<QRubberBand> gapIndicator;
607#endif
608#if QT_CONFIG(dockwidget)
609 QPointer<QDockWidgetGroupWindow> currentHoveredFloat; // set when dragging over a floating dock widget
610 void setCurrentHoveredFloat(QDockWidgetGroupWindow *w);
611#if QT_CONFIG(tabbar)
612 bool isDockWidgetTabbed(const QDockWidget *dockWidget) const;
613 QList<QDockWidget *> tabifiedDockWidgets(const QDockWidget *dockWidget) const;
614 QMainWindowTabBar *findTabBar(const QDockWidget *dockWidget) const;
615#endif
616#endif
617 bool isInApplyState = false;
618
619 void hover(QLayoutItem *hoverTarget, const QPoint &mousePos);
620 bool plug(QLayoutItem *widgetItem);
621 QLayoutItem *unplug(QWidget *widget, QDockWidgetPrivate::DragScope scope);
622 void revert(QLayoutItem *widgetItem);
623 void applyState(QMainWindowLayoutState &newState, bool animate = true);
624 void applyRestoredState();
625 void restore(bool keepSavedState = false);
626 void animationFinished(QWidget *widget);
627
628#if QT_CONFIG(draganddrop)
629 static bool needsPlatformDrag();
630 Qt::DropAction performPlatformWidgetDrag(QLayoutItem *widgetItem, const QPoint &pressPosition);
631 QLayoutItem *draggingWidget = nullptr;
632#endif
633
634protected:
635 void timerEvent(QTimerEvent *e) override;
636
637private Q_SLOTS:
638 void updateGapIndicator();
639#if QT_CONFIG(dockwidget)
640#if QT_CONFIG(tabbar)
641 void tabChanged();
642 void tabMoved(int from, int to);
643#endif
644#endif
645private:
646#if QT_CONFIG(tabbar)
647 void showTabBars();
648 void updateTabBarShapes();
649#endif
650 bool isInRestoreState = false;
651};
652
653#if QT_CONFIG(dockwidget) && !defined(QT_NO_DEBUG_STREAM)
654class QDebug;
655QDebug operator<<(QDebug debug, const QDockAreaLayout &layout);
656QDebug operator<<(QDebug debug, const QMainWindowLayout *layout);
657#endif
658
659QT_END_NAMESPACE
660
661#endif // QMAINWINDOWLAYOUT_P_H
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-l...
Definition qdockwidget.h:21
\inmodule QtCore
Definition qhash.h:837
The QMainWindow class provides a main application window.
Definition qmainwindow.h:26
friend class QWidget
Definition qpainter.h:431
void animate(QWidget *widget, const QRect &final_geometry, bool animate)
void abort(QWidget *widget)
bool animating() const
QT_REQUIRE_CONFIG(animation)
static int grow(QLayoutStruct &ls, int delta)
static QRect dockedGeometry(QWidget *widget)
static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)
static int realMinSize(const QDockAreaLayoutInfo &info)
static int qMax(int i1, int i2, int i3)
static int shrink(QLayoutStruct &ls, int delta)
static const int zero
static int separatorMoveHelper(QList< QLayoutStruct > &list, int index, int delta, int sep)
static QInternal::DockPosition dockPosHelper(const QRect &rect, const QPoint &_pos, Qt::Orientation o, bool nestingEnabled, QDockAreaLayoutInfo::TabMode tabMode)
static void paintSep(QPainter *p, QWidget *w, const QRect &r, Qt::Orientation o, bool mouse_over)
static int realMaxSize(const QDockAreaLayoutInfo &info)
QMainWindowLayout * qt_mainwindow_layout(const QMainWindow *window)
@ StateFlagFloating
@ StateFlagVisible
QT_REQUIRE_CONFIG(dockwidget)
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
QT_REQUIRE_CONFIG(mainwindow)