Add missing QQuickStyle::setStyle calls

Calls `QQuickStyle::setStyle("breeze")` everywhere we were
calling `QApplication::setStyle("org.kde.desktop")`.
This commit is contained in:
Albert Vaca Cintora 2024-10-18 11:38:57 +00:00
parent 10368df021
commit 475a4c2ca8
4 changed files with 14 additions and 0 deletions

View file

@ -11,6 +11,7 @@ target_link_libraries(kcm_kdeconnect
Qt::Core
Qt::Gui
Qt::QuickWidgets
Qt::QuickControls2
KF6::I18n
KF6::KCMUtils
kdeconnectinterfaces

View file

@ -16,6 +16,7 @@
#include <QQmlContext>
#include <QQuickItem>
#include <QQuickStyle>
#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);

View file

@ -12,6 +12,7 @@ target_link_libraries(kdeconnect-handler
kdeconnectcore
kdeconnectversion
Qt::Widgets
Qt::QuickControls2
KF6::CoreAddons
KF6::ConfigWidgets
KF6::DBusAddons

View file

@ -12,6 +12,7 @@
#include <QDialog>
#include <QFileDialog>
#include <QMessageBox>
#include <QQuickStyle>
#include <QTextStream>
#include <QUrl>
@ -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;