qt5base-lts/tests/auto/corelib/kernel
Simon Hausmann 549712830b QProperty: Add support for member function change handlers
When a class has multiple QProperty members to implement functionality,
it is common to have functions in the class that react to changes. For
example to emit a compatibility signal, in case of Qt Quick to mark the
scene graph as dirty, etc. etc.

To faciliate this use-case, this patch adds an internal
QPropertyMemberChangeHandler template that allows connecting a QProperty
field to a member function callback.

At the moment that callback is still 3 * sizeof(pointer). This could in
theory be reduced to 2 by eliminating the back-pointer (prev) as the
observer lives as long as the property. That however belongs into maybe
a future patch.

In order to get a pointer back to the surrounding object that holds the
QProperty as well as provides the callback function, the property system
was changed to pass through the address of the QProperty member at
run-time, and at compile time the delta from the QProperty member to the
beginning of the surrounding class is calculated. Through subtraction we
obtain the pointer to the owning object.

Change-Id: Ia2976357053f474ff44d0d6f60527c3b8e1f613a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-04-06 14:25:12 +02:00
..
qcoreapplication Port from QAtomic::load() to loadRelaxed() 2019-06-20 20:48:59 +02:00
qdeadlinetimer Merge remote-tracking branch 'origin/5.15' into dev 2020-03-04 14:39:18 +00:00
qelapsedtimer Merge remote-tracking branch 'origin/5.15' into dev 2020-03-16 18:41:27 +01:00
qeventdispatcher Detect double timer during single timeout in registerTimer test, and skip 2020-02-22 02:52:36 +01:00
qeventloop Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qmath Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qmetaenum Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qmetamethod Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qmetaobject MetaObject: store the QMetaType of the properties 2020-02-25 15:43:15 +01:00
qmetaobjectbuilder Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qmetaproperty MetaObject: store the QMetaType of the properties 2020-02-25 15:43:15 +01:00
qmetatype Enable qmetatype test with CMake 2020-04-01 10:29:33 +02:00
qmimedata Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qobject Merge remote-tracking branch 'origin/5.15' into dev 2020-02-28 09:48:30 +01:00
qpointer Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qproperty QProperty: Add support for member function change handlers 2020-04-06 14:25:12 +02:00
qsharedmemory Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qsignalblocker Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qsignalmapper Merge remote-tracking branch 'origin/5.15' into dev 2020-02-13 18:31:40 +01:00
qsocketnotifier Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qsystemsemaphore Regenerate tests/auto/corelib/kernel 2019-11-12 17:25:04 +00:00
qtimer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qtranslator Merge remote-tracking branch 'origin/5.15' into dev 2020-02-13 18:31:40 +01:00
qvariant CMake: Regenerate tests projects 2020-03-12 11:41:39 +01:00
qwineventnotifier Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
.prev_CMakeLists.txt cmake: Remove APPLE prefix from platform names 2020-03-16 17:57:56 +01:00
CMakeLists.txt Enable qmetatype test with CMake 2020-04-01 10:29:33 +02:00
kernel.pro Initial import of the Qt C++ property binding system 2020-03-16 18:19:45 +01:00