[Interest] [Qt6] QML notify dynamic property changes from C++

Konstantin Shegunov kshegunov at gmail.com
Mon Mar 21 11:32:41 CET 2022

On Mon, Mar 7, 2022 at 12:20 PM Konstantin Shegunov <kshegunov at gmail.com>

> Sure, I'm going to try and prepare a testcase sometime later this week.

A bit later than I'd hoped for, but I tracked down the problem; posting for
anyone that may stumble onto this at a later time.

I didn't have an equality operator for my gadget type, and a bit
surprisingly (to me at least) QQmlPropertyMap::insert() does check against
the existing value. Since I didn't have the == operator what I assume was
happening (I hadn't the ability to check at the time) was that QVariant
coerced the type to bool (as I've an implicit cast operator) and hence it
always produced in the QQmlOpenMetaObject::checkedSetValue() the same
value-check result no matter the actual object, hence the value didn't
update for me.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20220321/99b52e81/attachment.htm>

More information about the Interest mailing list