New bindable properties do not require signals. Because of that, checking how many times the value has actually changes becomes a little verbose.
On the C++ side you need to implement something like this:
And the situation becomes even more annoying, if one needs to do it on QML side. I could only solve it by introducing 2 extra properties:
Suggestion: let's implement a QBindableSpy that would behave very much like QSignalSpy, but do not require a signal.
The actual API can be discussed, but as I see it now, it should be possible to do at least two things:
- Query the total amount of changes (like QSignalSpy::count);
- Query the individual value by index (like QSignalSpy::at(index)).