QVector::removeLast() supported since Qt 5.1.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-08-20 22:30:40 +03:00
parent 3fe7ffa7eb
commit 3dab49c23e
3 changed files with 44 additions and 0 deletions

View file

@ -241,7 +241,11 @@ QVector<QPointF> VArc::GetPoints() const
QVector<QPointF> splPoints = spl.GetPoints();
if (not splPoints.isEmpty() && i != sectionAngle.size() - 1)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
splPoints.remove(splPoints.size() - 1);
#else
splPoints.removeLast();
#endif
}
points << splPoints;

View file

@ -366,7 +366,11 @@ QVector<QPointF> VEllipticalArc::GetPoints() const
if (not splPoints.isEmpty() && i != sectionAngle.size() - 1)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
splPoints.remove(splPoints.size() - 1);
#else
splPoints.removeLast();
#endif
}
points << splPoints;
currentAngle += sectionAngle.at(i);

View file

@ -103,7 +103,11 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
path << QPointF(10, 10);
QTest::newRow("Correct closed a path (four unique points)") << path << path;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
#else
path.removeLast();
#endif
QTest::newRow("Correct unclosed a path (four unique points)") << path << path;
path.clear();
@ -116,7 +120,11 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
path << QPointF(0, 10);
QTest::newRow("Correct closed a path (six unique points)") << path << path;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
#else
path.removeLast();
#endif
QTest::newRow("Correct unclosed a path (six unique points)") << path << path;
path.clear();
@ -133,8 +141,13 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
res << QPointF(20, 10);
QTest::newRow("One loop, closed a path (four unique points)") << path << res;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
res.remove(res.size() - 1);
#else
path.removeLast();
res.removeLast();
#endif
QTest::newRow("One loop, unclosed a path (four unique points)") << path << res;
path.clear();
@ -153,8 +166,13 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
res << QPointF(20, 10);
QTest::newRow("Two loops, closed a path (six unique points)") << path << res;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
res.remove(res.size() - 1);
#else
path.removeLast();
res.removeLast();
#endif
QTest::newRow("Two loops, unclosed a path (six unique points)") << path << res;
path.clear();
@ -173,8 +191,13 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
res << QPointF(20, 10);
QTest::newRow("One loop, the first loop, closed a path (six unique points)") << path << res;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
res.remove(res.size() - 1);
#else
path.removeLast();
res.removeLast();
#endif
QTest::newRow("One loop, the first loop, unclosed a path (six unique points)") << path << res;
path.clear();
@ -195,8 +218,13 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
res << QPointF(20, 10);
QTest::newRow("One loop, the second loop, closed a path (six unique points)") << path << res;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
res.remove(res.size() - 1);
#else
path.removeLast();
res.removeLast();
#endif
QTest::newRow("One loop, the second loop, unclosed a path (six unique points)") << path << res;
path.clear();
@ -208,7 +236,11 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
path << QPointF(20, 10);
QTest::newRow("Correct closed a path, point on line (four unique points)") << path << path;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
#else
path.removeLast();
#endif
QTest::newRow("Corect unclosed a path, point on line (four unique points)") << path << path;
path.clear();
@ -223,7 +255,11 @@ void TST_VAbstractDetail::PathRemoveLoop_data() const
path << QPointF(20, 10);
QTest::newRow("Correct closed a path, point on line (six unique points)") << path << path;
#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
path.remove(path.size() - 1);
#else
path.removeLast();
#endif
QTest::newRow("Corect unclosed a path, point on line (six unique points)") << path << path;
path.clear();