Commit eea1dc94 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt for building against qt6

parent 38f9e1f7
Pipeline #115334 passed with stage
in 35 seconds
......@@ -13,7 +13,7 @@ set(KSHISEN_VERSION "${KSHISEN_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VERSION}"
project(kshisen VERSION ${KSHISEN_VERSION})
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.85.0")
set(KF5_MIN_VERSION "5.90.0")
# Found this somewhere but cannot re-find it now ... but want to investigate later, so keeping this here for now.
#set(CXX_CLANG_TIDY ON)
......@@ -36,7 +36,9 @@ include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Gui)
find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
Crash
......
......@@ -43,7 +43,7 @@ target_link_libraries(kshisen
KF5::DBusAddons
KF5::I18n
KF5::XmlGui
Qt::Gui
Qt${QT_MAJOR_VERSION}::Gui
)
install(TARGETS kshisen ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -19,8 +19,9 @@
#include <KCrash>
#include <KDBusService>
#include <KLocalizedString>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <Kdelibs4ConfigMigrator>
#endif
// KShisen
#include "app.h"
#include "debug.h"
......@@ -29,14 +30,17 @@
int main(int argc, char ** argv)
{
// Fixes blurry icons with fractional scaling
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication a(argc, argv);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Migrate pre-existing (4.x) configuration
Kdelibs4ConfigMigrator migrate(QStringLiteral("kshisen"));
migrate.setConfigFiles(QStringList() << QStringLiteral("kshisenrc"));
migrate.setUiFiles(QStringList() << QStringLiteral("kshisenui.rc"));
migrate.migrate();
#endif
KLocalizedString::setApplicationDomain("kshisen");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment