qt5base-lts/tests/auto/corelib/kernel
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
..
qcoreapplication Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qdeadlinetimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qelapsedtimer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qeventdispatcher QEventDispatcher(Win): Always honor interrupted status to avoid races 2021-03-11 12:11:18 +01:00
qeventloop Remove the qmake project files 2021-01-07 15:32:28 +01:00
qjnienvironment JNI: Add calls to get field IDs 2021-06-04 10:46:57 +03:00
qjniobject Fix set*Field JNI template calls 2021-05-05 16:28:27 +03:00
qmath Add qHypot() to qmath.h, exposing and extending std::hypot() 2021-01-27 15:00:57 +01:00
qmetacontainer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetaenum Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetamethod QMetaMethod: Store method constness in metaobject system 2021-05-07 21:50:58 +02:00
qmetaobject Introduce QMetaObject::metaType 2021-03-25 17:33:07 +01:00
qmetaobjectbuilder QMetaObjectBuilder: remove unused serialization code 2021-03-20 10:24:27 +01:00
qmetaproperty Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmetatype normalizeTypeFromSignature: Beware of anonymous struct/union 2021-06-08 15:37:38 +02:00
qmimedata Remove the qmake project files 2021-01-07 15:32:28 +01:00
qobject QObject: optimize the common case of findChildren(QString()) 2021-07-13 16:57:31 +02:00
qpointer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qproperty QProperty: Downgrade assert in noSelfDependencies to warning 2021-07-07 17:07:15 +02:00
qsharedmemory Apple: Use POSIX IPC instead of System V in sandboxed applications 2021-06-16 15:53:23 +02:00
qsignalblocker Remove the qmake project files 2021-01-07 15:32:28 +01:00
qsignalmapper Remove the qmake project files 2021-01-07 15:32:28 +01:00
qsocketnotifier CMake: Remove the usage of QT_SOURCE_TREE from tests 2021-07-12 18:56:14 +02:00
qsystemsemaphore Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtimer Fix QTimer::setInterval to remove existing bindings 2021-02-15 13:47:31 +01:00
qtranslator Remove the qmake project files 2021-01-07 15:32:28 +01:00
qvariant Expand a test that QVariant isn't null even when what it wraps is 2021-06-24 16:35:41 +02:00
qwineventnotifier Repair tst_qwineventnotifier 2021-03-29 15:54:05 +02:00
CMakeLists.txt Repair tst_qwineventnotifier 2021-03-29 15:54:05 +02:00