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>
This commit is contained in:
parent
89f9f7cbdf
commit
b30ea41945
@ -49,6 +49,7 @@
|
|||||||
#include <QtCore/QLoggingCategory>
|
#include <QtCore/QLoggingCategory>
|
||||||
#include <qpa/qwindowsysteminterface.h>
|
#include <qpa/qwindowsysteminterface.h>
|
||||||
#include <qpa/qplatforminputcontextfactory_p.h>
|
#include <qpa/qplatforminputcontextfactory_p.h>
|
||||||
|
#include <private/qgenericunixthemes_p.h>
|
||||||
|
|
||||||
#include "qeglfsintegration.h"
|
#include "qeglfsintegration.h"
|
||||||
#include "qeglfswindow.h"
|
#include "qeglfswindow.h"
|
||||||
@ -173,6 +174,11 @@ QPlatformFontDatabase *QEglFSIntegration::fontDatabase() const
|
|||||||
return m_fontDb.data();
|
return m_fontDb.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPlatformTheme *QEglFSIntegration::createPlatformTheme(const QString &name) const
|
||||||
|
{
|
||||||
|
return QGenericUnixTheme::createUnixTheme(name);
|
||||||
|
}
|
||||||
|
|
||||||
QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const
|
QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *window) const
|
||||||
{
|
{
|
||||||
QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
|
QOpenGLCompositorBackingStore *bs = new QOpenGLCompositorBackingStore(window);
|
||||||
|
@ -68,6 +68,7 @@ public:
|
|||||||
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
|
QPlatformFontDatabase *fontDatabase() const Q_DECL_OVERRIDE;
|
||||||
QPlatformServices *services() const Q_DECL_OVERRIDE;
|
QPlatformServices *services() const Q_DECL_OVERRIDE;
|
||||||
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
|
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;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const Q_DECL_OVERRIDE;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const Q_DECL_OVERRIDE;
|
||||||
|
Loading…
Reference in New Issue
Block a user