qt5base-lts/examples/widgets/painting
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
..
affine Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
basicdrawing Delete the QVariant ctors taking global Qt enum values. 2012-10-10 08:45:22 +02:00
composition Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
concentriccircles Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
deform Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
fontsampler Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
gradients Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
imagecomposition Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
painterpaths Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
pathstroke Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
shared Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
svggenerator Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00
svgviewer Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00
transformations Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
painting.pro Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00
README Moving .qdoc files under examples/widgets/doc 2012-08-20 12:20:55 +02:00

Qt's painting system is able to render vector graphics, images, and outline
font-based text with sub-pixel accuracy accuracy using anti-aliasing to
improve rendering quality.

These examples show the most common techniques that are used when painting
with Qt, from basic concepts such as drawing simple primitives to the use of
transformations.


Documentation for these examples can be found via the Examples
link in the main Qt documentation.