[Qt-qml] running script at item load

michael.brasser at nokia.com michael.brasser at nokia.com
Fri Aug 13 03:31:02 CEST 2010


On 13/08/2010, at 11:00 AM, ext Robison, Clayne B wrote:
> I need to run a script when a QML Item loads and is done initializing. Launching a script in the default state doesn't seem to work, and there doesn't seem to be an "onLoad" event that gets fired by Items when they are done initializing. How does one accomplish this?

Usually Component.onCompleted is used for this type of thing -- see http://doc.trolltech.org/4.7-snapshot/qdeclarativejavascript.html#running-javascript-at-startup for more details (note that there aren't any Item-level notifications for this type of thing from QML, only Component-level).

Regards,
Michael



More information about the Qt-qml mailing list