diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebenginehttprequest.cpp | 2 | ||||
-rw-r--r-- | src/core/api/qwebenginescriptcollection.cpp | 2 | ||||
-rw-r--r-- | src/pdf/qpdfbookmarkmodel.cpp | 4 | ||||
-rw-r--r-- | src/pdf/qpdfdocument.cpp | 8 | ||||
-rw-r--r-- | src/pdf/qpdflinkmodel.cpp | 2 | ||||
-rw-r--r-- | src/pdf/qpdfpagenavigator.cpp | 22 | ||||
-rw-r--r-- | src/pdf/qpdfsearchmodel.cpp | 22 | ||||
-rw-r--r-- | src/pdfquick/qquickpdfselection.cpp | 8 | ||||
-rw-r--r-- | src/pdfwidgets/qpdfview.cpp | 2 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebengineclientcertificateselection.cpp | 2 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebenginefaviconprovider.cpp | 4 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebenginescriptcollection.cpp | 2 | ||||
-rw-r--r-- | src/webenginequick/api/qquickwebengineview.cpp | 2 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebengineview.cpp | 4 |
14 files changed, 43 insertions, 43 deletions
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp index bb822d6e3..050213d1e 100644 --- a/src/core/api/qwebenginehttprequest.cpp +++ b/src/core/api/qwebenginehttprequest.cpp @@ -151,7 +151,7 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url, QByteArray key = QUrl::toPercentEncoding(it.key()); QByteArray value = QUrl::toPercentEncoding(it.value()); - if (buffer.length() > 0) + if (buffer.size() > 0) buffer += '&'; buffer.append(key).append('=').append(value); } diff --git a/src/core/api/qwebenginescriptcollection.cpp b/src/core/api/qwebenginescriptcollection.cpp index e551a5127..7867192b6 100644 --- a/src/core/api/qwebenginescriptcollection.cpp +++ b/src/core/api/qwebenginescriptcollection.cpp @@ -120,7 +120,7 @@ QWebEngineScriptCollectionPrivate::QWebEngineScriptCollectionPrivate(QtWebEngine int QWebEngineScriptCollectionPrivate::count() const { - return m_scripts.count(); + return m_scripts.size(); } bool QWebEngineScriptCollectionPrivate::contains(const QWebEngineScript &s) const diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp index 7b984a300..c9035f21a 100644 --- a/src/pdf/qpdfbookmarkmodel.cpp +++ b/src/pdf/qpdfbookmarkmodel.cpp @@ -50,7 +50,7 @@ public: int childCount() const { - return m_childNodes.count(); + return m_childNodes.size(); } int row() const @@ -172,7 +172,7 @@ struct QPdfBookmarkModelPrivate const int titleLength = int(FPDFBookmark_GetTitle(bookmark, nullptr, 0)); QList<char16_t> titleBuffer(titleLength); - FPDFBookmark_GetTitle(bookmark, titleBuffer.data(), quint32(titleBuffer.length())); + FPDFBookmark_GetTitle(bookmark, titleBuffer.data(), quint32(titleBuffer.size())); const FPDF_DEST dest = FPDFBookmark_GetDest(document, bookmark); const int pageNumber = FPDFDest_GetDestPageIndex(document, dest); diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp index b738296ae..9b8d20d3b 100644 --- a/src/pdf/qpdfdocument.cpp +++ b/src/pdf/qpdfdocument.cpp @@ -639,7 +639,7 @@ QVariant QPdfDocument::metaData(MetaDataField field) const const unsigned long len = FPDF_GetMetaText(d->doc, fieldName.constData(), nullptr, 0); QList<ushort> buf(len); - FPDF_GetMetaText(d->doc, fieldName.constData(), buf.data(), buf.length()); + FPDF_GetMetaText(d->doc, fieldName.constData(), buf.data(), buf.size()); lock.unlock(); QString text = QString::fromUtf16(reinterpret_cast<const char16_t *>(buf.data())); @@ -969,7 +969,7 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma QString text; if (maxLength > 0) { text = d->getText(textPage, startIndex, maxLength); - rectCount = FPDFText_CountRects(textPage, startIndex, text.length()); + rectCount = FPDFText_CountRects(textPage, startIndex, text.size()); for (int i = 0; i < rectCount; ++i) { double l, r, b, t; FPDFText_GetRect(textPage, i, &l, &t, &r, &b); @@ -984,12 +984,12 @@ QPdfSelection QPdfDocument::getSelectionAtIndex(int page, int startIndex, int ma if (bounds.isEmpty()) hull = QRectF(d->getCharPosition(textPage, pageHeight, startIndex), QSizeF()); qCDebug(qLcDoc) << "on page" << page << "at index" << startIndex << "maxLength" << maxLength - << "got" << text.length() << "chars," << rectCount << "rects within" << hull; + << "got" << text.size() << "chars," << rectCount << "rects within" << hull; FPDFText_ClosePage(textPage); FPDF_ClosePage(pdfPage); - return QPdfSelection(text, bounds, hull, startIndex, startIndex + text.length()); + return QPdfSelection(text, bounds, hull, startIndex, startIndex + text.size()); } /*! diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp index 349e6a40b..c98a8723e 100644 --- a/src/pdf/qpdflinkmodel.cpp +++ b/src/pdf/qpdflinkmodel.cpp @@ -68,7 +68,7 @@ int QPdfLinkModel::rowCount(const QModelIndex &parent) const { Q_D(const QPdfLinkModel); Q_UNUSED(parent); - return d->links.count(); + return d->links.size(); } /*! \internal diff --git a/src/pdf/qpdfpagenavigator.cpp b/src/pdf/qpdfpagenavigator.cpp index 9e807e5cd..253c1dff8 100644 --- a/src/pdf/qpdfpagenavigator.cpp +++ b/src/pdf/qpdfpagenavigator.cpp @@ -62,7 +62,7 @@ QPdfPageNavigator::~QPdfPageNavigator() */ void QPdfPageNavigator::forward() { - if (d->currentHistoryIndex >= d->pageHistory.count() - 1) + if (d->currentHistoryIndex >= d->pageHistory.size() - 1) return; const bool backAvailableWas = backAvailable(); const bool forwardAvailableWas = forwardAvailable(); @@ -122,7 +122,7 @@ void QPdfPageNavigator::back() */ int QPdfPageNavigator::currentPage() const { - if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.count()) + if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size()) return -1; // only until ctor or clear() runs return d->pageHistory.at(d->currentHistoryIndex)->page; } @@ -136,7 +136,7 @@ int QPdfPageNavigator::currentPage() const */ QPointF QPdfPageNavigator::currentLocation() const { - if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.count()) + if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size()) return QPointF(); return d->pageHistory.at(d->currentHistoryIndex)->location; } @@ -149,14 +149,14 @@ QPointF QPdfPageNavigator::currentLocation() const */ qreal QPdfPageNavigator::currentZoom() const { - if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.count()) + if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size()) return 1; return d->pageHistory.at(d->currentHistoryIndex)->zoom; } QPdfLink QPdfPageNavigator::currentLink() const { - if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.count()) + if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size()) return QPdfLink(); return QPdfLink(d->pageHistory.at(d->currentHistoryIndex).data()); } @@ -195,9 +195,9 @@ void QPdfPageNavigator::jump(QPdfLink destination) const bool forwardAvailableWas = forwardAvailable(); if (!d->changing) { if (d->currentHistoryIndex >= 0 && forwardAvailableWas) - d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.count() - d->currentHistoryIndex - 1); + d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.size() - d->currentHistoryIndex - 1); d->pageHistory.append(destination.d); - d->currentHistoryIndex = d->pageHistory.count() - 1; + d->currentHistoryIndex = d->pageHistory.size() - 1; } if (zoomChange) emit currentZoomChanged(currentZoom()); @@ -251,9 +251,9 @@ void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom) const bool forwardAvailableWas = forwardAvailable(); if (!d->changing) { if (d->currentHistoryIndex >= 0 && forwardAvailableWas) - d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.count() - d->currentHistoryIndex - 1); + d->pageHistory.remove(d->currentHistoryIndex + 1, d->pageHistory.size() - d->currentHistoryIndex - 1); d->pageHistory.append(QExplicitlySharedDataPointer<QPdfLinkPrivate>(new QPdfLinkPrivate(page, location, zoom))); - d->currentHistoryIndex = d->pageHistory.count() - 1; + d->currentHistoryIndex = d->pageHistory.size() - 1; } if (zoomChange) emit currentZoomChanged(currentZoom()); @@ -293,7 +293,7 @@ void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom) */ void QPdfPageNavigator::update(int page, const QPointF &location, qreal zoom) { - if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.count()) + if (d->currentHistoryIndex < 0 || d->currentHistoryIndex >= d->pageHistory.size()) return; int currentPageWas = currentPage(); QPointF currentLocationWas = currentLocation(); @@ -340,7 +340,7 @@ bool QPdfPageNavigator::backAvailable() const */ bool QPdfPageNavigator::forwardAvailable() const { - return d->currentHistoryIndex < d->pageHistory.count() - 1; + return d->currentHistoryIndex < d->pageHistory.size() - 1; } /*! diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp index e8946ea86..a8946ccfe 100644 --- a/src/pdf/qpdfsearchmodel.cpp +++ b/src/pdf/qpdfsearchmodel.cpp @@ -161,7 +161,7 @@ QList<QPdfLink> QPdfSearchModel::resultsOnPage(int page) const { Q_D(const QPdfSearchModel); const_cast<QPdfSearchModelPrivate *>(d)->doSearch(page); - if (d->searchResults.count() <= page) + if (d->searchResults.size() <= page) return {}; return d->searchResults[page]; } @@ -207,7 +207,7 @@ void QPdfSearchModel::timerEvent(QTimerEvent *event) return; if (!d->document || d->nextPageToUpdate >= d->document->pageCount()) { if (d->document) - qCDebug(qLcS) << "done updating search results on" << d->searchResults.count() << "pages"; + qCDebug(qLcS) << "done updating search results on" << d->searchResults.size() << "pages"; killTimer(d->updateTimerId); d->updateTimerId = -1; } @@ -234,7 +234,7 @@ void QPdfSearchModelPrivate::clearResults() bool QPdfSearchModelPrivate::doSearch(int page) { - if (page < 0 || page >= pagesSearched.count() || searchString.isEmpty()) + if (page < 0 || page >= pagesSearched.size() || searchString.isEmpty()) return false; if (pagesSearched[page]) return true; @@ -298,7 +298,7 @@ bool QPdfSearchModelPrivate::doSearch(int page) if (si < 0) qWarning() << "search string" << searchString << "not found in context" << context; contextBefore = context.mid(0, si); - contextAfter = context.mid(si + searchString.length()); + contextAfter = context.mid(si + searchString.size()); } } if (!rects.isEmpty()) @@ -308,15 +308,15 @@ bool QPdfSearchModelPrivate::doSearch(int page) FPDFText_ClosePage(textPage); FPDF_ClosePage(pdfPage); qCDebug(qLcS) << searchString << "took" << timer.elapsed() << "ms to find" - << newSearchResults.count() << "results on page" << page; + << newSearchResults.size() << "results on page" << page; pagesSearched[page] = true; searchResults[page] = newSearchResults; - if (newSearchResults.count() > 0) { + if (newSearchResults.size() > 0) { int rowsBefore = rowsBeforePage(page); - qCDebug(qLcS) << "from row" << rowsBefore << "rowCount" << rowCountSoFar << "increasing by" << newSearchResults.count(); - rowCountSoFar += newSearchResults.count(); - q->beginInsertRows(QModelIndex(), rowsBefore, rowsBefore + newSearchResults.count() - 1); + qCDebug(qLcS) << "from row" << rowsBefore << "rowCount" << rowCountSoFar << "increasing by" << newSearchResults.size(); + rowCountSoFar += newSearchResults.size(); + q->beginInsertRows(QModelIndex(), rowsBefore, rowsBefore + newSearchResults.size() - 1); q->endInsertRows(); } return true; @@ -332,7 +332,7 @@ QPdfSearchModelPrivate::PageAndIndex QPdfSearchModelPrivate::pageAndIndexForResu for (int page = 0; page < pageCount; ++page) { if (!pagesSearched[page]) doSearch(page); - totalSoFar += searchResults[page].count(); + totalSoFar += searchResults[page].size(); if (totalSoFar > resultIndex) return {page, resultIndex - previousTotalSoFar}; previousTotalSoFar = totalSoFar; @@ -344,7 +344,7 @@ int QPdfSearchModelPrivate::rowsBeforePage(int page) { int ret = 0; for (int i = 0; i < page; ++i) - ret += searchResults[i].count(); + ret += searchResults[i].size(); return ret; } diff --git a/src/pdfquick/qquickpdfselection.cpp b/src/pdfquick/qquickpdfselection.cpp index ff50bcb23..4776cb8b4 100644 --- a/src/pdfquick/qquickpdfselection.cpp +++ b/src/pdfquick/qquickpdfselection.cpp @@ -188,12 +188,12 @@ void QQuickPdfSelection::keyReleaseEvent(QKeyEvent *ev) return; // iOS sends MoveToPreviousWord first to get to the beginning of the word, // and then SelectNextWord to select the whole word. - int i = allText.lastIndexOf(WordDelimiter, m_fromCharIndex - allText.length()); + int i = allText.lastIndexOf(WordDelimiter, m_fromCharIndex - allText.size()); if (i < 0) i = 0; else i += 1; // don't select the space before the word - auto sel = m_document->document()->getSelectionAtIndex(m_page, i, m_text.length() + m_fromCharIndex - i); + auto sel = m_document->document()->getSelectionAtIndex(m_page, i, m_text.size() + m_fromCharIndex - i); update(sel); QGuiApplication::inputMethod()->update(Qt::ImAnchorRectangle); } else if (ev == QKeySequence::SelectNextWord) { @@ -201,8 +201,8 @@ void QQuickPdfSelection::keyReleaseEvent(QKeyEvent *ev) return; int i = allText.indexOf(WordDelimiter, m_toCharIndex); if (i < 0) - i = allText.length(); // go to the end of m_textAfter - auto sel = m_document->document()->getSelectionAtIndex(m_page, m_fromCharIndex, m_text.length() + i - m_toCharIndex); + i = allText.size(); // go to the end of m_textAfter + auto sel = m_document->document()->getSelectionAtIndex(m_page, m_fromCharIndex, m_text.size() + i - m_toCharIndex); update(sel); QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle); } else if (ev == QKeySequence::Copy) { diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp index c4f233cb0..831b51515 100644 --- a/src/pdfwidgets/qpdfview.cpp +++ b/src/pdfwidgets/qpdfview.cpp @@ -136,7 +136,7 @@ void QPdfViewPrivate::pageRendered(int pageNumber, QSize imageSize, const QImage Q_UNUSED(requestId); if (!m_cachedPagesLRU.contains(pageNumber)) { - if (m_cachedPagesLRU.length() > m_pageCacheLimit) + if (m_cachedPagesLRU.size() > m_pageCacheLimit) m_pageCache.remove(m_cachedPagesLRU.takeFirst()); m_cachedPagesLRU.append(pageNumber); diff --git a/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp index f21750053..46e531716 100644 --- a/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp +++ b/src/webenginequick/api/qquickwebengineclientcertificateselection.cpp @@ -126,7 +126,7 @@ QQmlListProperty<QQuickWebEngineClientCertificateOption> QQuickWebEngineClientCe { if (m_certificates.empty()) { QList<QSslCertificate> certificates = d_ptr->certificates(); - for (int i = 0; i < certificates.count(); ++i) + for (int i = 0; i < certificates.size(); ++i) m_certificates.push_back(new QQuickWebEngineClientCertificateOption(this, i)); } diff --git a/src/webenginequick/api/qquickwebenginefaviconprovider.cpp b/src/webenginequick/api/qquickwebenginefaviconprovider.cpp index 087ab029b..56bbb97ac 100644 --- a/src/webenginequick/api/qquickwebenginefaviconprovider.cpp +++ b/src/webenginequick/api/qquickwebenginefaviconprovider.cpp @@ -35,9 +35,9 @@ static QSize largestSize(const QList<QSize> &availableSizes) static QSize fitSize(const QList<QSize> &availableSizes, const QSize &requestedSize) { - Q_ASSERT(availableSizes.count()); + Q_ASSERT(availableSizes.size()); QSize result = largestSize(availableSizes); - if (availableSizes.count() == 1 || area(requestedSize) >= area(result)) + if (availableSizes.size() == 1 || area(requestedSize) >= area(result)) return result; for (const QSize &size : availableSizes) { diff --git a/src/webenginequick/api/qquickwebenginescriptcollection.cpp b/src/webenginequick/api/qquickwebenginescriptcollection.cpp index 17db0d4d0..a58d97832 100644 --- a/src/webenginequick/api/qquickwebenginescriptcollection.cpp +++ b/src/webenginequick/api/qquickwebenginescriptcollection.cpp @@ -199,7 +199,7 @@ QJSValue QQuickWebEngineScriptCollection::collection() const const QList<QWebEngineScript> &list = d->toList(); QV4::ExecutionEngine *v4 = QQmlEnginePrivate::getV4Engine(d->m_qmlEngine); QV4::Scope scope(v4); - QV4::Scoped<QV4::ArrayObject> scriptArray(scope, v4->newArrayObject(list.length())); + QV4::Scoped<QV4::ArrayObject> scriptArray(scope, v4->newArrayObject(list.size())); int i = 0; for (const auto &val : list) { QV4::ScopedValue sv(scope, v4->fromVariant(QVariant::fromValue(val))); diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index 9ceffe09f..deb68c6d3 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -2324,7 +2324,7 @@ void QQuickContextMenuBuilder::addMenuItem(ContextMenuItem menuItem) case ContextMenuItem::SpellingSuggestions: { QPointer<QQuickWebEngineView> thisRef(m_view); - for (int i = 0; i < m_contextData->spellCheckerSuggestions().count() && i < 4; i++) { + for (int i = 0; i < m_contextData->spellCheckerSuggestions().size() && i < 4; i++) { action = new QQuickWebEngineAction(m_menu); QString replacement = m_contextData->spellCheckerSuggestions().at(i); QObject::connect(action, &QQuickWebEngineAction::triggered, [thisRef, replacement] { thisRef->replaceMisspelledWord(replacement); }); diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp index 5742dad3c..af7d27dab 100644 --- a/src/webenginewidgets/api/qwebengineview.cpp +++ b/src/webenginewidgets/api/qwebengineview.cpp @@ -439,7 +439,7 @@ void QWebEngineViewPrivate::contextMenuRequested(QWebEngineContextMenuRequest *r Q_EMIT q_ptr->customContextMenuRequested(request->position()); return; case Qt::ActionsContextMenu: - if (q_ptr->actions().count()) { + if (q_ptr->actions().size()) { QContextMenuEvent event(QContextMenuEvent::Mouse, request->position(), q_ptr->mapToGlobal(request->position())); QMenu::exec(q_ptr->actions(), event.globalPos(), 0, q_ptr); @@ -1521,7 +1521,7 @@ void QContextMenuBuilder::addMenuItem(ContextMenuItem menuItem) action = thisRef->action(QWebEnginePage::ViewSource); break; case ContextMenuItem::SpellingSuggestions: - for (int i = 0; i < m_contextData->spellCheckerSuggestions().count() && i < 4; i++) { + for (int i = 0; i < m_contextData->spellCheckerSuggestions().size() && i < 4; i++) { action = new QAction(m_menu); QString replacement = m_contextData->spellCheckerSuggestions().at(i); QObject::connect(action, &QAction::triggered, [thisRef, replacement] { |