Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
Some future release
-
-
43e3c21a0bad9141b6c35cc4ee4a58b4d824462a
Description
In C++, we have QQmlProperty that is used in some APIs to reference a property, like in QQmlPropertyValueSource. I would very much like to be able to create properties of type QQmlProperty in C++, and bind a property to those instead of the value of that property. Currently, there are a couple of APIs in QML that split the object and the property, taking a the object as a QObject pointer (so, taking an id in QML) and a string for the name of the property (Binding for instance). I would like to be able to create APIs where that split is not needed, but the user could point to a a property directly.
I am not sure if that would/should have a special designation or marker to distinguish them from normal property references, something like using Qt.property(theId.property) or not.
The usecase are APIs like Binding. I am not a fan of splitting the target and the property, and less of taking the property as a string.
Attachments
Issue Links
- duplicates
-
QTBUG-77622 Avoid accessing properties as strings
- Open
- relates to
-
QTBUG-75672 New property system
- Closed
-
QTBUG-19892 Allow "lazy" aliases to properties of objects created only later
- Closed