Qt: Remove version check macros

Not needed anymore since we require Qt6 on all platforms.
This commit is contained in:
Connor McLaughlin 2022-03-04 18:02:24 +10:00 committed by refractionpcsx2
parent 565189d08c
commit 5c5c7d64a8
4 changed files with 3 additions and 25 deletions

View File

@ -49,12 +49,7 @@ DisplayWidget::~DisplayWidget() = default;
qreal DisplayWidget::devicePixelRatioFromScreen() const
{
QScreen* screen_for_ratio;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
screen_for_ratio = windowHandle()->screen();
#else
screen_for_ratio = screen();
#endif
const QScreen* screen_for_ratio = screen();
if (!screen_for_ratio)
screen_for_ratio = QGuiApplication::primaryScreen();

View File

@ -184,13 +184,9 @@ static bool ParseCommandLineOptions(int argc, char* argv[], std::shared_ptr<VMBo
int main(int argc, char* argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
#endif
QApplication app(argc, argv);
std::shared_ptr<VMBootParameters> autoboot;

View File

@ -20,11 +20,7 @@
#include <QtGui/QDesktopServices>
#include <QtGui/QKeyEvent>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtGui/QAction>
#else
#include <QtWidgets/QAction>
#endif
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>

View File

@ -14,16 +14,12 @@
*/
#pragma once
#include <QtCore/QtCore>
#include <optional>
#include <type_traits>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#include <QtCore/QtCore>
#include <QtGui/QAction>
#else
#include <QtWidgets/QAction>
#endif
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDoubleSpinBox>
@ -152,13 +148,8 @@ namespace SettingWidgetBinder
static QString getStringValue(const QComboBox* widget)
{
const QVariant currentData(widget->currentData());
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (currentData.type() == QVariant::String)
return currentData.toString();
#else
if (currentData.metaType().id() == QMetaType::QString)
return currentData.toString();
#endif
return widget->currentText();
}