Remove outdated version checks

Change-Id: I972a7fe0842a0310ba5df1233a4f417627dad87c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Robert Löhning
2022-09-08 21:12:30 +02:00
parent ffe71ddba6
commit 11ea9fde23
10 changed files with 1 additions and 37 deletions

View File

@@ -55,11 +55,7 @@ inline void load(Archive &archive, QList<T *> &list, const Parameters &parameter
//archive >> ref<QList<T *>, T * const &>("item", list, &QList<T *>::append); //archive >> ref<QList<T *>, T * const &>("item", list, &QList<T *>::append);
archive >> ref("item", list, &QList<T *>::append); archive >> ref("item", list, &QList<T *>::append);
} else { } else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
using ParameterType = typename QList<T *>::parameter_type; using ParameterType = typename QList<T *>::parameter_type;
#else
using ParameterType = T * const &;
#endif
void (QList<T *>::*appendMethod)(ParameterType) = &QList<T *>::append; void (QList<T *>::*appendMethod)(ParameterType) = &QList<T *>::append;
archive >> attr("item", list, appendMethod); archive >> attr("item", list, appendMethod);
} }

View File

@@ -911,11 +911,7 @@ void PreviewDialog::setPixmap(const QPixmap &p, int zoom)
m_label->adjustSize(); m_label->adjustSize();
m_zoom = zoom; m_zoom = zoom;
m_label->setZoom(m_zoom); m_label->setZoom(m_zoom);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QSize size = m_label->pixmap().size() + QSize(54, 44); QSize size = m_label->pixmap().size() + QSize(54, 44);
#else
QSize size = m_label->pixmap()->size() + QSize(54, 44);
#endif
if (size.width() < 180) if (size.width() < 180)
size.setWidth(180); size.setWidth(180);
resize(size); resize(size);

View File

@@ -14,11 +14,7 @@
#include <QtCore/QScopedValueRollback> #include <QtCore/QScopedValueRollback>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
Q_CORE_EXPORT double qstrntod(const char *s00, int len, char const **se, bool *ok);
#else
Q_CORE_EXPORT double qstrntod(const char *s00, qsizetype len, char const **se, bool *ok); Q_CORE_EXPORT double qstrntod(const char *s00, qsizetype len, char const **se, bool *ok);
#endif
QT_END_NAMESPACE QT_END_NAMESPACE
using namespace QmlJS; using namespace QmlJS;

View File

@@ -466,7 +466,7 @@ TimelineItemsMaterial::TimelineItemsMaterial() : m_selectedItem(-1)
setFlag(QSGMaterial::Blending, false); setFlag(QSGMaterial::Blending, false);
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0) #if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
setFlag(QSGMaterial::NoBatching, true); setFlag(QSGMaterial::NoBatching, true);
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #else
setFlag(QSGMaterial::CustomCompileStep, true); setFlag(QSGMaterial::CustomCompileStep, true);
#endif // >= Qt 6.3/6.0 #endif // >= Qt 6.3/6.0
} }

View File

@@ -33,9 +33,6 @@ GradientPresetCustomListModel::GradientPresetCustomListModel(QObject *parent)
: GradientPresetListModel(parent) : GradientPresetListModel(parent)
, m_filename(getFilename()) , m_filename(getFilename())
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<GradientPresetItem>("GradientPresetItem");
#endif
readPresets(); readPresets();
} }

View File

@@ -56,14 +56,10 @@ void Quick2PropertyEditorView::registerQmlTypes()
const QString resourcePath = PropertyEditorQmlBackend::propertyEditorResourcesPath(); const QString resourcePath = PropertyEditorQmlBackend::propertyEditorResourcesPath();
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QUrl regExpUrl = QUrl::fromLocalFile(resourcePath + "/RegExpValidator.qml"); QUrl regExpUrl = QUrl::fromLocalFile(resourcePath + "/RegExpValidator.qml");
qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator"); qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator");
const QString qtPrefix = "/Qt6"; const QString qtPrefix = "/Qt6";
#else
const QString qtPrefix = "/Qt5";
#endif
qmlRegisterType(QUrl::fromLocalFile(resourcePath + qtPrefix + "HelperWindow.qml"), qmlRegisterType(QUrl::fromLocalFile(resourcePath + qtPrefix + "HelperWindow.qml"),
"HelperWidgets", "HelperWidgets",
2, 2,

View File

@@ -45,10 +45,6 @@ void EasingCurve::registerStreamOperators()
{ {
qRegisterMetaType<QmlDesigner::EasingCurve>("QmlDesigner::EasingCurve"); qRegisterMetaType<QmlDesigner::EasingCurve>("QmlDesigner::EasingCurve");
qRegisterMetaType<QmlDesigner::NamedEasingCurve>("QmlDesigner::NamedEasingCurve"); qRegisterMetaType<QmlDesigner::NamedEasingCurve>("QmlDesigner::NamedEasingCurve");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qRegisterMetaTypeStreamOperators<QmlDesigner::EasingCurve>("QmlDesigner::EasingCurve");
qRegisterMetaTypeStreamOperators<QmlDesigner::NamedEasingCurve>("QmlDesigner::NamedEasingCurve");
#endif
} }
int EasingCurve::count() const int EasingCurve::count() const

View File

@@ -49,11 +49,7 @@ static int resolveFont(const QString &fontFile, QFont &outFont)
outFont.setFamily(fontFamily); outFont.setFamily(fontFamily);
outFont.setStyle(rawFont.style()); outFont.setStyle(rawFont.style());
outFont.setStyleName(rawFont.styleName()); outFont.setStyleName(rawFont.styleName());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
outFont.setWeight(QFont::Weight(rawFont.weight())); outFont.setWeight(QFont::Weight(rawFont.weight()));
#else
outFont.setWeight(rawFont.weight());
#endif
} }
} }
} }

View File

@@ -471,12 +471,7 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
environment.set("QML_PUPPET_MODE", "true"); environment.set("QML_PUPPET_MODE", "true");
environment.set("QML_DISABLE_DISK_CACHE", "true"); environment.set("QML_DISABLE_DISK_CACHE", "true");
environment.set("QMLPUPPET_RENDER_EFFECTS", "true"); environment.set("QMLPUPPET_RENDER_EFFECTS", "true");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (!environment.hasKey("QT_SCREEN_SCALE_FACTORS") && !environment.hasKey("QT_SCALE_FACTOR")
&& QApplication::testAttribute(Qt::AA_EnableHighDpiScaling))
#else
if (!environment.hasKey("QT_SCREEN_SCALE_FACTORS") && !environment.hasKey("QT_SCALE_FACTOR")) if (!environment.hasKey("QT_SCREEN_SCALE_FACTORS") && !environment.hasKey("QT_SCALE_FACTOR"))
#endif
environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1"); environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
#ifndef QMLDESIGNER_TEST #ifndef QMLDESIGNER_TEST

View File

@@ -76,11 +76,7 @@ bool CMakeGeneratorDialogTreeModel::setData(const QModelIndex &index, const QVar
const QList<CheckableFileTreeItem*> CMakeGeneratorDialogTreeModel::items() const const QList<CheckableFileTreeItem*> CMakeGeneratorDialogTreeModel::items() const
{ {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QList<QStandardItem*> standardItems = findItems("*", Qt::MatchWildcard | Qt::MatchRecursive);
#else
QList<QStandardItem*> standardItems = findItems(".*", Qt::MatchRegularExpression | Qt::MatchRecursive); QList<QStandardItem*> standardItems = findItems(".*", Qt::MatchRegularExpression | Qt::MatchRecursive);
#endif
QList<CheckableFileTreeItem*> checkableItems; QList<CheckableFileTreeItem*> checkableItems;
for (QStandardItem *item : standardItems) for (QStandardItem *item : standardItems)
checkableItems.append(static_cast<CheckableFileTreeItem*>(item)); checkableItems.append(static_cast<CheckableFileTreeItem*>(item));