[Qt-qml] Javascript include/import?

greg.edwards at nokia.com greg.edwards at nokia.com
Wed Jun 16 18:58:31 CEST 2010


Hi all,

Have a look at an example of my javascript code below, it’s causing the following error,

    TypeError: Result of expression 'Component' [undefined] is not an object.

Do I need to include / import the Qt library? or should it already be available?
The strange thing is that Qt.createComponent() works so javascript does seem to have some knowledge of the Qt library.

Cheers
Greg

Ps. I’m on a Mac (10.6.3) running Qt Creator 1.3.84 (2.0.0-pre-rc1)


.pragma library

function doStuff() {
    var component = Qt.createComponent("App.qml");
   if (component.status == Component.Ready) {
       print("it worked!");
   }
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100616/9529fd33/attachment.html 


More information about the Qt-qml mailing list