summaryrefslogtreecommitdiffstats
path: root/src/shared/qtpropertybrowser/qtpropertybrowser.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 08:17:22 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-06 18:20:17 +0200
commitc338447261878111df7198fbd96051926464e865 (patch)
treed21b5af1efae225f75d5c05dfe370daefb1ea1d1 /src/shared/qtpropertybrowser/qtpropertybrowser.cpp
parent6495329e6de803025e6e4e8291b648f94893551c (diff)
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), 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: I95f6410e57a6a92b1cf91bbedfbe3d517cab6b44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/shared/qtpropertybrowser/qtpropertybrowser.cpp')
-rw-r--r--src/shared/qtpropertybrowser/qtpropertybrowser.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp
index 3d3f5ef12..61ead456b 100644
--- a/src/shared/qtpropertybrowser/qtpropertybrowser.cpp
+++ b/src/shared/qtpropertybrowser/qtpropertybrowser.cpp
@@ -388,7 +388,7 @@ void QtProperty::setModified(bool modified)
void QtProperty::addSubProperty(QtProperty *property)
{
QtProperty *after = nullptr;
- if (d_ptr->m_subItems.count() > 0)
+ if (d_ptr->m_subItems.size() > 0)
after = d_ptr->m_subItems.last();
insertSubProperty(property, after);
}
@@ -433,7 +433,7 @@ void QtProperty::insertSubProperty(QtProperty *property,
int pos = 0;
int newPos = 0;
QtProperty *properAfterProperty = nullptr;
- while (pos < pendingList.count()) {
+ while (pos < pendingList.size()) {
QtProperty *i = pendingList.at(pos);
if (i == property)
return; // if item is already inserted in this item then cannot add.
@@ -465,7 +465,7 @@ void QtProperty::removeSubProperty(QtProperty *property)
auto pendingList = subProperties();
int pos = 0;
- while (pos < pendingList.count()) {
+ while (pos < pendingList.size()) {
if (pendingList.at(pos) == property) {
d_ptr->m_subItems.removeAt(pos);
property->d_ptr->m_parentItems.remove(this);
@@ -1355,7 +1355,7 @@ void QtAbstractPropertyBrowserPrivate::removeBrowserIndexes(QtProperty *property
void QtAbstractPropertyBrowserPrivate::removeBrowserIndex(QtBrowserItem *index)
{
const auto children = index->children();
- for (int i = children.count(); i > 0; i--) {
+ for (int i = children.size(); i > 0; i--) {
removeBrowserIndex(children.at(i - 1));
}
@@ -1707,7 +1707,7 @@ void QtAbstractPropertyBrowser::clear()
QtBrowserItem *QtAbstractPropertyBrowser::addProperty(QtProperty *property)
{
QtProperty *afterProperty = nullptr;
- if (d_ptr->m_subItems.count() > 0)
+ if (d_ptr->m_subItems.size() > 0)
afterProperty = d_ptr->m_subItems.last();
return insertProperty(property, afterProperty);
}
@@ -1738,7 +1738,7 @@ QtBrowserItem *QtAbstractPropertyBrowser::insertProperty(QtProperty *property,
auto pendingList = properties();
int pos = 0;
int newPos = 0;
- while (pos < pendingList.count()) {
+ while (pos < pendingList.size()) {
QtProperty *prop = pendingList.at(pos);
if (prop == property)
return 0;
@@ -1775,7 +1775,7 @@ void QtAbstractPropertyBrowser::removeProperty(QtProperty *property)
auto pendingList = properties();
int pos = 0;
- while (pos < pendingList.count()) {
+ while (pos < pendingList.size()) {
if (pendingList.at(pos) == property) {
d_ptr->m_subItems.removeAt(pos); //perhaps this two lines
d_ptr->removeSubTree(property, 0); //should be moved down after propertyRemoved call.