Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qandroidplatformtheme.h
Go to the documentation of this file.
1// Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QANDROIDPLATFORMTHEME_H
5#define QANDROIDPLATFORMTHEME_H
6
7#include <qpa/qplatformtheme.h>
8#include <QtGui/qfont.h>
9#include <QtGui/qpalette.h>
10#include <QtCore/qhash.h>
11#include <QtCore/qbytearray.h>
12#include <QtCore/qloggingcategory.h>
13#include <QJsonObject>
14
15#include <memory>
16
18
20
22{
23 static QJsonObject loadStyleData();
26 QHash<int, QPalette> m_palettes;
27 QHash<int, QFont> m_fonts;
28 QHash<QByteArray, QFont> m_QWidgetsFonts;
29};
30
33{
34public:
36 void updateColorScheme();
37 void updateStyle();
39 QPlatformMenu *createPlatformMenu() const override;
41 void showPlatformMenuBar() override;
42 Qt::ColorScheme colorScheme() const override;
43 void requestColorScheme(Qt::ColorScheme scheme) override;
44
45 const QPalette *palette(Palette type = SystemPalette) const override;
46 const QFont *font(Font type = SystemFont) const override;
47 QIconEngine *createIconEngine(const QString &iconName) const override;
48 QVariant themeHint(ThemeHint hint) const override;
49 QString standardButtonText(int button) const override;
50 bool usePlatformNativeDialog(DialogType type) const override;
52
54 QAndroidPlatformNativeInterface * androidPlatformNativeInterface = nullptr);
55
56private:
57 QAndroidPlatformTheme(QAndroidPlatformNativeInterface * androidPlatformNativeInterface);
58 static QAndroidPlatformTheme * m_instance;
59 std::shared_ptr<AndroidStyle> m_androidStyleData;
60 QPalette m_defaultPalette;
61 QFont m_systemFont;
62 Qt::ColorScheme m_colorSchemeOverride = Qt::ColorScheme::Unknown;
63};
64
66
67#endif // QANDROIDPLATFORMTHEME_H
Qt::ColorScheme colorScheme() const override
QVariant themeHint(ThemeHint hint) const override
static QAndroidPlatformTheme * instance(QAndroidPlatformNativeInterface *androidPlatformNativeInterface=nullptr)
void requestColorScheme(Qt::ColorScheme scheme) override
QPlatformMenu * createPlatformMenu() const override
QString standardButtonText(int button) const override
Returns the text of a standard button.
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
bool usePlatformNativeDialog(DialogType type) const override
QPlatformMenuItem * createPlatformMenuItem() const override
QPlatformMenuBar * createPlatformMenuBar() const override
QIconEngine * createIconEngine(const QString &iconName) const override
Factory function for the QIconEngine used by QIcon::fromTheme().
\reentrant
Definition qfont.h:22
The QIconEngine class provides an abstract base class for QIcon renderers.
Definition qiconengine.h:15
\inmodule QtCore\reentrant
Definition qjsonobject.h:20
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QPlatformTheme class allows customizing the UI based on themes.
ThemeHint
This enum describes the available theme hints.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
QPushButton * button
[2]
Combined button and popup list for selecting options.
ColorScheme
Definition qnamespace.h:50
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum type
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QHash< int, QPalette > m_palettes
QHash< QByteArray, QFont > m_QWidgetsFonts
QHash< int, QFont > m_fonts
QJsonObject m_styleData