summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/minimal
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/minimal')
-rw-r--r--src/plugins/platforms/minimal/minimal.pro2
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.cpp25
-rw-r--r--src/plugins/platforms/minimal/qminimalintegration.h2
3 files changed, 22 insertions, 7 deletions
diff --git a/src/plugins/platforms/minimal/minimal.pro b/src/plugins/platforms/minimal/minimal.pro
index d6914026ae..0d31d6605b 100644
--- a/src/plugins/platforms/minimal/minimal.pro
+++ b/src/plugins/platforms/minimal/minimal.pro
@@ -10,6 +10,8 @@ HEADERS = qminimalintegration.h \
OTHER_FILES += minimal.json
+CONFIG += qpa/genericunixfontdatabase
+
PLUGIN_TYPE = platforms
PLUGIN_CLASS_NAME = QMinimalIntegrationPlugin
!equals(TARGET, $$QT_DEFAULT_QPA_PLUGIN): PLUGIN_EXTENDS = -
diff --git a/src/plugins/platforms/minimal/qminimalintegration.cpp b/src/plugins/platforms/minimal/qminimalintegration.cpp
index 45301f4caf..ac819b9282 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.cpp
+++ b/src/plugins/platforms/minimal/qminimalintegration.cpp
@@ -37,7 +37,14 @@
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformwindow.h>
+
+#if defined(Q_OS_WIN)
+#include <QtPlatformSupport/private/qbasicfontdatabase_p.h>
+#elif defined(QT_NO_FONTCONFIG)
#include <qpa/qplatformfontdatabase.h>
+#else
+#include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
+#endif
#if !defined(Q_OS_WIN)
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
@@ -62,7 +69,7 @@ static inline unsigned parseOptions(const QStringList &paramList)
}
QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
- : m_dummyFontDatabase(0)
+ : m_fontDatabase(0)
, m_options(parseOptions(parameters))
{
if (qEnvironmentVariableIsSet(debugBackingStoreEnvironmentVariable)
@@ -81,7 +88,7 @@ QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
QMinimalIntegration::~QMinimalIntegration()
{
- delete m_dummyFontDatabase;
+ delete m_fontDatabase;
}
bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) const
@@ -104,11 +111,17 @@ public:
QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const
{
- if (m_options & EnableFonts)
+ if (m_options & EnableFonts) {
+#ifndef QT_NO_FONTCONFIG
+ if (!m_fontDatabase)
+ m_fontDatabase = new QGenericUnixFontDatabase;
+#else
return QPlatformIntegration::fontDatabase();
- if (!m_dummyFontDatabase)
- m_dummyFontDatabase = new DummyFontDatabase;
- return m_dummyFontDatabase;
+#endif
+ }
+ if (!m_fontDatabase)
+ m_fontDatabase = new DummyFontDatabase;
+ return m_fontDatabase;
}
QPlatformWindow *QMinimalIntegration::createPlatformWindow(QWindow *window) const
diff --git a/src/plugins/platforms/minimal/qminimalintegration.h b/src/plugins/platforms/minimal/qminimalintegration.h
index eb7d81dc6d..672fecfae0 100644
--- a/src/plugins/platforms/minimal/qminimalintegration.h
+++ b/src/plugins/platforms/minimal/qminimalintegration.h
@@ -79,7 +79,7 @@ public:
static QMinimalIntegration *instance();
private:
- mutable QPlatformFontDatabase *m_dummyFontDatabase;
+ mutable QPlatformFontDatabase *m_fontDatabase;
unsigned m_options;
};