QObject dynamic properties and QML binding
Say I have this:
Code:
Rectangle {
width: object.dynamicProperty
}
If dynamicProperty changes no dynamicPropertyChanged signal will be issued, hence width won't change. Is it possible to somehow simulate a NOTIFY signal for a dynamic QObject property?
Re: QObject dynamic properties and QML binding
what kind of object is "object" c++, custom qml,... ?
Re: QObject dynamic properties and QML binding
Quote:
If dynamicProperty changes no dynamicPropertyChanged signal will be issued, hence width won't change.
Are you sure, as in, you've conclusively demonstrated this in your working code? From the docs:
Quote:
The property value is automatically kept up to date if the other properties or data values change.
Re: QObject dynamic properties and QML binding
The value is kept updated only if a notification signal is sent by the C++ object containing the property.
@ugluk: Why do you need a dynamic property to be reflected in QML? Can't you use a real property instead?
Re: QObject dynamic properties and QML binding
No, I can't. I thought that there perhaps exists a way to send a dynamic signal. I think that dynamic properties would fit well with a scripting language (which is also dynamic).
"object" is a C++ object (inheriting QObject).
Re: QObject dynamic properties and QML binding
Why can't you use real properties?