qt5base-lts/examples
Stephen Kelly 43325a23f3 Delete the QVariant ctors taking global Qt enum values.
They have unexpected results in Qt 5 (the Qt::GlobalColor one works
as expected in Qt 4, but was removed in Qt 5):

 QVariant v = QVariant(Qt::red);
 qDebug() << v; // QVariant(int, 7)
 v = Qt::red;
 qDebug() << v; // QVariant(int, 7)

The correct way is to use:

 QVariant v = QVariant::fromValue(QColor(Qt::red));

The deleted constructors are the ones for which there is a class
with an implicit constructor taking the enum, and that class is
a built-in metatype.

QLocale::Language and QKeySequence::StandardKey would also fit
the description, but I can't include the header for QKeySequence
as it is in QtGui, and I don't want to include the qlocale header
in qvariant.h. Putting a QLocale::Language is probably very
uncommon anyway.

The QTextFormat test is doing the wrong thing, but the result isn't
being tested. Added new tests which fail before the patch.

Change-Id: Ia38a0784990f4d40ff7457a86daf58aabd4964eb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2012-10-10 08:45:22 +02:00
..
dbus Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
embedded Fix compilation for Qt5: Avoid deprecated API 2012-09-26 18:52:14 +02:00
gestures Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
gui Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
ipc Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
ja_JP/linguist/hellotr Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
linguist Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
network Use QStringList::join(QChar) overload where applicable [examples] 2012-09-23 23:30:03 +02:00
opengl Made cube example not use glActiveTexture. 2012-10-02 10:43:48 +02:00
qmake Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qpa QPA/Windows example: Set proper window flags, titles, names. 2012-10-01 10:20:09 +02:00
qtconcurrent Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
qtestlib Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
sql Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
threads Use QStringList::join(QChar) overload where applicable [examples] 2012-09-23 23:30:03 +02:00
tools remove superfluous include from echoplugin example 2012-10-08 17:21:15 +02:00
touch Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
webkit/webkit-guide Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
widgets Delete the QVariant ctors taking global Qt enum values. 2012-10-10 08:45:22 +02:00
xml Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
examples.pro Move tutorials to widgets. 2012-09-09 01:18:37 +02:00
README Remove more references to demos. 2011-07-08 15:36:26 +02:00

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.