Skip to content

Commit 68cb00e

Browse files
committed
src/main: respect qt_quick_controls_style envvar
If this is set, respect it and let the user face the consequences. Also useful for debugging.
1 parent 0a21299 commit 68cb00e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,14 @@ int main(int argc, char *argv[])
305305
#endif // defined(Q_OS_WIN)
306306

307307
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
308-
QQuickStyle::setStyle(QStringLiteral("FluentWinUI3"));
308+
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE"))
309+
{
310+
QQuickStyle::setStyle(QStringLiteral("FluentWinUI3"));
311+
}
309312
#else
310313
/* Try to avoid overriding the default theme unless it's org.kde.desktop */
311-
if (QQuickStyle::name() == "org.kde.desktop")
314+
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE") &&
315+
QQuickStyle::name() == "org.kde.desktop")
312316
{
313317
QQuickStyle::setStyle(QStringLiteral("org.kde.breeze"));
314318
QQuickStyle::setFallbackStyle(QStringLiteral("org.kde.desktop"));

0 commit comments

Comments
 (0)