[Interest] QQmlApplicationEngine's rootObject() returns 0 objects count when trying to import of JavaScript file from Remote Server

ashish dabhade ashishd157 at gmail.com
Tue Nov 18 10:43:24 CET 2014


Well it actually cannot be termed as *Crash* as it just silently exits with
error 255 which I guess here must be resource not found.
Should it be reported as a bug ?

On Fri, Nov 14, 2014 at 7:48 PM, Alejandro Exojo <suy at badopi.org> wrote:

> El Friday 14 November 2014, ashish dabhade escribió:
> > No need to click even. It happens during load. Loading locally works as
> > expected. The JS file is proper. Just a single function in it
>
> I have to admit my ignorance respect network transparency with Qt Quick,
> but
> I've searched a bit and I've found:
>
> - QML files are network transparent, but you load a directory, and on the
> server you need the corresponding "qmldir" file to have the proper file
> loaded.
> - JS should be network transparent as well, but the only examples I've
> found
> make use of a remote QML file that loads a relative JS file (that then
> resolves
> to the network).
> - I've found no examples or tests in the qtdeclarative repository that
> import
> a JS file from the network like in your example.
>
>
> *However*, I tried runing the example with "qml" instead of "qmlscene" and
> it
> works fine.
>
> $ cat /var/www/sample.js
> .pragma library
>
> function myFunction() {
>     var d = new Date();
>     return d.toString();
> }
>
> $ cat test.qml
> import QtQuick 2.3
> import "http://localhost/sample.js" as Remote
>
> Rectangle {
>     width: 360
>     height: 360
>     MouseArea {
>         anchors.fill: parent
>         onClicked: {
>             console.log(Remote.myFunction());
>        }
>     }
>     Text {
>         anchors.centerIn: parent
>         text: "Hello World"
>     }
> }
>
>
> The "qml" program (a.k.a. "QML runtime") is something that I really can't
> explain properly, and is very hard to search for in the docs. Here is a
> talk
> by Alan Alpert introducing it:
>
> https://www.youtube.com/watch?v=2nnrl1v7LcE
>
> Hopefully someone with more knowledge can explain the issue.
>
> --
> Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
> http://barnacity.net/ | http://disperso.net
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141118/1005ccc2/attachment.html>


More information about the Interest mailing list