From 6e5ef08718b7b638b57dda4ef4a7bdbfe8046743 Mon Sep 17 00:00:00 2001 From: Frerich Raabe Date: Sat, 18 Jun 2016 01:19:05 +0200 Subject: Automatically load all fonts in 'fonts/' resources ...such that they can be used in style sheets. Change-Id: I677be428972dbfe9385cf438b0ccf2f0f3fcd822 Reviewed-by: Karsten Heimrich --- src/sdk/installerbase.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/sdk') diff --git a/src/sdk/installerbase.cpp b/src/sdk/installerbase.cpp index 8a009769d..c99a48aa8 100644 --- a/src/sdk/installerbase.cpp +++ b/src/sdk/installerbase.cpp @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -263,6 +264,16 @@ int InstallerBase::run() } } + { + QDirIterator fontIt(QStringLiteral(":/fonts")); + while (fontIt.hasNext()) { + const QString path = fontIt.next(); + qCDebug(QInstaller::lcResources) << "Registering custom font" << path; + if (QFontDatabase::addApplicationFont(path) == -1) + qWarning() << "Failed to register font!"; + } + } + //create the wizard GUI TabController controller(0); controller.setManager(m_core); -- cgit v1.2.3