Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
5.15.0
Description
this bug report contains 100% reproducible test case.
regression: on 5.14.2(and other past versions like 5.12) test case works, on 5.15 it doesnt
severity: it breaks my app completly on 5.15
QVariant treats enums (made for qml (enum classes) as strings rather than ints.
It happens after accessing enum property from qml in a eg. listview via model in a special way.
Ive made my models to be able to return QObject so that I can even emit some signal / launch some slots / q_invokables.
So when such QObject is returned and something is accessed via it (for example property) - it breaks whole QVariant - not only in QML but in c++ too.
This is output from qml:
//5.15 prints: status: E_loggedIn
//5.14.2 prints: status: 0 or 1 or 2 (number)
this is output from c++(QDebug):
//5.15 prints: cpp: QVariant(LoginStatusType::Type, "E_loggedIn")
//5.14.2 prnts: cpp: QVariant(int, 1)
ive included test case with simple code that shows it all - with comments where it happens and what it prints.