forked from qt-creator/qt-creator
Utils: Add sorted() function
For simpler calling code. Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -326,11 +326,9 @@ void DocSettingsPageWidget::removeDocumentation(const QList<QModelIndex> &items)
|
||||
if (items.isEmpty())
|
||||
return;
|
||||
|
||||
QList<QModelIndex> itemsByDecreasingRow = items;
|
||||
Utils::sort(itemsByDecreasingRow, [](const QModelIndex &i1, const QModelIndex &i2) {
|
||||
return i1.row() > i2.row();
|
||||
});
|
||||
for (const QModelIndex &item : std::as_const(itemsByDecreasingRow)) {
|
||||
const QList<QModelIndex> itemsByDecreasingRow = Utils::sorted(items,
|
||||
[](const QModelIndex &i1, const QModelIndex &i2) { return i1.row() > i2.row(); });
|
||||
for (const QModelIndex &item : itemsByDecreasingRow) {
|
||||
const int row = item.row();
|
||||
const QString nameSpace = m_model.entryAt(row).nameSpace;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user