QtQuick project with qt-components symbian
-
Hi all,
i'm trying that above in my project...well
i've a big problem at run-time: ReferenceError: Can't find variable: checkUtilOk, i'm not so newbie with that, but this is my initial code (in main.cpp):
@
QmlApplicationViewer viewer;
MyClass checkUtil;viewer.setMainQmlFile(QLatin1String("qml/Repos/main.qml")); viewer.rootContext()->setContextProperty("checkUtil", &checkUtil);
@
So my var is declared and setted into context!
-
Are you able to reference checkUtil inside your qml code??
Can you try below code...
@QmlApplicationViewer viewer;
MyClass checkUtil;
viewer.rootContext()->setContextProperty("checkUtil", &checkUtil);
viewer.setMainQmlFile(QLatin1String("qml/Repos/main.qml"));
@
Just moved setContextProperty() above setMainQmlFile() :) -
Ok... just tried out in my Qt Creator, the above should solve your problem. Basically you are setting contextProperty before its being referenced inside your qml file.
-
Damn!
it obviously doesn't work if i set it after!!!
thanks mate! -
ohhh it's very beautiful work with QtQuick and Symbian/Meego components!
I'm looking forward to stable components...