diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.cpp | 24 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.h | 2 |
6 files changed, 42 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 093151707c..1ba6d67742 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -571,6 +571,11 @@ bool QGuiApplication::compressEvent(QEvent *event, QObject *receiver, QPostEvent return QCoreApplication::compressEvent(event, receiver, postedEvents); } +bool QGuiApplicationPrivate::processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) +{ + return window->nativeEvent(eventType, message, result); +} + void QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent *e) { switch(e->type) { diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index ed21eecca3..baa74df009 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -135,6 +135,8 @@ public: static Qt::DropAction processDrag(QWindow *w, QMimeData *dropData, const QPoint &p); static Qt::DropAction processDrop(QWindow *w, QMimeData *dropData, const QPoint &p); + static bool processNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result); + static inline Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment) { if (!(alignment & Qt::AlignHorizontal_Mask)) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index d6194b5607..e85d8379fa 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1035,6 +1035,14 @@ void QWindow::touchEvent(QTouchEvent *ev) ev->ignore(); } +bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) +{ + Q_UNUSED(eventType); + Q_UNUSED(message); + Q_UNUSED(result); + return false; +} + /*! \fn QPoint QWindow::mapToGlobal(const QPoint &pos) const diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 0342f9b669..4e6a8591d8 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -288,6 +288,7 @@ protected: virtual void wheelEvent(QWheelEvent *); #endif virtual void touchEvent(QTouchEvent *); + virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result); QWindow(QWindowPrivate &dd, QWindow *parent); diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index 999e1a67d1..ae94b75076 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -60,6 +60,17 @@ QMutex QWindowSystemInterfacePrivate::queueMutex; extern QPointer<QWindow> qt_last_mouse_receiver; +/*! + \class QWindowSystemInterface + \since 5.0 + \internal + \preliminary + \ingroup qpa + \brief The QWindowSystemInterface provides an event queue for the QPA platform. + + The platform plugins call the various functions to notify about events. The events are queued + until sendWindowSystemEvents() is called by the event dispatcher. +*/ void QWindowSystemInterface::handleEnterEvent(QWindow *tlw) { @@ -379,4 +390,17 @@ Qt::DropAction QWindowSystemInterface::handleDrop(QWindow *w, QMimeData *dropDat return QGuiApplicationPrivate::processDrop(w, dropData, p); } +/*! + \fn static QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) + \brief Passes a native event identified by \a eventType to the \a window. + + \note This function can only be called from the GUI thread. + \sa QPlatformNativeInterface::setEventFilter() +*/ + +bool QWindowSystemInterface::handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result) +{ + return QGuiApplicationPrivate::processNativeEvent(window, eventType, message, result); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.h b/src/gui/kernel/qwindowsysteminterface_qpa.h index 66d55c9884..b99363eda7 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.h +++ b/src/gui/kernel/qwindowsysteminterface_qpa.h @@ -120,6 +120,8 @@ public: static Qt::DropAction handleDrag(QWindow *w, QMimeData *dropData, const QPoint &p); static Qt::DropAction handleDrop(QWindow *w, QMimeData *dropData, const QPoint &p); + static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, long *result); + // Changes to the screen static void handleScreenOrientationChange(QScreen *screen, Qt::ScreenOrientation newOrientation); static void handleScreenGeometryChange(QScreen *screen, const QRect &newGeometry); |