diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 3f62bef..bde8dfc 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -8,11 +8,12 @@ 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) +#find_package(Qt5Widgets CONFIG REQUIRED) +#find_package(Qt5PrintSupport 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 +41,9 @@ 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 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/kima2.cpp b/src/gui/kima2.cpp index 20fb3ba..bd5b470 100644 --- a/src/gui/kima2.cpp +++ b/src/gui/kima2.cpp @@ -7,12 +7,13 @@ #include #include #include -#include #include +#include #include +#include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { SingleApplication kimaApp(argc, argv); @@ -23,7 +24,11 @@ int main(int argc, char* argv[]) QTranslator qTranslator; QLocale german(QLocale::German); #ifdef __linux__ - qTranslator.load("qt_" + german.name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + bool retVal = + qTranslator.load("qt_" + german.name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath)); + if (!retVal) { + throw std::runtime_error("Could not load translation."); + } #endif #ifdef _WIN32 QApplication::setStyle(QStyleFactory::create("Fusion")); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index c69da27..526fe1b 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -96,7 +96,7 @@ MainWindow::MainWindow() connect(m_ui.aboutQtAction, &QAction::triggered, this, &MainWindow::onAboutQt); connect(m_ui.aboutAction, &QAction::triggered, this, &MainWindow::onAbout); connect(m_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(