qt5base-lts/tests/auto/corelib
Marc Mutz 7f78d547ca QCommandLineParser: support extremely concise option configuration in C++11
The goal of this commit to make the code in the test work:

    QCommandLineParser parser;
    parser.addOptions({
        { "a",                "The A option." },
        { { "v", "verbose" }, "The verbose option." },
        { { "i", "infile" },  "The input file.", "value" },
    });

For this, QCommandLineParser needs a version of addOption that can
take a list of options. That's what addOptions() is for.

More importantly, the QCommandLineOption ctors mustn't be explicit.
OTOH, any implicit conversion from QString or QStringList to
QCommandLineOption is also undesirable.

To solve this dilemma, add new QCommandLineOption ctors that just
take one argument and are explicit, and make the existing ctors
implicit. In order to avoid ambiguities, remove the default values
of their resp. 2nd arguments. The new ctors are by intention not
\since 5.4, as they are completely transparent to the user.

Et voila, even better than getopt_long(3).

[ChangeLog][QtCore][QCommandLineParser] Added addOptions() method.

Change-Id: I5e779f3406cd0f6c8ec6ecbf6c8074af226de300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-06 22:17:22 +02:00
..
animation Updated corelib's unit tests to use QSignalSpy's functor constructor 2014-05-08 04:22:54 +02:00
codecs Merge remote-tracking branch 'origin/release' into stable 2014-05-14 12:37:34 +02:00
global Logging: use the known function when the first frame of the backtrace is unknown 2014-08-05 16:52:34 +02:00
io QDebug: Improve QDebug stream operator for QFlags 2014-07-30 16:27:33 +02:00
itemmodels QAbstractProxyModel: Forward drop-related API. 2014-06-25 16:31:03 +02:00
json Add initializer list support in QJsonObject. 2014-07-30 10:20:28 +02:00
kernel Update QVariant tests 2014-07-10 13:14:40 +02:00
mimetypes test: Don't build qmimedatabase-cache for QNX 2014-01-16 16:11:04 +01:00
plugin Don't store QLibraryPrivate with empty file names in the global store 2014-07-23 17:50:31 +02:00
statemachine Export QAbstractState active property. 2014-07-29 11:27:09 +02:00
thread QFutureInterface: allow to work with a QThreadPool != globalInstance() 2014-08-05 18:04:56 +02:00
tools QCommandLineParser: support extremely concise option configuration in C++11 2014-08-06 22:17:22 +02:00
xml Include the duplicated attribute name in the error message 2014-05-06 01:20:19 +02:00
corelib.pro iOS: Enable building of basic tests 2014-01-22 12:35:17 +01:00