diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 275a4a1441f..48331c5a4d0 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -610,7 +610,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin void QWaylandDisplay::registry_global_remove(uint32_t id) { - for (int i = 0, ie = mGlobals.count(); i != ie; ++i) { + for (int i = 0, ie = mGlobals.size(); i != ie; ++i) { RegistryGlobal &global = mGlobals[i]; if (global.id == id) { if (global.interface == QLatin1String(QtWayland::wl_output::interface()->name)) { @@ -677,7 +677,7 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data) { Listener l = { listener, data }; mRegistryListeners.append(l); - for (int i = 0, ie = mGlobals.count(); i != ie; ++i) + for (int i = 0, ie = mGlobals.size(); i != ie; ++i) (*l.listener)(l.data, mGlobals[i].registry, mGlobals[i].id, mGlobals[i].interface, mGlobals[i].version); } diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp index 57bccde3805..fd56a252b93 100644 --- a/src/plugins/platforms/wayland/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp @@ -148,7 +148,7 @@ QList QWaylandScreen::virtualSiblings() const const QList screens = mWaylandDisplay->screens(); auto *placeholder = mWaylandDisplay->placeholderScreen(); - list.reserve(screens.count() + (placeholder ? 1 : 0)); + list.reserve(screens.size() + (placeholder ? 1 : 0)); for (QWaylandScreen *screen : qAsConst(screens)) { if (screen->screen()) diff --git a/src/plugins/platforms/wayland/qwaylandtouch.cpp b/src/plugins/platforms/wayland/qwaylandtouch.cpp index 41dfd085539..a88947e07dd 100644 --- a/src/plugins/platforms/wayland/qwaylandtouch.cpp +++ b/src/plugins/platforms/wayland/qwaylandtouch.cpp @@ -107,12 +107,12 @@ void QWaylandTouchExtension::touch_extension_touch(uint32_t time, void QWaylandTouchExtension::sendTouchEvent() { // Copy all points, that are in the previous but not in the current list, as stationary. - for (int i = 0; i < mPrevTouchPoints.count(); ++i) { + for (int i = 0; i < mPrevTouchPoints.size(); ++i) { const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i)); if (prevPoint.state == QEventPoint::Released) continue; bool found = false; - for (int j = 0; j < mTouchPoints.count(); ++j) + for (int j = 0; j < mTouchPoints.size(); ++j) if (mTouchPoints.at(j).id == prevPoint.id) { found = true; break; @@ -132,14 +132,14 @@ void QWaylandTouchExtension::sendTouchEvent() QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints); QEventPoint::States states = {}; - for (int i = 0; i < mTouchPoints.count(); ++i) + for (int i = 0; i < mTouchPoints.size(); ++i) states |= mTouchPoints.at(i).state; if (mFlags & QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH) { const bool firstPress = states == QEventPoint::Pressed; if (firstPress) mMouseSourceId = mTouchPoints.first().id; - for (int i = 0; i < mTouchPoints.count(); ++i) { + for (int i = 0; i < mTouchPoints.size(); ++i) { const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i)); if (tp.id == mMouseSourceId) { const bool released = tp.state == QEventPoint::Released; diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 001f99d02ae..73a14b89766 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -132,7 +132,7 @@ void QWaylandWindow::initWindow() mShellSurface->setAppId(fi.baseName()); } else { QString appId; - for (int i = 0; i < domainName.count(); ++i) + for (int i = 0; i < domainName.size(); ++i) appId.prepend(QLatin1Char('.')).prepend(domainName.at(i)); appId.append(fi.baseName()); mShellSurface->setAppId(appId); @@ -288,9 +288,9 @@ void QWaylandWindow::setWindowTitle(const QString &title) const int maxLength = libwaylandMaxBufferSize / 3 - 100; auto truncated = QStringView{formatted}.left(maxLength); - if (truncated.length() < formatted.length()) { + if (truncated.size() < formatted.size()) { qCWarning(lcQpaWayland) << "Window titles longer than" << maxLength << "characters are not supported." - << "Truncating window title (from" << formatted.length() << "chars)"; + << "Truncating window title (from" << formatted.size() << "chars)"; } mShellSurface->setTitle(truncated.toString()); } diff --git a/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp b/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp index 256a0c4230d..cfde26c76df 100644 --- a/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp +++ b/src/plugins/platforms/wayland/shared/qwaylandinputmethodeventbuilder.cpp @@ -106,7 +106,7 @@ QInputMethodEvent *QWaylandInputMethodEventBuilder::buildCommit(const QString &t const int absoluteOffset = absoluteCursor - cursor; - const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.length(); + const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.size(); surrounding.replace(qMin(anchor, cursor) + replacement.first, qAbs(anchor - cursor) + replacement.second, text); @@ -278,10 +278,10 @@ int QWaylandInputMethodEventBuilder::indexFromWayland(const QString &text, int l if (length < 0) { const QByteArray &utf8 = QStringView{text}.left(base).toUtf8(); - return QString::fromUtf8(utf8.left(qMax(utf8.length() + length, 0))).length(); + return QString::fromUtf8(utf8.left(qMax(utf8.size() + length, 0))).size(); } else { const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8(); - return QString::fromUtf8(utf8.left(length)).length() + base; + return QString::fromUtf8(utf8.left(length)).size() + base; } } @@ -304,20 +304,20 @@ int QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(const QString &text const unsigned char ch = utf8.at(start + i); // check if current character is a utf8's initial character. if (ch < 0x80 || ch > 0xbf) - return QString::fromUtf8(utf8.left(start + i)).length(); + return QString::fromUtf8(utf8.left(start + i)).size(); } } else { const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8(); const int len = utf8.size(); const int start = length; if (start >= len) - return base + QString::fromUtf8(utf8).length(); + return base + QString::fromUtf8(utf8).size(); for (int i = 0; i < 4; i++) { const unsigned char ch = utf8.at(start - i); // check if current character is a utf8's initial character. if (ch < 0x80 || ch > 0xbf) - return base + QString::fromUtf8(utf8.left(start - i)).length(); + return base + QString::fromUtf8(utf8.left(start - i)).size(); } } return -1; diff --git a/src/plugins/platforms/wayland/shared/qwaylandmimehelper.cpp b/src/plugins/platforms/wayland/shared/qwaylandmimehelper.cpp index f589666c1ec..3bbbad97b0b 100644 --- a/src/plugins/platforms/wayland/shared/qwaylandmimehelper.cpp +++ b/src/plugins/platforms/wayland/shared/qwaylandmimehelper.cpp @@ -36,7 +36,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString & content = qvariant_cast(mimeData->colorData()).name().toLatin1(); } else if (mimeType == QLatin1String("text/uri-list")) { QList urls = mimeData->urls(); - for (int i = 0; i < urls.count(); ++i) { + for (int i = 0; i < urls.size(); ++i) { content.append(urls.at(i).toEncoded()); content.append("\r\n"); } diff --git a/tests/auto/wayland/client/tst_client.cpp b/tests/auto/wayland/client/tst_client.cpp index 1c28832490a..db4eb77e451 100644 --- a/tests/auto/wayland/client/tst_client.cpp +++ b/tests/auto/wayland/client/tst_client.cpp @@ -590,7 +590,7 @@ void tst_WaylandClient::longWindowTitleWithUtf16Characters() { QWindow window; QString absurdlyLongTitle = QString("δΈ‰").repeated(10000); - Q_ASSERT(absurdlyLongTitle.length() == 10000); // just making sure the test isn't broken + Q_ASSERT(absurdlyLongTitle.size() == 10000); // just making sure the test isn't broken window.setTitle(absurdlyLongTitle); window.show(); QCOMPOSITOR_TRY_VERIFY(surface()); diff --git a/tests/auto/wayland/clientextension/tst_clientextension.cpp b/tests/auto/wayland/clientextension/tst_clientextension.cpp index 209afa822c5..a6e79bd2ca2 100644 --- a/tests/auto/wayland/clientextension/tst_clientextension.cpp +++ b/tests/auto/wayland/clientextension/tst_clientextension.cpp @@ -69,10 +69,10 @@ void tst_clientextension::createWithoutGlobal() QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged); QVERIFY(spy.isValid()); QVERIFY(!extension.isActive()); - QCOMPARE(spy.count(), 0); + QCOMPARE(spy.size(), 0); extension.initialize(); QVERIFY(!extension.isActive()); - QCOMPARE(spy.count(), 0); + QCOMPARE(spy.size(), 0); } void tst_clientextension::createWithGlobalAutomatic() @@ -83,7 +83,7 @@ void tst_clientextension::createWithGlobalAutomatic() QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged); QVERIFY(spy.isValid()); QTRY_VERIFY(extension.isActive()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); } void tst_clientextension::createWithGlobalManual() @@ -96,7 +96,7 @@ void tst_clientextension::createWithGlobalManual() QVERIFY(spy.isValid()); extension.initialize(); QVERIFY(extension.isActive()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); } void tst_clientextension::globalBecomesAvailable() @@ -106,7 +106,7 @@ void tst_clientextension::globalBecomesAvailable() QVERIFY(spy.isValid()); exec([this] { add(); }); QTRY_VERIFY(extension.isActive()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); } void tst_clientextension::globalRemoved() @@ -120,7 +120,7 @@ void tst_clientextension::globalRemoved() exec([this] { removeAll(); }); QTRY_VERIFY(!extension.isActive()); - QCOMPARE(spy.count(), 1); + QCOMPARE(spy.size(), 1); } QCOMPOSITOR_TEST_MAIN(tst_clientextension) diff --git a/tests/auto/wayland/datadevicev1/tst_datadevicev1.cpp b/tests/auto/wayland/datadevicev1/tst_datadevicev1.cpp index d4dfa2da046..d78255e9fc8 100644 --- a/tests/auto/wayland/datadevicev1/tst_datadevicev1.cpp +++ b/tests/auto/wayland/datadevicev1/tst_datadevicev1.cpp @@ -213,7 +213,7 @@ void tst_datadevicev1::destroysSelectionOnLeave() keyboard()->sendLeave(surface); }); - QTRY_COMPARE(dataChangedSpy.count(), 1); + QTRY_COMPARE(dataChangedSpy.size(), 1); QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Clipboard)->hasText()); } diff --git a/tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp b/tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp index c48e5532b84..15613bc0485 100644 --- a/tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp +++ b/tests/auto/wayland/fullscreenshellv1/tst_fullscreenshellv1.cpp @@ -25,7 +25,7 @@ void tst_WaylandClientFullScreenShellV1::createDestroyWindow() window.resize(800, 600); window.show(); - QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().count() == 1); + QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().size() == 1); QCOMPOSITOR_VERIFY(surface(0)); window.destroy(); diff --git a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp index 9bcfa9e776c..328dc1fb217 100644 --- a/tests/auto/wayland/inputcontext/tst_inputcontext.cpp +++ b/tests/auto/wayland/inputcontext/tst_inputcontext.cpp @@ -36,9 +36,9 @@ private: { exec([&] { QList extensions = getAll(); - if (extensions.length() > 1) + if (extensions.size() > 1) QFAIL("Requested type is a singleton, hence there should not be more then one object returned"); - if (extensions.length() == 0) + if (extensions.size() == 0) add(); }); } @@ -48,9 +48,9 @@ private: { exec([&] { QList extensions = getAll(); - if (extensions.length() > 1) + if (extensions.size() > 1) QFAIL("Requested type is a singleton, hence there should not be more then one object returned"); - if (extensions.length() == 1) + if (extensions.size() == 1) remove(extensions.first()); }); } diff --git a/tests/auto/wayland/primaryselectionv1/tst_primaryselectionv1.cpp b/tests/auto/wayland/primaryselectionv1/tst_primaryselectionv1.cpp index d947d30064e..5ec046d1757 100644 --- a/tests/auto/wayland/primaryselectionv1/tst_primaryselectionv1.cpp +++ b/tests/auto/wayland/primaryselectionv1/tst_primaryselectionv1.cpp @@ -409,7 +409,7 @@ void tst_primaryselectionv1::destroysSelectionOnLeave() keyboard()->sendLeave(surface); }); - QTRY_COMPARE(selectionChangedSpy.count(), 1); + QTRY_COMPARE(selectionChangedSpy.size(), 1); QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Selection)->hasText()); } diff --git a/tests/auto/wayland/seat/tst_seat.cpp b/tests/auto/wayland/seat/tst_seat.cpp index 0b1e1b2a2cb..68749486b43 100644 --- a/tests/auto/wayland/seat/tst_seat.cpp +++ b/tests/auto/wayland/seat/tst_seat.cpp @@ -94,7 +94,7 @@ void tst_seat::usesEnterSerial() }); QCOMPOSITOR_TRY_VERIFY(pointer()->cursorSurface()); - QTRY_COMPARE(setCursorSpy.count(), 1); + QTRY_COMPARE(setCursorSpy.size(), 1); QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial); } @@ -438,14 +438,14 @@ void tst_seat::singleTap() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchBegin); QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top())); } { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchEnd); QCOMPARE(e.touchPointStates, QEventPoint::State::Released); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top())); } } @@ -469,14 +469,14 @@ void tst_seat::singleTapFloat() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchBegin); QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top())); } { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchEnd); QCOMPARE(e.touchPointStates, QEventPoint::State::Released); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top())); } } @@ -512,7 +512,7 @@ void tst_seat::multiTouch() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchBegin); QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed); - QCOMPARE(e.touchPoints.length(), 2); + QCOMPARE(e.touchPoints.size(), 2); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Pressed); QCOMPARE(e.touchPoints[0].position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top())); @@ -523,7 +523,7 @@ void tst_seat::multiTouch() { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchUpdate); - QCOMPARE(e.touchPoints.length(), 2); + QCOMPARE(e.touchPoints.size(), 2); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Updated); QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top())); @@ -535,7 +535,7 @@ void tst_seat::multiTouch() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchUpdate); QCOMPARE(e.touchPointStates, QEventPoint::State::Released | QEventPoint::State::Stationary); - QCOMPARE(e.touchPoints.length(), 2); + QCOMPARE(e.touchPoints.size(), 2); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released); QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top())); @@ -547,7 +547,7 @@ void tst_seat::multiTouch() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchEnd); QCOMPARE(e.touchPointStates, QEventPoint::State::Released); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released); QCOMPARE(e.touchPoints[0].position(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top())); } @@ -589,14 +589,14 @@ void tst_seat::multiTouchUpAndMotionFrame() { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchUpdate); - QCOMPARE(e.touchPoints.length(), 2); + QCOMPARE(e.touchPoints.size(), 2); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released); QCOMPARE(e.touchPoints[1].state(), QEventPoint::State::Updated); } { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchEnd); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released); } QVERIFY(window.m_events.empty()); @@ -653,13 +653,13 @@ void tst_seat::cancelTouch() auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchBegin); QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed); - QCOMPARE(e.touchPoints.length(), 1); + QCOMPARE(e.touchPoints.size(), 1); QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top())); } { auto e = window.m_events.takeFirst(); QCOMPARE(e.type, QEvent::TouchCancel); - QCOMPARE(e.touchPoints.length(), 0); + QCOMPARE(e.touchPoints.size(), 0); } } diff --git a/tests/auto/wayland/seatv4/tst_seatv4.cpp b/tests/auto/wayland/seatv4/tst_seatv4.cpp index 3a5a479fbd8..873b0ff6101 100644 --- a/tests/auto/wayland/seatv4/tst_seatv4.cpp +++ b/tests/auto/wayland/seatv4/tst_seatv4.cpp @@ -127,7 +127,7 @@ void tst_seatv4::usesEnterSerial() }); QCOMPOSITOR_TRY_VERIFY(cursorSurface()); - QTRY_COMPARE(setCursorSpy.count(), 1); + QTRY_COMPARE(setCursorSpy.size(), 1); QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial); } @@ -139,13 +139,13 @@ void tst_seatv4::focusDestruction() window.show(); QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial); // Setting a cursor now is not allowed since there has been no enter event - QCOMPARE(setCursorSpy.count(), 0); + QCOMPARE(setCursorSpy.size(), 0); uint enterSerial = exec([&] { return pointer()->sendEnter(xdgSurface()->m_surface, {32, 32}); }); QCOMPOSITOR_TRY_VERIFY(cursorSurface()); - QTRY_COMPARE(setCursorSpy.count(), 1); + QTRY_COMPARE(setCursorSpy.size(), 1); QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial); // Destroy the focus @@ -159,7 +159,7 @@ void tst_seatv4::focusDestruction() // Setting a cursor now is not allowed since there has been no enter event xdgPingAndWaitForPong(); - QCOMPARE(setCursorSpy.count(), 0); + QCOMPARE(setCursorSpy.size(), 0); } void tst_seatv4::mousePress() @@ -568,7 +568,7 @@ void tst_seatv4::animatedCursor() }); // Verify that we get a new cursor buffer - QTRY_COMPARE(bufferSpy.count(), 1); + QTRY_COMPARE(bufferSpy.size(), 1); } #endif // QT_CONFIG(cursor) diff --git a/tests/auto/wayland/shared/mockcompositor.cpp b/tests/auto/wayland/shared/mockcompositor.cpp index 03d0ffb6c57..1266f7762b2 100644 --- a/tests/auto/wayland/shared/mockcompositor.cpp +++ b/tests/auto/wayland/shared/mockcompositor.cpp @@ -92,7 +92,7 @@ void DefaultCompositor::xdgPingAndWaitForPong() { QSignalSpy pongSpy(exec([=] { return get(); }), &XdgWmBase::pong); uint serial = exec([=] { return sendXdgShellPing(); }); - QTRY_COMPARE(pongSpy.count(), 1); + QTRY_COMPARE(pongSpy.size(), 1); QTRY_COMPARE(pongSpy.first().at(0).toUInt(), serial); } diff --git a/tests/auto/wayland/surface/tst_surface.cpp b/tests/auto/wayland/surface/tst_surface.cpp index e834508615f..083bc4faa90 100644 --- a/tests/auto/wayland/surface/tst_surface.cpp +++ b/tests/auto/wayland/surface/tst_surface.cpp @@ -55,7 +55,7 @@ void tst_surface::waitForFrameCallbackRaster() exec([=] { xdgToplevel()->sendCompleteConfigure(); }); // We should get the first buffer without waiting for a frame callback - QTRY_COMPARE(bufferSpy.count(), 1); + QTRY_COMPARE(bufferSpy.size(), 1); bufferSpy.removeFirst(); // Make sure we follow frame callbacks for some frames @@ -66,7 +66,7 @@ void tst_surface::waitForFrameCallbackRaster() QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty()); xdgToplevel()->surface()->sendFrameCallbacks(); }); - QTRY_COMPARE(bufferSpy.count(), 1); + QTRY_COMPARE(bufferSpy.size(), 1); bufferSpy.removeFirst(); } } @@ -96,14 +96,14 @@ void tst_surface::waitForFrameCallbackGl() exec([=] { xdgToplevel()->sendCompleteConfigure(); }); // We should get the first buffer without waiting for a frame callback - QTRY_COMPARE(bufferSpy.count(), 1); + QTRY_COMPARE(bufferSpy.size(), 1); bufferSpy.removeFirst(); // Make sure we follow frame callbacks for some frames for (int i = 0; i < 5; ++i) { xdgPingAndWaitForPong(); // Make sure things have happened on the client if (!qEnvironmentVariableIntValue("QT_WAYLAND_DISABLE_WINDOWDECORATION") && i == 0) { - QCOMPARE(bufferSpy.count(), 1); + QCOMPARE(bufferSpy.size(), 1); bufferSpy.removeFirst(); } exec([&] { @@ -111,7 +111,7 @@ void tst_surface::waitForFrameCallbackGl() QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty()); xdgToplevel()->surface()->sendFrameCallbacks(); }); - QTRY_COMPARE(bufferSpy.count(), 1); + QTRY_COMPARE(bufferSpy.size(), 1); bufferSpy.removeFirst(); } } @@ -168,15 +168,15 @@ void tst_surface::createSubsurface() // Move subsurface. The parent should redraw and commit subWindow.setGeometry(100, 100, 64, 64); // the toplevel should commit to indicate the subsurface moved - QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1); + QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1); mainSurfaceCommitSpy.clear(); childSurfaceCommitSpy.clear(); // Move and resize the subSurface. The parent should redraw and commit // The child should also redraw subWindow.setGeometry(50, 50, 80, 80); - QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1); - QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.count(), 1); + QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1); + QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.size(), 1); } diff --git a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp index 8d275e1ebcb..e560784e954 100644 --- a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp @@ -78,7 +78,7 @@ void tst_xdgshell::basicConfigure() QTRY_VERIFY(window.isExposed()); // The client is now going to ack the configure - QTRY_COMPARE(configureSpy.count(), 1); + QTRY_COMPARE(configureSpy.size(), 1); QCOMPARE(configureSpy.takeFirst().at(0).toUInt(), serial); // And attach a buffer @@ -104,7 +104,7 @@ void tst_xdgshell::configureSize() xdgToplevel()->sendCompleteConfigure(configureSize); }); - QTRY_COMPARE(configureSpy.count(), 1); + QTRY_COMPARE(configureSpy.size(), 1); exec([=] { Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer; @@ -192,7 +192,7 @@ void tst_xdgshell::popup() QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); QSignalSpy toplevelConfigureSpy(exec([=] { return xdgSurface(); }), &XdgSurface::configureCommitted); exec([=] { xdgToplevel()->sendCompleteConfigure(); }); - QTRY_COMPARE(toplevelConfigureSpy.count(), 1); + QTRY_COMPARE(toplevelConfigureSpy.size(), 1); uint clickSerial = exec([=] { auto *surface = xdgToplevel()->surface(); @@ -230,7 +230,7 @@ void tst_xdgshell::popup() QTRY_VERIFY(popup->isExposed()); // The client is now going to ack the configure - QTRY_COMPARE(popupConfigureSpy.count(), 1); + QTRY_COMPARE(popupConfigureSpy.size(), 1); QCOMPARE(popupConfigureSpy.takeFirst().at(0).toUInt(), configureSerial); // And attach a buffer @@ -560,7 +560,7 @@ void tst_xdgshell::pongs() wl_resource *resource = base->resourceMap().first()->handle; base->send_ping(resource, serial); }); - QTRY_COMPARE(pongSpy.count(), 1); + QTRY_COMPARE(pongSpy.size(), 1); QCOMPARE(pongSpy.first().at(0).toUInt(), serial); } @@ -626,7 +626,7 @@ void tst_xdgshell::foreignSurface() // the pointer events above are handled. QSignalSpy spy(exec([=] { return surface(newSurfaceIndex); }), &Surface::commit); wl_surface_commit(foreignSurface); - QTRY_COMPARE(spy.count(), 1); + QTRY_COMPARE(spy.size(), 1); wl_surface_destroy(foreignSurface); }