forked from qt-creator/qt-creator
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:
@@ -55,11 +55,7 @@ inline void load(Archive &archive, QList<T *> &list, const Parameters ¶meter
|
||||
//archive >> ref<QList<T *>, T * const &>("item", list, &QList<T *>::append);
|
||||
archive >> ref("item", list, &QList<T *>::append);
|
||||
} else {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
using ParameterType = typename QList<T *>::parameter_type;
|
||||
#else
|
||||
using ParameterType = T * const &;
|
||||
#endif
|
||||
void (QList<T *>::*appendMethod)(ParameterType) = &QList<T *>::append;
|
||||
archive >> attr("item", list, appendMethod);
|
||||
}
|
||||
|
||||
@@ -911,11 +911,7 @@ void PreviewDialog::setPixmap(const QPixmap &p, int zoom)
|
||||
m_label->adjustSize();
|
||||
m_zoom = zoom;
|
||||
m_label->setZoom(m_zoom);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QSize size = m_label->pixmap().size() + QSize(54, 44);
|
||||
#else
|
||||
QSize size = m_label->pixmap()->size() + QSize(54, 44);
|
||||
#endif
|
||||
if (size.width() < 180)
|
||||
size.setWidth(180);
|
||||
resize(size);
|
||||
|
||||
@@ -14,11 +14,7 @@
|
||||
#include <QtCore/QScopedValueRollback>
|
||||
|
||||
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);
|
||||
#endif
|
||||
QT_END_NAMESPACE
|
||||
|
||||
using namespace QmlJS;
|
||||
|
||||
@@ -466,7 +466,7 @@ TimelineItemsMaterial::TimelineItemsMaterial() : m_selectedItem(-1)
|
||||
setFlag(QSGMaterial::Blending, false);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 3, 0)
|
||||
setFlag(QSGMaterial::NoBatching, true);
|
||||
#elif QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
#else
|
||||
setFlag(QSGMaterial::CustomCompileStep, true);
|
||||
#endif // >= Qt 6.3/6.0
|
||||
}
|
||||
|
||||
@@ -33,9 +33,6 @@ GradientPresetCustomListModel::GradientPresetCustomListModel(QObject *parent)
|
||||
: GradientPresetListModel(parent)
|
||||
, m_filename(getFilename())
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
qRegisterMetaTypeStreamOperators<GradientPresetItem>("GradientPresetItem");
|
||||
#endif
|
||||
readPresets();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,14 +56,10 @@ void Quick2PropertyEditorView::registerQmlTypes()
|
||||
|
||||
const QString resourcePath = PropertyEditorQmlBackend::propertyEditorResourcesPath();
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
QUrl regExpUrl = QUrl::fromLocalFile(resourcePath + "/RegExpValidator.qml");
|
||||
qmlRegisterType(regExpUrl, "HelperWidgets", 2, 0, "RegExpValidator");
|
||||
|
||||
const QString qtPrefix = "/Qt6";
|
||||
#else
|
||||
const QString qtPrefix = "/Qt5";
|
||||
#endif
|
||||
qmlRegisterType(QUrl::fromLocalFile(resourcePath + qtPrefix + "HelperWindow.qml"),
|
||||
"HelperWidgets",
|
||||
2,
|
||||
|
||||
@@ -45,10 +45,6 @@ void EasingCurve::registerStreamOperators()
|
||||
{
|
||||
qRegisterMetaType<QmlDesigner::EasingCurve>("QmlDesigner::EasingCurve");
|
||||
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
|
||||
|
||||
@@ -49,11 +49,7 @@ static int resolveFont(const QString &fontFile, QFont &outFont)
|
||||
outFont.setFamily(fontFamily);
|
||||
outFont.setStyle(rawFont.style());
|
||||
outFont.setStyleName(rawFont.styleName());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
outFont.setWeight(QFont::Weight(rawFont.weight()));
|
||||
#else
|
||||
outFont.setWeight(rawFont.weight());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,12 +471,7 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
||||
environment.set("QML_PUPPET_MODE", "true");
|
||||
environment.set("QML_DISABLE_DISK_CACHE", "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"))
|
||||
#endif
|
||||
environment.set("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
|
||||
|
||||
#ifndef QMLDESIGNER_TEST
|
||||
|
||||
@@ -76,11 +76,7 @@ bool CMakeGeneratorDialogTreeModel::setData(const QModelIndex &index, const QVar
|
||||
|
||||
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);
|
||||
#endif
|
||||
QList<CheckableFileTreeItem*> checkableItems;
|
||||
for (QStandardItem *item : standardItems)
|
||||
checkableItems.append(static_cast<CheckableFileTreeItem*>(item));
|
||||
|
||||
Reference in New Issue
Block a user