From 475a4c2ca8432d3d040bae04c4ee2fafd44da7fb Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 18 Oct 2024 11:38:57 +0000 Subject: [PATCH] Add missing QQuickStyle::setStyle calls Calls `QQuickStyle::setStyle("breeze")` everywhere we were calling `QApplication::setStyle("org.kde.desktop")`. --- kcm/CMakeLists.txt | 1 + kcm/kcm.cpp | 6 ++++++ urlhandler/CMakeLists.txt | 1 + urlhandler/kdeconnect-handler.cpp | 6 ++++++ 4 files changed, 14 insertions(+) diff --git a/kcm/CMakeLists.txt b/kcm/CMakeLists.txt index dec601b49..85419c0ef 100644 --- a/kcm/CMakeLists.txt +++ b/kcm/CMakeLists.txt @@ -11,6 +11,7 @@ target_link_libraries(kcm_kdeconnect Qt::Core Qt::Gui Qt::QuickWidgets + Qt::QuickControls2 KF6::I18n KF6::KCMUtils kdeconnectinterfaces diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index 37601fdb9..48b09a86b 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -16,6 +16,7 @@ #include #include +#include #include "dbushelpers.h" #include "dbusinterfaces.h" @@ -51,6 +52,11 @@ KdeConnectKcm::KdeConnectKcm(QObject *parent, const KPluginMetaData &md, const Q QApplication::setStyle(QStringLiteral("breeze")); #endif + // Default to org.kde.desktop style unless the user forces another style + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); + } + kcmUi.setupUi(widget()); sortProxyModel = new DevicesSortProxyModel(devicesModel); diff --git a/urlhandler/CMakeLists.txt b/urlhandler/CMakeLists.txt index 541db2c64..fe6a9b91e 100644 --- a/urlhandler/CMakeLists.txt +++ b/urlhandler/CMakeLists.txt @@ -12,6 +12,7 @@ target_link_libraries(kdeconnect-handler kdeconnectcore kdeconnectversion Qt::Widgets + Qt::QuickControls2 KF6::CoreAddons KF6::ConfigWidgets KF6::DBusAddons diff --git a/urlhandler/kdeconnect-handler.cpp b/urlhandler/kdeconnect-handler.cpp index 175828c9d..82215e13d 100644 --- a/urlhandler/kdeconnect-handler.cpp +++ b/urlhandler/kdeconnect-handler.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -59,6 +60,11 @@ int main(int argc, char **argv) QApplication::setStyle(QStringLiteral("breeze")); #endif + // Default to org.kde.desktop style unless the user forces another style + if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE")) { + QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); + } + QUrl urlToShare; bool open; QString deviceId;