Thank you very much for the test code but it didn’t seem to do the trick for me. Anyway, I will try to compile the sample code once in a while.
Currently I have a problem with the type recognition of my context property. I keep on getting the following error during execution:
main.qml:35: TypeError: Object #<error> has no method 'rows'
Before running the application I am doing this:
qmlRegisterType<Level>("Level", 1, 0, "Level");
Level* pLevel = new Level();
viewer.rootContext()->setContextProperty("_currentLevel", pLevel);
Level is a subclass of QObject. Qt Creator recognizes the context property “_currentLevel” as well as it’s Q_INVOKABLE-marked functions and properties correctly. However, during execution I am still getting the error from above. Seems like to “Level” type is unknown to the QML part.
Do you have any idea?
↧