[Qt-qml] Component element: what is it for ?

Jason H scorp1us at yahoo.com
Thu Jul 22 19:50:47 CEST 2010


I believe that components can be instantiated but take some time to load. So 
they support a completed notification. So that once they are done loading you 
can show something atomically, and not as parts come in.

Though I do not understand the difference between Loader.onLoaded() and 
Component.onComplete()

I don't understand the use of Component.url. It is read-only, but this seems 
like it should be settable to resolve to remote components?






________________________________
From: Stephen Collyer <scollyer at netspinner.co.uk>
Cc: qt-qml at trolltech.com
Sent: Thu, July 22, 2010 11:57:35 AM
Subject: Re: [Qt-qml] Component element: what is it for ?


On 22 July 2010 16:44, Sacha Zyto <sacha at mit.edu> wrote:

Hi Stephen, 
>
>My understanding is that an Item placed inside a widget will be included in the 
>UI tree at that place, and hence displayed, which you don't want, say, if you've 
>designed  your component to be used as a "template" or a"lens" in order to be 
>used by a View to render Items that are inside a Model.  
>
>
 
Right. Assuming that your explanation is correct, that makes sense.
In that case, a Component is essentially the QML equivalent of a
class, defining an object template but not instantiating it. I'll have to play
around with this to see exactly how it works. 
 
Does an Item, conversely, both define an object template and
instantiate it, so that an Item can be used anywhere a Component
can be used ?
 
-- 
Stephen Collyer



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


More information about the Qt-qml mailing list