> -----Original Message-----
> Subject: [Qt-qml] How can i verify that QML elements are loaded or not?
> 
> Hi,
> 
> 
> 
> I have the following code snippet in QML, but i doubt statements inside
> Repeater element is not executed. Is there any way through which i can
> debug these, i know that there is a log property present for Repeater
> element but i am not sure how to use these.

The documentation for Loader  tells you onStatusChanged() might never be called 
for local files:

"Note that if the source is a local file, the status will initially be Ready 
(or Error). While there will be no onStatusChanged signal in that case, the 
onLoaded will still be invoked."

So you probably want to use onLoaded() instead of onStatusChanged().

Regarding how to 'debug' this: You can use e.g. the QML debugger/inspector 
integrated into Qt Creator. Or just use 'console.log("This is executed")' :)

Regards

Kai
 
> import QtQuick 1.1
> 
> Item {
> 
> id: screen
> 
> 
> 
> width: 1024
> height: 600
> 
> /*Loading Screen*/
> Interactive {id: interactive}
> Loading {id: loading;}
> 
> /*Application Components*/
> Pif {id: pif}
> Config {id: config}
> Media {id: media}
> 
> 
> Repeater {
>     model: config.launchers
>     delegate: Loader {
>         id:loader
>         anchors.fill: parent
>         source: file
>         onStatusChanged: {
>             if (loader.status == Loader.ready)
>             {
>                 loading.opacity = 0
>                 loading.visible = false
>             }
>         }
>     }
> 
> 
> }
> 
> 
> 
> Fullscreen {id: fullscreen}
> 
> 
> }
> 
> 
> 
> Thanks & Regards,
> Kalpesh Jain.
> 

_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to