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
QJsValueto 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
QVariantwith a custom struct beforeQQmlApplicationEngine, then with the same call above, theQVariant's userType is my custom struct, instead ofQJsValue.QQmlApplicationEngineis 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 theQQmlApplicationEngineis 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.