Unsolved When using QVariant with custom user type before QQmlEngine is created once, QVariant's get sent to c++ with different types.
-
I am generating bindings for .NET Core (see here).
When I pass a
QJsValue
to a C++ method (withQVariant
), theuserType()
is correct.obj.TestMethod({ "test": 23 }
void TestMethod(QVariant value) { // userType is expected to be ```QJsValue``` }
However, If I use
QVariant
with a custom struct beforeQQmlApplicationEngine
, then with the same call above, theQVariant
's userType is my custom struct, instead ofQJsValue
.QQmlApplicationEngine
is obviously doing some initialization stuff that should be done immediately in my application to prevent errors if someone does some stuff with my bindings before theQQmlApplicationEngine
is created. The question is, how do I force that initialization stuff to happen manually, without creating aQQmlApplicationEngine
? Or, maybe there is another way to solve this problem.