93 if (qEnvironmentVariable(
"QQC2_COMMONSTYLE") == QStringLiteral(
"true")) {
94 style =
new QCommonStyle;
96 const QString envStyle = qEnvironmentVariable(
"QQC2_STYLE");
97 if (!envStyle.isNull()) {
98 if (envStyle == QLatin1String(
"common"))
99 style =
new QCommonStyle;
100#if defined(Q_OS_MACOS)
101 else if (envStyle == QLatin1String(
"mac"))
102 style = QMacStyle::create();
104#if defined(Q_OS_WINDOWS)
105 else if (envStyle == QLatin1String(
"windows"))
106 style =
new QWindowsStyle;
107 else if (envStyle == QLatin1String(
"windowsxp"))
108 style =
new QWindowsXPStyle;
112#if defined(Q_OS_MACOS)
113 style = QMacStyle::create();
114#elif defined(Q_OS_WINDOWS)
115 style =
new QWindowsXPStyle;
116 if (QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Dark)
117 qobject_cast<QWindowsStyle *>(style)->refreshPalette();
119 style =
new QCommonStyle;
124#if defined(Q_OS_MACOS)
125 m_focusFrame.reset(
new QQuickMacFocusFrame());
126#elif defined(Q_OS_WIN)
127 m_focusFrame.reset(
new QQuickWindowsFocusFrame());
135 Q_ASSERT(style->thread()->isMainThread());
136 connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged,
137 style, [=]{ style->handleThemeChange(); });