Commit 678bdac0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to compile against qt6

parent 4051454d
Pipeline #113074 passed with stage
in 1 minute and 5 seconds
......@@ -29,7 +29,7 @@ include(ECMQtDeclareLoggingCategory)
include(GenerateExportHeader)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets)
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
CoreAddons
Config
......@@ -61,7 +61,7 @@ endif()
add_subdirectory( src )
if (BUILD_TESTING)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Test)
add_subdirectory( autotests )
endif()
ecm_qt_install_logging_categories(EXPORT KDEBUGSETTINGS FILE kdebugsettings.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
......
......@@ -12,9 +12,9 @@ macro(add_unittest _source)
add_test(NAME ${_name} COMMAND ${_name} )
ecm_mark_as_test(kdebugsettings-${_name})
target_link_libraries( ${_name}
Qt::Test
Qt${QT_MAJOR_VERSION}::Test
KF5::I18n
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::ConfigCore
KF5::WidgetsAddons
KF5::ItemViews
......
......@@ -22,7 +22,7 @@ void GroupManagementWidgetTest::shouldHaveDefaultValues()
GroupManagementWidget w;
auto mainLayout = w.findChild<QVBoxLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), {});
QCOMPARE(mainLayout->contentsMargins(), QMargins{});
auto mListWidget = w.findChild<QListWidget *>(QStringLiteral("mListWidget"));
QVERIFY(mListWidget);
......
......@@ -62,9 +62,9 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif()
generate_export_header(libkdebugsettings BASE_NAME libkdebugsettings)
target_link_libraries(libkdebugsettings
Qt::Core
Qt${QT_MAJOR_VERSION}::Core
KF5::I18n
Qt::Widgets
Qt${QT_MAJOR_VERSION}::Widgets
KF5::WidgetsAddons
KF5::ItemViews
KF5::ConfigCore
......@@ -83,7 +83,7 @@ if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(kdebugsettings PROPERTIES UNITY_BUILD ON)
endif()
target_link_libraries(kdebugsettings Qt::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons libkdebugsettings)
target_link_libraries(kdebugsettings Qt${QT_MAJOR_VERSION}::Widgets KF5::I18n KF5::DBusAddons KF5::CoreAddons libkdebugsettings)
install(TARGETS kdebugsettings ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
......
......@@ -24,7 +24,11 @@ void KDebugSettingsLoadingCategories::readQtLoggingFile()
if (!envPath.isEmpty()) {
readCategoriesFiles(envPath);
} else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
const QString dataPath = QDir(QLibraryInfo::path(QLibraryInfo::DataPath)).absoluteFilePath(QStringLiteral("qtlogging.ini"));
#else
const QString dataPath = QDir(QLibraryInfo::location(QLibraryInfo::DataPath)).absoluteFilePath(QStringLiteral("qtlogging.ini"));
#endif
readCategoriesFiles(dataPath);
}
}
......
......@@ -23,8 +23,8 @@ int main(int argc, char **argv)
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
#endif
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true);
#endif
QApplication app(argc, argv);
......
Supports Markdown
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