From d16a13c88bb9bc608e144fda31b7d24f2488ccaa Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Fri, 30 May 2025 03:34:23 +0200 Subject: [PATCH] QmlDesigner: Use std::ranges in GradientPresetListModel::sortItems() Change-Id: I80785759030e99ca4e553220fcc3ad474be7ff00 Reviewed-by: Thomas Hartmann --- .../components/propertyeditor/gradientpresetlistmodel.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp index da6e67993e6..676bdd28dfb 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientpresetlistmodel.cpp @@ -77,11 +77,8 @@ const QList &GradientPresetListModel::items() const void GradientPresetListModel::sortItems() { - auto itemSort = [](const GradientPresetItem &first, const GradientPresetItem &second) { - return (static_cast(first.presetID()) < static_cast(second.presetID())); - }; - std::sort(m_items.begin(), m_items.end(), itemSort); + std::ranges::sort(m_items, {}, &GradientPresetItem::presetID); } void GradientPresetListModel::registerDeclarativeType()