summaryrefslogtreecommitdiffstats
path: root/src/sdk/installerbase.cpp
diff options
context:
space:
mode:
authorFrerich Raabe <raabe@froglogic.com>2016-06-18 01:19:05 +0200
committerIikka Eklund <iikka.eklund@qt.io>2016-11-08 10:22:11 +0000
commit6e5ef08718b7b638b57dda4ef4a7bdbfe8046743 (patch)
tree3ed467fdc10ad74d339a54dda3685aa4e1c139e3 /src/sdk/installerbase.cpp
parent9269a8262f8d7ed433c1b3b5d63ebc0608abae9f (diff)
Automatically load all fonts in 'fonts/' resources
...such that they can be used in style sheets. Change-Id: I677be428972dbfe9385cf438b0ccf2f0f3fcd822 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'src/sdk/installerbase.cpp')
-rw-r--r--src/sdk/installerbase.cpp11
1 files changed, 11 insertions, 0 deletions
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 <QDir>
#include <QDirIterator>
+#include <QFontDatabase>
#include <QTemporaryFile>
#include <QTranslator>
#include <QUuid>
@@ -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);