diff --git a/CMakeLists.txt b/CMakeLists.txt index f5605b2..8dae988 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,11 +7,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Find Qt -if (NOT QT_VERSION_MAJOR) - set(QT_VERSION_MAJOR 6) -endif () -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network Svg LinguistTools) +find_package(Qt6 REQUIRED COMPONENTS Widgets Network Svg LinguistTools QuickControls2) if (NKR_CROSS) set_property(TARGET Qt6::moc PROPERTY IMPORTED_LOCATION /usr/bin/moc) @@ -243,7 +239,7 @@ target_sources(nekoray PRIVATE ${CMAKE_BINARY_DIR}/translations.qrc) # Target Link target_link_libraries(nekoray PRIVATE - Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Svg + Qt6::Widgets Qt6::Network Qt6::Svg Threads::Threads ${NKR_EXTERNAL_TARGETS} ${PLATFORM_LIBRARIES} diff --git a/libs/build_deps_all.sh b/libs/build_deps_all.sh index a17b803..86c4b1f 100755 --- a/libs/build_deps_all.sh +++ b/libs/build_deps_all.sh @@ -27,8 +27,8 @@ clean() { rm -rf dl.zip yaml-* zxing-* protobuf } -#### ZXing v2.0.0 #### -curl -L -o dl.zip https://github.com/nu-book/zxing-cpp/archive/refs/tags/v2.0.0.zip +#### ZXing v2.2.0 #### +curl -L -o dl.zip https://github.com/nu-book/zxing-cpp/archive/refs/tags/v2.2.0.zip unzip dl.zip cd zxing-* diff --git a/main/main.cpp b/main/main.cpp index 9d39351..ad77ac2 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -56,13 +56,7 @@ int main(int argc, char* argv[]) { Windows_SetCrashHandler(); #endif - // pre-init QApplication -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) - QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton); -#endif -#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) QApplication::setAttribute(Qt::AA_DontUseNativeDialogs); -#endif QApplication::setQuitOnLastWindowClosed(false); auto preQApp = new QApplication(argc, argv); @@ -146,12 +140,10 @@ int main(int argc, char* argv[]) { MF_release_runguard = [&] { guard.release(); }; // icons -#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)) QIcon::setFallbackSearchPaths(QStringList{ ":/nekoray", ":/icon", }); -#endif // icon for no theme if (QIcon::themeName().isEmpty()) { diff --git a/test/test-qt512-sdk-build.sh b/test/test-qt512-sdk-build.sh deleted file mode 100644 index 9414691..0000000 --- a/test/test-qt512-sdk-build.sh +++ /dev/null @@ -1,7 +0,0 @@ -QT=$PWD/qtsdk/5.12.12/gcc_64 -BUILD=build-sdk-qt512 -rm -rf $BUILD -mkdir -p $BUILD -cd $BUILD -cmake -GNinja -DCMAKE_PREFIX_PATH=$QT .. -ninja diff --git a/test/test-qt6-build.sh b/test/test-qt6-build.sh deleted file mode 100644 index 7c1247b..0000000 --- a/test/test-qt6-build.sh +++ /dev/null @@ -1,5 +0,0 @@ -rm -rf build-qt6 -mkdir -p build-qt6 -cd build-qt6 -cmake -GNinja -DQT_VERSION_MAJOR=6 .. -ninja diff --git a/ui/dialog_basic_settings.cpp b/ui/dialog_basic_settings.cpp index 44394bb..0db65b8 100644 --- a/ui/dialog_basic_settings.cpp +++ b/ui/dialog_basic_settings.cpp @@ -135,8 +135,6 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent) connect(ui->theme, static_cast(&QComboBox::currentIndexChanged), this, [=](int index) { themeManager->ApplyTheme(ui->theme->currentText()); NekoGui::dataStore->theme = ui->theme->currentText(); - repaint(); - mainwindow->repaint(); NekoGui::dataStore->Save(); }); diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index bdc9924..910d672 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -22,10 +22,7 @@ #include "3rdparty/VT100Parser.hpp" #include "3rdparty/qv2ray/v2/components/proxy/QvProxyConfigurator.hpp" #include "3rdparty/qv2ray/v2/ui/LogHighlighter.hpp" - -#ifndef NKR_NO_ZXING #include "3rdparty/ZxingQtReader.hpp" -#endif #ifdef Q_OS_WIN #include "3rdparty/WinCommander.hpp"