Qt 6.x
The Qt SDK
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
13#include <QJsonObject>
14
15#include <memory>
16
18
20{
27};
28
31{
32public:
34 void updateColorScheme();
35 void updateStyle();
37 QPlatformMenu *createPlatformMenu() const override;
39 void showPlatformMenuBar() override;
40 Qt::ColorScheme colorScheme() const override;
41 const QPalette *palette(Palette type = SystemPalette) const override;
42 const QFont *font(Font type = SystemFont) const override;
43 QVariant themeHint(ThemeHint hint) const override;
44 QString standardButtonText(int button) const override;
45 bool usePlatformNativeDialog(DialogType type) const override;
47
49 QAndroidPlatformNativeInterface * androidPlatformNativeInterface = nullptr);
50
51private:
52 QAndroidPlatformTheme(QAndroidPlatformNativeInterface * androidPlatformNativeInterface);
53 static QAndroidPlatformTheme * m_instance;
54 std::shared_ptr<AndroidStyle> m_androidStyleData;
55 QPalette m_defaultPalette;
56 QFont m_systemFont;
57};
58
60
61#endif // QANDROIDPLATFORMTHEME_H
Qt::ColorScheme colorScheme() const override
QVariant themeHint(ThemeHint hint) const override
static QAndroidPlatformTheme * instance(QAndroidPlatformNativeInterface *androidPlatformNativeInterface=nullptr)
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
\reentrant
Definition qfont.h:20
\inmodule QtCore
Definition qhash.h:818
\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:127
\inmodule QtCore
Definition qvariant.h:64
QPushButton * button
[2]
Combined button and popup list for selecting options.
ColorScheme
Definition qnamespace.h:49
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
static QJsonObject loadStyleData()
QJsonObject m_styleData