From 77ecb98f47deedace054d750595e790164a6d18b Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 21 Sep 2021 14:33:22 +0200 Subject: [PATCH] Initial support for Qt 6 --- src/gui/CMakeLists.txt | 7 +++---- src/gui/mainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 3f62bef..0cba38c 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -8,11 +8,10 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) # Find the QtWidgets library -find_package(Qt5Widgets CONFIG REQUIRED) -find_package(Qt5PrintSupport CONFIG REQUIRED) +find_package(Qt6 COMPONENTS Widgets Network PrintSupport CONFIG REQUIRED) # For SingleApplication: -find_package(Qt5Network CONFIG REQUIRED) +#find_package(Qt5Network CONFIG REQUIRED) set(QAPPLICATION_CLASS QApplication) add_compile_definitions(QAPPLICATION_CLASS=${QAPPLICATION_CLASS}) @@ -40,7 +39,7 @@ set(GUI_SOURCES add_executable(kima2 ${GUI_SOURCES} kima2.rc) target_include_directories(kima2 PRIVATE ${PROJECT_BINARY_DIR}) target_include_directories(kima2 PRIVATE ${PROJECT_SOURCE_DIR}/subprojects/singleapplication/singleapplication.git) -target_link_libraries(kima2 core printer Qt5::Widgets Qt5::PrintSupport Qt5::Network stdc++fs) +target_link_libraries(kima2 core printer Qt::Core Qt::PrintSupport Qt::Network stdc++fs) if(WIN32) set_target_properties(kima2 PROPERTIES LINK_FLAGS "-mwindows") endif(WIN32) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 0d727b8..a90cf43 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -96,7 +96,7 @@ MainWindow::MainWindow() connect(ui_.aboutQtAction, &QAction::triggered, this, &MainWindow::onAboutQt); connect(ui_.aboutAction, &QAction::triggered, this, &MainWindow::onAbout); connect(ui_.openManualAction, &QAction::triggered, this, []() { - auto locations = QStandardPaths::standardLocations(QStandardPaths::DataLocation); + auto locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation); for (auto location : locations) { if (QFile::exists(location + QString("/Benutzerhandbuch.pdf"))) { QDesktopServices::openUrl(