qt5base-lts/tests/auto/corelib/kernel/qproperty
Simon Hausmann 36f6922925 Implement support for QProperty<T> with a static observer
A common pattern in Qt Quick will be QProperty members that are
connected to a callback that needs to perform something when the value
changes, for example emitting a compatibility signal or marking scene
graph node data dirty.

To make such a pattern more efficient, a new QNotifiedProperty type is
introduced that offers the same API as QProperty<T>, with two changes:

    (1) The template instantiation not only takes the property type as
    parameter but also a callback pointer-to-member.

    (2) Since that member itself cannot be called without an instance
    and to avoid storing an instance pointer permanently, the API for
    setBinding and setValue are adjusted to also take the instance
    pointer. For the former it gets stored in the binding, for the
    latter it is used to invoke the callback after setting the new
    value.

Change-Id: I85cc1d1d1c0472164c4ae87808cfdc0d0b1475e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-28 21:08:51 +00:00
..
CMakeLists.txt Add QProperty tests to the cmake build 2020-03-27 13:29:47 +01:00
qproperty.pro Initial import of the Qt C++ property binding system 2020-03-16 18:19:45 +01:00
tst_qproperty.cpp Implement support for QProperty<T> with a static observer 2020-05-28 21:08:51 +00:00