diff --git a/src/core/tests/test_layouter.cpp b/src/core/tests/test_layouter.cpp index e249bce3..bce182ff 100644 --- a/src/core/tests/test_layouter.cpp +++ b/src/core/tests/test_layouter.cpp @@ -72,10 +72,10 @@ private Q_SLOTS: } } - static void assertRegionContainsStates(State *region, const QList states) + static void assertRegionContainsStates(State *region, const QList &states) { const QRectF rect = region->boundingRect(); - foreach (State *item, states) { + for (const State *item : states) { QVERIFY(rect.contains(item->boundingRect())); } } diff --git a/src/core/util/objecthelper.cpp b/src/core/util/objecthelper.cpp index ce74b9bc..4dc925e1 100644 --- a/src/core/util/objecthelper.cpp +++ b/src/core/util/objecthelper.cpp @@ -41,7 +41,7 @@ QString ObjectHelper::addressToString(const void *p) QString ObjectHelper::className(const QObject *object, ObjectHelper::DisplayOption option) { QString className = QString::fromLatin1(object->metaObject()->className()); - return option == StripNameSpace ? stripNameSpace(className) : className; + return option == StripNameSpace ? stripNameSpace(className) : std::move(className); } QString ObjectHelper::displayString(const QObject *object, DisplayOption option) diff --git a/src/core/util/objecthelper.h b/src/core/util/objecthelper.h index abbd1fff..8a34f7fb 100644 --- a/src/core/util/objecthelper.h +++ b/src/core/util/objecthelper.h @@ -71,10 +71,10 @@ KDSME_CORE_EXPORT int depth(const QObject *root, const QObject *object); * Returns a list that only contains item of type @p FilterType */ template -QList copy_if_type(const QList list) +QList copy_if_type(const QList &list) { QList filteredList; - Q_FOREACH (const ItemType object, list) { + for (const ItemType &object : list) { if (FilterType filterObject = qobject_cast(object)) filteredList << filterObject; } diff --git a/src/view/widgets/statemachineview.cpp b/src/view/widgets/statemachineview.cpp index a27a0823..553809e9 100644 --- a/src/view/widgets/statemachineview.cpp +++ b/src/view/widgets/statemachineview.cpp @@ -241,7 +241,7 @@ void StateMachineView::setThemeName(const QString &themeName) } } - d->m_themeName = selectedThemeName; + d->m_themeName = std::move(selectedThemeName); emit themeNameChanged(d->m_themeName); }