From 0a8eeeb541e2064908df51005454cb747782a9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Tue, 18 Jul 2023 21:13:25 +0200 Subject: [PATCH] Revert "chore: clazy fixes" This reverts commit c32b851264f15978ae1a1fe6227cb2a4221559d6. --- qqmlsortfilterproxymodel.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/qqmlsortfilterproxymodel.cpp b/qqmlsortfilterproxymodel.cpp index d13efdf..bd06435 100644 --- a/qqmlsortfilterproxymodel.cpp +++ b/qqmlsortfilterproxymodel.cpp @@ -208,11 +208,11 @@ void QQmlSortFilterProxyModel::componentComplete() { m_completed = true; - for (const auto& filter : qAsConst(m_filters)) + for (const auto& filter : m_filters) filter->proxyModelCompleted(*this); - for (const auto& sorter : qAsConst(m_sorters)) + for (const auto& sorter : m_sorters) sorter->proxyModelCompleted(*this); - for (const auto& proxyRole : qAsConst(m_proxyRoles)) + for (const auto& proxyRole : m_proxyRoles) proxyRole->proxyModelCompleted(*this); invalidate(); @@ -266,7 +266,7 @@ QVariantMap QQmlSortFilterProxyModel::get(int row) const QVariantMap map; QModelIndex modelIndex = index(row, 0); QHash roles = roleNames(); - for (auto it = roles.cbegin(); it != roles.cend(); ++it) + for (QHash::const_iterator it = roles.begin(); it != roles.end(); ++it) map.insert(it.value(), data(modelIndex, it.key())); return map; } @@ -436,9 +436,8 @@ void QQmlSortFilterProxyModel::updateRoleNames() auto roles = m_roleNames.keys(); auto maxIt = std::max_element(roles.cbegin(), roles.cend()); int maxRole = maxIt != roles.cend() ? *maxIt : -1; - for (auto proxyRole : qAsConst(m_proxyRoles)) { - const auto proxyRoleNames = proxyRole->names(); - for (const auto &roleName : proxyRoleNames) { + for (auto proxyRole : m_proxyRoles) { + for (auto roleName : proxyRole->names()) { ++maxRole; m_roleNames[maxRole] = roleName.toUtf8(); m_proxyRoleMap[maxRole] = {proxyRole, roleName}; @@ -510,7 +509,7 @@ QVariantMap QQmlSortFilterProxyModel::modelDataMap(const QModelIndex& modelIndex { QVariantMap map; QHash roles = roleNames(); - for (auto it = roles.cbegin(); it != roles.cend(); ++it) + for (QHash::const_iterator it = roles.begin(); it != roles.end(); ++it) map.insert(it.value(), sourceModel()->data(modelIndex, it.key())); return map; }