Q_PROPERTYs in preferences code

Lubomir I. Ivanov neolit123 at gmail.com
Sat Dec 16 11:35:29 PST 2017


On 16 December 2017 at 14:26, Berthold Stoeger
<bstoeger at mail.tuwien.ac.at> wrote:
> Somehow this all seems redundant: Each property has a WRITE method and a
> NOTIFY signal, but the signal is raised in the WRITE method anyway..? Does
> this mean that the signals are raised twice on mobile?
>

http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
"For maximum interoperability with QML, any property that is writable
should have an associated NOTIFY signal that is emitted whenever the
property value has changed"

you can then use the "on<my-var>Changed" slot naming scheme, which is
automatically handled in QML.
also i think i got QML errors at one point where my properties didn't
have the NOTIFY signals.

lubomir
--


More information about the subsurface mailing list