Drop Qt 5 support

Qt 6 has been available for almost 4 years. Qt 5 is no longer officially supported by Qt for opensource, it's time to drop Qt 5.
This commit is contained in:
Jonas Kvinge
2024-09-07 00:12:56 +02:00
parent eb30c654c5
commit e3e6a22172
91 changed files with 76 additions and 760 deletions

View File

@@ -63,21 +63,12 @@ void FavoriteWidget::paintEvent(QPaintEvent *e) {
QStylePainter p(this);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
if (favorite_) {
p.drawPixmap(rect_, on_.pixmap(rect_.size(), devicePixelRatioF()));
}
else {
p.drawPixmap(rect_, off_.pixmap(rect_.size(), devicePixelRatioF()));
}
#else
if (favorite_) {
p.drawPixmap(rect_, on_.pixmap(rect_.size()));
}
else {
p.drawPixmap(rect_, off_.pixmap(rect_.size()));
}
#endif
}

View File

@@ -245,12 +245,7 @@ void FileView::Delete(const QStringList &filenames) {
if (DeleteConfirmationDialog::warning(filenames) != QDialogButtonBox::Yes) return;
bool use_trash = false;
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
use_trash = true;
#endif
DeleteFiles *delete_files = new DeleteFiles(task_manager_, storage_, use_trash);
DeleteFiles *delete_files = new DeleteFiles(task_manager_, storage_, true);
QObject::connect(delete_files, &DeleteFiles::Finished, this, &FileView::DeleteFinished);
delete_files->Start(filenames);

View File

@@ -242,11 +242,7 @@ void GroupedIconView::paintEvent(QPaintEvent *e) {
// This code was adapted from QListView::paintEvent(), changed to use the visualRect() of items, and to draw headers.
QStyleOptionViewItem option;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
initViewItemOption(&option);
#else
option = viewOptions();
#endif
if (isWrapping()) {
option.features = QStyleOptionViewItem::WrapText;
}

View File

@@ -71,11 +71,7 @@ void TrackSliderSlider::mousePressEvent(QMouseEvent *e) {
}
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QMouseEvent new_event(e->type(), e->pos(), e->globalPosition(), new_button, new_button, e->modifiers());
#else
QMouseEvent new_event(e->type(), e->pos(), e->globalPos(), new_button, new_button, e->modifiers());
#endif
QSlider::mousePressEvent(&new_event);
if (new_event.isAccepted()) {
@@ -137,11 +133,7 @@ void TrackSliderSlider::wheelEvent(QWheelEvent *e) {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void TrackSliderSlider::enterEvent(QEnterEvent *e) {
#else
void TrackSliderSlider::enterEvent(QEvent *e) {
#endif
QSlider::enterEvent(e);
#ifndef Q_OS_MACOS

View File

@@ -54,11 +54,7 @@ class TrackSliderSlider : public QSlider {
void mouseReleaseEvent(QMouseEvent *e) override;
void mouseMoveEvent(QMouseEvent *e) override;
void wheelEvent(QWheelEvent *e) override;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void enterEvent(QEnterEvent *e) override;
#else
void enterEvent(QEvent *e) override;
#endif
void leaveEvent(QEvent *e) override;
void keyPressEvent(QKeyEvent *event) override;

View File

@@ -40,11 +40,7 @@
#include <QAction>
#include <QLinearGradient>
#include <QStyleOptionViewItem>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
# include <QEnterEvent>
#else
# include <QEvent>
#endif
#include <QEnterEvent>
#include <QPaintEvent>
#include <QContextMenuEvent>
#include <QMouseEvent>
@@ -233,11 +229,7 @@ void VolumeSlider::drawVolumeSliderHandle() {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void VolumeSlider::enterEvent(QEnterEvent*) {
#else
void VolumeSlider::enterEvent(QEvent*) {
#endif
anim_enter_ = true;
anim_count_ = 0;

View File

@@ -32,15 +32,12 @@
#include "sliderslider.h"
class QTimer;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class QEnterEvent;
#else
class QEvent;
#endif
class QPaintEvent;
class QMouseEvent;
class QWheelEvent;
class QContextMenuEvent;
class QEvent;
class VolumeSlider : public SliderSlider {
Q_OBJECT
@@ -51,11 +48,7 @@ class VolumeSlider : public SliderSlider {
void HandleWheel(const int delta);
protected:
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void enterEvent(QEnterEvent*) override;
#else
void enterEvent(QEvent*) override;
#endif
void leaveEvent(QEvent*) override;
void paintEvent(QPaintEvent*) override;
virtual void paletteChange(const QPalette&);