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

@@ -464,11 +464,8 @@ void OSDPretty::Reposition() {
}
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
void OSDPretty::enterEvent(QEnterEvent*) {
#else
void OSDPretty::enterEvent(QEvent*) {
#endif
if (mode_ == Mode::Popup) {
setWindowOpacity(0.25);
}
@@ -486,11 +483,7 @@ void OSDPretty::mousePressEvent(QMouseEvent *e) {
}
else {
original_window_pos_ = pos();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
drag_start_pos_ = e->globalPosition().toPoint();
#else
drag_start_pos_ = e->globalPos();
#endif
}
}
@@ -498,19 +491,11 @@ void OSDPretty::mousePressEvent(QMouseEvent *e) {
void OSDPretty::mouseMoveEvent(QMouseEvent *e) {
if (mode_ == Mode::Draggable) {
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QPoint delta = e->globalPosition().toPoint() - drag_start_pos_;
#else
QPoint delta = e->globalPos() - drag_start_pos_;
#endif
QPoint new_pos = original_window_pos_ + delta;
// Keep it to the bounds of the desktop
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
QScreen *screen = current_screen(e->globalPosition().toPoint());
#else
QScreen *screen = current_screen(e->globalPos());
#endif
if (!screen) return;
QRect geometry = screen->availableGeometry();