6#include <QtCore/QStringList>
7#include <QtCore/QVariant>
8#include <QtCore/private/qcore_mac_p.h>
11#include <QtGui/private/qcoregraphics_p.h>
13#include <QtGui/private/qcoretextfontdatabase_p.h>
14#include <QtGui/private/qappleiconengine_p.h>
15#include <QtGui/private/qguiapplication_p.h>
16#include <qpa/qplatformintegration.h>
18#include <UIKit/UIFont.h>
19#include <UIKit/UIInterface.h>
21#if !defined(Q_OS_TVOS) && !defined(Q_OS_VISIONOS)
25#if !defined(Q_OS_TVOS)
43 UIContentSizeCategoryDidChangeNotification, [] {
44 qCDebug(lcQpaFonts) <<
"Contents size category changed to" << UIApplication.sharedApplication.preferredContentSizeCategory;
78 if (@available(ios 15.0, *))
85 return &s_systemPalette;
89#if !defined(Q_OS_TVOS) && !defined(Q_OS_VISIONOS)
150#if defined(Q_OS_VISIONOS)
158 return s_colorSchemeOverride;
162 UIUserInterfaceStyle appearance = UIScreen.mainScreen.traitCollection.userInterfaceStyle;
166 appearance =
static_cast<QUIWindow*
>(
window).traitCollection.userInterfaceStyle;
171 return appearance == UIUserInterfaceStyleDark
179#if defined(Q_OS_VISIONOS)
182 s_colorSchemeOverride = scheme;
187 if (qt_objc_cast<QUIWindow*>(
window))
195 const UIUserInterfaceStyle style = []{
196 switch (s_colorSchemeOverride) {
198 return UIUserInterfaceStyleDark;
200 return UIUserInterfaceStyleLight;
202 return UIUserInterfaceStyleUnspecified;
206 window.overrideUserInterfaceStyle = style;
212 const auto *coreTextFontDatabase =
static_cast<QCoreTextFontDatabase *
>(platformIntegration->fontDatabase());
The QColor class provides colors based on RGB, HSV or CMYK values.
QFont * themeFont(QPlatformTheme::Font) const
static QPlatformIntegration * platformIntegration()
QIconEngine * createIconEngine(const QString &iconName) const override
Factory function for the QIconEngine used by QIcon::fromTheme().
QPlatformMenu * createPlatformMenu() const override
const QFont * font(Font type=SystemFont) const override
QVariant themeHint(ThemeHint hint) const override
void requestColorScheme(Qt::ColorScheme scheme) override
static void initializeSystemPalette()
Qt::ColorScheme colorScheme() const override
bool usePlatformNativeDialog(DialogType type) const override
QPlatformMenuItem * createPlatformMenuItem() const override
static void applyTheme(UIWindow *window)
const QPalette * palette(Palette type=SystemPalette) const override
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
The QIconEngine class provides an abstract base class for QIcon renderers.
The QPalette class contains color groups for each widget state.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
bool qt_apple_isApplicationExtension()
AppleApplication * qt_apple_sharedApplication()
QBrush qt_mac_toQBrush(CGColorRef color)
#define qCDebug(category,...)
#define QStringLiteral(str)
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)