From 7218d0dc8751c1c757ff9201dae386242887756c Mon Sep 17 00:00:00 2001 From: luisangelsm Date: Fri, 20 Feb 2026 21:48:15 +0100 Subject: [PATCH] Drop Qt 5 support --- Qt5-DROP.md | 2 +- YACReader/YACReader.pro | 7 +- YACReader/main.cpp | 10 +-- YACReader/main_window_viewer.cpp | 4 +- YACReader/mouse_handler.cpp | 12 --- YACReader/translator.cpp | 14 --- YACReader/viewer.cpp | 4 - YACReaderLibrary/YACReaderLibrary.pro | 7 +- .../comic_vine/comic_vine_dialog.cpp | 8 -- .../comic_vine/scraper_tableview.cpp | 12 --- .../initial_comic_info_extractor.cpp | 5 -- YACReaderLibrary/library_window.cpp | 6 -- YACReaderLibrary/main.cpp | 2 - YACReaderLibrary/trayhandler.mm | 2 - .../YACReaderLibraryServer.pro | 4 +- YACReaderLibraryServer/main.cpp | 2 - build_scripts/ubuntu_22.04/README.md | 6 -- build_scripts/ubuntu_22.04/build.sh | 88 ------------------- build_scripts/ubuntu_24.04/build.sh | 2 +- common/comic.cpp | 5 -- common/pdf_comic.h | 4 - common/pdf_comic.mm | 2 - config.pri | 4 +- custom_widgets/help_about_dialog.cpp | 8 -- custom_widgets/yacreader_table_view.cpp | 12 --- dependencies/pdf_backend.pri | 36 +++----- docker/Dockerfile.aarch64 | 73 +++++++-------- 27 files changed, 56 insertions(+), 285 deletions(-) delete mode 100644 build_scripts/ubuntu_22.04/README.md delete mode 100644 build_scripts/ubuntu_22.04/build.sh diff --git a/Qt5-DROP.md b/Qt5-DROP.md index 658c4c28..a0fefe52 100644 --- a/Qt5-DROP.md +++ b/Qt5-DROP.md @@ -181,7 +181,7 @@ These add `QT += core5compat` for Qt6 builds. Needed by third-party QtWebApp (QT | `docker/Dockerfile` | Ubuntu x64 Qt6 — installs `libqt6core5compat6-dev` (build) and `libqt6core5compat6` (runtime) | | `docker/Dockerfile.aarch64` | Ubuntu ARM64 Qt5-only build | -**Action**: Remove or convert `Dockerfile.aarch64` to Qt6. Keep core5compat packages in main Dockerfile (QtWebApp). +**Action**: Convert `Dockerfile.aarch64` to Qt6. Keep core5compat packages in main Dockerfile (QtWebApp). Make sure the conversion is good, there must be other images online that use the arm+qt6 combo, we can search online. --- diff --git a/YACReader/YACReader.pro b/YACReader/YACReader.pro index 2a9b3f69..06ef1432 100644 --- a/YACReader/YACReader.pro +++ b/YACReader/YACReader.pro @@ -45,16 +45,13 @@ macx { CONFIG += objective_c LIBS += -framework Foundation -framework ApplicationServices -framework AppKit - lessThan(QT_MAJOR_VERSION, 6): QT += macextras } QT += network widgets core multimedia svg -greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat +QT += core5compat -greaterThan(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 6) { - QT += gui-private -} +greaterThan(QT_MINOR_VERSION, 6): QT += gui-private #CONFIG += release CONFIG -= flat diff --git a/YACReader/main.cpp b/YACReader/main.cpp index cb408d36..813674cf 100644 --- a/YACReader/main.cpp +++ b/YACReader/main.cpp @@ -99,9 +99,7 @@ int main(int argc, char *argv[]) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QImageReader::setAllocationLimit(0); -#endif #if defined(_MSC_VER) && defined(_DEBUG) _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); @@ -131,16 +129,10 @@ int main(int argc, char *argv[]) QCommandLineOption comicId("comicId", "", "comicId"); QCommandLineOption libraryId("libraryId", "", "libraryId"); QCommandLineOption readingListId("readingListId", "", "readingListId"); -// hide comicId and libraryId from help -#if QT_VERSION >= 0x050800 + // hide comicId and libraryId from help comicId.setFlags(QCommandLineOption::HiddenFromHelp); libraryId.setFlags(QCommandLineOption::HiddenFromHelp); readingListId.setFlags(QCommandLineOption::HiddenFromHelp); -#else - comicId.setHidden(true); - libraryId.setHidden(true); - readingListId.setHidden(true); -#endif // process parser.addOption(comicId); diff --git a/YACReader/main_window_viewer.cpp b/YACReader/main_window_viewer.cpp index 4c671ca1..2018b25f 100644 --- a/YACReader/main_window_viewer.cpp +++ b/YACReader/main_window_viewer.cpp @@ -480,9 +480,7 @@ void MainWindowViewer::createToolBars() { #ifdef Y_MAC_UI comicToolBar = new YACReaderMacOSXToolbar(this); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) comicToolBar->setIconSize(QSize(18, 18)); -#endif #else comicToolBar = addToolBar(tr("&File")); #endif @@ -1354,7 +1352,7 @@ void MainWindowViewer::toggleFitToWidthSlider() if (zoomSliderAction->isVisible()) { zoomSliderAction->hide(); } else { -#if defined(Y_MAC_UI) && (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#ifdef Y_MAC_UI zoomSliderAction->move((this->width() - zoomSliderAction->width()) / 2, y); #else zoomSliderAction->move(250, y); diff --git a/YACReader/mouse_handler.cpp b/YACReader/mouse_handler.cpp index 331d33f2..9ab6055e 100644 --- a/YACReader/mouse_handler.cpp +++ b/YACReader/mouse_handler.cpp @@ -19,11 +19,7 @@ void YACReader::MouseHandler::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { viewer->drag = true; -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto position = event->position(); -#else - auto position = QPointF(event->x(), event->y()); -#endif dragOrigin = dragLatestPosition = position; viewer->setCursor(Qt::ClosedHandCursor); event->accept(); @@ -53,11 +49,7 @@ void YACReader::MouseHandler::mouseReleaseEvent(QMouseEvent *event) event->accept(); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto position = event->position(); -#else - auto position = QPointF(event->x(), event->y()); -#endif auto dragDistance = QLineF(position, dragOrigin).length(); auto mouseMode = Configuration::getConfiguration().getMouseMode(); @@ -104,11 +96,7 @@ void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event) viewer->showCursor(); viewer->hideCursorTimer->start(2500); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto position = event->position(); -#else - auto position = QPointF(event->x(), event->y()); -#endif if (viewer->magnifyingGlassShown) viewer->mglass->move(static_cast(position.x() - float(viewer->mglass->width()) / 2), static_cast(position.y() - float(viewer->mglass->height()) / 2)); diff --git a/YACReader/translator.cpp b/YACReader/translator.cpp index 1419adba..a2524706 100644 --- a/YACReader/translator.cpp +++ b/YACReader/translator.cpp @@ -1,11 +1,6 @@ #include -#if QT_VERSION >= 0x050000 #include -#else -#include -#include -#endif #include #include @@ -160,12 +155,7 @@ YACReaderTranslator::YACReaderTranslator(Viewer *parent) connect(speakButton, &QAbstractButton::pressed, this, &YACReaderTranslator::play); connect(clearButton, &QAbstractButton::pressed, this, &YACReaderTranslator::clear); - // multimedia/phonon -#if QT_VERSION >= 0x050000 player = new QMediaPlayer; -#else - music = createPlayer(MusicCategory); -#endif } void YACReaderTranslator::hideResults() @@ -288,11 +278,7 @@ void YACReaderTranslator::populateCombos() void YACReaderTranslator::play() { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) player->setSource(ttsSource); -#else - player->setMedia(ttsSource); -#endif player->play(); } diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index 80ea8338..7187f77b 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -759,11 +759,7 @@ void Viewer::resizeEvent(QResizeEvent *event) QPixmap Viewer::pixmap() const { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) return content->pixmap(); -#else - return content->pixmap(Qt::ReturnByValue); -#endif } void Viewer::magnifyingGlassSwitch() diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index e7ca65bc..2755861f 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -41,18 +41,15 @@ macx { LIBS += -framework Foundation -framework ApplicationServices -framework AppKit CONFIG += objective_c QT += gui-private - lessThan(QT_MAJOR_VERSION, 6): QT += macextras } #CONFIG += release CONFIG -= flat QT += sql network widgets svg quickcontrols2 -greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat +QT += core5compat -greaterThan(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 6) { - QT += gui-private -} +greaterThan(QT_MINOR_VERSION, 6): QT += gui-private # Input HEADERS += \ diff --git a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp index 2c172d1d..23d74cd3 100644 --- a/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine/comic_vine_dialog.cpp @@ -146,22 +146,14 @@ void ComicVineDialog::goNext() QList> matchingInfo = sortVolumeComicsWidget->getMatchingInfo(); auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QtConcurrent::run(&ComicVineDialog::getComicsInfo, this, matchingInfo, volumeInfo); -#else - QtConcurrent::run(this, &ComicVineDialog::getComicsInfo, matchingInfo, volumeInfo); -#endif } else if (content->currentWidget() == selectComicWidget) { showLoading(); QString comicId = selectComicWidget->getSelectedComicId(); auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QtConcurrent::run(&ComicVineDialog::getComicInfo, this, comicId, volumeInfo); -#else - QtConcurrent::run(this, &ComicVineDialog::getComicInfo, comicId, volumeInfo); -#endif } } diff --git a/YACReaderLibrary/comic_vine/scraper_tableview.cpp b/YACReaderLibrary/comic_vine/scraper_tableview.cpp index 0fa134a8..0b528802 100644 --- a/YACReaderLibrary/comic_vine/scraper_tableview.cpp +++ b/YACReaderLibrary/comic_vine/scraper_tableview.cpp @@ -6,25 +6,13 @@ ScraperTableView::ScraperTableView(QWidget *parent) : QTableView(parent) { setShowGrid(false); -#if QT_VERSION >= 0x050000 verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); -#else - verticalHeader()->setResizeMode(QHeaderView::Fixed); -#endif horizontalHeader()->setStretchLastSection(true); -#if QT_VERSION >= 0x050000 horizontalHeader()->setSectionsClickable(false); -#else - horizontalHeader()->setClickable(false); -#endif // comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); verticalHeader()->setDefaultSectionSize(24); -#if QT_VERSION >= 0x050000 verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo -#else - verticalHeader()->setClickable(false); // TODO comportamiento anómalo -#endif setCornerButtonEnabled(false); diff --git a/YACReaderLibrary/initial_comic_info_extractor.cpp b/YACReaderLibrary/initial_comic_info_extractor.cpp index 15528ede..23f96ef0 100644 --- a/YACReaderLibrary/initial_comic_info_extractor.cpp +++ b/YACReaderLibrary/initial_comic_info_extractor.cpp @@ -41,12 +41,7 @@ void InitialComicInfoExtractor::extract() return; } #else -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto pdfComic = Poppler::Document::load(_fileSource); -#else - auto _pdfComic = Poppler::Document::load(_fileSource); - auto pdfComic = std::unique_ptr(_pdfComic); -#endif #endif if (!pdfComic) { QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource; diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 7ec65a0c..e7e9551e 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -169,13 +169,11 @@ bool LibraryWindow::eventFilter(QObject *object, QEvent *event) return QMainWindow::eventFilter(object, event); } -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto keyCombination = keySequence[0]; if (keyCombination.keyboardModifiers() != Qt::NoModifier) { return QMainWindow::eventFilter(object, event); } -#endif auto string = keySequence.toString(); @@ -774,11 +772,7 @@ void LibraryWindow::createConnections() // Search filter #ifdef Y_MAC_UI -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) connect(libraryToolBar, &YACReaderMacOSXToolbar::filterChanged, searchDebouncer, &KDToolBox::KDStringSignalDebouncer::throttle); -#else - connect(searchEdit, &YACReaderMacOSXSearchLineEdit::filterChanged, searchDebouncer, &KDToolBox::KDStringSignalDebouncer::throttle); -#endif connect(searchDebouncer, &KDToolBox::KDStringSignalDebouncer::triggered, this, [=](QString filter) { setSearchFilter(filter); }); diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index d7c35788..5507e25e 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -131,9 +131,7 @@ int main(int argc, char **argv) QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QImageReader::setAllocationLimit(0); -#endif QApplication app(argc, argv); diff --git a/YACReaderLibrary/trayhandler.mm b/YACReaderLibrary/trayhandler.mm index c53f0897..05eb6502 100644 --- a/YACReaderLibrary/trayhandler.mm +++ b/YACReaderLibrary/trayhandler.mm @@ -1,8 +1,6 @@ #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #undef __OBJC_BOOL_IS_BOOL -#endif #import #include "trayhandler.h" diff --git a/YACReaderLibraryServer/YACReaderLibraryServer.pro b/YACReaderLibraryServer/YACReaderLibraryServer.pro index ed7ca78f..89e0938e 100644 --- a/YACReaderLibraryServer/YACReaderLibraryServer.pro +++ b/YACReaderLibraryServer/YACReaderLibraryServer.pro @@ -17,7 +17,7 @@ include(headless_config.pri) include(../dependencies/pdf_backend.pri) include(../third_party/QrCode/QrCode.pri) -greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat +QT += core5compat win32 { LIBS += -loleaut32 -lole32 -lshell32 -luser32 @@ -37,8 +37,6 @@ macx { CONFIG -= flat QT += core sql network -greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat - # Source files HEADERS += ../YACReaderLibrary/library_creator.h \ ../YACReaderLibrary/package_manager.h \ diff --git a/YACReaderLibraryServer/main.cpp b/YACReaderLibraryServer/main.cpp index 2b82c93d..ac6fb435 100644 --- a/YACReaderLibraryServer/main.cpp +++ b/YACReaderLibraryServer/main.cpp @@ -50,9 +50,7 @@ int main(int argc, char **argv) QCoreApplication app(argc, argv); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) QImageReader::setAllocationLimit(0); -#endif app.setApplicationName("YACReaderLibrary"); app.setOrganizationName("YACReader"); diff --git a/build_scripts/ubuntu_22.04/README.md b/build_scripts/ubuntu_22.04/README.md deleted file mode 100644 index b65a6d7a..00000000 --- a/build_scripts/ubuntu_22.04/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Ubuntu 22.04 build script -You can use `build.sh` to build YACReader from scratch in `Ubuntu 22.04` with `7zip` (including `RAR5` support) and `poppler` (pdf). This build uses Qt5. - -The script will create a folder next to it where all the downloads and building will happen, it will also install all the required dependencies. The installs 7z.so in /usr/lib/7zip/. Once the scrip finishes succesfully `YACReader`, `YACReaderLibrary` and `YACReaderLibraryServer` should be installed in your system. - -WARNIG: This doesn't work with the latest release (9.14), there is a bug and some of the code is still looking for the old p7zip library, you need to build from develop, to do so run: `build.sh develop`. \ No newline at end of file diff --git a/build_scripts/ubuntu_22.04/build.sh b/build_scripts/ubuntu_22.04/build.sh deleted file mode 100644 index 3153fb50..00000000 --- a/build_scripts/ubuntu_22.04/build.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash - -# Exit immediately if a command exits with a non-zero status -set -e - -# Define variables -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -BUILD_DIR="$SCRIPT_DIR/yacreader_build" -YACREADER_DIR="$BUILD_DIR/yacreader" -COMPRESSED_ARCHIVE_DIR="$YACREADER_DIR/compressed_archive" -YACREADER_REPO="https://github.com/YACReader/yacreader.git" -SEVENZIP_URL="https://github.com/YACReader/yacreader-7z-deps/blob/main/7z2301-src.7z?raw=true" -SEVENZIP_ARCHIVE="$COMPRESSED_ARCHIVE_DIR/7z2301-src.7z" -SEVENZIP_DIR="$COMPRESSED_ARCHIVE_DIR/lib7zip" - -# Function to download the latest release source tarball -download_latest_release() { - echo "Fetching the latest release information..." - LATEST_RELEASE_URL=$(curl -s https://api.github.com/repos/YACReader/yacreader/releases/latest | grep "browser_download_url.*src.tar.xz" | cut -d '"' -f 4 | head -n 1) - if [ -z "$LATEST_RELEASE_URL" ]; then - echo "Failed to fetch the latest release information." - exit 1 - fi - echo "Downloading the latest release source tarball..." - wget "$LATEST_RELEASE_URL" -O "$BUILD_DIR/latest_release_src.tar.xz" - echo "Extracting the latest release source tarball..." - mkdir -p "$YACREADER_DIR" - tar -xf "$BUILD_DIR/latest_release_src.tar.xz" -C "$YACREADER_DIR" --strip-components=1 -} - -# Step 1: Create a folder for the build process -if [ -d "$BUILD_DIR" ]; then - echo "Removing existing build directory..." - rm -rf "$BUILD_DIR" -fi -echo "Creating build directory..." -mkdir -p "$BUILD_DIR" -mkdir -p "$COMPRESSED_ARCHIVE_DIR" - -# Step 2: Install required packages -echo "Updating package list and installing required packages..." -sudo apt-get update -sudo apt-get install -y qtchooser qtbase5-dev-tools qt5-qmake \ - qtbase5-dev qtmultimedia5-dev libpoppler-qt5-dev qttools5-dev-tools \ - libqt5opengl5-dev qtdeclarative5-dev libqt5svg5-dev qtquickcontrols2-5-dev \ - qt5-image-formats-plugins qml-module-qtquick-controls2 qml-module-qtquick-layouts \ - qml-module-qtgraphicaleffects qml-module-qtquick2 qml-module-qtquick-controls \ - libqt5multimedia5-plugins qt5-image-formats-plugins qml-module-qtquick-controls2 qml-module-qtquick-layouts \ - qml-module-qtgraphicaleffects qml-module-qtquick2 qml-module-qtquick-controls \ - git build-essential - -# Step 3: Download YACReader source code -if [ "$1" == "develop" ]; then - if [ -d "$YACREADER_DIR" ]; then - echo "Removing existing YACReader directory..." - rm -rf "$YACREADER_DIR" - fi - echo "Cloning YACReader repository..." - git clone "$YACREADER_REPO" "$YACREADER_DIR" -else - download_latest_release -fi - -# Step 4: Download and extract 7zip source code -echo "Downloading 7zip source code..." -wget "$SEVENZIP_URL" -O "$SEVENZIP_ARCHIVE" -echo "Extracting 7zip source code..." -7z x "$SEVENZIP_ARCHIVE" -o"$SEVENZIP_DIR" - -# Step 5: Build and install 7z.so with RAR support -echo "Building and installing 7z.so with RAR support..." -cd "$SEVENZIP_DIR/CPP/7zip/Bundles/Format7zF" -make -f makefile.gcc -sudo mkdir -p /usr/lib/7zip -sudo cp ./_o/7z.so /usr/lib/7zip - -# Step 6: Build YACReader -echo "Building YACReader..." -cd "$YACREADER_DIR" -export DEFINES_VAR=DEFINES+\=\"BUILD_NUMBER=\\\\\\\"CUSTOM_BUILD\\\\\\\"\" -qmake CONFIG+="7zip" $DEFINES_VAR -make - -# Step 7: Install YACReader -echo "Installing YACReader..." -sudo make install - -echo "YACReader build and installation complete." \ No newline at end of file diff --git a/build_scripts/ubuntu_24.04/build.sh b/build_scripts/ubuntu_24.04/build.sh index 979b5330..eb7b7894 100644 --- a/build_scripts/ubuntu_24.04/build.sh +++ b/build_scripts/ubuntu_24.04/build.sh @@ -40,7 +40,7 @@ mkdir -p "$COMPRESSED_ARCHIVE_DIR" # Step 2: Install required packages echo "Updating package list and installing required packages..." sudo apt-get update -sudo apt-get install -y qtchooser qt6-tools-dev qt6-base-dev-tools qmake6 qmake6-bin qt6-base-dev qt6-multimedia-dev qt6-tools-dev-tools libgl-dev qt6-l10n-tools libqt6opengl6-dev qt6-declarative-dev libqt6svg6-dev libqt6core5compat6-dev qml6-module-qt5compat-graphicaleffects qt6-5compat-dev libpoppler-qt6-dev qt6-image-formats-plugins qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtqml-workerscript qml6-module-qtquick-templates 7zip-full 7zip-rar git build-essential +sudo apt-get install -y qtchooser qt6-tools-dev qt6-base-dev-tools qmake6 qmake6-bin qt6-base-dev qt6-multimedia-dev qt6-tools-dev-tools libgl-dev qt6-l10n-tools libqt6opengl6-dev qt6-declarative-dev libqt6svg6-dev libqt6core5compat6-dev qt6-5compat-dev libpoppler-qt6-dev qt6-image-formats-plugins qml6-module-qtquick-controls qml6-module-qtquick-layouts qml6-module-qtqml-workerscript qml6-module-qtquick-templates 7zip-full 7zip-rar git build-essential # Step 3: Download YACReader source code if [ "$1" == "develop" ]; then diff --git a/common/comic.cpp b/common/comic.cpp index 6763db2a..04ea4886 100644 --- a/common/comic.cpp +++ b/common/comic.cpp @@ -809,12 +809,7 @@ void PDFComic::process() } #else -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) pdfComic = Poppler::Document::load(_path); -#else - auto _pdfComic = Poppler::Document::load(_path); - pdfComic = std::unique_ptr(_pdfComic); -#endif if (!pdfComic) { moveToThread(QCoreApplication::instance()->thread()); diff --git a/common/pdf_comic.h b/common/pdf_comic.h index 1eadd705..cc47d0cd 100644 --- a/common/pdf_comic.h +++ b/common/pdf_comic.h @@ -46,10 +46,6 @@ private: QFile pdfFile; }; #else -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include -#else -#include "poppler-qt5.h" -#endif // QT_VERSION #endif // Q_OS_MACOS #endif // PDF_COMIC_H diff --git a/common/pdf_comic.mm b/common/pdf_comic.mm index 9f671cb3..c242169a 100644 --- a/common/pdf_comic.mm +++ b/common/pdf_comic.mm @@ -1,8 +1,6 @@ #include "pdf_comic.h" -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #undef __OBJC_BOOL_IS_BOOL -#endif #import #import diff --git a/config.pri b/config.pri index 2ca74575..083bef24 100644 --- a/config.pri +++ b/config.pri @@ -38,8 +38,8 @@ defineTest(minQtVersion) { return(false) } -!minQtVersion(5, 15, 0) { - error(YACReader requires Qt 5.15 or newer but $$[QT_VERSION] was detected) +!minQtVersion(6, 0, 0) { + error(YACReader requires Qt 6.0 or newer but $$[QT_VERSION] was detected) } # reduce log pollution diff --git a/custom_widgets/help_about_dialog.cpp b/custom_widgets/help_about_dialog.cpp index 17c4a82d..2b8de003 100644 --- a/custom_widgets/help_about_dialog.cpp +++ b/custom_widgets/help_about_dialog.cpp @@ -11,10 +11,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) -#include -#endif - #include "yacreader_global.h" HelpAboutDialog::HelpAboutDialog(QWidget *parent) @@ -85,11 +81,7 @@ QString HelpAboutDialog::fileToString(const QString &path) f.open(QIODevice::ReadOnly); QTextStream txtS(&f); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) txtS.setEncoding(QStringConverter::Utf8); -#else - txtS.setCodec(QTextCodec::codecForName("UTF-8")); -#endif QString content = txtS.readAll(); f.close(); diff --git a/custom_widgets/yacreader_table_view.cpp b/custom_widgets/yacreader_table_view.cpp index 7c8b2507..85c6ccba 100644 --- a/custom_widgets/yacreader_table_view.cpp +++ b/custom_widgets/yacreader_table_view.cpp @@ -26,26 +26,14 @@ YACReaderTableView::YACReaderTableView(QWidget *parent) setContextMenuPolicy(Qt::ActionsContextMenu); setShowGrid(false); -#if QT_VERSION >= 0x050000 verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); -#else - verticalHeader()->setResizeMode(QHeaderView::Fixed); -#endif // comicView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); horizontalHeader()->setStretchLastSection(true); -#if QT_VERSION >= 0x050000 horizontalHeader()->setSectionsClickable(false); -#else - horizontalHeader()->setClickable(false); -#endif // comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); verticalHeader()->setDefaultSectionSize(24); -#if QT_VERSION >= 0x050000 verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo -#else - verticalHeader()->setClickable(false); // TODO comportamiento anómalo -#endif setCornerButtonEnabled(false); diff --git a/dependencies/pdf_backend.pri b/dependencies/pdf_backend.pri index e008dc95..1402b9e2 100644 --- a/dependencies/pdf_backend.pri +++ b/dependencies/pdf_backend.pri @@ -49,38 +49,24 @@ CONFIG(poppler) { contains(QMAKE_TARGET.arch, x86_64): { error ("We currently don't ship precompiled poppler libraries for 64 bit builds on Windows") } - INCLUDEPATH += $$PWD/poppler/include/qt5 - LIBS += -L$$PWD/poppler/lib -lpoppler-qt5 + INCLUDEPATH += $$PWD/poppler/include/qt6 + LIBS += -L$$PWD/poppler/lib -lpoppler-qt6 # Add extra paths for dll dependencies so the executables don't crash when launching # from QtCreator LIBS += -L$$PWD/poppler/bin LIBS += -L$$PWD/poppler/dependencies/bin } if(unix|mingw):!macx { - greaterThan (QT_MAJOR_VERSION, 5) { - !contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt6) { - message("Using system provided installation of poppler-qt6 found by pkg-config.") - CONFIG += link_pkgconfig - PKGCONFIG += poppler-qt6 - } else:!macx:exists(/usr/include/poppler/qt6) { - message("Using system provided installation of poppler-qt6.") - INCLUDEPATH += /usr/include/poppler/qt6 - LIBS += -lpoppler-qt6 - } else { - error("Could not find poppler-qt6") - } + !contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt6) { + message("Using system provided installation of poppler-qt6 found by pkg-config.") + CONFIG += link_pkgconfig + PKGCONFIG += poppler-qt6 + } else:!macx:exists(/usr/include/poppler/qt6) { + message("Using system provided installation of poppler-qt6.") + INCLUDEPATH += /usr/include/poppler/qt6 + LIBS += -lpoppler-qt6 } else { - !contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt5) { - message("Using system provided installation of poppler-qt5 found by pkg-config.") - CONFIG += link_pkgconfig - PKGCONFIG += poppler-qt5 - } else:!macx:exists(/usr/include/poppler/qt5) { - message("Using system provided installation of poppler-qt5.") - INCLUDEPATH += /usr/include/poppler/qt5 - LIBS += -lpoppler-qt5 - } else { - error("Could not find poppler-qt5") - } + error("Could not find poppler-qt6") } } unix:macx { diff --git a/docker/Dockerfile.aarch64 b/docker/Dockerfile.aarch64 index faf2c430..bd4660c7 100644 --- a/docker/Dockerfile.aarch64 +++ b/docker/Dockerfile.aarch64 @@ -17,37 +17,36 @@ RUN \ desktop-file-utils \ g++ \ git \ - libglu1-mesa-dev \ - libpoppler-qt5-dev \ - libpoppler-qt5-1 \ - libqt5core5a \ - libqt5gui5 \ - libqt5multimedia5 \ - libqt5network5 \ - libqt5opengl5-dev \ - libqt5qml5 \ - libqt5quickcontrols2-5 \ - libqt5script5 \ - libqt5sql5-sqlite \ - libqt5sql5 \ - libqt5svg5-dev \ + qt6-tools-dev \ + qt6-base-dev-tools \ + qmake6 \ + qt6-base-dev \ + qt6-multimedia-dev \ + qt6-tools-dev-tools \ + qt6-l10n-tools \ + qt6-declarative-dev \ + libqt6svg6-dev \ + libqt6core5compat6-dev \ + libqt6gui6t64 \ + libqt6multimedia6 \ + libqt6network6t64 \ + libqt6qml6 \ + libqt6quickcontrols2-6 \ + qt6-image-formats-plugins \ + libqt6sql6 \ + libqt6sql6-sqlite \ + libpoppler-qt6-dev \ libsqlite3-dev \ + libbz2-dev \ + libglu1-mesa-dev \ + liblzma-dev \ make \ - 7zip \ - 7zip-rar \ - qtchooser \ - qtbase5-dev-tools \ - qt5-qmake \ - qtbase5-dev \ - qtmultimedia5-dev \ - qt5-image-formats-plugins \ - qtdeclarative5-dev \ - qtquickcontrols2-5-dev \ - qtscript5-dev \ - qttools5-dev-tools \ sqlite3 \ unzip \ - wget && \ + wget \ + 7zip \ + 7zip-rar \ + zlib1g-dev && \ ldconfig # clone YACReader repo @@ -62,7 +61,7 @@ RUN cd /src/git/compressed_archive && \ # build yacreaderlibraryserver RUN cd /src/git/YACReaderLibraryServer && \ - qmake PREFIX=/app CONFIG+="7zip server_standalone" YACReaderLibraryServer.pro && \ + qmake6 PREFIX=/app CONFIG+="7zip server_standalone" YACReaderLibraryServer.pro && \ make && \ make install @@ -72,7 +71,7 @@ RUN echo "Building and installing 7z.so with RAR support..." && \ make -f makefile.gcc && \ mkdir -p /app/lib/7zip && \ cp ./_o/7z.so /app/lib/7zip - + FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble # env variables @@ -82,19 +81,15 @@ LABEL maintainer="luisangelsm" # Copy the built application from the builder stage COPY --from=builder /app /app - + # runtime packages RUN apt-get update && \ apt-get install -y --no-install-recommends \ - libqt5core5a \ - libqt5network5 \ - libqt5script5 \ - libqt5sql5-sqlite \ - libqt5sql5 \ - libqt5svg5 \ - libsqlite3-0 \ - libpoppler-qt5-1 \ - qt5-image-formats-plugins && \ + libqt6core5compat6 \ + libpoppler-qt6-3t64 \ + qt6-image-formats-plugins \ + libqt6network6t64 \ + libqt6sql6-sqlite && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*