Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
QObject::findChildren returns a QList of the objects that match the search criteria.
One could instead imagine
1. a visitChildren function:
object->visitChildren<QLabel *>(QString(), [](QLabel *label) { label->setText("42"); });
2. a generator API:
for (QLabel *label : object->children<QLabel *>()) // not sure about a good name here label->setText("42");
Because if the point is to do an action for each child found this way, then one doesn't need to allocate and return a QList of results.
Do we want both? Only 2.?