summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmtheme.cpp
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2019-05-06 13:37:56 +1000
committerAapo Keskimolo <aapo.keskimolo@qt.io>2019-05-07 07:21:58 +0000
commit050e7bafad3b723fe5be6e981a32e708dbdc5150 (patch)
tree1001ba5fb1b7fdb39ac5fad5f50a6aa393ecffe1 /src/plugins/platforms/wasm/qwasmtheme.cpp
parent8ea0a82a6a771dd76df2d51c6ef3ed966a5b9b45 (diff)
wasm: add fixedPitch font
Also define our default font so as to return something we actually have Task-number: QTBUG-75587 Change-Id: I26e3c62921d369c3017af9796c0a20f7ac06d07c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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