Drop Qt 5 support

This commit is contained in:
luisangelsm
2026-02-20 21:48:15 +01:00
parent 9e0974be12
commit 7218d0dc87
27 changed files with 56 additions and 285 deletions

View File

@ -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` | Ubuntu x64 Qt6 installs `libqt6core5compat6-dev` (build) and `libqt6core5compat6` (runtime) |
| `docker/Dockerfile.aarch64` | Ubuntu ARM64 Qt5-only build | | `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.
--- ---

View File

@ -45,16 +45,13 @@ macx {
CONFIG += objective_c CONFIG += objective_c
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
lessThan(QT_MAJOR_VERSION, 6): QT += macextras
} }
QT += network widgets core multimedia svg 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) { greaterThan(QT_MINOR_VERSION, 6): QT += gui-private
QT += gui-private
}
#CONFIG += release #CONFIG += release
CONFIG -= flat CONFIG -= flat

View File

@ -99,9 +99,7 @@ int main(int argc, char *argv[])
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QImageReader::setAllocationLimit(0); QImageReader::setAllocationLimit(0);
#endif
#if defined(_MSC_VER) && defined(_DEBUG) #if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
@ -131,16 +129,10 @@ int main(int argc, char *argv[])
QCommandLineOption comicId("comicId", "", "comicId"); QCommandLineOption comicId("comicId", "", "comicId");
QCommandLineOption libraryId("libraryId", "", "libraryId"); QCommandLineOption libraryId("libraryId", "", "libraryId");
QCommandLineOption readingListId("readingListId", "", "readingListId"); QCommandLineOption readingListId("readingListId", "", "readingListId");
// hide comicId and libraryId from help // hide comicId and libraryId from help
#if QT_VERSION >= 0x050800
comicId.setFlags(QCommandLineOption::HiddenFromHelp); comicId.setFlags(QCommandLineOption::HiddenFromHelp);
libraryId.setFlags(QCommandLineOption::HiddenFromHelp); libraryId.setFlags(QCommandLineOption::HiddenFromHelp);
readingListId.setFlags(QCommandLineOption::HiddenFromHelp); readingListId.setFlags(QCommandLineOption::HiddenFromHelp);
#else
comicId.setHidden(true);
libraryId.setHidden(true);
readingListId.setHidden(true);
#endif
// process // process
parser.addOption(comicId); parser.addOption(comicId);

View File

@ -480,9 +480,7 @@ void MainWindowViewer::createToolBars()
{ {
#ifdef Y_MAC_UI #ifdef Y_MAC_UI
comicToolBar = new YACReaderMacOSXToolbar(this); comicToolBar = new YACReaderMacOSXToolbar(this);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
comicToolBar->setIconSize(QSize(18, 18)); comicToolBar->setIconSize(QSize(18, 18));
#endif
#else #else
comicToolBar = addToolBar(tr("&File")); comicToolBar = addToolBar(tr("&File"));
#endif #endif
@ -1354,7 +1352,7 @@ void MainWindowViewer::toggleFitToWidthSlider()
if (zoomSliderAction->isVisible()) { if (zoomSliderAction->isVisible()) {
zoomSliderAction->hide(); zoomSliderAction->hide();
} else { } 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); zoomSliderAction->move((this->width() - zoomSliderAction->width()) / 2, y);
#else #else
zoomSliderAction->move(250, y); zoomSliderAction->move(250, y);

View File

@ -19,11 +19,7 @@ void YACReader::MouseHandler::mousePressEvent(QMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) { if (event->button() == Qt::LeftButton) {
viewer->drag = true; viewer->drag = true;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto position = event->position(); auto position = event->position();
#else
auto position = QPointF(event->x(), event->y());
#endif
dragOrigin = dragLatestPosition = position; dragOrigin = dragLatestPosition = position;
viewer->setCursor(Qt::ClosedHandCursor); viewer->setCursor(Qt::ClosedHandCursor);
event->accept(); event->accept();
@ -53,11 +49,7 @@ void YACReader::MouseHandler::mouseReleaseEvent(QMouseEvent *event)
event->accept(); event->accept();
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto position = event->position(); auto position = event->position();
#else
auto position = QPointF(event->x(), event->y());
#endif
auto dragDistance = QLineF(position, dragOrigin).length(); auto dragDistance = QLineF(position, dragOrigin).length();
auto mouseMode = Configuration::getConfiguration().getMouseMode(); auto mouseMode = Configuration::getConfiguration().getMouseMode();
@ -104,11 +96,7 @@ void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event)
viewer->showCursor(); viewer->showCursor();
viewer->hideCursorTimer->start(2500); viewer->hideCursorTimer->start(2500);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto position = event->position(); auto position = event->position();
#else
auto position = QPointF(event->x(), event->y());
#endif
if (viewer->magnifyingGlassShown) if (viewer->magnifyingGlassShown)
viewer->mglass->move(static_cast<int>(position.x() - float(viewer->mglass->width()) / 2), static_cast<int>(position.y() - float(viewer->mglass->height()) / 2)); viewer->mglass->move(static_cast<int>(position.x() - float(viewer->mglass->width()) / 2), static_cast<int>(position.y() - float(viewer->mglass->height()) / 2));

View File

@ -1,11 +1,6 @@
#include <QUrl> #include <QUrl>
#if QT_VERSION >= 0x050000
#include <QMediaPlayer> #include <QMediaPlayer>
#else
#include <Phonon/MediaObject>
#include <Phonon/MediaSource>
#endif
#include <QPushButton> #include <QPushButton>
#include <QPalette> #include <QPalette>
@ -160,12 +155,7 @@ YACReaderTranslator::YACReaderTranslator(Viewer *parent)
connect(speakButton, &QAbstractButton::pressed, this, &YACReaderTranslator::play); connect(speakButton, &QAbstractButton::pressed, this, &YACReaderTranslator::play);
connect(clearButton, &QAbstractButton::pressed, this, &YACReaderTranslator::clear); connect(clearButton, &QAbstractButton::pressed, this, &YACReaderTranslator::clear);
// multimedia/phonon
#if QT_VERSION >= 0x050000
player = new QMediaPlayer; player = new QMediaPlayer;
#else
music = createPlayer(MusicCategory);
#endif
} }
void YACReaderTranslator::hideResults() void YACReaderTranslator::hideResults()
@ -288,11 +278,7 @@ void YACReaderTranslator::populateCombos()
void YACReaderTranslator::play() void YACReaderTranslator::play()
{ {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
player->setSource(ttsSource); player->setSource(ttsSource);
#else
player->setMedia(ttsSource);
#endif
player->play(); player->play();
} }

View File

@ -759,11 +759,7 @@ void Viewer::resizeEvent(QResizeEvent *event)
QPixmap Viewer::pixmap() const QPixmap Viewer::pixmap() const
{ {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return content->pixmap(); return content->pixmap();
#else
return content->pixmap(Qt::ReturnByValue);
#endif
} }
void Viewer::magnifyingGlassSwitch() void Viewer::magnifyingGlassSwitch()

View File

@ -41,18 +41,15 @@ macx {
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
CONFIG += objective_c CONFIG += objective_c
QT += gui-private QT += gui-private
lessThan(QT_MAJOR_VERSION, 6): QT += macextras
} }
#CONFIG += release #CONFIG += release
CONFIG -= flat CONFIG -= flat
QT += sql network widgets svg quickcontrols2 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) { greaterThan(QT_MINOR_VERSION, 6): QT += gui-private
QT += gui-private
}
# Input # Input
HEADERS += \ HEADERS += \

View File

@ -146,22 +146,14 @@ void ComicVineDialog::goNext()
QList<QPair<ComicDB, QString>> matchingInfo = sortVolumeComicsWidget->getMatchingInfo(); QList<QPair<ComicDB, QString>> matchingInfo = sortVolumeComicsWidget->getMatchingInfo();
auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo(); auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(&ComicVineDialog::getComicsInfo, this, matchingInfo, volumeInfo); QtConcurrent::run(&ComicVineDialog::getComicsInfo, this, matchingInfo, volumeInfo);
#else
QtConcurrent::run(this, &ComicVineDialog::getComicsInfo, matchingInfo, volumeInfo);
#endif
} else if (content->currentWidget() == selectComicWidget) { } else if (content->currentWidget() == selectComicWidget) {
showLoading(); showLoading();
QString comicId = selectComicWidget->getSelectedComicId(); QString comicId = selectComicWidget->getSelectedComicId();
auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo(); auto volumeInfo = selectVolumeWidget->getSelectedVolumeInfo();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QtConcurrent::run(&ComicVineDialog::getComicInfo, this, comicId, volumeInfo); QtConcurrent::run(&ComicVineDialog::getComicInfo, this, comicId, volumeInfo);
#else
QtConcurrent::run(this, &ComicVineDialog::getComicInfo, comicId, volumeInfo);
#endif
} }
} }

View File

@ -6,25 +6,13 @@ ScraperTableView::ScraperTableView(QWidget *parent)
: QTableView(parent) : QTableView(parent)
{ {
setShowGrid(false); setShowGrid(false);
#if QT_VERSION >= 0x050000
verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
#else
verticalHeader()->setResizeMode(QHeaderView::Fixed);
#endif
horizontalHeader()->setStretchLastSection(true); horizontalHeader()->setStretchLastSection(true);
#if QT_VERSION >= 0x050000
horizontalHeader()->setSectionsClickable(false); horizontalHeader()->setSectionsClickable(false);
#else
horizontalHeader()->setClickable(false);
#endif
// comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); // comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
verticalHeader()->setDefaultSectionSize(24); verticalHeader()->setDefaultSectionSize(24);
#if QT_VERSION >= 0x050000
verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo
#else
verticalHeader()->setClickable(false); // TODO comportamiento anómalo
#endif
setCornerButtonEnabled(false); setCornerButtonEnabled(false);

View File

@ -41,12 +41,7 @@ void InitialComicInfoExtractor::extract()
return; return;
} }
#else #else
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto pdfComic = Poppler::Document::load(_fileSource); auto pdfComic = Poppler::Document::load(_fileSource);
#else
auto _pdfComic = Poppler::Document::load(_fileSource);
auto pdfComic = std::unique_ptr<Poppler::Document>(_pdfComic);
#endif
#endif #endif
if (!pdfComic) { if (!pdfComic) {
QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource; QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource;

View File

@ -169,13 +169,11 @@ bool LibraryWindow::eventFilter(QObject *object, QEvent *event)
return QMainWindow::eventFilter(object, event); return QMainWindow::eventFilter(object, event);
} }
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto keyCombination = keySequence[0]; auto keyCombination = keySequence[0];
if (keyCombination.keyboardModifiers() != Qt::NoModifier) { if (keyCombination.keyboardModifiers() != Qt::NoModifier) {
return QMainWindow::eventFilter(object, event); return QMainWindow::eventFilter(object, event);
} }
#endif
auto string = keySequence.toString(); auto string = keySequence.toString();
@ -774,11 +772,7 @@ void LibraryWindow::createConnections()
// Search filter // Search filter
#ifdef Y_MAC_UI #ifdef Y_MAC_UI
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
connect(libraryToolBar, &YACReaderMacOSXToolbar::filterChanged, searchDebouncer, &KDToolBox::KDStringSignalDebouncer::throttle); 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) { connect(searchDebouncer, &KDToolBox::KDStringSignalDebouncer::triggered, this, [=](QString filter) {
setSearchFilter(filter); setSearchFilter(filter);
}); });

View File

@ -131,9 +131,7 @@ int main(int argc, char **argv)
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QImageReader::setAllocationLimit(0); QImageReader::setAllocationLimit(0);
#endif
QApplication app(argc, argv); QApplication app(argc, argv);

View File

@ -1,8 +1,6 @@
#include <QtGlobal> #include <QtGlobal>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#undef __OBJC_BOOL_IS_BOOL #undef __OBJC_BOOL_IS_BOOL
#endif
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#include "trayhandler.h" #include "trayhandler.h"

View File

@ -17,7 +17,7 @@ include(headless_config.pri)
include(../dependencies/pdf_backend.pri) include(../dependencies/pdf_backend.pri)
include(../third_party/QrCode/QrCode.pri) include(../third_party/QrCode/QrCode.pri)
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat QT += core5compat
win32 { win32 {
LIBS += -loleaut32 -lole32 -lshell32 -luser32 LIBS += -loleaut32 -lole32 -lshell32 -luser32
@ -37,8 +37,6 @@ macx {
CONFIG -= flat CONFIG -= flat
QT += core sql network QT += core sql network
greaterThan(QT_MAJOR_VERSION, 5): QT += core5compat
# Source files # Source files
HEADERS += ../YACReaderLibrary/library_creator.h \ HEADERS += ../YACReaderLibrary/library_creator.h \
../YACReaderLibrary/package_manager.h \ ../YACReaderLibrary/package_manager.h \

View File

@ -50,9 +50,7 @@ int main(int argc, char **argv)
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QImageReader::setAllocationLimit(0); QImageReader::setAllocationLimit(0);
#endif
app.setApplicationName("YACReaderLibrary"); app.setApplicationName("YACReaderLibrary");
app.setOrganizationName("YACReader"); app.setOrganizationName("YACReader");

View File

@ -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`.

View File

@ -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."

View File

@ -40,7 +40,7 @@ mkdir -p "$COMPRESSED_ARCHIVE_DIR"
# Step 2: Install required packages # Step 2: Install required packages
echo "Updating package list and installing required packages..." echo "Updating package list and installing required packages..."
sudo apt-get update 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 # Step 3: Download YACReader source code
if [ "$1" == "develop" ]; then if [ "$1" == "develop" ]; then

View File

@ -809,12 +809,7 @@ void PDFComic::process()
} }
#else #else
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
pdfComic = Poppler::Document::load(_path); pdfComic = Poppler::Document::load(_path);
#else
auto _pdfComic = Poppler::Document::load(_path);
pdfComic = std::unique_ptr<Poppler::Document>(_pdfComic);
#endif
if (!pdfComic) { if (!pdfComic) {
moveToThread(QCoreApplication::instance()->thread()); moveToThread(QCoreApplication::instance()->thread());

View File

@ -46,10 +46,6 @@ private:
QFile pdfFile; QFile pdfFile;
}; };
#else #else
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <poppler-qt6.h> #include <poppler-qt6.h>
#else
#include "poppler-qt5.h"
#endif // QT_VERSION
#endif // Q_OS_MACOS #endif // Q_OS_MACOS
#endif // PDF_COMIC_H #endif // PDF_COMIC_H

View File

@ -1,8 +1,6 @@
#include "pdf_comic.h" #include "pdf_comic.h"
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#undef __OBJC_BOOL_IS_BOOL #undef __OBJC_BOOL_IS_BOOL
#endif
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>

View File

@ -38,8 +38,8 @@ defineTest(minQtVersion) {
return(false) return(false)
} }
!minQtVersion(5, 15, 0) { !minQtVersion(6, 0, 0) {
error(YACReader requires Qt 5.15 or newer but $$[QT_VERSION] was detected) error(YACReader requires Qt 6.0 or newer but $$[QT_VERSION] was detected)
} }
# reduce log pollution # reduce log pollution

View File

@ -11,10 +11,6 @@
#include <QTextStream> #include <QTextStream>
#include <QScreen> #include <QScreen>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QTextCodec>
#endif
#include "yacreader_global.h" #include "yacreader_global.h"
HelpAboutDialog::HelpAboutDialog(QWidget *parent) HelpAboutDialog::HelpAboutDialog(QWidget *parent)
@ -85,11 +81,7 @@ QString HelpAboutDialog::fileToString(const QString &path)
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
QTextStream txtS(&f); QTextStream txtS(&f);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
txtS.setEncoding(QStringConverter::Utf8); txtS.setEncoding(QStringConverter::Utf8);
#else
txtS.setCodec(QTextCodec::codecForName("UTF-8"));
#endif
QString content = txtS.readAll(); QString content = txtS.readAll();
f.close(); f.close();

View File

@ -26,26 +26,14 @@ YACReaderTableView::YACReaderTableView(QWidget *parent)
setContextMenuPolicy(Qt::ActionsContextMenu); setContextMenuPolicy(Qt::ActionsContextMenu);
setShowGrid(false); setShowGrid(false);
#if QT_VERSION >= 0x050000
verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
#else
verticalHeader()->setResizeMode(QHeaderView::Fixed);
#endif
// comicView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); // comicView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
horizontalHeader()->setStretchLastSection(true); horizontalHeader()->setStretchLastSection(true);
#if QT_VERSION >= 0x050000
horizontalHeader()->setSectionsClickable(false); horizontalHeader()->setSectionsClickable(false);
#else
horizontalHeader()->setClickable(false);
#endif
// comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); // comicView->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
verticalHeader()->setDefaultSectionSize(24); verticalHeader()->setDefaultSectionSize(24);
#if QT_VERSION >= 0x050000
verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo verticalHeader()->setSectionsClickable(false); // TODO comportamiento anómalo
#else
verticalHeader()->setClickable(false); // TODO comportamiento anómalo
#endif
setCornerButtonEnabled(false); setCornerButtonEnabled(false);

View File

@ -49,38 +49,24 @@ CONFIG(poppler) {
contains(QMAKE_TARGET.arch, x86_64): { contains(QMAKE_TARGET.arch, x86_64): {
error ("We currently don't ship precompiled poppler libraries for 64 bit builds on Windows") error ("We currently don't ship precompiled poppler libraries for 64 bit builds on Windows")
} }
INCLUDEPATH += $$PWD/poppler/include/qt5 INCLUDEPATH += $$PWD/poppler/include/qt6
LIBS += -L$$PWD/poppler/lib -lpoppler-qt5 LIBS += -L$$PWD/poppler/lib -lpoppler-qt6
# Add extra paths for dll dependencies so the executables don't crash when launching # Add extra paths for dll dependencies so the executables don't crash when launching
# from QtCreator # from QtCreator
LIBS += -L$$PWD/poppler/bin LIBS += -L$$PWD/poppler/bin
LIBS += -L$$PWD/poppler/dependencies/bin LIBS += -L$$PWD/poppler/dependencies/bin
} }
if(unix|mingw):!macx { if(unix|mingw):!macx {
greaterThan (QT_MAJOR_VERSION, 5) { !contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt6) {
!contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt6) { message("Using system provided installation of poppler-qt6 found by pkg-config.")
message("Using system provided installation of poppler-qt6 found by pkg-config.") CONFIG += link_pkgconfig
CONFIG += link_pkgconfig PKGCONFIG += poppler-qt6
PKGCONFIG += poppler-qt6 } else:!macx:exists(/usr/include/poppler/qt6) {
} else:!macx:exists(/usr/include/poppler/qt6) { message("Using system provided installation of poppler-qt6.")
message("Using system provided installation of poppler-qt6.") INCLUDEPATH += /usr/include/poppler/qt6
INCLUDEPATH += /usr/include/poppler/qt6 LIBS += -lpoppler-qt6
LIBS += -lpoppler-qt6
} else {
error("Could not find poppler-qt6")
}
} else { } else {
!contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt5) { error("Could not find poppler-qt6")
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")
}
} }
} }
unix:macx { unix:macx {

View File

@ -17,37 +17,36 @@ RUN \
desktop-file-utils \ desktop-file-utils \
g++ \ g++ \
git \ git \
libglu1-mesa-dev \ qt6-tools-dev \
libpoppler-qt5-dev \ qt6-base-dev-tools \
libpoppler-qt5-1 \ qmake6 \
libqt5core5a \ qt6-base-dev \
libqt5gui5 \ qt6-multimedia-dev \
libqt5multimedia5 \ qt6-tools-dev-tools \
libqt5network5 \ qt6-l10n-tools \
libqt5opengl5-dev \ qt6-declarative-dev \
libqt5qml5 \ libqt6svg6-dev \
libqt5quickcontrols2-5 \ libqt6core5compat6-dev \
libqt5script5 \ libqt6gui6t64 \
libqt5sql5-sqlite \ libqt6multimedia6 \
libqt5sql5 \ libqt6network6t64 \
libqt5svg5-dev \ libqt6qml6 \
libqt6quickcontrols2-6 \
qt6-image-formats-plugins \
libqt6sql6 \
libqt6sql6-sqlite \
libpoppler-qt6-dev \
libsqlite3-dev \ libsqlite3-dev \
libbz2-dev \
libglu1-mesa-dev \
liblzma-dev \
make \ 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 \ sqlite3 \
unzip \ unzip \
wget && \ wget \
7zip \
7zip-rar \
zlib1g-dev && \
ldconfig ldconfig
# clone YACReader repo # clone YACReader repo
@ -62,7 +61,7 @@ RUN cd /src/git/compressed_archive && \
# build yacreaderlibraryserver # build yacreaderlibraryserver
RUN cd /src/git/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 && \
make install make install
@ -72,7 +71,7 @@ RUN echo "Building and installing 7z.so with RAR support..." && \
make -f makefile.gcc && \ make -f makefile.gcc && \
mkdir -p /app/lib/7zip && \ mkdir -p /app/lib/7zip && \
cp ./_o/7z.so /app/lib/7zip cp ./_o/7z.so /app/lib/7zip
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-noble
# env variables # env variables
@ -82,19 +81,15 @@ LABEL maintainer="luisangelsm"
# Copy the built application from the builder stage # Copy the built application from the builder stage
COPY --from=builder /app /app COPY --from=builder /app /app
# runtime packages # runtime packages
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
libqt5core5a \ libqt6core5compat6 \
libqt5network5 \ libpoppler-qt6-3t64 \
libqt5script5 \ qt6-image-formats-plugins \
libqt5sql5-sqlite \ libqt6network6t64 \
libqt5sql5 \ libqt6sql6-sqlite && \
libqt5svg5 \
libsqlite3-0 \
libpoppler-qt5-1 \
qt5-image-formats-plugins && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*