summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 07:43:51 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-05 14:59:30 +0200
commit1a85163e1538e8a8e60c884bb21a5084d6170759 (patch)
treef06ced3698895d8f59458b039e5e754427fe0b89
parentaffcc0be3f200372ed709f4041dc5079ed2e117a (diff)
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Ibed02600e225ee63c06d61bcd6187518f650a0a0 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/datavisualization/engine/abstract3dcontroller.cpp6
-rw-r--r--src/datavisualization/input/qtouch3dinputhandler.cpp4
-rw-r--r--src/datavisualization/utils/meshloader.cpp2
-rw-r--r--src/datavisualization/utils/scatterobjectbufferhelper.cpp16
-rw-r--r--src/datavisualizationqml/declarativeseries.cpp2
-rw-r--r--tests/auto/cpptest/q3daxis-category/tst_axis.cpp4
-rw-r--r--tests/auto/cpptest/q3daxis-value/tst_axis.cpp4
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp32
-rw-r--r--tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp8
-rw-r--r--tests/auto/cpptest/q3dbars/tst_bars.cpp44
-rw-r--r--tests/auto/cpptest/q3dscatter/tst_scatter.cpp16
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp24
-rw-r--r--tests/auto/cpptest/q3dsurface/tst_surface.cpp16
-rw-r--r--tests/auto/cpptest/q3dtheme/tst_theme.cpp12
14 files changed, 95 insertions, 95 deletions
diff --git a/src/datavisualization/engine/abstract3dcontroller.cpp b/src/datavisualization/engine/abstract3dcontroller.cpp
index 56be1496..700af4fe 100644
--- a/src/datavisualization/engine/abstract3dcontroller.cpp
+++ b/src/datavisualization/engine/abstract3dcontroller.cpp
@@ -996,7 +996,7 @@ int Abstract3DController::addCustomItem(QCustom3DItem *item)
item->d_ptr->resetDirtyBits();
m_isCustomDataDirty = true;
emitNeedRender();
- return m_customItems.count() - 1;
+ return m_customItems.size() - 1;
}
void Abstract3DController::deleteCustomItems()
@@ -1523,7 +1523,7 @@ int Abstract3DController::selectedLabelIndex() const
{
int index = m_selectedLabelIndex;
QAbstract3DAxis *axis = selectedAxis();
- if (axis && axis->labels().count() <= index)
+ if (axis && axis->labels().size() <= index)
index = -1;
return index;
}
@@ -1553,7 +1553,7 @@ QAbstract3DAxis *Abstract3DController::selectedAxis() const
int Abstract3DController::selectedCustomItemIndex() const
{
int index = m_selectedCustomItemIndex;
- if (m_customItems.count() <= index)
+ if (m_customItems.size() <= index)
index = -1;
return index;
}
diff --git a/src/datavisualization/input/qtouch3dinputhandler.cpp b/src/datavisualization/input/qtouch3dinputhandler.cpp
index 60ac1368..9edbd87e 100644
--- a/src/datavisualization/input/qtouch3dinputhandler.cpp
+++ b/src/datavisualization/input/qtouch3dinputhandler.cpp
@@ -95,12 +95,12 @@ void QTouch3DInputHandler::touchEvent(QTouchEvent *event)
QList<QTouchEvent::TouchPoint> points;
points = event->points();
- if (!scene()->isSlicingActive() && points.count() == 2) {
+ if (!scene()->isSlicingActive() && points.size() == 2) {
d_ptr->m_holdTimer->stop();
QPointF distance = points.at(0).position() - points.at(1).position();
QPoint midPoint = ((points.at(0).position() + points.at(1).position()) / 2.0).toPoint();
d_ptr->handlePinchZoom(distance.manhattanLength(), midPoint);
- } else if (points.count() == 1) {
+ } else if (points.size() == 1) {
QPointF pointerPos = points.at(0).position();
if (event->type() == QEvent::TouchBegin) {
// Flush input state
diff --git a/src/datavisualization/utils/meshloader.cpp b/src/datavisualization/utils/meshloader.cpp
index baa719bc..dc21b0f6 100644
--- a/src/datavisualization/utils/meshloader.cpp
+++ b/src/datavisualization/utils/meshloader.cpp
@@ -55,7 +55,7 @@ bool MeshLoader::loadOBJ(const QString &path, QList<QVector3D> &out_vertices,
QStringList set1 = lineContents.at(1).split(slashTag);
QStringList set2 = lineContents.at(2).split(slashTag);
QStringList set3 = lineContents.at(3).split(slashTag);
- if (set1.length() < 3 || set2.length() < 3 || set3.length() < 3) {
+ if (set1.size() < 3 || set2.size() < 3 || set3.size() < 3) {
qWarning("The file being loaded is missing UVs and/or normals");
return false;
}
diff --git a/src/datavisualization/utils/scatterobjectbufferhelper.cpp b/src/datavisualization/utils/scatterobjectbufferhelper.cpp
index fb6428a1..f4e6268e 100644
--- a/src/datavisualization/utils/scatterobjectbufferhelper.cpp
+++ b/src/datavisualization/utils/scatterobjectbufferhelper.cpp
@@ -52,10 +52,10 @@ void ScatterObjectBufferHelper::fullLoad(ScatterSeriesRenderCache *cache, qreal
const QList<QVector3D> indexed_vertices = dotObj->indexedvertices();
const QList<QVector2D> indexed_uvs = dotObj->indexedUVs();
const QList<QVector3D> indexed_normals = dotObj->indexedNormals();
- const int indicesCount = indices.count();
- const int verticeCount = indexed_vertices.count();
- const int uvsCount = indexed_uvs.count();
- const int normalsCount = indexed_normals.count();
+ const int indicesCount = indices.size();
+ const int verticeCount = indexed_vertices.size();
+ const int uvsCount = indexed_uvs.size();
+ const int normalsCount = indexed_normals.size();
float itemSize = cache->itemSize() / itemScaler;
if (itemSize == 0.0f)
@@ -172,7 +172,7 @@ void ScatterObjectBufferHelper::fullLoad(ScatterSeriesRenderCache *cache, qreal
void ScatterObjectBufferHelper::updateUVs(ScatterSeriesRenderCache *cache)
{
ObjectHelper *dotObj = cache->object();
- const int uvsCount = dotObj->indexedUVs().count();
+ const int uvsCount = dotObj->indexedUVs().size();
const ScatterRenderItemArray &renderArray = cache->renderArray();
const bool updateAll = (cache->updateIndices().size() == 0);
const int updateSize = updateAll ? renderArray.size() : cache->updateIndices().size();
@@ -213,7 +213,7 @@ uint ScatterObjectBufferHelper::createRangeGradientUVs(ScatterSeriesRenderCache
QList<QVector2D> &buffered_uvs)
{
ObjectHelper *dotObj = cache->object();
- const int uvsCount = dotObj->indexedUVs().count();
+ const int uvsCount = dotObj->indexedUVs().size();
const ScatterRenderItemArray &renderArray = cache->renderArray();
const bool updateAll = (cache->updateIndices().size() == 0);
const int updateSize = updateAll ? renderArray.size() : cache->updateIndices().size();
@@ -256,7 +256,7 @@ uint ScatterObjectBufferHelper::createObjectGradientUVs(ScatterSeriesRenderCache
const QList<QVector3D> &indexed_vertices)
{
ObjectHelper *dotObj = cache->object();
- const int uvsCount = dotObj->indexedUVs().count();
+ const int uvsCount = dotObj->indexedUVs().size();
const ScatterRenderItemArray &renderArray = cache->renderArray();
const uint renderArraySize = renderArray.size();
@@ -293,7 +293,7 @@ void ScatterObjectBufferHelper::update(ScatterSeriesRenderCache *cache, qreal do
// Index vertices
const QList<QVector3D> indexed_vertices = dotObj->indexedvertices();
- int verticeCount = indexed_vertices.count();
+ int verticeCount = indexed_vertices.size();
float itemSize = cache->itemSize() / itemScaler;
if (itemSize == 0.0f)
diff --git a/src/datavisualizationqml/declarativeseries.cpp b/src/datavisualizationqml/declarativeseries.cpp
index a92edabb..0ba5c484 100644
--- a/src/datavisualizationqml/declarativeseries.cpp
+++ b/src/datavisualizationqml/declarativeseries.cpp
@@ -163,7 +163,7 @@ void DeclarativeBar3DSeries::appendRowColorsFunc(QQmlListProperty<DeclarativeCol
qsizetype DeclarativeBar3DSeries::countRowColorsFunc(QQmlListProperty<DeclarativeColor> *list)
{
- return reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->colorList().count();
+ return reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->colorList().size();
}
DeclarativeColor *DeclarativeBar3DSeries::atRowColorsFunc(QQmlListProperty<DeclarativeColor> *list,
diff --git a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp b/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
index 2d875ded..d1440d6a 100644
--- a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
+++ b/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
@@ -54,7 +54,7 @@ void tst_axis::initialProperties()
{
QVERIFY(m_axis);
- QCOMPARE(m_axis->labels().length(), 0);
+ QCOMPARE(m_axis->labels().size(), 0);
// Common (from QAbstract3DAxis)
QCOMPARE(m_axis->isAutoAdjustRange(), true);
@@ -74,7 +74,7 @@ void tst_axis::initializeProperties()
m_axis->setLabels(QStringList() << "first" << "second");
- QCOMPARE(m_axis->labels().length(), 2);
+ QCOMPARE(m_axis->labels().size(), 2);
QCOMPARE(m_axis->labels().at(1), QString("second"));
// Common (from QAbstract3DAxis)
diff --git a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
index fe93e1ca..54d36d3d 100644
--- a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
+++ b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
@@ -62,7 +62,7 @@ void tst_axis::initialProperties()
// Common (from QAbstract3DAxis)
QCOMPARE(m_axis->isAutoAdjustRange(), true);
QCOMPARE(m_axis->labelAutoRotation(), 0.0f);
- QCOMPARE(m_axis->labels().length(), 6);
+ QCOMPARE(m_axis->labels().size(), 6);
QCOMPARE(m_axis->labels().at(0), QString("0.00"));
QCOMPARE(m_axis->labels().at(1), QString("2.00"));
QCOMPARE(m_axis->labels().at(2), QString("4.00"));
@@ -103,7 +103,7 @@ void tst_axis::initializeProperties()
QCOMPARE(m_axis->isAutoAdjustRange(), false);
QCOMPARE(m_axis->labelAutoRotation(), 15.0f);
- QCOMPARE(m_axis->labels().length(), 3);
+ QCOMPARE(m_axis->labels().size(), 3);
QCOMPARE(m_axis->labels().at(0), QString("5m"));
QCOMPARE(m_axis->labels().at(1), QString("15m"));
QCOMPARE(m_axis->labels().at(2), QString("25m"));
diff --git a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
index eed90338..424aad3f 100644
--- a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
@@ -66,8 +66,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->columnRole(), QString(""));
QCOMPARE(proxy->valueRole(), QString("val"));
QCOMPARE(proxy->rotationRole(), QString(""));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val");
@@ -76,8 +76,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->columnRole(), QString("col"));
QCOMPARE(proxy->valueRole(), QString("val"));
QCOMPARE(proxy->rotationRole(), QString(""));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val", "rot");
@@ -86,8 +86,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->columnRole(), QString("col"));
QCOMPARE(proxy->valueRole(), QString("val"));
QCOMPARE(proxy->rotationRole(), QString("rot"));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val",
@@ -97,8 +97,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->columnRole(), QString("col"));
QCOMPARE(proxy->valueRole(), QString("val"));
QCOMPARE(proxy->rotationRole(), QString(""));
- QCOMPARE(proxy->rowCategories().length(), 1);
- QCOMPARE(proxy->columnCategories().length(), 1);
+ QCOMPARE(proxy->rowCategories().size(), 1);
+ QCOMPARE(proxy->columnCategories().size(), 1);
delete proxy;
proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val", "rot",
@@ -108,8 +108,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->columnRole(), QString("col"));
QCOMPARE(proxy->valueRole(), QString("val"));
QCOMPARE(proxy->rotationRole(), QString("rot"));
- QCOMPARE(proxy->rowCategories().length(), 1);
- QCOMPARE(proxy->columnCategories().length(), 1);
+ QCOMPARE(proxy->rowCategories().size(), 1);
+ QCOMPARE(proxy->columnCategories().size(), 1);
delete proxy;
}
@@ -137,9 +137,9 @@ void tst_proxy::initialProperties()
QCOMPARE(m_proxy->valueRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->valueRoleReplace(), QString());
- QCOMPARE(m_proxy->columnLabels().count(), 0);
+ QCOMPARE(m_proxy->columnLabels().size(), 0);
QCOMPARE(m_proxy->rowCount(), 0);
- QCOMPARE(m_proxy->rowLabels().count(), 0);
+ QCOMPARE(m_proxy->rowLabels().size(), 0);
QVERIFY(!m_proxy->series());
QCOMPARE(m_proxy->type(), QAbstractDataProxy::DataTypeBar);
@@ -173,7 +173,7 @@ void tst_proxy::initializeProperties()
QCOMPARE(m_proxy->autoColumnCategories(), false);
QCOMPARE(m_proxy->autoRowCategories(), false);
- QCOMPARE(m_proxy->columnCategories().count(), 2);
+ QCOMPARE(m_proxy->columnCategories().size(), 2);
QCOMPARE(m_proxy->columnRole(), QString("column"));
QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/"));
QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1"));
@@ -182,7 +182,7 @@ void tst_proxy::initializeProperties()
QCOMPARE(m_proxy->rotationRole(), QString("rotation"));
QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->rotationRoleReplace(), QString("\\\\1"));
- QCOMPARE(m_proxy->rowCategories().count(), 2);
+ QCOMPARE(m_proxy->rowCategories().size(), 2);
QCOMPARE(m_proxy->rowRole(), QString("row"));
QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1"));
@@ -246,9 +246,9 @@ void tst_proxy::multiMatch()
QCoreApplication::processEvents();
QCOMPARE(graph.valueAxis()->max(), 15.0f);
- QCOMPARE(m_proxy->columnLabels().count(), 1);
+ QCOMPARE(m_proxy->columnLabels().size(), 1);
QCOMPARE(m_proxy->rowCount(), 1);
- QCOMPARE(m_proxy->rowLabels().count(), 1);
+ QCOMPARE(m_proxy->rowLabels().size(), 1);
QVERIFY(m_proxy->series());
m_proxy = 0; // Proxy gets deleted as graph gets deleted
diff --git a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
index ce411e74..4c343cb4 100644
--- a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
@@ -53,9 +53,9 @@ void tst_proxy::initialProperties()
{
QVERIFY(m_proxy);
- QCOMPARE(m_proxy->columnLabels().count(), 0);
+ QCOMPARE(m_proxy->columnLabels().size(), 0);
QCOMPARE(m_proxy->rowCount(), 0);
- QCOMPARE(m_proxy->rowLabels().count(), 0);
+ QCOMPARE(m_proxy->rowLabels().size(), 0);
QVERIFY(!m_proxy->series());
QCOMPARE(m_proxy->type(), QAbstractDataProxy::DataTypeBar);
@@ -71,9 +71,9 @@ void tst_proxy::initializeProperties()
m_proxy->addRow(data);
m_proxy->setRowLabels(QStringList() << "1");
- QCOMPARE(m_proxy->columnLabels().count(), 3);
+ QCOMPARE(m_proxy->columnLabels().size(), 3);
QCOMPARE(m_proxy->rowCount(), 1);
- QCOMPARE(m_proxy->rowLabels().count(), 1);
+ QCOMPARE(m_proxy->rowLabels().size(), 1);
}
QTEST_MAIN(tst_proxy)
diff --git a/tests/auto/cpptest/q3dbars/tst_bars.cpp b/tests/auto/cpptest/q3dbars/tst_bars.cpp
index 961a9e3d..2b8cc340 100644
--- a/tests/auto/cpptest/q3dbars/tst_bars.cpp
+++ b/tests/auto/cpptest/q3dbars/tst_bars.cpp
@@ -98,7 +98,7 @@ void tst_bars::initialProperties()
QCOMPARE(m_graph->barSpacing(), QSizeF(1.0f, 1.0f));
QCOMPARE(m_graph->barSeriesMargin(), QSizeF(0.0f, 0.0f));
QCOMPARE(m_graph->isBarSpacingRelative(), true);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
QVERIFY(!m_graph->selectedSeries());
QVERIFY(!m_graph->primarySeries());
QCOMPARE(m_graph->floorLevel(), 0.0);
@@ -198,7 +198,7 @@ void tst_bars::addSeries()
m_graph->addSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QVERIFY(!m_graph->selectedSeries());
QCOMPARE(m_graph->primarySeries(), series);
}
@@ -213,7 +213,7 @@ void tst_bars::addMultipleSeries()
m_graph->addSeries(series2);
m_graph->addSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 3);
+ QCOMPARE(m_graph->seriesList().size(), 3);
QCOMPARE(m_graph->primarySeries(), series);
m_graph->setPrimarySeries(series2);
@@ -228,7 +228,7 @@ void tst_bars::selectSeries()
m_graph->addSeries(series);
m_graph->primarySeries()->setSelectedBar(QPoint(0, 0));
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->clearSelection();
@@ -241,7 +241,7 @@ void tst_bars::removeSeries()
m_graph->addSeries(series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
}
@@ -259,16 +259,16 @@ void tst_bars::removeMultipleSeries()
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 2);
+ QCOMPARE(m_graph->seriesList().size(), 2);
QCOMPARE(m_graph->primarySeries(), series2);
QVERIFY(!m_graph->selectedSeries());
m_graph->removeSeries(series2);
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QCOMPARE(m_graph->primarySeries(), series3);
m_graph->removeSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
delete series2;
@@ -294,14 +294,14 @@ void tst_bars::addInputHandler()
m_graph->addInputHandler(handler);
m_graph->addInputHandler(handler2);
- QCOMPARE(m_graph->inputHandlers().length(), 3); // Default, as it is still active, plus added ones
+ QCOMPARE(m_graph->inputHandlers().size(), 3); // Default, as it is still active, plus added ones
QCOMPARE(m_graph->activeInputHandler(), initialHandler);
m_graph->setActiveInputHandler(handler2);
QCOMPARE(m_graph->activeInputHandler(), handler2);
m_graph->setActiveInputHandler(NULL);
QVERIFY(!m_graph->activeInputHandler());
- QCOMPARE(m_graph->inputHandlers().length(), 2);
+ QCOMPARE(m_graph->inputHandlers().size(), 2);
}
void tst_bars::removeInputHandler()
@@ -313,12 +313,12 @@ void tst_bars::removeInputHandler()
m_graph->addInputHandler(handler2);
m_graph->setActiveInputHandler(handler2);
- QCOMPARE(m_graph->inputHandlers().length(), 2); // Default handler removed by previous call
+ QCOMPARE(m_graph->inputHandlers().size(), 2); // Default handler removed by previous call
QCOMPARE(m_graph->activeInputHandler(), handler2);
m_graph->releaseInputHandler(handler2);
- QCOMPARE(m_graph->inputHandlers().length(), 1);
+ QCOMPARE(m_graph->inputHandlers().size(), 1);
m_graph->releaseInputHandler(handler);
- QCOMPARE(m_graph->inputHandlers().length(), 0);
+ QCOMPARE(m_graph->inputHandlers().size(), 0);
delete handler2;
delete handler;
@@ -332,7 +332,7 @@ void tst_bars::addTheme()
m_graph->addTheme(theme);
m_graph->addTheme(theme2);
- QCOMPARE(m_graph->themes().length(), 3); // Default, plus added ones
+ QCOMPARE(m_graph->themes().size(), 3); // Default, plus added ones
QCOMPARE(m_graph->activeTheme(), initialTheme);
m_graph->setActiveTheme(theme2);
QCOMPARE(m_graph->activeTheme(), theme2);
@@ -348,9 +348,9 @@ void tst_bars::removeTheme()
m_graph->setActiveTheme(theme2);
QCOMPARE(m_graph->activeTheme(), theme2);
m_graph->releaseTheme(theme2);
- QCOMPARE(m_graph->themes().length(), 2);
+ QCOMPARE(m_graph->themes().size(), 2);
m_graph->releaseTheme(theme);
- QCOMPARE(m_graph->themes().length(), 1); // Default theme remains
+ QCOMPARE(m_graph->themes().size(), 1); // Default theme remains
delete theme2;
delete theme;
@@ -362,9 +362,9 @@ void tst_bars::addCustomItem()
QCustom3DItem *item2 = new QCustom3DItem();
m_graph->addCustomItem(item);
- QCOMPARE(m_graph->customItems().length(), 1);
+ QCOMPARE(m_graph->customItems().size(), 1);
m_graph->addCustomItem(item2);
- QCOMPARE(m_graph->customItems().length(), 2);
+ QCOMPARE(m_graph->customItems().size(), 2);
}
void tst_bars::removeCustomItem()
@@ -379,14 +379,14 @@ void tst_bars::removeCustomItem()
m_graph->addCustomItem(item3);
m_graph->releaseCustomItem(item);
- QCOMPARE(m_graph->customItems().length(), 2);
+ QCOMPARE(m_graph->customItems().size(), 2);
m_graph->removeCustomItem(item2);
- QCOMPARE(m_graph->customItems().length(), 1);
+ QCOMPARE(m_graph->customItems().size(), 1);
m_graph->addCustomItem(item);
m_graph->removeCustomItemAt(QVector3D(1, 1, 1));
- QCOMPARE(m_graph->customItems().length(), 1);
+ QCOMPARE(m_graph->customItems().size(), 1);
m_graph->removeCustomItems();
- QCOMPARE(m_graph->customItems().length(), 0);
+ QCOMPARE(m_graph->customItems().size(), 0);
}
void tst_bars::renderToImage()
diff --git a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
index 44c19c6a..e8b26baf 100644
--- a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
+++ b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
@@ -78,7 +78,7 @@ void tst_scatter::construct()
void tst_scatter::initialProperties()
{
QVERIFY(m_graph);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
QVERIFY(!m_graph->selectedSeries());
QCOMPARE(m_graph->axisX()->orientation(), QAbstract3DAxis::AxisOrientationX);
QCOMPARE(m_graph->axisY()->orientation(), QAbstract3DAxis::AxisOrientationY);
@@ -158,7 +158,7 @@ void tst_scatter::addSeries()
{
m_graph->addSeries(newSeries());
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QVERIFY(!m_graph->selectedSeries());
}
@@ -172,7 +172,7 @@ void tst_scatter::addMultipleSeries()
m_graph->addSeries(series2);
m_graph->addSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 3);
+ QCOMPARE(m_graph->seriesList().size(), 3);
}
void tst_scatter::selectSeries()
@@ -182,7 +182,7 @@ void tst_scatter::selectSeries()
m_graph->addSeries(series);
m_graph->seriesList()[0]->setSelectedItem(1);
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->clearSelection();
@@ -195,7 +195,7 @@ void tst_scatter::removeSeries()
m_graph->addSeries(series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
}
@@ -214,14 +214,14 @@ void tst_scatter::removeMultipleSeries()
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 2);
+ QCOMPARE(m_graph->seriesList().size(), 2);
QVERIFY(!m_graph->selectedSeries());
m_graph->removeSeries(series2);
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
m_graph->removeSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
delete series2;
diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
index 76fc1c16..a442b1f3 100644
--- a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
@@ -68,8 +68,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->xPosRole(), QString(""));
QCOMPARE(proxy->yPosRole(), QString("y"));
QCOMPARE(proxy->zPosRole(), QString(""));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "y");
@@ -79,8 +79,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->xPosRole(), QString("column"));
QCOMPARE(proxy->yPosRole(), QString("y"));
QCOMPARE(proxy->zPosRole(), QString("row"));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "x", "y", "z");
@@ -90,8 +90,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->xPosRole(), QString("x"));
QCOMPARE(proxy->yPosRole(), QString("y"));
QCOMPARE(proxy->zPosRole(), QString("z"));
- QCOMPARE(proxy->rowCategories().length(), 0);
- QCOMPARE(proxy->columnCategories().length(), 0);
+ QCOMPARE(proxy->rowCategories().size(), 0);
+ QCOMPARE(proxy->columnCategories().size(), 0);
delete proxy;
proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "y",
@@ -102,8 +102,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->xPosRole(), QString("column"));
QCOMPARE(proxy->yPosRole(), QString("y"));
QCOMPARE(proxy->zPosRole(), QString("row"));
- QCOMPARE(proxy->rowCategories().length(), 1);
- QCOMPARE(proxy->columnCategories().length(), 1);
+ QCOMPARE(proxy->rowCategories().size(), 1);
+ QCOMPARE(proxy->columnCategories().size(), 1);
delete proxy;
proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "x", "y", "z",
@@ -114,8 +114,8 @@ void tst_proxy::construct()
QCOMPARE(proxy->xPosRole(), QString("x"));
QCOMPARE(proxy->yPosRole(), QString("y"));
QCOMPARE(proxy->zPosRole(), QString("z"));
- QCOMPARE(proxy->rowCategories().length(), 1);
- QCOMPARE(proxy->columnCategories().length(), 1);
+ QCOMPARE(proxy->rowCategories().size(), 1);
+ QCOMPARE(proxy->columnCategories().size(), 1);
delete proxy;
}
@@ -184,13 +184,13 @@ void tst_proxy::initializeProperties()
QCOMPARE(m_proxy->autoColumnCategories(), false);
QCOMPARE(m_proxy->autoRowCategories(), false);
- QCOMPARE(m_proxy->columnCategories().count(), 2);
+ QCOMPARE(m_proxy->columnCategories().size(), 2);
QCOMPARE(m_proxy->columnRole(), QString("column"));
QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/"));
QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1"));
QVERIFY(m_proxy->itemModel());
QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelSurfaceDataProxy::MMBAverage);
- QCOMPARE(m_proxy->rowCategories().count(), 2);
+ QCOMPARE(m_proxy->rowCategories().size(), 2);
QCOMPARE(m_proxy->rowRole(), QString("row"));
QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1"));
diff --git a/tests/auto/cpptest/q3dsurface/tst_surface.cpp b/tests/auto/cpptest/q3dsurface/tst_surface.cpp
index 6782b5df..0da7fa50 100644
--- a/tests/auto/cpptest/q3dsurface/tst_surface.cpp
+++ b/tests/auto/cpptest/q3dsurface/tst_surface.cpp
@@ -83,7 +83,7 @@ void tst_surface::construct()
void tst_surface::initialProperties()
{
QVERIFY(m_graph);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
QVERIFY(!m_graph->selectedSeries());
QCOMPARE(m_graph->flipHorizontalGrid(), false);
QCOMPARE(m_graph->axisX()->orientation(), QAbstract3DAxis::AxisOrientationX);
@@ -168,7 +168,7 @@ void tst_surface::addSeries()
{
m_graph->addSeries(newSeries());
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QVERIFY(!m_graph->selectedSeries());
}
@@ -182,7 +182,7 @@ void tst_surface::addMultipleSeries()
m_graph->addSeries(series2);
m_graph->addSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 3);
+ QCOMPARE(m_graph->seriesList().size(), 3);
}
void tst_surface::selectSeries()
@@ -192,7 +192,7 @@ void tst_surface::selectSeries()
m_graph->addSeries(series);
m_graph->seriesList()[0]->setSelectedPoint(QPoint(0, 0));
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->clearSelection();
@@ -205,7 +205,7 @@ void tst_surface::removeSeries()
m_graph->addSeries(series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
}
@@ -224,14 +224,14 @@ void tst_surface::removeMultipleSeries()
QCOMPARE(m_graph->selectedSeries(), series);
m_graph->removeSeries(series);
- QCOMPARE(m_graph->seriesList().length(), 2);
+ QCOMPARE(m_graph->seriesList().size(), 2);
QVERIFY(!m_graph->selectedSeries());
m_graph->removeSeries(series2);
- QCOMPARE(m_graph->seriesList().length(), 1);
+ QCOMPARE(m_graph->seriesList().size(), 1);
m_graph->removeSeries(series3);
- QCOMPARE(m_graph->seriesList().length(), 0);
+ QCOMPARE(m_graph->seriesList().size(), 0);
delete series;
delete series2;
diff --git a/tests/auto/cpptest/q3dtheme/tst_theme.cpp b/tests/auto/cpptest/q3dtheme/tst_theme.cpp
index be5b7335..24503d95 100644
--- a/tests/auto/cpptest/q3dtheme/tst_theme.cpp
+++ b/tests/auto/cpptest/q3dtheme/tst_theme.cpp
@@ -54,10 +54,10 @@ void tst_theme::construct()
QCOMPARE(theme->ambientLightStrength(), 0.5f);
QCOMPARE(theme->backgroundColor(), QColor(Qt::black));
QCOMPARE(theme->isBackgroundEnabled(), true);
- QCOMPARE(theme->baseColors().length(), 5);
+ QCOMPARE(theme->baseColors().size(), 5);
QCOMPARE(theme->baseColors().at(0), QColor(Qt::white));
QCOMPARE(theme->baseColors().at(4), QColor(QRgb(0x6b6b6b)));
- QCOMPARE(theme->baseGradients().length(), 5);
+ QCOMPARE(theme->baseGradients().size(), 5);
QCOMPARE(theme->baseGradients().at(0).stops().at(1).second, QColor(Qt::white));
QCOMPARE(theme->baseGradients().at(4).stops().at(1).second, QColor(QRgb(0x6b6b6b)));
QCOMPARE(theme->colorStyle(), Q3DTheme::ColorStyleUniform);
@@ -87,9 +87,9 @@ void tst_theme::initialProperties()
QCOMPARE(m_theme->ambientLightStrength(), 0.25f);
QCOMPARE(m_theme->backgroundColor(), QColor(Qt::black));
QCOMPARE(m_theme->isBackgroundEnabled(), true);
- QCOMPARE(m_theme->baseColors().length(), 1);
+ QCOMPARE(m_theme->baseColors().size(), 1);
QCOMPARE(m_theme->baseColors().at(0), QColor(Qt::black));
- QCOMPARE(m_theme->baseGradients().length(), 1);
+ QCOMPARE(m_theme->baseGradients().size(), 1);
QCOMPARE(m_theme->baseGradients().at(0).stops().at(0).second, QColor(Qt::black));
QCOMPARE(m_theme->baseGradients().at(0).stops().at(1).second, QColor(Qt::white));
QCOMPARE(m_theme->colorStyle(), Q3DTheme::ColorStyleUniform);
@@ -152,10 +152,10 @@ void tst_theme::initializeProperties()
QCOMPARE(m_theme->ambientLightStrength(), 0.3f);
QCOMPARE(m_theme->backgroundColor(), QColor(Qt::red));
QCOMPARE(m_theme->isBackgroundEnabled(), false);
- QCOMPARE(m_theme->baseColors().length(), 2);
+ QCOMPARE(m_theme->baseColors().size(), 2);
QCOMPARE(m_theme->baseColors().at(0), QColor(Qt::red));
QCOMPARE(m_theme->baseColors().at(1), QColor(Qt::blue));
- QCOMPARE(m_theme->baseGradients().length(), 2);
+ QCOMPARE(m_theme->baseGradients().size(), 2);
QCOMPARE(m_theme->baseGradients().at(0), gradient1);
QCOMPARE(m_theme->baseGradients().at(0), gradient2);
QCOMPARE(m_theme->colorStyle(), Q3DTheme::ColorStyleRangeGradient);