johnbakers
johnbakers

Reputation: 24750

When does a Q_Property notification signal get called?

In this:

Q_PROPERTY(QString datastring READ showdata() NOTIFY datastringChanged)

Is the datastringChanged signal for the purposes of emitting a signal when the QML side assigns something new to datastring property, or is it for emitting when the C++ side needs to notify the QML side that showdata() should be checked again as it has updated information?

Upvotes: 4

Views: 2970

Answers (1)

peppe
peppe

Reputation: 22724

The latter. Note that QML has no way to set that property (i.e. it's read only in QML), as it lacks a WRITE method.

(And, to nitpick, it's just READ showdata, without ().)

Upvotes: 5

Related Questions