In that:
Q_PROPERTY(QString datastring READ showdata() NOTIFY datastringChanged)
Is it a datastringChanged signal to emit a signal when the QML side assigns something new to the datastring property, or is it intended to emit when the C ++ side needs to tell the QML side that showdata() needs to be checked again since it updated the information?
datastringChanged
datastring
showdata()
Last. Please note that QML does not have the ability to set this property (i.e. Read only in QML), because it does not need the WRITE method.
WRITE
(And for nitpick, it's just READ showdata , without () .)
READ showdata
()