From 734e5d0d11fa5845b2a72af216f7a83cf6d6ff25 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 9 Feb 2023 16:45:45 +0200 Subject: [PATCH] QVector and QStringList are now just aliases to QList. --- src/libs/ifc/xml/utils.h | 5 ++++- src/libs/ifc/xml/vdomdocument.h | 2 ++ src/libs/vdxf/libdxfrw/intern/drw_textcodec.h | 4 ++++ src/libs/vlayout/vlayoutpaper.cpp | 2 ++ src/libs/vlayout/vlayoutpaper.h | 5 +++++ src/libs/vlayout/vlayoutpiece.cpp | 4 ++-- src/libs/vlayout/vposter.h | 6 +++++- src/libs/vmisc/literals.h | 2 ++ src/libs/vmisc/testpath.h | 2 ++ src/libs/vtest/abstracttest.h | 2 ++ src/libs/vtools/dialogs/tools/dialogmove.cpp | 4 ++-- src/libs/vtools/dialogs/tools/dialogrotation.cpp | 12 ++++++------ src/libs/vtools/undocommands/deltool.cpp | 2 +- 13 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/libs/ifc/xml/utils.h b/src/libs/ifc/xml/utils.h index 6c9487158..3f9d7d94a 100644 --- a/src/libs/ifc/xml/utils.h +++ b/src/libs/ifc/xml/utils.h @@ -30,10 +30,13 @@ class QMimeType; class QString; -class QStringList; class QMimeType; class QByteArray; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +class QStringList; +#endif + auto IsMimeTypeImage(const QMimeType &mime) -> bool; auto SplitString(QString str) -> QStringList; auto MimeTypeFromByteArray(const QByteArray &data) -> QMimeType; diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index a495cdb9e..2aea0f136 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -50,7 +50,9 @@ class QDomElement; class QDomNode; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) template class QVector; +#endif template class QFutureWatcher; Q_DECLARE_LOGGING_CATEGORY(vXML) diff --git a/src/libs/vdxf/libdxfrw/intern/drw_textcodec.h b/src/libs/vdxf/libdxfrw/intern/drw_textcodec.h index 041da8cf7..f303d27fe 100644 --- a/src/libs/vdxf/libdxfrw/intern/drw_textcodec.h +++ b/src/libs/vdxf/libdxfrw/intern/drw_textcodec.h @@ -7,7 +7,11 @@ #include "../vmisc/defglobal.h" class QTextCodec; + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) class QStringList; +#endif + template class QMap; class DRW_TextCodec diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index 2f02c672a..b153cac44 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -442,10 +442,12 @@ void VLayoutPaper::SetDetails(const QVector &details) } //--------------------------------------------------------------------------------------------------------------------- +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void VLayoutPaper::SetDetails(const QList &details) { d->details = ConvertToVector(details); } +#endif //--------------------------------------------------------------------------------------------------------------------- QRectF VLayoutPaper::DetailsBoundingRect() const diff --git a/src/libs/vlayout/vlayoutpaper.h b/src/libs/vlayout/vlayoutpaper.h index c2e79a24d..7955a8259 100644 --- a/src/libs/vlayout/vlayoutpaper.h +++ b/src/libs/vlayout/vlayoutpaper.h @@ -46,7 +46,10 @@ class QRectF; class QGraphicsItem; class QMutex; template class QList; + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) template class QVector; +#endif class VLayoutPaper { @@ -100,7 +103,9 @@ public: QVector GetDetails() const; void SetDetails(const QVector& details); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) void SetDetails(const QList& details); +#endif QRectF DetailsBoundingRect() const; diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 190a64387..3ed224c3b 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -1797,8 +1797,8 @@ auto VLayoutPiece::EdgeByPoint(const QVector &path, const QPointF &p1) } const QVector points = Map(path); - const auto *const posIter = std::find_if(points.cbegin(), points.cend(), - [&p1](const QPointF &point){ return VFuzzyComparePoints(point, p1); }); + auto posIter = std::find_if(points.cbegin(), points.cend(), + [&p1](const QPointF &point){ return VFuzzyComparePoints(point, p1); }); if (posIter != points.cend()) { return static_cast(posIter - points.cbegin() + 1); diff --git a/src/libs/vlayout/vposter.h b/src/libs/vlayout/vposter.h index 6bfc50020..c30490f75 100644 --- a/src/libs/vlayout/vposter.h +++ b/src/libs/vlayout/vposter.h @@ -38,9 +38,13 @@ class QGraphicsItem; class QPrinter; -template class QVector; struct VWatermarkData; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +template class QVector; +#endif + + struct PosterData { PosterData() diff --git a/src/libs/vmisc/literals.h b/src/libs/vmisc/literals.h index a3508a9e6..126e4b05e 100644 --- a/src/libs/vmisc/literals.h +++ b/src/libs/vmisc/literals.h @@ -29,7 +29,9 @@ #define LITERALS_H class QString; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) class QStringList; +#endif // From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This // furthermore blows up the binary sizes. diff --git a/src/libs/vmisc/testpath.h b/src/libs/vmisc/testpath.h index 5ecdc4d57..bda082a60 100644 --- a/src/libs/vmisc/testpath.h +++ b/src/libs/vmisc/testpath.h @@ -37,7 +37,9 @@ #include class QPointF; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) template class QVector; +#endif class VSAPoint; class VRawSAPoint; diff --git a/src/libs/vtest/abstracttest.h b/src/libs/vtest/abstracttest.h index 9d6c6ef2f..d94e2b0df 100644 --- a/src/libs/vtest/abstracttest.h +++ b/src/libs/vtest/abstracttest.h @@ -43,7 +43,9 @@ #include "../vlayout/vrawsapoint.h" #include "../ifc/exception/vexception.h" +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) template class QVector; +#endif #include diff --git a/src/libs/vtools/dialogs/tools/dialogmove.cpp b/src/libs/vtools/dialogs/tools/dialogmove.cpp index abc6cb919..79c29715b 100644 --- a/src/libs/vtools/dialogs/tools/dialogmove.cpp +++ b/src/libs/vtools/dialogs/tools/dialogmove.cpp @@ -430,8 +430,8 @@ void DialogMove::SelectedObject(bool selected, quint32 object, quint32 tool) Q_UNUSED(tool) if (stage1) { - auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), - [object](const SourceItem &sItem) { return sItem.id == object; }); + auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), + [object](const SourceItem &sItem) { return sItem.id == object; }); if (selected) { if (obj == sourceObjects.cend()) diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 33db7062b..6bbe64262 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -330,8 +330,8 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type) auto *operation = qobject_cast(vis); SCASSERT(operation != nullptr) - auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), - [id](const SourceItem &sItem) { return sItem.id == id; }); + auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), + [id](const SourceItem &sItem) { return sItem.id == id; }); if (obj != sourceObjects.cend()) { @@ -370,8 +370,8 @@ void DialogRotation::SelectedObject(bool selected, quint32 object, quint32 tool) Q_UNUSED(tool) if (stage1) { - auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), - [object](const SourceItem &sItem) { return sItem.id == object; }); + auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), + [object](const SourceItem &sItem) { return sItem.id == object; }); if (selected) { if (obj == sourceObjects.cend()) @@ -532,8 +532,8 @@ void DialogRotation::PointChanged() { quint32 id = getCurrentObjectId(ui->comboBoxOriginPoint); - auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), - [id](const SourceItem &sItem) { return sItem.id == id; }); + auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), + [id](const SourceItem &sItem) { return sItem.id == id; }); QColor color; if (obj != sourceObjects.cend()) diff --git a/src/libs/vtools/undocommands/deltool.cpp b/src/libs/vtools/undocommands/deltool.cpp index c22be3b72..bfdae2045 100644 --- a/src/libs/vtools/undocommands/deltool.cpp +++ b/src/libs/vtools/undocommands/deltool.cpp @@ -67,7 +67,7 @@ DelTool::DelTool(VAbstractPattern *doc, quint32 id, QUndoCommand *parent) while (i != groups.constEnd()) { VGroupData groupData = i.value(); - auto *itemRecord = std::find_if(groupData.items.begin(), groupData.items.end(), + auto itemRecord = std::find_if(groupData.items.begin(), groupData.items.end(), [id](const QPair &item) { return item.second == id; }); if (itemRecord != groupData.items.end())