summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-01 15:22:04 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-06-07 12:17:46 +0000
commitcafdb8d3ee1195b8ace5556e52bb992d95d788ab (patch)
tree55175dcb87e3cee9f6243126d4ff41c323977bd0 /src/gui/kernel/qwindow.cpp
parent19a154f57b9141e5cbe7dba3919a2acdfa91525a (diff)
Expose the native interfaces of QScreen/QWindow
Add the macros. Task-number: QTBUG-84220 Change-Id: Ica23b9e4d5c1ca072acb5356e6f2be28d5199fa6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index bacc49a98e..61c201559a 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -69,6 +69,7 @@
#include <QStyleHints>
#include <qpa/qplatformcursor.h>
+#include <qpa/qplatformwindow_p.h>
QT_BEGIN_NAMESPACE
@@ -3003,6 +3004,31 @@ bool QWindowPrivate::applyCursor()
}
#endif // QT_NO_CURSOR
+template <>
+Q_NATIVE_INTERFACE_EXPORT void *QNativeInterface::Private::resolveInterface(const QWindow *that, const char *name, int revision)
+{
+ using namespace QNativeInterface::Private;
+
+ auto *platformWindow = that->handle();
+ Q_UNUSED(platformWindow);
+ Q_UNUSED(name);
+ Q_UNUSED(revision);
+
+#if defined(Q_OS_WIN)
+ QT_NATIVE_INTERFACE_RETURN_IF(QWindowsWindow, platformWindow);
+#endif
+
+#if QT_CONFIG(xcb)
+ QT_NATIVE_INTERFACE_RETURN_IF(QXcbWindow, platformWindow);
+#endif
+
+#if defined(Q_OS_MACOS)
+ QT_NATIVE_INTERFACE_RETURN_IF(QCocoaWindow, platformWindow);
+#endif
+
+ return nullptr;
+}
+
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug debug, const QWindow *window)
{