qt5base-lts/examples
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
..
aggregate install a sane top-level examples.pro file 2012-12-11 13:37:57 +01:00
corelib Android: trim down the examples manifests from obsolete tags 2021-07-01 23:54:15 +03:00
dbus Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
embedded Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
gui Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
network Use new permission api for http example 2021-06-07 14:59:14 +03:00
opengl Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
qmake Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
qpa Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
qtconcurrent Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
qtestlib Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
sql Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
vulkan vulkan: Update legacy tests and examples to the modern validation layer 2021-05-31 17:16:49 +02:00
widgets QObject: optimize the common case of findChildren(QString()) 2021-07-13 16:57:31 +02:00
xml Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
CMakeLists.txt Build examples in isolated sub-builds using ExternalProject 2021-05-26 13:33:29 +02:00
examples.pro Turn off the dbus examples for qmake-generated VS projects 2021-02-09 15:45:06 +01: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.