diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-11-01 10:45:41 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-11-02 18:11:01 +0100 |
commit | 2d3d9e12ed845240a9bc77689adfc0dd162e7407 (patch) | |
tree | b29b44ddd106d6e48d2c8ec0e6dc241c230839aa | |
parent | b7fd5774f69e6b9bef0a6f31d3e01d974eccc3a0 (diff) |
Monthly re-run of clang-tidy qt-* checks (11/2022)
Change-Id: Ie7d9117f627984c4af2cf600c8e9119abf306319
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
5 files changed, 19 insertions, 19 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 9ff2fcc655..eaa44ff231 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -1441,7 +1441,7 @@ std::optional<int> QQuickShaderEffectPrivate::findMappedShaderVariableId(const Q bool QQuickShaderEffectPrivate::sourceIsUnique(QQuickItem *source, Shader typeToSkip, int indexToSkip) const { for (int shaderType = 0; shaderType < NShader; ++shaderType) { - for (int idx = 0; idx < m_shaders[shaderType].varData.count(); ++idx) { + for (int idx = 0; idx < m_shaders[shaderType].varData.size(); ++idx) { if (shaderType != typeToSkip || idx != indexToSkip) { const auto &vd(m_shaders[shaderType].varData[idx]); if (vd.specialType == QSGShaderEffectNode::VariableData::Source && qvariant_cast<QObject *>(vd.value) == source) diff --git a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp index c5b5c7d9cd..230c9e09e7 100644 --- a/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp +++ b/tests/auto/qml/qqmlvaluetypeproviders/tst_qqmlvaluetypeproviders.cpp @@ -340,7 +340,7 @@ void tst_qqmlvaluetypeproviders::recursive() QVERIFY(!o.isNull()); const QList<StructuredValueType> l = o->property("l").value<QList<StructuredValueType>>(); - QCOMPARE(l.length(), 3); + QCOMPARE(l.size(), 3); QCOMPARE(l[2].i(), 4); QCOMPARE(l[1].p().x(), 88); QCOMPARE(l[0].sizes()[1].width(), 19); diff --git a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp index 89487269f7..e488c0486f 100644 --- a/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp +++ b/tests/auto/quick/pointerhandlers/qquickhoverhandler/tst_qquickhoverhandler.cpp @@ -596,12 +596,12 @@ void tst_HoverHandler::addHandlerFromCpp() // Move mouse inside child QTest::mouseMove(window.data(), inside); QVERIFY(handler->isHovered()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); // Move mouse outside child QTest::mouseMove(window.data(), outside); QVERIFY(!handler->isHovered()); - QCOMPARE(spy.count(), 2); + QCOMPARE(spy.size(), 2); // Remove the parent item from the handler spy.clear(); @@ -610,12 +610,12 @@ void tst_HoverHandler::addHandlerFromCpp() // Move mouse inside child QTest::mouseMove(window.data(), inside); QVERIFY(!handler->isHovered()); - QCOMPARE(spy.count(), 0); + QCOMPARE(spy.size(), 0); // Move mouse outside child QTest::mouseMove(window.data(), outside); QVERIFY(!handler->isHovered()); - QCOMPARE(spy.count(), 0); + QCOMPARE(spy.size(), 0); // Reparent back the item to the handler spy.clear(); @@ -624,12 +624,12 @@ void tst_HoverHandler::addHandlerFromCpp() // Move mouse inside child QTest::mouseMove(window.data(), inside); QVERIFY(handler->isHovered()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); // Move mouse outside child QTest::mouseMove(window.data(), outside); QVERIFY(!handler->isHovered()); - QCOMPARE(spy.count(), 2); + QCOMPARE(spy.size(), 2); } void tst_HoverHandler::ensureHoverHandlerWorksWhenItemHasHoverDisabled() @@ -663,12 +663,12 @@ void tst_HoverHandler::ensureHoverHandlerWorksWhenItemHasHoverDisabled() // Move mouse inside child QTest::mouseMove(window.data(), inside); QVERIFY(handler->isHovered()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); // Move mouse outside child QTest::mouseMove(window.data(), outside); QVERIFY(!handler->isHovered()); - QCOMPARE(spy.count(), 2); + QCOMPARE(spy.size(), 2); } QTEST_MAIN(tst_HoverHandler) diff --git a/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp b/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp index e1ba583dfe..7e6416b8e2 100644 --- a/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp +++ b/tests/auto/quick/qquickdeliveryagent/tst_qquickdeliveryagent.cpp @@ -372,8 +372,8 @@ void tst_qquickdeliveryagent::tapHandlerDoesntOverrideSubsceneGrabber() // QTBUG QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, clickPos); qCDebug(lcTests) << "clicking subscene TextEdit set cursorPos to" << cursorPos; QVERIFY(textEdit->property("cursorPosition").toInt() > cursorPos); // TextEdit reacts regardless - QCOMPARE(clickSpy.count(), expectedTaps); - QCOMPARE(cancelSpy.count(), expectedCancels); + QCOMPARE(clickSpy.size(), expectedTaps); + QCOMPARE(cancelSpy.size(), expectedCancels); } void tst_qquickdeliveryagent::undoDelegationWhenSubsceneFocusCleared() // QTBUG-105192 diff --git a/tests/auto/quickcontrols2/pointerhandlers/tst_pointerhandlers.cpp b/tests/auto/quickcontrols2/pointerhandlers/tst_pointerhandlers.cpp index ffb57718e3..aa83175252 100644 --- a/tests/auto/quickcontrols2/pointerhandlers/tst_pointerhandlers.cpp +++ b/tests/auto/quickcontrols2/pointerhandlers/tst_pointerhandlers.cpp @@ -199,8 +199,8 @@ void tst_pointerhandlers::buttonTapHandler() // QTBUG-105609 case QPointingDevice::DeviceType::Mouse: // click it QTest::mouseClick(&window, mouseButton, Qt::NoModifier, pos); - QTRY_COMPARE(clickedSpy.count(), 1); // perhaps Button should not react to right-click, but it does - QCOMPARE(tappedSpy.count(), 1); + QTRY_COMPARE(clickedSpy.size(), 1); // perhaps Button should not react to right-click, but it does + QCOMPARE(tappedSpy.size(), 1); break; case QPointingDevice::DeviceType::TouchScreen: { @@ -209,8 +209,8 @@ void tst_pointerhandlers::buttonTapHandler() // QTBUG-105609 touch.press(0, pos, &window).commit(); QTRY_COMPARE(target->property("pressed").toBool(), true); touch.release(0, pos, &window).commit(); - QTRY_COMPARE(clickedSpy.count(), 1); - QCOMPARE(tappedSpy.count(), 1); + QTRY_COMPARE(clickedSpy.size(), 1); + QCOMPARE(tappedSpy.size(), 1); break; } default: @@ -247,7 +247,7 @@ void tst_pointerhandlers::buttonDragHandler() // QTBUG-105610 case QPointingDevice::DeviceType::Mouse: // click it QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, dragPos); - QTRY_COMPARE(clickedSpy.count(), 1); + QTRY_COMPARE(clickedSpy.size(), 1); // drag it QTest::mousePress(&window, Qt::LeftButton, Qt::NoModifier, dragPos); @@ -266,7 +266,7 @@ void tst_pointerhandlers::buttonDragHandler() // QTBUG-105610 // tap it touch.press(0, dragPos, &window).commit(); touch.release(0, dragPos, &window).commit(); - QTRY_COMPARE(clickedSpy.count(), 1); + QTRY_COMPARE(clickedSpy.size(), 1); // drag it touch.press(0, dragPos, &window).commit(); @@ -286,7 +286,7 @@ void tst_pointerhandlers::buttonDragHandler() // QTBUG-105610 // click it again QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, dragPos); - QTRY_COMPARE(clickedSpy.count(), 2); + QTRY_COMPARE(clickedSpy.size(), 2); } QTEST_MAIN(tst_pointerhandlers) |