Remove use of deprecated Qt algorithms

Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2016-08-03 23:29:58 +03:00
committed by Orgad Shaneh
parent d4b3789db4
commit 670e54345c
33 changed files with 103 additions and 81 deletions

View File

@@ -25,6 +25,7 @@
#include "fancymainwindow.h"
#include "algorithm.h"
#include "qtcassert.h"
#include <QAbstractButton>
@@ -505,13 +506,6 @@ bool FancyMainWindow::autoHideTitleBars() const
return d->m_autoHideTitleBars.isChecked();
}
static bool actionLessThan(const QAction *action1, const QAction *action2)
{
QTC_ASSERT(action1, return true);
QTC_ASSERT(action2, return false);
return action1->text().toLower() < action2->text().toLower();
}
void FancyMainWindow::addDockActionsToMenu(QMenu *menu)
{
QList<QAction *> actions;
@@ -523,7 +517,11 @@ void FancyMainWindow::addDockActionsToMenu(QMenu *menu)
actions.append(dockwidgets.at(i)->toggleViewAction());
}
}
qSort(actions.begin(), actions.end(), actionLessThan);
Utils::sort(actions, [](const QAction *action1, const QAction *action2) {
QTC_ASSERT(action1, return true);
QTC_ASSERT(action2, return false);
return action1->text().toLower() < action2->text().toLower();
});
foreach (QAction *action, actions)
menu->addAction(action);
menu->addAction(&d->m_menuSeparator1);