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 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;

View File

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

View File

@ -7,7 +7,11 @@
#include "../vmisc/defglobal.h"
class QTextCodec;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
class QStringList;
#endif
template <class Key, class T> class QMap;
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)
{
d->details = ConvertToVector(details);
}
#endif
//---------------------------------------------------------------------------------------------------------------------
QRectF VLayoutPaper::DetailsBoundingRect() const

View File

@ -46,7 +46,10 @@ class QRectF;
class QGraphicsItem;
class QMutex;
template <typename T> class QList;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template <typename T> class QVector;
#endif
class VLayoutPaper
{
@ -100,7 +103,9 @@ public:
QVector<VLayoutPiece> GetDetails() const;
void SetDetails(const QVector<VLayoutPiece>& details);
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void SetDetails(const QList<VLayoutPiece>& details);
#endif
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 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); });
if (posIter != points.cend())
{

View File

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

View File

@ -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.

View File

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

View File

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

View File

@ -430,7 +430,7 @@ void DialogMove::SelectedObject(bool selected, quint32 object, quint32 tool)
Q_UNUSED(tool)
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; });
if (selected)
{

View File

@ -330,7 +330,7 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type)
auto *operation = qobject_cast<VisToolRotation *>(vis);
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; });
if (obj != sourceObjects.cend())
@ -370,7 +370,7 @@ void DialogRotation::SelectedObject(bool selected, quint32 object, quint32 tool)
Q_UNUSED(tool)
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; });
if (selected)
{
@ -532,7 +532,7 @@ void DialogRotation::PointChanged()
{
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; });
QColor color;

View File

@ -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<vidtype, vidtype> &item) { return item.second == id; });
if (itemRecord != groupData.items.end())