QVector and QStringList are now just aliases to QList.

This commit is contained in:
Roman Telezhynskyi 2023-02-09 16:45:45 +02:00
parent 171b3be090
commit 734e5d0d11
13 changed files with 39 additions and 13 deletions

View File

@ -30,10 +30,13 @@
class QMimeType; class QMimeType;
class QString; class QString;
class QStringList;
class QMimeType; class QMimeType;
class QByteArray; class QByteArray;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class QStringList;
#endif
auto IsMimeTypeImage(const QMimeType &mime) -> bool; auto IsMimeTypeImage(const QMimeType &mime) -> bool;
auto SplitString(QString str) -> QStringList; auto SplitString(QString str) -> QStringList;
auto MimeTypeFromByteArray(const QByteArray &data) -> QMimeType; auto MimeTypeFromByteArray(const QByteArray &data) -> QMimeType;

View File

@ -50,7 +50,9 @@
class QDomElement; class QDomElement;
class QDomNode; class QDomNode;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <typename T> class QVector; template <typename T> class QVector;
#endif
template <typename T> class QFutureWatcher; template <typename T> class QFutureWatcher;
Q_DECLARE_LOGGING_CATEGORY(vXML) Q_DECLARE_LOGGING_CATEGORY(vXML)

View File

@ -7,7 +7,11 @@
#include "../vmisc/defglobal.h" #include "../vmisc/defglobal.h"
class QTextCodec; class QTextCodec;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class QStringList; class QStringList;
#endif
template <class Key, class T> class QMap; template <class Key, class T> class QMap;
class DRW_TextCodec class DRW_TextCodec

View File

@ -442,10 +442,12 @@ void VLayoutPaper::SetDetails(const QVector<VLayoutPiece> &details)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void VLayoutPaper::SetDetails(const QList<VLayoutPiece> &details) void VLayoutPaper::SetDetails(const QList<VLayoutPiece> &details)
{ {
d->details = ConvertToVector(details); d->details = ConvertToVector(details);
} }
#endif
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QRectF VLayoutPaper::DetailsBoundingRect() const QRectF VLayoutPaper::DetailsBoundingRect() const

View File

@ -46,7 +46,10 @@ class QRectF;
class QGraphicsItem; class QGraphicsItem;
class QMutex; class QMutex;
template <typename T> class QList; template <typename T> class QList;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <typename T> class QVector; template <typename T> class QVector;
#endif
class VLayoutPaper class VLayoutPaper
{ {
@ -100,7 +103,9 @@ public:
QVector<VLayoutPiece> GetDetails() const; QVector<VLayoutPiece> GetDetails() const;
void SetDetails(const QVector<VLayoutPiece>& details); void SetDetails(const QVector<VLayoutPiece>& details);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void SetDetails(const QList<VLayoutPiece>& details); void SetDetails(const QList<VLayoutPiece>& details);
#endif
QRectF DetailsBoundingRect() const; QRectF DetailsBoundingRect() const;

View File

@ -1797,7 +1797,7 @@ auto VLayoutPiece::EdgeByPoint(const QVector<QPointF> &path, const QPointF &p1)
} }
const QVector<QPointF> points = Map(path); const QVector<QPointF> points = Map(path);
const auto *const posIter = std::find_if(points.cbegin(), points.cend(), auto posIter = std::find_if(points.cbegin(), points.cend(),
[&p1](const QPointF &point){ return VFuzzyComparePoints(point, p1); }); [&p1](const QPointF &point){ return VFuzzyComparePoints(point, p1); });
if (posIter != points.cend()) if (posIter != points.cend())
{ {

View File

@ -38,9 +38,13 @@
class QGraphicsItem; class QGraphicsItem;
class QPrinter; class QPrinter;
template <class T> class QVector;
struct VWatermarkData; struct VWatermarkData;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <class T> class QVector;
#endif
struct PosterData struct PosterData
{ {
PosterData() PosterData()

View File

@ -29,7 +29,9 @@
#define LITERALS_H #define LITERALS_H
class QString; class QString;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class QStringList; class QStringList;
#endif
// From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This // From documantation: If you use QStringLiteral you should avoid declaring the same literal in multiple places: This
// furthermore blows up the binary sizes. // furthermore blows up the binary sizes.

View File

@ -37,7 +37,9 @@
#include <QTextStream> #include <QTextStream>
class QPointF; class QPointF;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <class T> class QVector; template <class T> class QVector;
#endif
class VSAPoint; class VSAPoint;
class VRawSAPoint; class VRawSAPoint;

View File

@ -43,7 +43,9 @@
#include "../vlayout/vrawsapoint.h" #include "../vlayout/vrawsapoint.h"
#include "../ifc/exception/vexception.h" #include "../ifc/exception/vexception.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <class T> class QVector; template <class T> class QVector;
#endif
#include <ciso646> #include <ciso646>

View File

@ -430,7 +430,7 @@ void DialogMove::SelectedObject(bool selected, quint32 object, quint32 tool)
Q_UNUSED(tool) Q_UNUSED(tool)
if (stage1) if (stage1)
{ {
auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(),
[object](const SourceItem &sItem) { return sItem.id == object; }); [object](const SourceItem &sItem) { return sItem.id == object; });
if (selected) if (selected)
{ {

View File

@ -330,7 +330,7 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type)
auto *operation = qobject_cast<VisToolRotation *>(vis); auto *operation = qobject_cast<VisToolRotation *>(vis);
SCASSERT(operation != nullptr) SCASSERT(operation != nullptr)
auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(),
[id](const SourceItem &sItem) { return sItem.id == id; }); [id](const SourceItem &sItem) { return sItem.id == id; });
if (obj != sourceObjects.cend()) if (obj != sourceObjects.cend())
@ -370,7 +370,7 @@ void DialogRotation::SelectedObject(bool selected, quint32 object, quint32 tool)
Q_UNUSED(tool) Q_UNUSED(tool)
if (stage1) if (stage1)
{ {
auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(),
[object](const SourceItem &sItem) { return sItem.id == object; }); [object](const SourceItem &sItem) { return sItem.id == object; });
if (selected) if (selected)
{ {
@ -532,7 +532,7 @@ void DialogRotation::PointChanged()
{ {
quint32 id = getCurrentObjectId(ui->comboBoxOriginPoint); quint32 id = getCurrentObjectId(ui->comboBoxOriginPoint);
auto *obj = std::find_if(sourceObjects.begin(), sourceObjects.end(), auto obj = std::find_if(sourceObjects.begin(), sourceObjects.end(),
[id](const SourceItem &sItem) { return sItem.id == id; }); [id](const SourceItem &sItem) { return sItem.id == id; });
QColor color; QColor color;

View File

@ -67,7 +67,7 @@ DelTool::DelTool(VAbstractPattern *doc, quint32 id, QUndoCommand *parent)
while (i != groups.constEnd()) while (i != groups.constEnd())
{ {
VGroupData groupData = i.value(); 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<vidtype, vidtype> &item) { return item.second == id; }); [id](const QPair<vidtype, vidtype> &item) { return item.second == id; });
if (itemRecord != groupData.items.end()) if (itemRecord != groupData.items.end())