qtquick|MDI: Improvements for resizing
This commit is contained in:
@@ -119,6 +119,7 @@ bool WidgetResizeHandler::eventFilter(QObject *o, QEvent *e)
|
||||
case QEvent::MouseButtonPress: {
|
||||
if (mTarget->isMaximized())
|
||||
break;
|
||||
|
||||
auto mouseEvent = static_cast<QMouseEvent *>(e);
|
||||
auto cursorPos = cursorPosition(Qt5Qt6Compat::eventGlobalPos(mouseEvent));
|
||||
updateCursor(cursorPos);
|
||||
@@ -503,6 +504,14 @@ CursorPosition WidgetResizeHandler::cursorPosition(QPoint globalPos) const
|
||||
if (!mTarget)
|
||||
return CursorPosition_Undefined;
|
||||
|
||||
#ifdef KDDOCKWIDGETS_QTQUICK
|
||||
if (isMDI()) {
|
||||
// Special case for QtQuick. The MouseAreas are driving it and know better what's the
|
||||
// cursor position
|
||||
return CursorPosition(mTarget->property("cursorPosition").toInt());
|
||||
}
|
||||
#endif
|
||||
|
||||
QPoint pos = mTarget->mapFromGlobal(globalPos);
|
||||
|
||||
const int x = pos.x();
|
||||
|
||||
@@ -77,7 +77,9 @@ public:
|
||||
return false;
|
||||
|
||||
// Finally send the event
|
||||
m_eventTarget->setProperty("cursorPosition", m_eventSource->property("cursorPosition"));
|
||||
qApp->sendEvent(m_eventTarget, me);
|
||||
m_eventTarget->setProperty("cursorPosition", CursorPosition_Undefined);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user