[Qt-qml] Unable to use external JS file with QML

aaron.kennedy at nokia.com aaron.kennedy at nokia.com
Wed Apr 14 11:02:47 CEST 2010


Hi,

If Script { source: "a.js" } works for you without any warnings it is because you are using an old build.

In the latest code, available from http://qt.gitorious.org, we support the import "a.js" as A syntax.  For the time being we are also still supporting the Script{} tag to give people time to port their code.  The latest builds of QML will output a warning if you use the Script{} tag instructing you to update your files.

The final 4.7 release will only support the import syntax.

Cheers,

Aaron


On 14/04/10 6:19 PM, "ext Jack Wootton" <jackwootton at gmail.com> wrote:

Script { source: "a.js" }

works for me.  Is this because of the "overlap" that's been mentioned or is it because i'm using a version of Qt that doesn't implement the "import" method?

I'm using 4.7.0 snapshot built form source, downloaded from http://qt.nokia.com/developer/qt-qtcreator-prerelease#download

On Wed, Apr 14, 2010 at 6:13 AM,  <warwick.allison at nokia.com> wrote:
> Did the older versions of QML support importing of js files that way
> (import "a.js" as Misc)?  I know the old { Script: a.js } way of
> including js files doesn't work anymore, was that replaced with the
> new way, or were both always an option?

The import way replaced the Script{} way, with some overlap.

--
Warwick

_______________________________________________
Qt-qml mailing list
Qt-qml at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100414/2abe6557/attachment.html 


More information about the Qt-qml mailing list