Details
-
Suggestion
-
Resolution: Invalid
-
P2: Important
-
5.12.6
Description
Today, Repeater can create QQuickItems only. It would be very useful if it could also create Objects (i.e., QtObjects). The reason is that will allow C+-defined models to be passed to C+ from QML.
The BirthdayParty example included in Qt, which demonstrates attached properties, uses default properties for Person declarations. It inlines three "Person"s line this:
BirthdayParty { Person { } Person { } Person { } }
But given that you have a data source for each person, it's cleaner to define this dynamically using a Repeater, as in the below example:
BirthdayParty { Repeater { model: 3 Person { } } }
Unfortunately, Person is an QObject, so this does not compile/work.
Attachments
Issue Links
- is required for
-
QTBUG-73063 Qt Quick Changes in Qt 6
- Open
-
QTBUG-62425 Changes planned for Qt 6
- Closed
- relates to
-
QTBUG-34433 Instantiator in QtQuick Controls gives error when onObjectRemoved is called.
- Open
-
QTBUG-64546 Instantiator: provide a way to set the QObject parent of the objects it creates
- Reported
-
QTBUG-72838 No way to declaratively instantiate Path elements in ShapePath
- Reported