the framework functions used will setup the proper
icon set and re-coloring and style to use
details see
https://invent.kde.org/frameworks/kiconthemes/-/issues/3
#include <KCrash>
#include <KDBusService>
#include <KIO/PreviewJob>
#include <KCrash>
#include <KDBusService>
#include <KIO/PreviewJob>
#include <KLocalizedString>
#include <KWindowSystem>
#include <KLocalizedString>
#include <KWindowSystem>
#include <Kdelibs4ConfigMigrator>
#endif
#include <Kdelibs4ConfigMigrator>
#endif
+#define HAVE_STYLE_MANAGER __has_include(<KStyleManager>)
+#if HAVE_STYLE_MANAGER
+#include <KStyleManager>
+#endif
+
#include <QApplication>
#include <QCommandLineParser>
#include <QDBusConnection>
#include <QApplication>
#include <QCommandLineParser>
#include <QDBusConnection>
+ /**
+ * trigger initialisation of proper icon theme
+ */
+#if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 3, 0)
+ KIconTheme::initTheme();
+#endif
+
/**
* enable high dpi support
*/
/**
* enable high dpi support
*/
QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("system-file-manager"), app.windowIcon()));
-#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
+#if HAVE_STYLE_MANAGER
+ /**
+ * trigger initialisation of proper application style
+ */
+ KStyleManager::initStyle();
+#else
+ /**
+ * For Windows and macOS: use Breeze if available
+ * Of all tested styles that works the best for us
+ */
+#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
QApplication::setStyle(QStringLiteral("breeze"));
QApplication::setStyle(QStringLiteral("breeze"));
#endif
KCrash::initialize();
#endif
KCrash::initialize();