KDDockWidgets API Documentation  1.5
FloatingWindow.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KDDockWidgets.
3 
4  SPDX-FileCopyrightText: 2019-2022 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 "FloatingWindow_p.h"
13 #include "MainWindowBase.h"
14 #include "Logging_p.h"
15 #include "Frame_p.h"
16 #include "TitleBar_p.h"
17 #include "WindowBeingDragged_p.h"
18 #include "Utils_p.h"
19 #include "WidgetResizeHandler_p.h"
20 #include "DockRegistry_p.h"
21 #include "Config.h"
22 #include "FrameworkWidgetFactory.h"
23 #include "DragController_p.h"
24 #include "LayoutSaver_p.h"
25 
26 #include <QCloseEvent>
27 #include <QScopedValueRollback>
28 #include <QTimer>
29 #include <QWindow>
30 
31 #if defined(Q_OS_WIN)
32 #if defined(Q_CC_MSVC)
33 //NOMINMAX tells windows.h not to define the max and min macros
34 //which will interfere with the max() from std::numeric_limits
35 #define NOMINMAX
36 #endif
37 #include <windows.h>
38 #include <dwmapi.h>
39 #endif
40 
41 using namespace KDDockWidgets;
42 
44 Qt::WindowFlags FloatingWindow::s_windowFlagsOverride = {};
45 
47 {
48  if (FloatingWindow::s_windowFlagsOverride) {
49  // The user specifically set different flags.
50  return FloatingWindow::s_windowFlagsOverride;
51  }
52 
53  if (KDDockWidgets::usesNativeDraggingAndResizing())
54  return Qt::Window;
55 
57  return Qt::Window;
58 
59  return Qt::Tool;
60 }
61 
62 static MainWindowBase *hackFindParentHarder(Frame *frame, MainWindowBase *candidateParent)
63 {
65  return nullptr;
66  }
67 
68  // TODO: Using a parent helps the floating windows stay in front of the main window always.
69  // We're not receiving the parent via ctor argument as the app can have multiple-main windows,
70  // so use a hack here.
71  // Not quite clear what to do if the app supports multiple main windows though.
72 
73  if (candidateParent)
74  return candidateParent;
75 
76  const MainWindowBase::List windows = DockRegistry::self()->mainwindows();
77 
78  if (windows.isEmpty())
79  return nullptr;
80 
81  if (windows.size() == 1) {
82  return windows.first();
83  } else {
84  const QStringList affinities = frame ? frame->affinities() : QStringList();
85  const MainWindowBase::List mainWindows = DockRegistry::self()->mainWindowsWithAffinity(affinities);
86 
87  if (mainWindows.isEmpty()) {
88  qWarning() << Q_FUNC_INFO << "No window with affinity" << affinities << "found";
89  return nullptr;
90  } else {
91  return mainWindows.first();
92  }
93  }
94 }
95 
97 {
99  ? nullptr
100  : candidate;
101 }
102 
103 FloatingWindow::FloatingWindow(QRect suggestedGeometry, MainWindowBase *parent)
104  : QWidgetAdapter(actualParent(parent), windowFlagsToUse())
105  , Draggable(this, KDDockWidgets::usesNativeDraggingAndResizing()) // FloatingWindow is only draggable when using a native title bar. Otherwise the KDDockWidgets::TitleBar is the draggable
106  , m_dropArea(new DropArea(this))
107  , m_titleBar(Config::self().frameworkWidgetFactory()->createTitleBar(this))
108 {
109  if (!suggestedGeometry.isNull())
110  setGeometry(suggestedGeometry);
111 
112  if (kddwUsesQtWidgets()) {
113  // For QtQuick we do it a bit later, once we have the QQuickWindow
114 #ifdef Q_OS_WIN
115  create();
116 #ifdef KDDOCKWIDGETS_QTWIDGETS
117  m_nchittestFilter = new NCHITTESTEventFilter(this);
118  qApp->installNativeEventFilter(m_nchittestFilter);
119 #endif
120  WidgetResizeHandler::setupWindow(windowHandle());
121 #endif
122  }
123 
124  DockRegistry::self()->registerFloatingWindow(this);
125 
126  if (Config::self().flags() & Config::Flag_KeepAboveIfNotUtilityWindow)
127  setWindowFlag(Qt::WindowStaysOnTopHint, true);
128 
129  if (kddwUsesQtWidgets()) {
130  // QtQuick will do it a bit later, once it has a QWindow
131  maybeCreateResizeHandler();
132  }
133 
134  updateTitleBarVisibility();
135  connect(m_dropArea, &LayoutWidget::visibleWidgetCountChanged, this,
136  &FloatingWindow::onFrameCountChanged);
137  connect(m_dropArea, &LayoutWidget::visibleWidgetCountChanged, this,
138  &FloatingWindow::numFramesChanged);
139  connect(m_dropArea, &LayoutWidget::visibleWidgetCountChanged, this,
140  &FloatingWindow::onVisibleFrameCountChanged);
141  m_layoutDestroyedConnection = connect(m_dropArea, &QObject::destroyed, this, &FloatingWindow::scheduleDeleteLater);
142 }
143 
144 FloatingWindow::FloatingWindow(Frame *frame, QRect suggestedGeometry, MainWindowBase *parent)
145  : FloatingWindow(suggestedGeometry, hackFindParentHarder(frame, parent))
146 {
147  m_disableSetVisible = true;
148  // Adding a widget will trigger onFrameCountChanged, which triggers a setVisible(true).
149  // The problem with setVisible(true) will forget about or requested geometry and place the window at 0,0
150  // So disable the setVisible(true) call while in the ctor.
151  m_dropArea->addWidget(frame, KDDockWidgets::Location_OnTop, {});
152  m_disableSetVisible = false;
153 }
154 
155 FloatingWindow::~FloatingWindow()
156 {
157  m_inDtor = true;
158  disconnect(m_layoutDestroyedConnection);
159  delete m_nchittestFilter;
160 
161  DockRegistry::self()->unregisterFloatingWindow(this);
162 }
163 
164 #if defined(Q_OS_WIN) && defined(KDDOCKWIDGETS_QTWIDGETS)
165 bool FloatingWindow::nativeEvent(const QByteArray &eventType, void *message, Qt5Qt6Compat::qintptr *result)
166 {
167  if (m_inDtor || m_deleteScheduled)
168  return QWidget::nativeEvent(eventType, message, result);
169 
170  if (KDDockWidgets::usesAeroSnapWithCustomDecos()) {
171  // To enable aero snap we need to tell Windows where's our custom title bar
172  if (WidgetResizeHandler::handleWindowsNativeEvent(this, eventType, message, result))
173  return true;
174  } else if (KDDockWidgets::usesNativeTitleBar()) {
175  auto msg = static_cast<MSG *>(message);
176  if (msg->message == WM_SIZING) {
177  // Cancel any drag if we're resizing
178  Q_EMIT DragController::instance()->dragCanceled();
179  }
180  }
181 
182  return QWidget::nativeEvent(eventType, message, result);
183 }
184 #endif
185 
186 void FloatingWindow::maybeCreateResizeHandler()
187 {
188  if (!KDDockWidgets::usesNativeDraggingAndResizing()) {
189  setFlag(Qt::FramelessWindowHint, true);
190  setWidgetResizeHandler(new WidgetResizeHandler(/*topLevel=*/true, this));
191  }
192 }
193 
194 std::unique_ptr<WindowBeingDragged> FloatingWindow::makeWindow()
195 {
196  return std::unique_ptr<WindowBeingDragged>(new WindowBeingDragged(this, this));
197 }
198 
199 DockWidgetBase *FloatingWindow::singleDockWidget() const
200 {
201  const Frame::List frames = this->frames();
202  if (frames.size() == 1) {
203  Frame *frame = frames.first();
204  if (frame->hasSingleDockWidget())
205  return frame->dockWidgetAt(0);
206  }
207 
208  return nullptr;
209 }
210 
211 const DockWidgetBase::List FloatingWindow::dockWidgets() const
212 {
213  return m_dropArea->dockWidgets();
214 }
215 
216 const Frame::List FloatingWindow::frames() const
217 {
218  Q_ASSERT(m_dropArea);
219  return m_dropArea->frames();
220 }
221 
222 QSize FloatingWindow::maxSizeHint() const
223 {
224  QSize result = Layouting::Item::hardcodedMaximumSize;
225 
226  if (!m_dropArea) {
227  // Still early, no layout set
228  return result;
229  }
230 
231  const Frame::List frames = this->frames();
232  if (frames.size() == 1) {
233  // Let's honour max-size when we have a single-frame.
234  // multi-frame cases are more complicated and we're not sure if we want the window to
235  // bounce around. single-frame is the most common case, like floating a dock widget, so
236  // let's do that first, it's also easy.
237  Frame *frame = frames[0];
238  if (frame->dockWidgetCount() == 1) { // We don't support if there's tabbing
239  const QSize waste = (minimumSize() - frame->minSize()).expandedTo(QSize(0, 0));
240  result = frame->maxSizeHint() + waste;
241  }
242  }
243 
244  // Semantically the result is fine, but bound it so we don't get:
245  // QWidget::setMaximumSize: (/KDDockWidgets::FloatingWindowWidget) The largest allowed size is (16777215,16777215)
246  return result.boundedTo(Layouting::Item::hardcodedMaximumSize);
247 }
248 
249 void FloatingWindow::setSuggestedGeometry(QRect suggestedRect, SuggestedGeometryHints hint)
250 {
251  const QSize maxSize = maxSizeHint();
252  const bool hasMaxSize = maxSize != Layouting::Item::hardcodedMaximumSize;
253  if (hasMaxSize) {
254  // Resize to new size but preserve center
255  const QPoint originalCenter = suggestedRect.center();
256  suggestedRect.setSize(maxSize.boundedTo(suggestedRect.size()));
257 
259  && (Config::self().flags() & Config::Flag_NativeTitleBar)) {
260  const QMargins margins = contentMargins();
261  suggestedRect.setHeight(suggestedRect.height() - m_titleBar->height() + margins.top()
262  + margins.bottom());
263  }
264 
266  suggestedRect.moveCenter(originalCenter);
267  }
268 
269  ensureRectIsOnScreen(suggestedRect);
270 
271  setGeometry(suggestedRect);
272 }
273 
274 void FloatingWindow::scheduleDeleteLater()
275 {
276  m_deleteScheduled = true;
277  DockRegistry::self()->unregisterFloatingWindow(this);
278  deleteLater();
279 }
280 
281 MultiSplitter *FloatingWindow::multiSplitter() const
282 {
283  return m_dropArea;
284 }
285 
286 LayoutWidget *FloatingWindow::layoutWidget() const
287 {
288  return m_dropArea;
289 }
290 
291 bool FloatingWindow::isInDragArea(QPoint globalPoint) const
292 {
293 #ifdef Q_OS_WIN
294  // A click near the border will still send a Qt::NonClientMousePressEvent. We shouldn't
295  // interpret that as a drag, as it's for a native resize.
296  // Keep track of how we handled the WM_NCHITTEST
297  if (usesAeroSnapWithCustomDecos())
298  return m_lastHitTest == HTCAPTION;
299 #endif
300 
301  return dragRect().contains(globalPoint);
302 }
303 
304 bool FloatingWindow::anyNonClosable() const
305 {
306  for (Frame *frame : frames()) {
307  if (frame->anyNonClosable())
308  return true;
309  }
310  return false;
311 }
312 
313 bool FloatingWindow::anyNonDockable() const
314 {
315  for (Frame *frame : frames()) {
316  if (frame->anyNonDockable())
317  return true;
318  }
319  return false;
320 }
321 
322 bool FloatingWindow::hasSingleFrame() const
323 {
324  return m_dropArea->visibleCount() == 1;
325 }
326 
327 bool FloatingWindow::hasSingleDockWidget() const
328 {
329  const Frame::List frames = this->frames();
330  if (frames.size() != 1)
331  return false;
332 
333  Frame *frame = frames.first();
334  return frame->dockWidgetCount() == 1;
335 }
336 
337 Frame *FloatingWindow::singleFrame() const
338 {
339  const Frame::List frames = this->frames();
340 
341  return frames.isEmpty() ? nullptr
342  : frames.first();
343 }
344 
345 bool FloatingWindow::beingDeleted() const
346 {
347  if (m_deleteScheduled || m_inDtor)
348  return true;
349 
350  // TODO: Confusing logic
351  for (Frame *f : frames()) {
352  if (!f->beingDeletedLater())
353  return false;
354  }
355 
356  return true;
357 }
358 
359 void FloatingWindow::onFrameCountChanged(int count)
360 {
361  if (count == 0) {
362  scheduleDeleteLater();
363  } else {
364  updateTitleBarVisibility();
365  if (count == 1) // if something was removed, then our single dock widget is floating, we need to check the QAction
366  dropArea()->updateFloatingActions();
367  }
368 }
369 
370 void FloatingWindow::onVisibleFrameCountChanged(int count)
371 {
372  if (m_disableSetVisible)
373  return;
374 
375  updateSizeConstraints();
376  setVisible(count > 0);
377 }
378 
379 Qt::WindowState FloatingWindow::windowStateOverride() const
380 {
382 
383  if (isMaximizedOverride())
384  state = Qt::WindowMaximized;
385  else if (isMinimizedOverride())
386  state = Qt::WindowMinimized;
387 
388  return state;
389 }
390 
391 void FloatingWindow::updateTitleBarVisibility()
392 {
393  if (m_updatingTitleBarVisibility)
394  return; // Break recursion
395 
396  QScopedValueRollback<bool> guard(m_updatingTitleBarVisibility, true);
397  updateTitleAndIcon();
398 
399  bool visible = true;
400 
401  for (Frame *frame : frames())
402  frame->updateTitleBarVisibility();
403 
404  if (KDDockWidgets::usesClientTitleBar()) {
405  const auto flags = Config::self().flags();
406  if ((flags & Config::Flag_HideTitleBarWhenTabsVisible) && !(flags & Config::Flag_AlwaysTitleBarWhenFloating)) {
407  if (hasSingleFrame()) {
408  visible = !frames().first()->hasTabsVisible();
409  }
410  }
411 
412  m_titleBar->updateButtons();
413  } else {
414  visible = false;
415  }
416 
417  m_titleBar->setVisible(visible);
418 }
419 
420 QStringList FloatingWindow::affinities() const
421 {
422  auto frames = this->frames();
423  return frames.isEmpty() ? QStringList() : frames.constFirst()->affinities();
424 }
425 
426 void FloatingWindow::updateTitleAndIcon()
427 {
428  QString title;
429  QIcon icon;
430  if (hasSingleFrame()) {
431  const Frame *frame = frames().constFirst();
432  title = frame->title();
433  icon = frame->icon();
434  } else {
435  title = qApp->applicationName();
436  }
437  m_titleBar->setTitle(title);
438  m_titleBar->setIcon(icon);
439 
440  // Even without a native title bar it's nice to set the window title/icon, so it shows
441  // in the taskbar (when minimization is supported), or Alt-Tab (in supporting Window Managers)
442  setWindowTitle(title);
443  setWindowIcon(icon);
444 }
445 
446 void FloatingWindow::onCloseEvent(QCloseEvent *e)
447 {
448  if (e->spontaneous() && anyNonClosable()) {
449  // Event from the window system won't close us
450  e->ignore();
451  return;
452  }
453 
454  e->accept(); // Accepted by default (will close unless ignored)
455 
456  const Frame::List frames = this->frames();
457  for (Frame *frame : frames) {
458  qApp->sendEvent(frame, e);
459  if (!e->isAccepted())
460  break; // Stop when the first frame prevents closing
461  }
462 }
463 
464 bool FloatingWindow::deserialize(const LayoutSaver::FloatingWindow &fw)
465 {
466  if (dropArea()->deserialize(fw.multiSplitterLayout)) {
467  updateTitleBarVisibility();
468 
469  if (fw.normalGeometry.isValid() && !isNormalWindowState(fw.windowState)) {
470  // Restore QWidgetPrivate's normalGeometry (no public API in QWidget)
471  setNormalGeometry(fw.normalGeometry);
472  }
473 
474  // And show it:
475  if (fw.windowState & Qt::WindowMaximized) {
476  showMaximized();
477  } else if (fw.windowState & Qt::WindowMinimized) {
478  showMinimized();
479  } else {
480  showNormal();
481  }
482 
483  return true;
484  } else {
485  return false;
486  }
487 }
488 
489 LayoutSaver::FloatingWindow FloatingWindow::serialize() const
490 {
491  LayoutSaver::FloatingWindow fw;
492 
493  fw.geometry = geometry();
494  fw.normalGeometry = normalGeometry();
495  fw.isVisible = isVisible();
496  fw.multiSplitterLayout = dropArea()->serialize();
497  fw.screenIndex = screenNumberForWidget(this);
498  fw.screenSize = screenSizeForWidget(this);
499  fw.affinities = affinities();
500  fw.windowState = windowStateOverride();
501 
502  auto mainWindow = qobject_cast<MainWindowBase *>(parentWidget());
503  fw.parentIndex = mainWindow ? DockRegistry::self()->mainwindows().indexOf(mainWindow)
504  : -1;
505 
506  return fw;
507 }
508 
509 QRect FloatingWindow::dragRect() const
510 {
511  QRect rect;
512  if (m_titleBar->isVisible()) {
513  rect = m_titleBar->rect();
514  rect.moveTopLeft(m_titleBar->mapToGlobal(QPoint(0, 0)));
515  } else if (hasSingleFrame()) {
516  rect = frames().constFirst()->dragRect();
517  } else {
518  qWarning() << Q_FUNC_INFO << "Expected a title bar";
519  }
520 
521  return rect;
522 }
523 
524 bool FloatingWindow::event(QEvent *ev)
525 {
526  if (ev->type() == QEvent::ActivationChange) {
527  // Since QWidget is missing a signal for window activation
528  Q_EMIT activatedChanged();
529  } else if (ev->type() == QEvent::StatusTip && parent()) {
530  // show status tips in the main window
531  return parent()->event(ev);
532  } else if (ev->type() == QEvent::LayoutRequest) {
533  updateSizeConstraints();
534  }
535 
536  return QWidgetAdapter::event(ev);
537 }
538 
539 bool FloatingWindow::allDockWidgetsHave(DockWidgetBase::Option option) const
540 {
541  const Frame::List frames = this->frames();
542  return std::all_of(frames.begin(), frames.end(), [option](Frame *frame) {
543  return frame->allDockWidgetsHave(option);
544  });
545 }
546 
547 bool FloatingWindow::anyDockWidgetsHas(DockWidgetBase::Option option) const
548 {
549  const Frame::List frames = this->frames();
550  return std::any_of(frames.begin(), frames.end(), [option](Frame *frame) {
551  return frame->anyDockWidgetsHas(option);
552  });
553 }
554 
555 bool FloatingWindow::allDockWidgetsHave(DockWidgetBase::LayoutSaverOption option) const
556 {
557  const Frame::List frames = this->frames();
558  return std::all_of(frames.begin(), frames.end(), [option](Frame *frame) {
559  return frame->allDockWidgetsHave(option);
560  });
561 }
562 
563 bool FloatingWindow::anyDockWidgetsHas(DockWidgetBase::LayoutSaverOption option) const
564 {
565  const Frame::List frames = this->frames();
566  return std::any_of(frames.begin(), frames.end(), [option](Frame *frame) {
567  return frame->anyDockWidgetsHas(option);
568  });
569 }
570 
571 void FloatingWindow::addDockWidget(DockWidgetBase *dw, Location location,
572  DockWidgetBase *relativeTo, InitialOption option)
573 {
574  m_dropArea->addDockWidget(dw, location, relativeTo, option);
575 }
576 
577 bool FloatingWindow::isMDI() const
578 {
579  return false;
580 }
581 
582 bool FloatingWindow::isWindow() const
583 {
584  return true;
585 }
586 
587 MainWindowBase *FloatingWindow::mainWindow() const
588 {
589  return qobject_cast<MainWindowBase *>(parent());
590 }
591 
592 QMargins FloatingWindow::contentMargins() const
593 {
594  return { 4, 4, 4, 4 };
595 }
596 
597 bool FloatingWindow::isMaximizedOverride() const
598 {
599  return QWidgetAdapter::isMaximized();
600 }
601 
602 bool FloatingWindow::isMinimizedOverride() const
603 {
605 }
606 
607 void FloatingWindow::showMaximized()
608 {
609  QWidgetAdapter::showMaximized();
610 }
611 
612 void FloatingWindow::showNormal()
613 {
614  QWidgetAdapter::showNormal();
615 }
616 
617 void FloatingWindow::showMinimized()
618 {
619  QWidgetAdapter::showMinimized();
620 }
621 
622 QRect FloatingWindow::normalGeometry() const
623 {
624  return QWidgetAdapter::normalGeometry();
625 }
626 
627 int FloatingWindow::userType() const
628 {
629  if (Frame *f = singleFrame())
630  return f->userType();
631  return 0;
632 }
633 
634 void FloatingWindow::updateSizeConstraints()
635 {
636  // Doing a delayed call to make sure the layout has completled any ongoing operation.
637  QTimer::singleShot(0, this, [this] {
638  // Not simply using layout's max-size support because
639  // 1) that's not portable to QtQuick
640  // 2) QStackedLayout (from tab-widget) doesn't propagate size constraints up
641  // Doing it manually instead.
642  setMaximumSize(maxSizeHint());
643  });
644 }
645 
646 void FloatingWindow::ensureRectIsOnScreen(QRect &geometry)
647 {
648  const auto screens = qApp->screens();
649  if (screens.empty())
650  return;
651 
652  int nearestDistSq = std::numeric_limits<int>::max();
653  int nearestIndex = -1;
654 
655  const int screenCount = screens.count();
656  for (int i = 0; i < screenCount; i++) {
657  auto scrGeom = screens[i]->geometry();
658 
659  // Account for virtual coordinates space
660  scrGeom.moveTopLeft(scrGeom.topLeft() - screens[i]->virtualGeometry().topLeft());
661 
662  // If the rectangle is visible at all, we need do nothing
663  if (scrGeom.intersects(geometry))
664  return;
665 
666  // Find the nearest screen, so we can move the geometry onto it
667  const QPoint dist2D = geometry.center() - scrGeom.center();
668  const int distSq = (dist2D.x() * dist2D.x()) + (dist2D.y() * dist2D.y());
669  if (distSq < nearestDistSq) {
670  nearestDistSq = distSq;
671  nearestIndex = i;
672  }
673  }
674 
675  // Move the rectangle to the nearest vertical and/or horizontal screen edge
676  auto scrGeom = screens[nearestIndex]->geometry();
677  scrGeom.moveTopLeft(scrGeom.topLeft() - screens[nearestIndex]->virtualGeometry().topLeft());
678 
679  if (geometry.left() < scrGeom.left()) {
680  geometry.moveLeft(scrGeom.left());
681  } else if (geometry.left() > scrGeom.right()) {
682  geometry.moveRight(scrGeom.right());
683  }
684 
685  if (geometry.top() < scrGeom.top()) {
686  geometry.moveTop(scrGeom.top());
687  } else if (geometry.top() > scrGeom.bottom()) {
688  geometry.moveBottom(scrGeom.bottom());
689  }
690 }
QMainWindow::event
virtual bool event(QEvent *event) override
KDDockWidgets::SuggestedGeometryHint_PreserveCenter
@ SuggestedGeometryHint_PreserveCenter
Definition: KDDockWidgets.h:203
QRect::setSize
void setSize(const QSize &size)
QRect::moveTopLeft
void moveTopLeft(const QPoint &position)
QVector::isEmpty
bool isEmpty() const const
QMargins::bottom
int bottom() const const
QEvent::ActivationChange
ActivationChange
QRect::moveBottom
void moveBottom(int y)
QRect::size
QSize size() const const
QRect
QWidget::nativeEvent
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result)
KDDockWidgets::InitialOption
Struct describing the preferred dock widget size and visibility when adding it to a layout.
Definition: KDDockWidgets.h:105
QTimer::singleShot
singleShot
KDDockWidgets::Location_OnTop
@ Location_OnTop
Left docking location
Definition: KDDockWidgets.h:48
KDDockWidgets::Location
Location
Definition: KDDockWidgets.h:45
QSize
QPoint::x
int x() const const
QPoint::y
int y() const const
QVector::first
T & first()
QRect::left
int left() const const
MainWindowBase.h
The MainWindow base-class that's shared between QtWidgets and QtQuick stack.
QObject::destroyed
void destroyed(QObject *obj)
Qt::WindowFlags
typedef WindowFlags
QRect::top
int top() const const
QCloseEvent
QRect::setHeight
void setHeight(int height)
QString
QEvent::isAccepted
bool isAccepted() const const
QRect::moveTop
void moveTop(int y)
KDDockWidgets::DockWidgetBase::LayoutSaverOption
LayoutSaverOption
Options which will affect LayoutSaver save/restore.
Definition: DockWidgetBase.h:86
KDDockWidgets::Config
Singleton to allow to choose certain behaviours of the framework.
Definition: Config.h:55
QSize::boundedTo
QSize boundedTo(const QSize &otherSize) const const
Qt::WindowState
WindowState
QRect::center
QPoint center() const const
QIcon
QRect::isNull
bool isNull() const const
QEvent::spontaneous
bool spontaneous() const const
QMargins
QRect::moveCenter
void moveCenter(const QPoint &position)
Config.h
Application-wide config to tune certain behaviours of the framework.
QRect::height
int height() const const
QEvent::type
QEvent::Type type() const const
QEvent
QEvent::ignore
void ignore()
KDDockWidgets::DockWidgetBase
The DockWidget base-class. DockWidget and DockWidgetBase are only split in two so we can share some c...
Definition: DockWidgetBase.h:61
KDDockWidgets
Definition: Config.cpp:36
QScopedValueRollback
QVector::size
int size() const const
Draggable
KDDockWidgets::Private::isMinimized
bool isMinimized(QWindow *window)
Definition: QWidgetAdapter.h:31
KDDockWidgets::MainWindowBase
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
Definition: MainWindowBase.h:56
QVector
KDDockWidgets::DockWidgetBase::Option
Option
DockWidget options to pass at construction time.
Definition: DockWidgetBase.h:75
QRect::moveLeft
void moveLeft(int x)
hackFindParentHarder
static MainWindowBase * hackFindParentHarder(Frame *frame, MainWindowBase *candidateParent)
Definition: FloatingWindow.cpp:62
windowFlagsToUse
static Qt::WindowFlags windowFlagsToUse()
Definition: FloatingWindow.cpp:46
KDDockWidgets::SuggestedGeometryHint_GeometryIsFromDocked
@ SuggestedGeometryHint_GeometryIsFromDocked
Definition: KDDockWidgets.h:204
QMargins::top
int top() const const
KDDockWidgets::Config::InternalFlag_DontUseQtToolWindowsForFloatingWindows
@ InternalFlag_DontUseQtToolWindowsForFloatingWindows
FloatingWindows will use Qt::Window instead of Qt::Tool.
Definition: Config.h:116
QPoint
KDDockWidgets::Config::InternalFlag_DontUseParentForFloatingWindows
@ InternalFlag_DontUseParentForFloatingWindows
FloatingWindows won't have a parent top-level.
Definition: Config.h:115
QByteArray
QEvent::accept
void accept()
KDDockWidgets::Config::self
static Config & self()
returns the singleton Config instance
Definition: Config.cpp:82
FrameworkWidgetFactory.h
A factory class for allowing the user to customize some internal widgets.
QStringList
QRect::moveRight
void moveRight(int x)
actualParent
MainWindowBase * actualParent(MainWindowBase *candidate)
Definition: FloatingWindow.cpp:96

© 2019-2022 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 on Mon Mar 7 2022 02:01:20 for KDDockWidgets API Documentation by doxygen 1.8.20