Commit 670e5434 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Remove use of deprecated Qt algorithms

Change-Id: Ib35cffa2d5762874feea9b1d4df7f569c0e5f496
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent d4b3789d
......@@ -27,6 +27,8 @@
#include <QDebug>
#include <algorithm>
namespace QmlDesigner {
ChildrenChangedCommand::ChildrenChangedCommand()
......@@ -58,8 +60,8 @@ QVector<InformationContainer> ChildrenChangedCommand::informations() const
void ChildrenChangedCommand::sort()
{
qSort(m_childrenVector);
qSort(m_informationVector);
std::sort(m_childrenVector.begin(), m_childrenVector.end());
std::sort(m_informationVector.begin(), m_informationVector.end());
}
QDataStream &operator<<(QDataStream &out, const ChildrenChangedCommand &command)
......
......@@ -28,6 +28,8 @@
#include <QDataStream>
#include <QDebug>
#include <algorithm>
namespace QmlDesigner {
ComponentCompletedCommand::ComponentCompletedCommand()
......@@ -46,7 +48,7 @@ QVector<qint32> ComponentCompletedCommand::instances() const
void ComponentCompletedCommand::sort()
{
qSort(m_instanceVector);
std::sort(m_instanceVector.begin(), m_instanceVector.end());
}
QDataStream &operator<<(QDataStream &out, const ComponentCompletedCommand &command)
......
......@@ -30,6 +30,8 @@
#include "propertyvaluecontainer.h"
#include <algorithm>
namespace QmlDesigner {
InformationChangedCommand::InformationChangedCommand()
......@@ -48,7 +50,7 @@ QVector<InformationContainer> InformationChangedCommand::informations() const
void InformationChangedCommand::sort()
{
qSort(m_informationVector);
std::sort(m_informationVector.begin(), m_informationVector.end());
}
QDataStream &operator<<(QDataStream &out, const InformationChangedCommand &command)
......
......@@ -29,6 +29,8 @@
#include <QVarLengthArray>
#include <algorithm>
namespace QmlDesigner {
PixmapChangedCommand::PixmapChangedCommand()
......@@ -47,7 +49,7 @@ QVector<ImageContainer> PixmapChangedCommand::images() const
void PixmapChangedCommand::sort()
{
qSort(m_imageVector);
std::sort(m_imageVector.begin(), m_imageVector.end());
}
QDataStream &operator<<(QDataStream &out, const PixmapChangedCommand &command)
......
......@@ -27,6 +27,8 @@
#include <QDebug>
#include <algorithm>
namespace QmlDesigner {
StatePreviewImageChangedCommand::StatePreviewImageChangedCommand()
......@@ -45,7 +47,7 @@ QVector<ImageContainer> StatePreviewImageChangedCommand::previews()const
void StatePreviewImageChangedCommand::sort()
{
qSort(m_previewVector);
std::sort(m_previewVector.begin(), m_previewVector.end());
}
QDataStream &operator<<(QDataStream &out, const StatePreviewImageChangedCommand &command)
......
......@@ -28,6 +28,8 @@
#include <QDataStream>
#include <QDebug>
#include <algorithm>
namespace QmlDesigner {
TokenCommand::TokenCommand()
......@@ -59,7 +61,7 @@ QVector<qint32> TokenCommand::instances() const
void TokenCommand::sort()
{
qSort(m_instanceIdVector);
std::sort(m_instanceIdVector.begin(), m_instanceIdVector.end());
}
QDataStream &operator<<(QDataStream &out, const TokenCommand &command)
......
......@@ -31,6 +31,8 @@
#include <cstring>
#include <algorithm>
namespace QmlDesigner {
// using cache as a container which deletes sharedmemory pointers at process exit
......@@ -68,7 +70,7 @@ void ValuesChangedCommand::removeSharedMemorys(const QVector<qint32> &keyNumberV
void ValuesChangedCommand::sort()
{
qSort(m_valueChangeVector);
std::sort(m_valueChangeVector.begin(), m_valueChangeVector.end());
}
static const QLatin1String valueKeyTemplateString("Values-%1");
......
......@@ -275,11 +275,6 @@ using namespace ExtensionSystem::Internal;
static Internal::PluginManagerPrivate *d = 0;
static PluginManager *m_instance = 0;
static bool lessThanByPluginName(const PluginSpec *one, const PluginSpec *two)
{
return one->name() < two->name();
}
/*!
Gets the unique plugin manager instance.
*/
......@@ -588,7 +583,7 @@ static QStringList subList(const QStringList &in, const QString &key)
QStringList rc;
// Find keyword and copy arguments until end or next keyword
const QStringList::const_iterator inEnd = in.constEnd();
QStringList::const_iterator it = qFind(in.constBegin(), inEnd, key);
QStringList::const_iterator it = std::find(in.constBegin(), inEnd, key);
if (it != inEnd) {
const QChar nextIndicator = QLatin1Char(':');
for (++it; it != inEnd && !it->startsWith(nextIndicator); ++it)
......@@ -1468,7 +1463,7 @@ void PluginManagerPrivate::readPluginPaths()
}
resolveDependencies();
// ensure deterministic plugin load order by sorting
qSort(pluginSpecs.begin(), pluginSpecs.end(), lessThanByPluginName);
Utils::sort(pluginSpecs, &PluginSpec::name);
emit q->pluginsChanged();
}
......
......@@ -37,6 +37,8 @@
#include "qmt/diagram/dannotation.h"
#include "qmt/infrastructure/qmtassert.h"
#include <utils/algorithm.h>
#include <QSet>
#include <QDebug>
......@@ -292,7 +294,7 @@ const Style *DefaultStyleEngine::applyObjectStyle(const Style *baseStyle, const
int depth = 0;
if (!depths.isEmpty()) {
QList<int> keys = depths.keys();
qSort(keys);
Utils::sort(keys);
foreach (int d, keys) {
DepthProperties properties = depths.value(d);
if (properties.m_elementType == elementType
......
......@@ -34,6 +34,7 @@
#include "qmljsviewercontext.h"
#include <cplusplus/cppmodelmanagerbase.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/runextensions.h>
......@@ -439,9 +440,9 @@ void ModelManagerInterface::iterateQrcFiles(ProjectExplorer::Project *project,
} else {
pInfos = projectInfos();
if (resources == ActiveQrcResources) // make the result predictable
qSort(pInfos.begin(), pInfos.end(), &pInfoLessThanActive);
Utils::sort(pInfos, &pInfoLessThanActive);
else
qSort(pInfos.begin(), pInfos.end(), &pInfoLessThanAll);
Utils::sort(pInfos, &pInfoLessThanAll);
}
QSet<QString> pathsChecked;
......
......@@ -25,6 +25,8 @@
#include <qmljs/qmljsscanner.h>
#include <algorithm>
using namespace QmlJS;
namespace {
......@@ -410,10 +412,7 @@ int Scanner::state() const
bool Scanner::isKeyword(const QString &text) const
{
if (qBinaryFind(begin(js_keywords), end(js_keywords), text) != end(js_keywords))
return true;
return false;
return std::binary_search(begin(js_keywords), end(js_keywords), text);
}
QStringList Scanner::keywords()
......
......@@ -32,6 +32,8 @@
#include <QResizeEvent>
#include <QPainter>
#include <algorithm>
namespace Utils {
static const int ArrowBorderSize = 12;
......@@ -292,10 +294,8 @@ void CrumblePath::sortChildren(Qt::SortOrder order)
QTC_ASSERT(childList, return);
QList<QAction *> actions = childList->actions();
if (order == Qt::AscendingOrder)
qStableSort(actions.begin(), actions.end(), lessThan);
else
qStableSort(actions.begin(), actions.end(), greaterThan);
std::stable_sort(actions.begin(), actions.end(),
order == Qt::AscendingOrder ? lessThan : greaterThan);
childList->clear();
childList->addActions(actions);
......
......@@ -23,6 +23,7 @@
**
****************************************************************************/
#include "algorithm.h"
#include "environment.h"
#include <QDir>
......@@ -55,14 +56,9 @@ Q_GLOBAL_STATIC(SystemEnvironment, staticSystemEnvironment)
namespace Utils {
static bool sortEnvironmentItem(const EnvironmentItem &a, const EnvironmentItem &b)
{
return a.name < b.name;
}
void EnvironmentItem::sort(QList<EnvironmentItem> *list)
{
qSort(list->begin(), list->end(), &sortEnvironmentItem);
Utils::sort(*list, &EnvironmentItem::name);
}
QList<EnvironmentItem> EnvironmentItem::fromStringList(const QStringList &list)
......
......@@ -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);
......
......@@ -409,16 +409,16 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
} else if (line.startsWith(QLatin1String("---")) || line.startsWith(QLatin1String("==="))) {
if (platform.apiLevel == -1)
continue;
auto it = qLowerBound(m_availableSdkPlatforms.begin(), m_availableSdkPlatforms.end(),
platform, sortSdkPlatformByApiLevel);
auto it = std::lower_bound(m_availableSdkPlatforms.begin(), m_availableSdkPlatforms.end(),
platform, sortSdkPlatformByApiLevel);
m_availableSdkPlatforms.insert(it, platform);
platform = SdkPlatform();
}
}
if (platform.apiLevel != -1) {
auto it = qLowerBound(m_availableSdkPlatforms.begin(), m_availableSdkPlatforms.end(),
platform, sortSdkPlatformByApiLevel);
auto it = std::lower_bound(m_availableSdkPlatforms.begin(), m_availableSdkPlatforms.end(),
platform, sortSdkPlatformByApiLevel);
m_availableSdkPlatforms.insert(it, platform);
}
......
......@@ -67,6 +67,7 @@
#include <QCheckBox>
#include <QScrollArea>
#include <algorithm>
#include <limits>
using namespace ProjectExplorer;
......@@ -1337,7 +1338,8 @@ const QStringList &PermissionsModel::permissions()
QModelIndex PermissionsModel::addPermission(const QString &permission)
{
const int idx = qLowerBound(m_permissions, permission) - m_permissions.constBegin();
auto it = std::lower_bound(m_permissions.constBegin(), m_permissions.constEnd(), permission);
const int idx = it - m_permissions.constBegin();
beginInsertRows(QModelIndex(), idx, idx);
m_permissions.insert(idx, permission);
endInsertRows();
......@@ -1351,7 +1353,8 @@ bool PermissionsModel::updatePermission(const QModelIndex &index, const QString
if (m_permissions[index.row()] == permission)
return false;
int newIndex = qLowerBound(m_permissions.constBegin(), m_permissions.constEnd(), permission) - m_permissions.constBegin();
auto it = std::lower_bound(m_permissions.constBegin(), m_permissions.constEnd(), permission);
const int newIndex = it - m_permissions.constBegin();
if (newIndex == index.row() || newIndex == index.row() + 1) {
m_permissions[index.row()] = permission;
emit dataChanged(index, index);
......
......@@ -251,7 +251,7 @@ void NewDialog::setWizardFactories(QList<IWizardFactory *> factories,
{
m_defaultLocation = defaultLocation;
m_extraVariables = extraVariables;
qStableSort(factories.begin(), factories.end(), wizardFactoryLessThan);
std::stable_sort(factories.begin(), factories.end(), wizardFactoryLessThan);
m_model->clear();
QStandardItem *parentItem = m_model->invisibleRootItem();
......
......@@ -70,7 +70,7 @@ bool optionsPageLessThan(const IOptionsPage *p1, const IOptionsPage *p2)
static inline QList<IOptionsPage*> sortedOptionsPages()
{
QList<IOptionsPage*> rc = ExtensionSystem::PluginManager::getObjects<IOptionsPage>();
qStableSort(rc.begin(), rc.end(), optionsPageLessThan);
std::stable_sort(rc.begin(), rc.end(), optionsPageLessThan);
return rc;
}
......@@ -222,7 +222,7 @@ void CategoryModel::ensurePages(Category *category)
category->pages += createdPages;
category->providerPagesCreated = true;
qStableSort(category->pages.begin(), category->pages.end(), optionsPageLessThan);
std::stable_sort(category->pages.begin(), category->pages.end(), optionsPageLessThan);
}
}
......
......@@ -91,7 +91,7 @@ static bool lessThanByText(SearchResultTreeItem *a, const QString &b)
int SearchResultTreeItem::insertionIndex(const QString &text, SearchResultTreeItem **existingItem) const
{
QList<SearchResultTreeItem *>::const_iterator insertionPosition =
qLowerBound(m_children.begin(), m_children.end(), text, lessThanByText);
std::lower_bound(m_children.begin(), m_children.end(), text, lessThanByText);
if (existingItem) {
if (insertionPosition != m_children.end() && (*insertionPosition)->item.text == text)
(*existingItem) = (*insertionPosition);
......
......@@ -390,7 +390,7 @@ QList<QModelIndex> SearchResultTreeModel::addResults(const QList<SearchResultIte
{
QSet<SearchResultTreeItem *> pathNodes;
QList<SearchResultItem> sortedItems = items;
qStableSort(sortedItems.begin(), sortedItems.end(), lessThanByPath);
std::stable_sort(sortedItems.begin(), sortedItems.end(), lessThanByPath);
QList<SearchResultItem> itemSet;
foreach (const SearchResultItem &item, sortedItems) {
m_editorFontIsUsed |= item.useTextEditorFont;
......
......@@ -48,6 +48,8 @@
#include <QPushButton>
#include <QSortFilterProxyModel>
#include <algorithm>
using namespace CPlusPlus;
using namespace CppTools;
namespace CMI = CppCodeModelInspector;
......@@ -410,7 +412,7 @@ void IncludesModel::configure(const QList<Document::Include> &includes)
{
emit layoutAboutToBeChanged();
m_includes = includes;
qStableSort(m_includes.begin(), m_includes.end(), includesSorter);
std::stable_sort(m_includes.begin(), m_includes.end(), includesSorter);
emit layoutChanged();
}
......@@ -513,7 +515,7 @@ void DiagnosticMessagesModel::configure(
{
emit layoutAboutToBeChanged();
m_messages = messages;
qStableSort(m_messages.begin(), m_messages.end(), diagnosticMessagesModelSorter);
std::stable_sort(m_messages.begin(), m_messages.end(), diagnosticMessagesModelSorter);
emit layoutChanged();
}
......
......@@ -31,6 +31,8 @@
#include <projectexplorer/session.h>
#include <algorithm>
using namespace CppEditor::Internal;
static bool projectPartLessThan(const CppTools::ProjectPart::Ptr &projectPart1,
......@@ -58,7 +60,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &fil
int currentIndex = 0;
QList<CppTools::ProjectPart::Ptr> sortedProjectParts(projectParts);
qStableSort(sortedProjectParts.begin(), sortedProjectParts.end(), projectPartLessThan);
std::stable_sort(sortedProjectParts.begin(), sortedProjectParts.end(), projectPartLessThan);
foreach (CppTools::ProjectPart::Ptr projectPart, sortedProjectParts) {
m_ui->projectComboBox->addItem(projectPart->displayName);
......
......@@ -30,6 +30,8 @@
#include <QStringMatcher>
#include <algorithm>
using namespace CppTools;
using namespace CppTools::Internal;
......@@ -107,9 +109,9 @@ QList<Core::LocatorFilterEntry> CppLocatorFilter::matchesFor(
});
if (goodEntries.size() < 1000)
qStableSort(goodEntries.begin(), goodEntries.end(), compareLexigraphically);
std::stable_sort(goodEntries.begin(), goodEntries.end(), compareLexigraphically);
if (betterEntries.size() < 1000)
qStableSort(betterEntries.begin(), betterEntries.end(), compareLexigraphically);
std::stable_sort(betterEntries.begin(), betterEntries.end(), compareLexigraphically);
betterEntries += goodEntries;
return betterEntries;
......
......@@ -1273,7 +1273,7 @@ int WatchModel::memberVariableRecursion(WatchItem *item,
const QString toolTip = variableToolTip(childName, item->type, childOffset);
const ColorNumberToolTip colorNumberNamePair((*colorNumberIn)++, toolTip);
const ColorNumberToolTips::iterator begin = cnmv->begin() + childOffset;
qFill(begin, begin + item->size, colorNumberNamePair);
std::fill(begin, begin + item->size, colorNumberNamePair);
childCount++;
childCount += memberVariableRecursion(child, childName, start, end, colorNumberIn, cnmv);
}
......
......@@ -78,6 +78,8 @@
#include <QPluginLoader>
#include <QTime>
#include <algorithm>
static const char settingsGroupC[] = "Designer";
/* Actions of the designer plugin:
......@@ -249,8 +251,8 @@ FormEditorData::FormEditorData() :
QTC_ASSERT(!d, return);
d = this;
qFill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount,
static_cast<QWidget *>(0));
std::fill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount,
static_cast<QWidget *>(0));
m_formeditor->setTopLevel(ICore::mainWindow());
m_formeditor->setSettingsManager(new SettingsManager());
......@@ -449,7 +451,7 @@ void FormEditorData::fullInit()
void FormEditorData::initDesignerSubWindows()
{
qFill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<QWidget*>(0));
std::fill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<QWidget*>(0));
QDesignerWidgetBoxInterface *wb = QDesignerComponents::createWidgetBox(m_formeditor, 0);
wb->setWindowTitle(tr("Widget Box"));
......
......@@ -640,9 +640,9 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
approval.description = ao.value(approvalsDescriptionKey).toString();
change->currentPatchSet.approvals.push_back(approval);
}
qStableSort(change->currentPatchSet.approvals.begin(),
change->currentPatchSet.approvals.end(),
gerritApprovalLessThan);
std::stable_sort(change->currentPatchSet.approvals.begin(),
change->currentPatchSet.approvals.end(),
gerritApprovalLessThan);
// Remaining
change->number = object.value(numberKey).toString().toInt();
change->url = object.value(urlKey).toString();
......@@ -779,7 +779,7 @@ void GerritModel::queryFinished(const QByteArray &output)
}
}
// Sort by depth (root nodes first) and by date.
qStableSort(changes.begin(), changes.end(), gerritChangeLessThan);
std::stable_sort(changes.begin(), changes.end(), gerritChangeLessThan);
numberIndexHash.clear();
foreach (const GerritChangePtr &c, changes) {
......
......@@ -269,9 +269,8 @@ void KitManager::registerKitInformation(KitInformation *ki)
QTC_CHECK(!isLoaded());
QTC_ASSERT(!d->m_informationList.contains(ki), return);
QList<KitInformation *>::iterator it
= qLowerBound(d->m_informationList.begin(),
d->m_informationList.end(), ki, greaterPriority);
auto it = std::lower_bound(d->m_informationList.begin(), d->m_informationList.end(),
ki, greaterPriority);
d->m_informationList.insert(it, ki);
if (!isLoaded())
......
......@@ -869,7 +869,7 @@ void FlatModel::changedSortKey(FolderNode *folderNode, Node *node)
int oldIndex = nodes.indexOf(node);
nodes.removeAt(oldIndex);
QList<Node *>::iterator newPosIt = qLowerBound(nodes.begin(), nodes.end(), node, sortNodes);
QList<Node *>::iterator newPosIt = std::lower_bound(nodes.begin(), nodes.end(), node, sortNodes);
int newIndex = newPosIt - nodes.begin();
if (newIndex == oldIndex)
......
......@@ -370,7 +370,7 @@ void FolderNode::addFileNodes(const QList<FileNode *> &files)
// empty list or greater then last node
m_fileNodes.append(file);
} else {
auto it = qLowerBound(m_fileNodes.begin(), m_fileNodes.end(), file);
auto it = std::lower_bound(m_fileNodes.begin(), m_fileNodes.end(), file);
m_fileNodes.insert(it, file);
}
}
......@@ -438,7 +438,7 @@ void FolderNode::addFolderNodes(const QList<FolderNode*> &subFolders)
m_subFolderNodes.append(folder);
} else {
// Binary Search for insertion point
auto it = qLowerBound(m_subFolderNodes.begin(), m_subFolderNodes.end(), folder);
auto it = std::lower_bound(m_subFolderNodes.begin(), m_subFolderNodes.end(), folder);
m_subFolderNodes.insert(it, folder);
}
......
......@@ -32,6 +32,8 @@
#include <QFontMetrics>
#include <algorithm>
namespace ProjectExplorer {
namespace Internal {
......@@ -106,7 +108,7 @@ void TaskModel::addTask(const Task &task)
CategoryData &data = m_categories[task.category];
CategoryData &global = m_categories[Core::Id()];
auto it = qLowerBound(m_tasks.begin(), m_tasks.end(),task.taskId, sortById);
auto it = std::lower_bound(m_tasks.begin(), m_tasks.end(),task.taskId, sortById);
int i = it - m_tasks.begin();
beginInsertRows(QModelIndex(), i, i);
m_tasks.insert(it, task);
......@@ -131,7 +133,7 @@ void TaskModel::removeTask(const Task &task)
int TaskModel::rowForId(unsigned int id)
{
auto it = qLowerBound(m_tasks.constBegin(), m_tasks.constEnd(), id, sortById);
auto it = std::lower_bound(m_tasks.constBegin(), m_tasks.constEnd(), id, sortById);
if (it == m_tasks.constEnd())
return -1;
return it - m_tasks.constBegin();
......@@ -374,8 +376,8 @@ QVariant TaskFilterModel::data(const QModelIndex &index, int role) const
static QPair<int, int> findFilteredRange(int first, int last, const QList<int> &list)
{
auto filteredFirst = qLowerBound(list, first);
auto filteredLast = qUpperBound(filteredFirst, list.constEnd(), last);
auto filteredFirst = std::lower_bound(list.constBegin(), list.constEnd(), first);
auto filteredLast = std::upper_bound(filteredFirst, list.constEnd(), last);
return qMakePair(filteredFirst - list.constBegin(), filteredLast - list.constBegin() - 1);
}
......@@ -399,7 +401,7 @@ void TaskFilterModel::handleNewRows(const QModelIndex &index, int first, int las
if (last == m_sourceModel->rowCount() - 1)
filteredFirst = m_mapping.count();
else
filteredFirst = qLowerBound(m_mapping, first) - m_mapping.constBegin();
filteredFirst = std::lower_bound(m_mapping.constBegin(), m_mapping.constEnd(), first) - m_mapping.constBegin();
const int filteredLast = filteredFirst + newItems - 1;
beginInsertRows(QModelIndex(), filteredFirst, filteredLast);
......@@ -449,8 +451,8 @@ void TaskFilterModel::handleReset()
QModelIndex TaskFilterModel::mapFromSource(const QModelIndex &idx) const
{
auto it = qBinaryFind(m_mapping.constBegin(), m_mapping.constEnd(), idx.row());
if (it == m_mapping.constEnd())
auto it = std::lower_bound(m_mapping.constBegin(), m_mapping.constEnd(), idx.row());
if (it == m_mapping.constEnd() || idx.row() != *it)
return QModelIndex();
return index(it - m_mapping.constBegin(), 0);
}
......
......@@ -59,6 +59,7 @@
#include <QCoreApplication>
#include <QByteArray>
#include <algorithm>
#include <functional>
namespace QmlDesigner {
......@@ -568,7 +569,7 @@ static inline QList<IOptionsPage*> sortedOptionsPages()
static PropertyNameList sortedPropertyNameList(const PropertyNameList &nameList)
{
PropertyNameList sortedPropertyNameList = nameList;
qStableSort(sortedPropertyNameList);
std::stable_sort(sortedPropertyNameList.begin(), sortedPropertyNameList.end());
return sortedPropertyNameList;
}
......
......@@ -38,6 +38,8 @@
#include <QLabel>
#include <QStandardItemModel>
#include <algorithm>
using Core::ICore;
using ProjectExplorer::ProjectExplorerPlugin;
......@@ -121,7 +123,7 @@ void QmlProjectRunConfigurationWidget::updateFileComboBox()
}
sortedFiles = relativeFiles;
qStableSort(sortedFiles.begin(), sortedFiles.end(), caseInsensitiveLessThan);
std::stable_sort(sortedFiles.begin(), sortedFiles.end(), caseInsensitiveLessThan);
QString mainScriptPath;
if (m_runConfiguration->mainScriptSource() != QmlProjectRunConfiguration::FileInEditor)
......
......@@ -33,6 +33,8 @@
#include <texteditor/texteditorsettings.h>
#include <texteditor/texteditor.h>
#include <algorithm>
namespace TextEditor {
// --------------------------
......@@ -51,12 +53,12 @@ Keywords::Keywords(const QStringList &variabels, const QStringList &functions, c
bool Keywords::isVariable(const QString &word) const
{
return qBinaryFind(m_variables, word) != m_variables.constEnd();
return std::binary_search(m_variables.constBegin(), m_variables.constEnd(), word);
}
bool Keywords::isFunction(const QString &word) const
{
return qBinaryFind(m_functions, word) != m_functions.constEnd();
return std::binary_search(m_functions.constBegin(), m_functions.constEnd(), word);