diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-11-11 15:53:00 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-18 22:01:40 +0100 |
commit | bd8a9c9ca7bbdea78148d9c78fa392e26d22137f (patch) | |
tree | 20509eedbe219eabdb8a494005d5f235901aeb08 /src | |
parent | bb7962d822618523c1dafb7eaef7fe43113e8fbc (diff) |
Port from container::count() and length() to size() - V5
This is a the same semantic patch (qt-port-to-std-compatible-api V5
with config Scope: 'Container') as in dev. I've re-ran it in 6.4 to
avoid cherry-pick conflicts.
Change-Id: Ia27645cbf2b156fb594a7878dc6405f5b1a40692
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src')
5 files changed, 15 insertions, 15 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, |