diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 222d6c8..0053e5c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -3,32 +3,6 @@ name: Ubuntu CI on: [push, pull_request] jobs: - ubuntu-20-04-build: - - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - - name: Get build dept. - run: | - sudo apt update - sudo apt install cmake qtbase5-dev libqt5svg5-dev qttools5-dev libexiv2-dev - - name: Build it - run: | - mkdir build - cd build - cmake ../ - make - cpack -G DEB - - name: Try install it - run: | - cd build - sudo apt install ./*.deb - - uses: actions/upload-artifact@v3 - with: - name: ubuntu-20.04-deb-package - path: build/*.deb - ubuntu-22-04-build: runs-on: ubuntu-22.04 diff --git a/CMakeLists.txt b/CMakeLists.txt index dbad14c..30c11df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ else () endif () if (${QT_VERSION_MAJOR} EQUAL "5") - set (QT_MINIMUM_VERSION "5.10") + set (QT_MINIMUM_VERSION "5.15.2") else () set (QT_MINIMUM_VERSION "6.4") endif () @@ -102,12 +102,7 @@ set (EXE_NAME ppic) file (GLOB PPIC_TS_FILES app/translations/*.ts) set (PPIC_CPP_FILES_FOR_I18N ${PPIC_CPP_FILES}) -if (${QT_VERSION_MAJOR} EQUAL "5") - # TODO: remove this when we lift our Qt5 minimum version to Qt 5.15 - qt5_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) -else () - qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) -endif () +qt_create_translation(PPIC_QM_FILES ${PPIC_CPP_FILES_FOR_I18N} ${PPIC_TS_FILES}) if (WIN32) list(APPEND PPIC_RC_FILES assets/pineapple-pictures.rc) @@ -140,9 +135,9 @@ if (LibExiv2_FOUND) ) endif () -if (Qt5DBus_FOUND) +if (Qt5DBus_FOUND OR Qt6DBus_FOUND) target_link_libraries (${EXE_NAME} - Qt5::DBus + Qt${QT_VERSION_MAJOR}::DBus ) target_compile_definitions(${EXE_NAME} PRIVATE HAVE_QTDBUS diff --git a/app/graphicsview.cpp b/app/graphicsview.cpp index f4b8f60..0bff010 100644 --- a/app/graphicsview.cpp +++ b/app/graphicsview.cpp @@ -13,13 +13,6 @@ #include #include -// TODO: remove this once we drop older Qt support. -#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0) -#define COMPAT_CONSTCOLOR constexpr -#else -#define COMPAT_CONSTCOLOR const -#endif - GraphicsView::GraphicsView(QWidget *parent) : QGraphicsView (parent) { @@ -387,8 +380,8 @@ void GraphicsView::setCheckerboardEnabled(bool enabled, bool invertColor) QPixmap tilePixmap(0x20, 0x20); tilePixmap.fill(invertColor ? QColor(220, 220, 220, 170) : QColor(35, 35, 35, 170)); QPainter tilePainter(&tilePixmap); - COMPAT_CONSTCOLOR QColor color(45, 45, 45, 170); - COMPAT_CONSTCOLOR QColor invertedColor(210, 210, 210, 170); + constexpr QColor color(45, 45, 45, 170); + constexpr QColor invertedColor(210, 210, 210, 170); tilePainter.fillRect(0, 0, 0x10, 0x10, invertColor ? invertedColor : color); tilePainter.fillRect(0x10, 0x10, 0x10, 0x10, invertColor ? invertedColor : color); tilePainter.end(); diff --git a/app/mainwindow.cpp b/app/mainwindow.cpp index 7e78ae9..0897ad1 100644 --- a/app/mainwindow.cpp +++ b/app/mainwindow.cpp @@ -309,13 +309,9 @@ void MainWindow::mousePressEvent(QMouseEvent *event) void MainWindow::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() & Qt::LeftButton && m_clickedOnWindow && !isMaximized()) { -#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) if (!window()->windowHandle()->startSystemMove()) { move(event->globalPos() - m_oldMousePos); } -#else - move(event->globalPos() - m_oldMousePos); -#endif // QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) event->accept(); }