Search code examples
qtqmlqtquick2qt-quickqqmlcomponent

Difference between QML's Component and Instantiator?


The QML types Component and Instantiator appear to do similar things; create QML objects on demand, as opposed to when parsing their definitions. So what's the difference? Why would I want to use one over the other?


Solution

  • An Instantiator creates instances of the given Component - one for each model-entry given in model. It's similar to the Repeater.

    A Component is a Class. A Instantiator is sort of a Factory for the given Component.