summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2023-04-19 12:48:20 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2023-04-25 10:39:05 -0700
commit258cf0ff289edb7960cf78b35417fa9c5fa4ecf7 (patch)
tree61ed8dc71b021ff1af5490b628d67add7c2fe4fe /Source
parentce9413e5494b7025a2f73f54f7438a756fcecf82 (diff)
DolphinQt: assume QT_VERSION_CHECK >= 6.0.0
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp14
-rw-r--r--Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h4
-rw-r--r--Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp4
-rw-r--r--Source/Core/DolphinQt/GBAWidget.cpp7
4 files changed, 2 insertions, 27 deletions
diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp b/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp
index 7f5516bbd2..ccec65c374 100644
--- a/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp
+++ b/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp
@@ -16,12 +16,7 @@
#include <QPushButton>
#include <QStyle>
-#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
#include <QScreen>
-#else
-#include <QApplication>
-#include <QDesktopWidget>
-#endif
#if defined(__APPLE__)
#include <QToolTip>
@@ -105,11 +100,7 @@ BalloonTip::BalloonTip(PrivateTag, const QIcon& icon, QString title, QString mes
message_label->setTextFormat(Qt::RichText);
message_label->setAlignment(Qt::AlignTop | Qt::AlignLeft);
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- const int limit = QApplication::desktop()->availableGeometry(message_label).width() / 3;
-#else
const int limit = message_label->screen()->availableGeometry().width() / 3;
-#endif
message_label->setMaximumWidth(limit);
message_label->setSizePolicy(QSizePolicy::Policy::MinimumExpanding,
QSizePolicy::Policy::MinimumExpanding);
@@ -136,14 +127,11 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& pos, ShowArrow show_arrow)
{
m_show_arrow = show_arrow == ShowArrow::Yes;
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- const QRect screen_rect = QApplication::desktop()->screenGeometry(pos);
-#else
QScreen* screen = QGuiApplication::screenAt(pos);
if (!screen)
screen = QGuiApplication::primaryScreen();
const QRect screen_rect = screen->geometry();
-#endif
+
QSize sh = sizeHint();
// The look should resemble the default tooltip style set in Settings::SetCurrentUserStyle()
const int border = 1;
diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h
index 6e3658e8bb..1f7c574345 100644
--- a/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h
+++ b/Source/Core/DolphinQt/Config/ToolTipControls/ToolTipWidget.h
@@ -22,11 +22,7 @@ public:
void SetDescription(QString description) { m_description = std::move(description); }
private:
-#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
- void enterEvent(QEvent* event) override
-#else
void enterEvent(QEnterEvent* event) override
-#endif
{
if (m_timer_id)
return;
diff --git a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
index 41b406536b..80a4cdd7f4 100644
--- a/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/MemoryViewWidget.cpp
@@ -212,11 +212,7 @@ void MemoryViewWidget::UpdateFont()
// BoundingRect is too unpredictable, a custom one would be needed for each view type. Different
// fonts have wildly different spacing between two characters and horizontalAdvance includes
// spacing.
-#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
m_font_width = fm.horizontalAdvance(QLatin1Char('0'));
-#else
- m_font_width = fm.width(QLatin1Char('0'));
-#endif
m_table->setFont(Settings::Instance().GetDebugFont());
CreateTable();
diff --git a/Source/Core/DolphinQt/GBAWidget.cpp b/Source/Core/DolphinQt/GBAWidget.cpp
index eb868440e5..6805321df5 100644
--- a/Source/Core/DolphinQt/GBAWidget.cpp
+++ b/Source/Core/DolphinQt/GBAWidget.cpp
@@ -514,12 +514,7 @@ void GBAWidget::mouseMoveEvent(QMouseEvent* event)
{
if (!m_moving)
return;
- auto event_pos =
-#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
- event->globalPosition().toPoint();
-#else
- event->globalPos();
-#endif
+ auto event_pos = event->globalPosition().toPoint();
move(event_pos - m_move_pos - (geometry().topLeft() - pos()));
}