qt6-bb10/tests/auto/corelib/tools
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
..
collections Stop using setSharable in the Java-style mutable iterators 2014-05-18 02:08:13 +02:00
qalgorithms tst_QAlgorithms: fix compilation with C++11 enabled 2013-11-17 09:48:17 +01:00
qarraydata Deprecate setSharable in Qt containers 2014-04-24 10:49:10 +02:00
qarraydata_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qbitarray Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qbytearray Fix QByteArray::to{Upper,Lower} when the array contains embedded nulls 2014-07-30 19:48:41 +02:00
qbytearraymatcher Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qbytedatabuffer don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
qcache Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qchar Fix qchar testdata installation. 2014-03-14 18:19:00 +01:00
qcollator tst_qcollator: Exclude failing test cases for non-ICU/Windows. 2014-06-30 15:02:06 +02:00
qcommandlineparser QCommandLineParser: support extremely concise option configuration in C++11 2014-08-06 22:17:22 +02:00
qcontiguouscache Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qcryptographichash Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
qdate Speedup qDebug() << QDate(...) 2014-07-14 00:11:35 +02:00
qdatetime QNX: Make QDateTime "daylightTransitions" auto test pass 2014-05-14 09:12:39 +02:00
qeasingcurve Fix MSVC-warnings about double to float truncation. 2014-01-24 20:26:39 +01:00
qelapsedtimer Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qexplicitlyshareddatapointer Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qfreelist Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qhash tst_QHash: replace QVERIFY(x == y) with QCOMPARE(x,y) 2014-07-25 14:52:40 +02:00
qhash_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qline Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qlinkedlist Deprecate setSharable in Qt containers 2014-04-24 10:49:10 +02:00
qlist Deprecate setSharable in Qt containers 2014-04-24 10:49:10 +02:00
qlist_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qlocale Make tst_QLocale::macDefaultLocale() more robust 2014-07-02 12:55:47 +02:00
qmap tst_QMap: replace QVERIFY(x == y) with QCOMPARE(x,y) 2014-07-25 14:53:05 +02:00
qmap_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
qmargins QMarginsF - Add new QMarginsF class 2014-02-21 20:33:10 +01:00
qmessageauthenticationcode Removed unnecessary TESTDATA statement from qmessageauthenticationcode. 2014-03-14 15:26:21 +01:00
qpair
qpoint Add static dotProduct methods to the QPoint(F) classes 2013-01-26 00:09:14 +01:00
qpointf Fix QPointF::division autotest 2013-08-19 14:24:28 +02:00
qqueue Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
qrect QMarginsF - Add new QMarginsF class 2014-02-21 20:33:10 +01:00
qregexp Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qregularexpression QRegularExpression: add ways to force an immediate optimization 2014-05-06 00:10:55 +02:00
qringbuffer Rewrite QRingBuffer 2014-07-24 17:31:20 +02:00
qscopedpointer Revert "Implement move-ctor and move-assignment-op for QScopedPointer" 2013-09-05 08:20:19 +02:00
qscopedvaluerollback qscopedvaluerollback: add convenience constructor 2014-05-21 02:15:10 +02:00
qset tst_QSet: verify that {}-style initialization drops duplicates 2014-07-25 14:53:25 +02:00
qsharedpointer Add QEnableSharedFromThis class 2014-06-29 23:20:10 +02:00
qsize Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qsizef Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstl Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstring Add QString::splitRef functions. 2014-07-31 08:50:22 +02:00
qstring_no_cast_from_bytearray Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstringbuilder Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstringiterator Long live QStringIterator! 2014-02-07 04:47:04 +01:00
qstringlist QStringList: add op= overloads for QList<QString> 2014-04-11 22:54:40 +02:00
qstringmatcher Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qstringref Implement QStringRef::split 2014-08-06 14:04:40 +02:00
qtextboundaryfinder Remove qSort usages from core tests 2014-02-22 09:51:14 +01:00
qtime Use the short time format of the current locale on Windows 2013-12-16 22:26:37 +01:00
qtimeline Updated corelib's unit tests to use QSignalSpy's functor constructor 2014-05-08 04:22:54 +02:00
qtimezone tst_QTimeZone: test QTimeZonePrivate::isValidId() 2014-07-31 21:05:07 +02:00
qvarlengtharray Add QVarLengthArray::{indexOf,lastIndexOf,contains} functions 2014-01-09 17:42:22 +01:00
qvector Fix typo with impact on test output 2014-07-28 08:39:49 +02:00
qvector_strictiterators Make sure all containers compile in strict-iterator mode 2014-02-22 04:38:01 +01:00
tools.pro Move tst_collections test to corelib/tools. 2014-05-13 16:08:01 +02:00