KDDockWidgets API Documentation  1.6
QWidgetAdapter_quick.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 
21 #include "QWidgetAdapter.h"
22 #include "MainWindowBase.h"
23 
24 #include "../DockRegistry_p.h"
25 #include "../Utils_p.h"
26 #include "../FloatingWindow_p.h"
27 #include "../multisplitter/Item_p.h"
28 
29 #include <QResizeEvent>
30 #include <QMouseEvent>
31 #include <QQmlComponent>
32 #include <QQuickItem>
33 #include <QQmlEngine>
34 #include <QQuickView>
35 #include <QScopedValueRollback>
36 
37 #include <qpa/qplatformwindow.h>
38 
39 using namespace KDDockWidgets;
40 
41 namespace KDDockWidgets {
42 
48 class MouseEventRedirector : public QObject
49 {
50  Q_OBJECT
51 public:
52  explicit MouseEventRedirector(QObject *eventSource, QObject *eventTarget)
53  : QObject(eventTarget)
54  , m_eventSource(eventSource)
55  , m_eventTarget(eventTarget)
56  {
57  eventSource->installEventFilter(this);
58 
59  // Each source can only have one MouseEventRedirector
60  auto oldRedirector = s_mouseEventRedirectors.take(eventSource);
61  if (oldRedirector) {
62  eventSource->removeEventFilter(oldRedirector);
63  oldRedirector->deleteLater();
64  }
65 
66  s_mouseEventRedirectors.insert(eventSource, this);
67  }
68 
69  static MouseEventRedirector *redirectorForSource(QObject *eventSource)
70  {
71  return s_mouseEventRedirectors.value(eventSource);
72  }
73 
74  ~MouseEventRedirector() override;
75 
76  bool eventFilter(QObject *source, QEvent *ev) override
77  {
78  QMouseEvent *me = mouseEvent(ev);
79  if (!me)
80  return false;
81 
82  // MouseArea.enable is different from Item.enabled. The former still lets the events
83  // go through event loops. So query MouseArea.enable here and bail out if false.
84  const QVariant v = source->property("enabled");
85  if (v.isValid() && !v.toBool())
86  return false;
87 
88  // Finally send the event
89  m_eventTarget->setProperty("cursorPosition", m_eventSource->property("cursorPosition"));
90  qApp->sendEvent(m_eventTarget, me);
91  m_eventTarget->setProperty("cursorPosition", CursorPosition_Undefined);
92 
93  return false;
94  }
95 
96  QObject *const m_eventSource;
97  QObject *const m_eventTarget;
98  static QHash<QObject *, MouseEventRedirector *> s_mouseEventRedirectors;
99 };
100 
101 QHash<QObject *, MouseEventRedirector *> MouseEventRedirector::s_mouseEventRedirectors = {};
102 
103 MouseEventRedirector::~MouseEventRedirector()
104 {
105  s_mouseEventRedirectors.remove(m_eventSource);
106 }
107 
108 }
109 
111 {
112  return flags & (Qt::Window | Qt::Tool);
113 }
114 
115 static QQuickItem *actualParentItem(QQuickItem *candidateParentItem, Qt::WindowFlags flags)
116 {
117  // When we have a top-level, such as FloatingWindow, we only want to set QObject parentship
118  // and not parentItem.
119  return flagsAreTopLevelFlags(flags) ? nullptr
120  : candidateParentItem;
121 }
122 
123 QWidgetAdapter::QWidgetAdapter(QQuickItem *parent, Qt::WindowFlags flags)
124  : QQuickItem(actualParentItem(parent, flags))
125  , m_windowFlags(flags)
126 {
127  if (parent && flagsAreTopLevelFlags(flags)) {
128  // See comment in actualParentItem(). We set only the QObject parent. Mimics QWidget behaviour
129  QObject::setParent(parent);
130  }
131 
132  connect(this, &QQuickItem::widthChanged, this, [this] {
133  onResize(size());
134  updateGeometry();
135  });
136 
137  connect(this, &QQuickItem::heightChanged, this, [this] {
138  if (!m_windowIsBeingDestroyed) { // If Window is being destroyed we don't bother
139  onResize(size());
140  updateGeometry();
141  }
142  });
143 
144  qApp->installEventFilter(this);
145 
146  setSize(QSize(800, 800));
147 }
148 
149 QWidgetAdapter::~QWidgetAdapter()
150 {
151 }
152 
153 void QWidgetAdapter::raiseAndActivate()
154 {
155  if (QWindow *w = windowHandle()) {
156  w->raise();
157  w->requestActivate();
158  }
159 }
160 
161 void QWidgetAdapter::setWindowOpacity(qreal level)
162 {
163  if (QWindow *w = windowHandle())
164  w->setOpacity(level);
165 }
166 
167 bool QWidgetAdapter::onResize(QSize)
168 {
169  return false;
170 }
171 void QWidgetAdapter::onLayoutRequest()
172 {
173 }
174 void QWidgetAdapter::onMousePress()
175 {
176 }
177 void QWidgetAdapter::onMouseMove(QPoint)
178 {
179 }
180 void QWidgetAdapter::onMouseRelease()
181 {
182 }
183 void QWidgetAdapter::onCloseEvent(QCloseEvent *)
184 {
185 }
186 void QWidgetAdapter::onResizeEvent(QResizeEvent *)
187 {
188  updateNormalGeometry();
189 }
190 void QWidgetAdapter::onMoveEvent(QMoveEvent *)
191 {
192  updateNormalGeometry();
193 }
194 
195 void QWidgetAdapter::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
196 {
197  QQuickItem::itemChange(change, data);
198 
199  // Emulate the QWidget behaviour as QQuickItem doesn't receive some QEvents.
200  switch (change) {
201  case QQuickItem::ItemParentHasChanged: {
203  qApp->sendEvent(this, &ev); // Not calling event() directly, otherwise it would skip event filters
204  Q_EMIT parentChanged(this);
205  break;
206  }
207  case QQuickItem::ItemVisibleHasChanged: {
208  if (m_inSetParent) {
209  // Setting parent to nullptr will emit visible true in QtQuick
210  // which we don't want, as we're going to hide it (as we do with QtWidgets)
211  break;
212  }
213 
214  QEvent ev(isVisible() ? QEvent::Show : QEvent::Hide);
215  event(&ev);
216  break;
217  }
218  default:
219  break;
220  }
221 }
222 
223 void QWidgetAdapter::updateNormalGeometry()
224 {
225  QWindow *window = windowHandle();
226  if (!window) {
227  return;
228  }
229 
230  QRect normalGeometry;
231  if (const QPlatformWindow *pw = window->handle()) {
232  normalGeometry = pw->normalGeometry();
233  }
234 
235  if (!normalGeometry.isValid() && isNormalWindowState(window->windowState())) {
236  normalGeometry = window->geometry();
237  }
238 
239  if (normalGeometry.isValid()) {
240  setNormalGeometry(normalGeometry);
241  }
242 }
243 
244 void QWidgetAdapter::QQUICKITEMgeometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
245 {
246  // Send a few events manually, since QQuickItem doesn't do it for us.
247  QQuickItem::QQUICKITEMgeometryChanged(newGeometry, oldGeometry);
248 
249  // Not calling event() directly, otherwise it would skip event filters
250 
251  if (newGeometry.size() != oldGeometry.size()) {
253  qApp->sendEvent(this, &ev);
254  }
255 
256  if (newGeometry.topLeft() != oldGeometry.topLeft()) {
257  QEvent ev(QEvent::Move);
258  qApp->sendEvent(this, &ev);
259  }
260 
261  Q_EMIT itemGeometryChanged();
262 }
263 
264 void QWidgetAdapter::raise()
265 {
266  if (isTopLevel()) {
267  if (QWindow *w = windowHandle())
268  w->raise();
269  } else if (auto p = QQuickItem::parentItem()) {
270  // It's not a top-level, so just increase its Z-order
271  const auto siblings = p->childItems();
272  QQuickItem *last = siblings.last();
273  if (last != this)
274  stackAfter(last);
275  }
276 }
277 
278 QSize QWidgetAdapter::minimumSize() const
279 {
280  if (m_isWrapper) {
281  const auto children = childItems();
282  if (!children.isEmpty()) {
283  const QSize min = children.constFirst()->property("kddockwidgets_min_size").toSize();
284  return min.expandedTo(Layouting::Item::hardcodedMinimumSize);
285  }
286  }
287 
288  const QSize min = property("kddockwidgets_min_size").toSize();
289  return min.expandedTo(Layouting::Item::hardcodedMinimumSize);
290 }
291 
292 QSize QWidgetAdapter::maximumSize() const
293 {
294  if (m_isWrapper) {
295  const auto children = childItems();
296  if (!children.isEmpty()) {
297  const QSize max = children.constFirst()->property("kddockwidgets_max_size").toSize();
298  return max.isEmpty() ? Layouting::Item::hardcodedMaximumSize
299  : max.boundedTo(Layouting::Item::hardcodedMaximumSize);
300  }
301  }
302 
303  const QSize max = property("kddockwidgets_max_size").toSize();
304  return max.isEmpty() ? Layouting::Item::hardcodedMaximumSize
305  : max.boundedTo(Layouting::Item::hardcodedMaximumSize);
306 }
307 
308 WId QWidgetAdapter::winId() const
309 {
310  if (QWindow *w = windowHandle())
311  return w->winId();
312 
313  return WId(-1);
314 }
315 
316 FloatingWindow *QWidgetAdapter::floatingWindow() const
317 {
318  if (auto fw = qobject_cast<FloatingWindow *>(window()))
319  return fw;
320 
321  return nullptr;
322 }
323 
324 QRect QWidgetAdapter::geometry() const
325 {
326  if (isTopLevel()) {
327  if (QWindow *w = windowHandle()) {
328  return w->geometry();
329  }
330  }
331 
332  return KDDockWidgets::Private::geometry(this);
333 }
334 
335 QRect QWidgetAdapter::normalGeometry() const
336 {
337  return m_normalGeometry;
338 }
339 
340 void QWidgetAdapter::setNormalGeometry(QRect geo)
341 {
342  m_normalGeometry = geo;
343 }
344 
345 QRect QWidgetAdapter::rect() const
346 {
347  return QRectF(0, 0, width(), height()).toRect();
348 }
349 
350 QPoint QWidgetAdapter::pos() const
351 {
352  return geometry().topLeft();
353 }
354 
355 void QWidgetAdapter::show()
356 {
357  setVisible(true);
358 }
359 
360 void QWidgetAdapter::setFixedHeight(int height)
361 {
362  setHeight(height);
363 }
364 
365 void QWidgetAdapter::setFixedWidth(int width)
366 {
367  setWidth(width);
368 }
369 
370 void QWidgetAdapter::setGeometry(QRect rect)
371 {
372  setWidth(rect.width());
373  setHeight(rect.height());
374  move(rect.topLeft());
375 }
376 
377 QRect QWidgetAdapter::frameGeometry() const
378 {
379  if (QWindow *w = windowHandle())
380  return w->frameGeometry();
381 
382  return geometry();
383 }
384 
385 void QWidgetAdapter::grabMouse()
386 {
387  QQuickItem::grabMouse();
388 }
389 
390 void QWidgetAdapter::releaseMouse()
391 {
392  QQuickItem::ungrabMouse();
393 }
394 
395 void QWidgetAdapter::releaseKeyboard()
396 {
397  // Not needed apparently
398 }
399 
400 void QWidgetAdapter::setMinimumSize(QSize sz)
401 {
402  if (minimumSize() != sz) {
403  setProperty("kddockwidgets_min_size", sz);
404  updateGeometry();
405  }
406 }
407 
408 void QWidgetAdapter::setMaximumSize(QSize sz)
409 {
410  if (maximumSize() != sz) {
411  setProperty("kddockwidgets_max_size", sz);
412  updateGeometry();
413  }
414 }
415 
416 void QWidgetAdapter::setMaximumSize(int w, int h)
417 {
418  QWidgetAdapter::setMaximumSize(QSize(w, h));
419 }
420 
421 void QWidgetAdapter::setMinimumSize(int w, int h)
422 {
423  QWidgetAdapter::setMinimumSize(QSize(w, h));
424 }
425 
426 void QWidgetAdapter::updateGeometry()
427 {
428  Q_EMIT geometryUpdated();
429 }
430 
431 void QWidgetAdapter::resize(QSize sz)
432 {
433  setWidth(sz.width());
434  setHeight(sz.height());
435 }
436 
437 void QWidgetAdapter::resize(int w, int h)
438 {
439  resize({ w, h });
440 }
441 
442 bool QWidgetAdapter::isWindow() const
443 {
444  QQuickItem *parent = parentItem();
445  if (!parent)
446  return true;
447 
448  if (QQuickView *w = quickView()) {
449  if (parent == w->contentItem() || parent == w->rootObject())
450  return true;
451  }
452 
453  return false;
454 }
455 
456 bool QWidgetAdapter::isMaximized() const
457 {
458  if (QWindow *w = windowHandle())
459  return w->windowStates() & Qt::WindowMaximized;
460 
461  return false;
462 }
463 
464 bool QWidgetAdapter::isFullScreen() const
465 {
466  if (QWindow *w = windowHandle())
467  return w->windowStates() & Qt::WindowFullScreen;
468 
469  return false;
470 }
471 
472 bool QWidgetAdapter::isMinimized() const
473 {
474  if (QWindow *w = windowHandle())
475  return w->windowStates() & Qt::WindowMinimized;
476 
477  return false;
478 }
479 
480 bool KDDockWidgets::QWidgetAdapter::isActiveWindow() const
481 {
482  if (QWindow *w = windowHandle())
483  return w->isActive();
484 
485  return false;
486 }
487 
488 void QWidgetAdapter::showMaximized()
489 {
490  if (QWindow *w = windowHandle())
491  w->showMaximized();
492 }
493 
494 void QWidgetAdapter::showMinimized()
495 {
496  if (QWindow *w = windowHandle())
497  w->showMinimized();
498 }
499 
500 void QWidgetAdapter::showNormal()
501 {
502  if (QWindow *w = windowHandle())
503  w->showNormal();
504 }
505 
506 QQuickView *QWidgetAdapter::quickView() const
507 {
508  return qobject_cast<QQuickView *>(QQuickItem::window());
509 }
510 
511 QWindow *QWidgetAdapter::windowHandle() const
512 {
513  return QQuickItem::window();
514 }
515 
516 QWidgetAdapter *QWidgetAdapter::window() const
517 {
518  // We return the top-most QWidgetAdapter
519 
520  if (QWidgetAdapter *w = parentWidget(/*includeTransient =*/false))
521  return w->window();
522 
523  return const_cast<QWidgetAdapter *>(this);
524 }
525 
526 QWidgetAdapter *QWidgetAdapter::parentWidget(bool includeTransient) const
527 {
528  QQuickItem *p = parentItem();
529  while (p) {
530  if (auto qa = qobject_cast<QWidgetAdapter *>(p))
531  return qa;
532 
533  p = p->parentItem();
534  }
535 
536  if (includeTransient) {
537  if (QQuickView *w = quickView()) {
538  // Here we're mimicking QWidget::parentWidget(), which can return the transient parent of the QWindow.
539  MainWindowBase *mw = DockRegistry::self()->mainWindowForHandle(w->transientParent());
540  if (mw)
541  return mw;
542  }
543  }
544 
545 
546  return nullptr;
547 }
548 
549 QPoint QWidgetAdapter::mapToGlobal(QPoint pt) const
550 {
551  return QQuickItem::mapToGlobal(pt).toPoint();
552 }
553 
554 QPoint QWidgetAdapter::mapFromGlobal(QPoint pt) const
555 {
556  return QQuickItem::mapFromGlobal(pt).toPoint();
557 }
558 
559 QPoint QWidgetAdapter::mapTo(const QQuickItem *parent, QPoint pos) const
560 {
561  if (!parent)
562  return {};
563 
564  return parent->mapFromGlobal(QQuickItem::mapToGlobal(pos)).toPoint();
565 }
566 
567 bool QWidgetAdapter::testAttribute(Qt::WidgetAttribute attr) const
568 {
569  return m_widgetAttributes & attr;
570 }
571 
572 void QWidgetAdapter::setAttribute(Qt::WidgetAttribute attr, bool enable)
573 {
574  if (enable)
575  m_widgetAttributes |= attr;
576  else
577  m_widgetAttributes &= ~attr;
578 }
579 
580 void QWidgetAdapter::setWindowTitle(const QString &title)
581 {
582  if (QWindow *window = windowHandle())
583  window->setTitle(title);
584 }
585 
586 void QWidgetAdapter::setWindowIcon(const QIcon &icon)
587 {
588  if (QWindow *window = windowHandle())
589  window->setIcon(icon);
590 }
591 
592 bool QWidgetAdapter::close()
593 {
594  QCloseEvent ev;
595  onCloseEvent(&ev);
596 
597  if (ev.isAccepted()) {
598  setVisible(false);
599  return true;
600  }
601 
602  return false;
603 }
604 
605 QQuickItem *QWidgetAdapter::childAt(QPoint p) const
606 {
607  return QQuickItem::childAt(p.x(), p.y());
608 }
609 
610 void QWidgetAdapter::move(QPoint pt)
611 {
612  move(pt.x(), pt.y());
613 }
614 
615 void QWidgetAdapter::move(int x, int y)
616 {
617  if (isTopLevel()) {
618  if (QWindow *w = windowHandle()) {
619  w->setPosition(x, y);
620  return;
621  }
622  }
623 
624  setX(x);
625  setY(y);
626  setAttribute(Qt::WA_Moved);
627 }
628 
629 void QWidgetAdapter::setSize(QSize size)
630 {
631  QQuickItem::setSize(QSizeF(size));
632 }
633 
634 void QWidgetAdapter::setParent(QQuickItem *p)
635 {
636  {
637  QScopedValueRollback<bool> guard(m_inSetParent, true);
638 
639  QQuickItem::setParent(p);
640  QQuickItem::setParentItem(p);
641  }
642 
643  // Mimic QWidget::setParent(), hide widget when setting parent
644  if (!p)
645  setVisible(false);
646 }
647 
648 void QWidgetAdapter::activateWindow()
649 {
650  if (QWindow *w = windowHandle())
651  w->requestActivate();
652 }
653 
654 void QWidgetAdapter::setSizePolicy(QSizePolicy sp)
655 {
656  m_sizePolicy = sp;
657 }
658 
659 QSizePolicy QWidgetAdapter::sizePolicy() const
660 {
661  return m_sizePolicy;
662 }
663 
664 QSize QWidgetAdapter::sizeHint() const
665 {
666  return m_sizeHint;
667 }
668 
669 bool QWidgetAdapter::hasFocus() const
670 {
671  return hasActiveFocus();
672 }
673 
674 void QWidgetAdapter::setWindowFlag(int flag, bool enable)
675 {
676  Q_UNUSED(flag);
677  Q_UNUSED(enable);
678 }
679 
680 Qt::WindowFlags QWidgetAdapter::windowFlags() const
681 {
682  return m_windowFlags;
683 }
684 
686 QQuickItem *QWidgetAdapter::createItem(QQmlEngine *engine, const QString &filename)
687 {
688  QQmlComponent component(engine, filename);
689  QObject *obj = component.create();
690  if (!obj) {
691  qWarning() << Q_FUNC_INFO << component.errorString();
692  return nullptr;
693  }
694 
695  return qobject_cast<QQuickItem *>(obj);
696 }
697 
698 void QWidgetAdapter::makeItemFillParent(QQuickItem *item)
699 {
700  // This is equivalent to "anchors.fill: parent
701 
702  if (!item) {
703  qWarning() << Q_FUNC_INFO << "Invalid item";
704  return;
705  }
706 
707  QQuickItem *parentItem = item->parentItem();
708  if (!parentItem) {
709  qWarning() << Q_FUNC_INFO << "Invalid parentItem for" << item;
710  return;
711  }
712 
713  QObject *anchors = item->property("anchors").value<QObject *>();
714  if (!anchors) {
715  qWarning() << Q_FUNC_INFO << "Invalid anchors for" << item;
716  return;
717  }
718 
719  anchors->setProperty("fill", QVariant::fromValue(parentItem));
720 }
721 
722 void QWidgetAdapter::setFlag(Qt::WindowType f, bool on)
723 {
724  if (on) {
725  m_windowFlags |= f;
726  } else {
727  m_windowFlags &= ~f;
728  }
729 }
730 
731 Qt::FocusPolicy QWidgetAdapter::focusPolicy() const
732 {
733  return m_focusPolicy;
734 }
735 
736 void QWidgetAdapter::setFocusPolicy(Qt::FocusPolicy policy)
737 {
738  m_focusPolicy = policy;
739 }
740 
741 void QWidgetAdapter::setFocus(Qt::FocusReason reason)
742 {
743  QQuickItem::setFocus(true, reason);
744  forceActiveFocus(reason);
745 }
746 
747 void QWidgetAdapter::render(QPainter *)
748 {
749  qWarning() << Q_FUNC_INFO << "Implement me";
750 }
751 
752 void QWidgetAdapter::setMouseTracking(bool enabled)
753 {
754  m_mouseTrackingEnabled = enabled;
755 }
756 
757 bool QWidgetAdapter::event(QEvent *ev)
758 {
759  if (ev->type() == QEvent::Close)
760  onCloseEvent(static_cast<QCloseEvent *>(ev));
761 
762  return QQuickItem::event(ev);
763 }
764 
765 bool QWidgetAdapter::eventFilter(QObject *watched, QEvent *ev)
766 {
767  if (qobject_cast<QWindow *>(watched)) {
768  if (m_mouseTrackingEnabled) {
769  switch (ev->type()) {
770  case QEvent::MouseMove:
773  ev->ignore();
774  qApp->sendEvent(this, ev);
775  // qDebug() << "Mouse event" << ev;
776  if (ev->isAccepted())
777  return true;
778  break;
779  default:
780  break;
781  }
782  }
783 
784  if (ev->type() == QEvent::Resize) {
785  onResizeEvent(static_cast<QResizeEvent *>(ev));
786  } else if (ev->type() == QEvent::Move) {
787  onMoveEvent(static_cast<QMoveEvent *>(ev));
788  }
789  }
790 
791  return QQuickItem::eventFilter(watched, ev);
792 }
793 
794 QScreen *QWidgetAdapter::screen() const
795 {
796  if (QQuickView *w = quickView()) {
797  return w->screen();
798  }
799 
800  return nullptr;
801 }
802 
803 void QWidgetAdapter::setWindowIsBeingDestroyed(bool is)
804 {
805  m_windowIsBeingDestroyed = is;
806 }
807 
808 void QWidgetAdapter::create()
809 {
810  // Nothing to do, for QtQuick ?
811 }
812 
813 QQuickItem *KDDockWidgets::Private::widgetForWindow(QWindow *window)
814 {
815  if (!window)
816  return nullptr;
817 
818  return window->property("kddockwidgets_qwidget").value<QQuickItem *>();
819 }
820 
821 void QWidgetAdapter::redirectMouseEvents(QObject *source)
822 {
823  if (auto existingRedirector = MouseEventRedirector::redirectorForSource(source)) {
824  if (existingRedirector->m_eventTarget == this) {
825  // Nothing to do. The specified event source is already redirecting to this instance
826  return;
827  }
828  }
829 
830  new MouseEventRedirector(source, this);
831 }
832 
833 void QWidgetAdapter::setIsWrapper()
834 {
835  m_isWrapper = true;
836 }
837 
838 bool QWidgetAdapter::isWrapper() const
839 {
840  return m_isWrapper;
841 }
842 
843 LayoutGuestWidget::~LayoutGuestWidget() = default;
844 
845 #include "QWidgetAdapter_quick.moc"
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::removeEventFilter
void removeEventFilter(QObject *obj)
QVariant::isValid
bool isValid() const const
QEvent::ParentChange
ParentChange
QRect::topLeft
QPoint topLeft() const const
QVariant::fromValue
QVariant fromValue(const T &value)
QRect
QWindow::geometry
QRect geometry() const const
QRectF::toRect
QRect toRect() const const
QVariant::value
T value() const const
QSize::isEmpty
bool isEmpty() const const
actualParentItem
static QQuickItem * actualParentItem(QQuickItem *candidateParentItem, Qt::WindowFlags flags)
Definition: QWidgetAdapter_quick.cpp:115
QWindow
QRect::width
int width() const const
QSize
QPoint::x
int x() const const
QPoint::y
int y() const const
QSize::width
int width() const const
QPainter
KDDockWidgets::CursorPosition_Undefined
@ CursorPosition_Undefined
Definition: KDDockWidgets.h:255
QMouseEvent
QScreen
MainWindowBase.h
The MainWindow base-class that's shared between QtWidgets and QtQuick stack.
QWidgetAdapter.h
Abstraction for supporting both QtWidgets and QtQuick.
Qt::WindowFlags
typedef WindowFlags
QSizePolicy
QCloseEvent
QObject
Qt::FocusReason
FocusReason
QSize::height
int height() const const
QRectF::topLeft
QPointF topLeft() const const
QString
QWindow::setTitle
void setTitle(const QString &)
QEvent::isAccepted
bool isAccepted() const const
QObject::installEventFilter
void installEventFilter(QObject *filterObj)
QRect::isValid
bool isValid() const const
QSize::boundedTo
QSize boundedTo(const QSize &otherSize) const const
Qt::WindowMaximized
WindowMaximized
QIcon
QVariant::toBool
bool toBool() const const
QMoveEvent
QObject::setProperty
bool setProperty(const char *name, const QVariant &value)
QSize::expandedTo
QSize expandedTo(const QSize &otherSize) const const
QRect::height
int height() const const
QHash::remove
int remove(const Key &key)
QEvent::type
QEvent::Type type() const const
QEvent
QResizeEvent
QObject::setParent
void setParent(QObject *parent)
QSizeF
QEvent::ignore
void ignore()
QRectF
KDDockWidgets
Definition: Config.cpp:37
QScopedValueRollback
QRectF::size
QSizeF size() const const
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
QWindow::windowState
Qt::WindowState windowState() const const
flagsAreTopLevelFlags
static bool flagsAreTopLevelFlags(Qt::WindowFlags flags)
Definition: QWidgetAdapter_quick.cpp:110
QVariant
Qt::FocusPolicy
FocusPolicy
QHash< QObject *, MouseEventRedirector * >
Qt::WidgetAttribute
WidgetAttribute
QWindow::setIcon
void setIcon(const QIcon &icon)
QPoint
QObject::property
QVariant property(const char *name) const const

© 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 Thu Sep 15 2022 00:16:29 for KDDockWidgets API Documentation by doxygen 1.8.20