summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2016-01-06 09:44:11 +0100
committerShawn Rutledge <shawn.rutledge@theqtcompany.com>2016-01-18 08:32:59 +0000
commitb30ea419450c968c009ddcae964b1b54755f11ac (patch)
tree59b786af8f480b4776e1127c75db328b57ba78f9
parent89f9f7cbdfd085c3536304ae52b8935096db7217 (diff)
eglfs: use QGenericUnixTheme if requested
We need to have reasonable paths for loading icons and such things, just as in any other Unix GUI environment. However there is some concern that it would be too much of a behavior change if there was a theme by default, so for now it's required to set the env var: QT_QPA_PLATFORMTHEME=generic That works because QGuiApplicationPrivate::createPlatformIntegration() reads the env variable and passes platformThemeName to init_platform(). Step 3 in init_platform() does not find a theme plugin by that name (because QGenericUnixTheme is statically linked via libQt5PlatformSupport.a). Then in step 4 it iterates the given platformThemeName plus any which were returned from QPlatformIntegration::themeNames() (which in our case will be an empty list) and calls createPlatformTheme() with each of those, until something is returned. So, QEglFSIntegration::createPlatformTheme() will be called with the value of the QT_QPA_PLATFORMTHEME env var, and QGenericUnixTheme::createUnixTheme() will create the generic, KDE or Gnome theme depending on that value. Change-Id: Id16b881819ba872830b019ab147b32fbc2156520 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp6
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 7e50b54ec6..3d3381323c 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -49,6 +49,7 @@
#include <QtCore/QLoggingCategory>
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatforminputcontextfactory_p.h>
+#include <private/qgenericunixthemes_p.h>
#include "qeglfsintegration.h"
#include "qeglfswindow.h"
@@ -173,6 +174,11 @@ QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const
return m_fontDb.data();
}
+QPlatformTheme *QEglFSIntegration::createPlatformTheme(const QString &name) const
+{
+ return QGenericUnixTheme::createUnixTheme(name);
+}
+
QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const
{
QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h
index 73617f7eb9..e06d7e8876 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.h
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.h
@@ -68,6 +68,7 @@ public:
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
QPlatformServices *services() const Q_DECL_OVERRIDE;
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
+ QPlatformTheme *createPlatformTheme(const QString &name) const Q_DECL_OVERRIDE;
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;