forked from qt-creator/qt-creator
Libs: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I00d9f7c1634bbb62191470d58158e1fd150533c0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -1580,7 +1580,7 @@ void AspectContainer::addAspectHelper(BaseAspect *aspect)
|
||||
*/
|
||||
void AspectContainer::addToLayout(LayoutBuilder &builder)
|
||||
{
|
||||
for (BaseAspect *aspect : d->m_items) {
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items)) {
|
||||
if (aspect->isVisible())
|
||||
aspect->addToLayout(builder);
|
||||
}
|
||||
@@ -1591,7 +1591,7 @@ void AspectContainer::addToLayout(LayoutBuilder &builder)
|
||||
*/
|
||||
void AspectContainer::fromMap(const QVariantMap &map)
|
||||
{
|
||||
for (BaseAspect *aspect : d->m_items)
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
aspect->fromMap(map);
|
||||
}
|
||||
|
||||
@@ -1600,7 +1600,7 @@ void AspectContainer::fromMap(const QVariantMap &map)
|
||||
*/
|
||||
void AspectContainer::toMap(QVariantMap &map) const
|
||||
{
|
||||
for (BaseAspect *aspect : d->m_items)
|
||||
for (BaseAspect *aspect : qAsConst(d->m_items))
|
||||
aspect->toMap(map);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user