From 6f03740a19cbba1b050466e4be27410c1f64bab4 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 25 Feb 2016 16:22:32 +0300 Subject: QPlatformWindow: add startSystemMove() It can be used by custom widgets or for example by the Breeze style from KDE, which allows to drag windows by some widgets. It's important on X11 because _NET_WM_MOVERESIZE requests induced by touch sequences require support from Qt. Task-number: QTBUG-58044 Change-Id: I31c37534555a9050cf361cad85bdef13c2808572 Reviewed-by: Johan Helsing Reviewed-by: Shawn Rutledge --- src/gui/kernel/qplatformwindow.cpp | 19 +++++++++++++++++++ src/gui/kernel/qplatformwindow.h | 1 + 2 files changed, 20 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 4bf96e277f..a66420c364 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -474,6 +474,25 @@ bool QPlatformWindow::startSystemResize(const QPoint &pos, Qt::Corner corner) return false; } +/*! + Reimplement this method to start a system move operation if + the system supports it and return true to indicate success. + + The \a pos is a position of MouseButtonPress event or TouchBegin + event from a sequence of mouse events that triggered the movement. + It must be specified in window coordinates. + + The default implementation is empty and does nothing with \a pos. + + \since 5.11 +*/ + +bool QPlatformWindow::startSystemMove(const QPoint &pos) +{ + Q_UNUSED(pos) + return false; +} + /*! Reimplement this method to set whether frame strut events should be sent to \a enabled. diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 61f1cb624c..84dff681d5 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -129,6 +129,7 @@ public: virtual void windowEvent(QEvent *event); virtual bool startSystemResize(const QPoint &pos, Qt::Corner corner); + virtual bool startSystemMove(const QPoint &pos); virtual void setFrameStrutEventsEnabled(bool enabled); virtual bool frameStrutEventsEnabled() const; -- cgit v1.2.3