22 #include "../FloatingWindow_p.h"
23 #include "../Utils_p.h"
24 #include "Qt5Qt6Compat_p.h"
26 #include <QResizeEvent>
27 #include <QMouseEvent>
30 #include <QtWidgets/private/qwidget_p.h>
39 QWidgetAdapter::~QWidgetAdapter()
43 FloatingWindow *QWidgetAdapter::floatingWindow()
const
45 if (
auto fw = qobject_cast<FloatingWindow *>(window()))
51 void QWidgetAdapter::raiseAndActivate()
55 window()->activateWindow();
58 bool QWidgetAdapter::event(
QEvent *e)
68 if (!onResize(ev->
size()))
77 void QWidgetAdapter::mouseMoveEvent(
QMouseEvent *ev)
79 onMouseMove(Qt5Qt6Compat::eventGlobalPos(ev));
82 void QWidgetAdapter::mouseReleaseEvent(
QMouseEvent *)
97 void QWidgetAdapter::setSize(
QSize size)
99 QRect geo = geometry();
104 bool QWidgetAdapter::onResize(
QSize)
108 void QWidgetAdapter::onLayoutRequest()
112 void QWidgetAdapter::onMousePress()
115 void QWidgetAdapter::onMouseMove(
QPoint)
118 void QWidgetAdapter::onMouseRelease()
134 void QWidgetAdapter::setNormalGeometry(
QRect geo)
136 if (isNormalWindowState(windowState())) {
139 QWidgetPrivate *priv = QWidgetPrivate::get(
this);
140 if (priv->extra && priv->extra->topextra) {
141 priv->topData()->normalGeometry = geo;
143 qWarning() << Q_FUNC_INFO <<
"Failing to set normal geometry";
148 LayoutGuestWidget::~LayoutGuestWidget() =
default;