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

Adapt to build against qt6

parent 0630633e
Pipeline #117541 passed with stage
in 36 seconds
......@@ -13,7 +13,7 @@ set(KSPACEDUEL_VERSION "${KSPACEDUEL_BASE_VERSION}.${RELEASE_SERVICE_COMPACT_VER
project(kspaceduel VERSION ${KSPACEDUEL_VERSION})
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.89.0")
set (KF5_MIN_VERSION "5.90.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......@@ -27,7 +27,13 @@ include(ECMInstallIcons)
include(ECMSetupVersion)
include(FeatureSummary)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg)
find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6SvgWidgets ${REQUIRED_QT_VERSION} CONFIG)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Config
ConfigWidgets
......@@ -44,7 +50,7 @@ find_package(KF5KDEGames 7.3.0 REQUIRED)
add_definitions(
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQT_DEPRECATED_WARNINGS_SINCE=0x060000
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055600
-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800
-DKF_DEPRECATED_WARNINGS_SINCE=0x060000
)
......
......@@ -42,9 +42,13 @@ target_link_libraries(kspaceduel
KF5::Crash
KF5::DBusAddons
KF5::XmlGui
Qt::Svg
Qt${QT_MAJOR_VERSION}::Svg
)
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(kspaceduel Qt6::SvgWidgets)
endif()
install(TARGETS kspaceduel ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES default_theme.svgz DESTINATION ${KDE_INSTALL_DATADIR}/kspaceduel/sprites)
......
......@@ -152,11 +152,7 @@ ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent)
for(i=0;i<EditNum;++i)
{
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
label[i]=new QLabel(i18n(LabelName[i]),configWidgets[Parent[i]]);
#else
label[i]=new QLabel(LabelName[i].toString(),configWidgets[Parent[i]]);
#endif
slider[i]=new QSlider(Qt::Horizontal,configWidgets[Parent[i]]);
slider[i]->setRange((int)(EditVal[i][0]*EditDiv[i]), (int)(EditVal[i][1]*EditDiv[i]));
slider[i]->setPageStep((int)((EditVal[i][1]-EditVal[i][0])/10));
......@@ -170,11 +166,7 @@ ConfigSetup::ConfigSetup(SConfig *custom,QWidget *parent)
configCombo->setEditable(false);
connect(configCombo, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), this, &ConfigSetup::configSelected);
for(i=0;i<predefinedConfigNum;++i)
#if KI18N_VERSION < QT_VERSION_CHECK(5, 89, 0)
configCombo->addItem(i18n(predefinedConfigName[i]));
#else
configCombo->addItem(predefinedConfigName[i].toString());
#endif
configCombo->addItem(i18nc("custom values","Custom"));
boxlayout->addSpacing( 2 * 6 );
......
......@@ -18,7 +18,9 @@
int main(int argc,char **argv)
{
// Fixes blurry icons with fractional scaling
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain("kspaceduel");
......
......@@ -8,7 +8,6 @@
#define __SP_STRUCTS_H
#include <KLocalizedString>
#include <ki18n_version.h>
#include <KLazyLocalizedString>
struct SConfig
{
......
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