qt5base-lts/examples/widgets/painting
Marc Mutz 2b50c8bec0 QObject: optimize the common case of findChildren(QString())
Outside tests, all in-tree callers of QObject::findChildren() pass no
name to match, and in my experience that is also true for the vast
majority of out-of-tree users.

Avoid the temporary QString creation in the caller and the repeated
QString::isNull() checks in the implementation by overloading
findChildren() without a name argument and checking for name.isNull()
only once, forking off into separate helper functions.

Adjust in-tree callers that used an explicit `QString()` argument in
order to pass options, which goes to show that `name` should never
have been the first argument of findChilden() in the first place, even
though I appreciate the symmetry with findChild() (the use-cases of
which, however, are radically different).

Change a `findChildren().size() == 0` call found while scanning for
findChildren() calls to `!findChild()` as a drive-by.

Modernize loops in the various qt_qFindChild{,ren}_helper() overloads
to match how the new code looks.

[ChangeLog][QtCore][QObject] Added findChildren() overload taking no
name (thus optimizing this common case).

Change-Id: Ifc56e5438023d079b40c67f11ae274a3e128ad5e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-13 16:57:31 +02:00
..
affine Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
basicdrawing CMake: Regenerate examples to set the WIN32_EXECUTABLE property 2020-10-27 12:49:39 +01:00
composition Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
concentriccircles CMake: Regenerate examples to set the WIN32_EXECUTABLE property 2020-10-27 12:49:39 +01:00
deform Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
fontsampler Qt::PrintSupport is an optional component in the fontsampler example 2021-06-15 22:11:10 +02:00
gradients Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
imagecomposition CMake: Regenerate examples to set the WIN32_EXECUTABLE property 2020-10-27 12:49:39 +01:00
painterpaths CMake: Regenerate examples to set the WIN32_EXECUTABLE property 2020-10-27 12:49:39 +01:00
pathstroke Fix BASE argument of qt_add_resources 2021-05-18 16:02:52 +02:00
shared QObject: optimize the common case of findChildren(QString()) 2021-07-13 16:57:31 +02:00
transformations CMake: Regenerate examples to set the WIN32_EXECUTABLE property 2020-10-27 12:49:39 +01:00
.prev_CMakeLists.txt CMake: Regenerate examples/widgets/ projects 2020-04-29 22:48:38 +02:00
CMakeLists.txt Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
painting.pro
README

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.