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

ashish dabhade ashishd157 at gmail.com
Thu Nov 13 16:48:05 CET 2014


Hmm. That explains it. Thanks.
Another question,
Is the Qt Quick UI project suitable for this kind of scenario ?
For eg. I create a "New File or Project > Application > Qt Quick UI" and
then in QML the same

import QtQuick 2.3
import "http://192.168.1.2/sample.js" as Remote

Rectangle {
    width: 100
    height: 62

    MouseArea {
        anchors.fill: parent
        onClicked: Remote.myFunction()
    }
}


but it crashed here. Following is the log:

Starting /home/ashish/Qt-Main/5.3/gcc/bin/qmlscene...

/home/ashish/Qt-Main/5.3/gcc/bin/qmlscene exited with code 255

Is it related to the first scenario ?

On Thu, Nov 13, 2014 at 8:25 PM, Alejandro Exojo <suy at badopi.org> wrote:

> El Thursday 13 November 2014, ashish dabhade escribió:
> > Now keeping everything the same and just commenting the import line
> > properly shows objects count as 1.
> > Also importing the javascript file locally also succeeds.
> > Is this a known issue ?
>
> Did you check the docs? :-)
>
> >From QQmlApplicationEngine::load:
>
> "The object tree defined by the file is created immediately for local file
> urls.
> Remote urls are loaded asynchronously, listen to the objectCreated signal
> to
> determine when the object tree is ready."
>
> --
> 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/20141113/90a6a032/attachment.html>


More information about the Interest mailing list