summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmtheme.cpp
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-06 15:35:06 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-06 19:00:41 +0200
commit2a302a73613d68475e667f69b8e36ce07853c813 (patch)
tree06de55baaed993b51af517dba8f230fab749882c /src/plugins/platforms/wasm/qwasmtheme.cpp
parent5505d25be972948db1621e1511b89b4144aa8bfc (diff)
parentdea7110b29c5c68a5b09454c968324042ed1b607 (diff)
Merge remote-tracking branch 'origin/dev' into wip/qt6
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmtheme.cpp')
-rw-r--r--src/plugins/platforms/wasm/qwasmtheme.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmtheme.cpp b/src/plugins/platforms/wasm/qwasmtheme.cpp
index a7f2db3bd3..978d60d686 100644
--- a/src/plugins/platforms/wasm/qwasmtheme.cpp
+++ b/src/plugins/platforms/wasm/qwasmtheme.cpp
@@ -29,15 +29,22 @@
#include "qwasmtheme.h"
#include <QtCore/qvariant.h>
+#include <QFontDatabase>
QT_BEGIN_NAMESPACE
QWasmTheme::QWasmTheme()
{
+ QFontDatabase fdb;
+ for (auto family : fdb.families())
+ if (fdb.isFixedPitch(family))
+ fixedFont = new QFont(family);
}
QWasmTheme::~QWasmTheme()
{
+ if (fixedFont)
+ delete fixedFont;
}
QVariant QWasmTheme::themeHint(ThemeHint hint) const
@@ -47,4 +54,12 @@ QVariant QWasmTheme::themeHint(ThemeHint hint) const
return QPlatformTheme::themeHint(hint);
}
+const QFont *QWasmTheme::font(Font type) const
+{
+ if (type == QPlatformTheme::FixedFont) {
+ return fixedFont;
+ }
+ return nullptr;
+}
+
QT_END_NAMESPACE