Friday, 27 September 2013

How does Q_PROPERTY() RESET clause work?

How does Q_PROPERTY() RESET clause work?

When using the Q_PROPERTY macro to define a property to Qt's property
system, one of the available clauses is RESET. I know what the reset
function is for, and how to create one, but I can't figure out when it
would be triggered from QML. I notice that examples of reset function
declarations I've looked at in the BlackBerry Cascades header files are
not specified as Q_INVOKABLE, so you can't just call the function, but
they are always defined as a slot. This makes me wonder if the property
system has a hidden reset signal that is connected to the reset function
slot when you use the RESET clause with Q_PROPERTY. This way it would get
automatically triggered when some event happened from your QML. What this
event might be is what I just can't figure out.
I've been through the Cascades and Qt documentation upside-down and
sideways, and I can find lots of stuff about using the RESET clause and
how the reset function must be declared, but nothing on what makes it
trigger.
Does anyone have any insight on this?

No comments:

Post a Comment