diff options
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmtheme.cpp')
-rw-r--r-- | src/plugins/platforms/wasm/qwasmtheme.cpp | 15 |
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 |