summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@digia.com>2014-05-02 11:04:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-09 11:03:30 +0200
commit5c287474541c865cc9e3e7caa1a6b819041d8279 (patch)
tree52542f292a6988574b6770b557465d1b9796c6d1 /src/gui/kernel/qguiapplication.cpp
parent112b8e49c291a2ee6a1d67dccf368e53c9bd19cd (diff)
Use QtPlatformHeaders to set platform specific functionality
This involves exposing a new function in the QPlatformNativeInterface which gets a public function for QGuiApplication Proof of concept is done through implementing _NET_WM_WINDOW_TYPE setters for xcb Change-Id: Ic9544e775fb71cc9b30273595ec41b1cdb1c9d64 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 827bf0164b..2d5f717222 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1413,6 +1413,20 @@ QPlatformNativeInterface *QGuiApplication::platformNativeInterface()
}
/*!
+ Returns a function pointer from the platformplugin matching \a function
+*/
+QFunctionPointer QGuiApplication::platformFunction(const QByteArray &function)
+{
+ QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration();
+ if (!pi) {
+ qWarning() << "QGuiApplication::platformFunction(): Must construct a QGuiApplication before accessing a platform function";
+ return Q_NULLPTR;
+ }
+
+ return pi->nativeInterface() ? pi->nativeInterface()->platformFunction(function) : Q_NULLPTR;
+}
+
+/*!
Enters the main event loop and waits until exit() is called, and then
returns the value that was set to exit() (which is 0 if exit() is called
via quit()).