Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.7.0, 5.8.0 Alpha
-
2cfe1bb09c11432ca5033f9589243e9e62fe9488
Description
If I do the following
cpp: qmlRegisterType<MyType1>("MyModule", 1, 0, "MyType"); qmlRegisterType<MyType2>("MyModule", 1, 0, "MyType"); runSomeQmlApplication(); qml: MyType{ ... }
then QML will instantiate MyType2. This makes sense, it was the last type to be registered.
However, if I do this
cpp: qmlRegisterSingletonType<MySingleton1>("MyModule", 1, 0, "MySingleton", createMySingleton1); qmlRegisterSingletonType<MySingleton2>("MyModule", 1, 0, "MySingleton", createMySingleton2); qml: MySingleton.callSomeMethod();
then QML will call MySingleton1::callSomeMethod.
This is not only inconsistent, it's blocking a work-aoround for QTBUG-56172. Related to QTBUG-56532.