diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-12 03:02:43 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-02-12 03:02:43 +0100 |
commit | 27feedeb09968fc8e1d6e52cf7ffac74c4368eb1 (patch) | |
tree | a7b3fa6bc8ccd41dbaf90f5284047790fcd7c4dc | |
parent | 683728c0f3a4f724ed3a977ed93e4d52a02a323b (diff) | |
parent | 9010c97bfb341166f963090935a0694a7ac5e929 (diff) | |
download | qtxmlpatterns-27feedeb09968fc8e1d6e52cf7ffac74c4368eb1.tar.gz |
Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Id9dce0d42a392a079c23fb54c4ce5634ac265ca4
-rw-r--r-- | tools/xmlpatterns/qapplicationargument.cpp | 5 | ||||
-rw-r--r-- | tools/xmlpatterns/qapplicationargument_p.h | 1 | ||||
-rw-r--r-- | tools/xmlpatterns/qapplicationargumentparser.cpp | 23 |
3 files changed, 10 insertions, 19 deletions
diff --git a/tools/xmlpatterns/qapplicationargument.cpp b/tools/xmlpatterns/qapplicationargument.cpp index 92a8e9e..c0b672d 100644 --- a/tools/xmlpatterns/qapplicationargument.cpp +++ b/tools/xmlpatterns/qapplicationargument.cpp @@ -151,6 +151,11 @@ bool QApplicationArgument::operator==(const QApplicationArgument &other) const return name() == other.name(); } +bool QApplicationArgument::operator<(const QApplicationArgument &other) const +{ + return name() < other.name(); +} + /*! \fn qHash(const QApplicationArgument &); \internal diff --git a/tools/xmlpatterns/qapplicationargument_p.h b/tools/xmlpatterns/qapplicationargument_p.h index acdd075..aef216b 100644 --- a/tools/xmlpatterns/qapplicationargument_p.h +++ b/tools/xmlpatterns/qapplicationargument_p.h @@ -57,6 +57,7 @@ public: ~QApplicationArgument(); QApplicationArgument &operator=(const QApplicationArgument &other); bool operator==(const QApplicationArgument &other) const; + bool operator<(const QApplicationArgument &other) const; void setName(const QString &newName); QString name() const; diff --git a/tools/xmlpatterns/qapplicationargumentparser.cpp b/tools/xmlpatterns/qapplicationargumentparser.cpp index f441b93..8aaae31 100644 --- a/tools/xmlpatterns/qapplicationargumentparser.cpp +++ b/tools/xmlpatterns/qapplicationargumentparser.cpp @@ -40,6 +40,8 @@ #include "qapplicationargumentparser_p.h" +#include <algorithm> + QT_BEGIN_NAMESPACE /*! @@ -291,23 +293,6 @@ void QApplicationArgumentParserPrivate::displayVersion() const << endl; } -/*! - \internal - \relates QApplicationArgument - - qLess() functor for QApplicationArgument that considers the name. - */ -template<> -class qLess <QApplicationArgument> -{ -public: - inline bool operator()(const QApplicationArgument &o1, - const QApplicationArgument &o2) const - { - return o1.name().compare(o2.name()) < 0; - } -}; - void QApplicationArgumentParserPrivate::displayHelp() const { enum Constants @@ -334,7 +319,7 @@ void QApplicationArgumentParserPrivate::displayHelp() const /* Sort them, such that we get the nameless options at the end, and it * generally looks tidy. */ - qSort(args); + std::sort(args.begin(), args.end()); /* This is the basic approach: * Switches: @@ -353,7 +338,7 @@ void QApplicationArgumentParserPrivate::displayHelp() const int maxWidth = 0; QList<QApplicationArgument> nameless(declaredNamelessArguments); - qSort(nameless); + std::sort(nameless.begin(), nameless.end()); /* Note, here the nameless arguments appear last, but are sorted * with themselves. */ |