Quoted from Qt 
Doc<http://doc.trolltech.com/4.7-snapshot/qdeclarativedynamicobjects.html>

Also, note that while dynamically created objects may be used the same as
> other objects, they do not have an id in QML.


Although I also think there're requirements that we need manipulate
dynamically created objects by ID, but unfortunately, there's only this
simple sentence in the doc to explain the ID issue.

Maybe nokia guys could tell more on this.

Thanks,
Brandon

On Tue, Dec 28, 2010 at 9:20 AM, Girish Ramakrishnan
<[email protected]>wrote:

> Hi Mathias,
>
> On Tue, Dec 28, 2010 at 6:15 AM,  <[email protected]> wrote:
> > Quick question; anyone know if it's possible to give an element created
> by
> > calling createObject() on a component an id?
> >
> > The documentation only says how to give it a parent:
> >
> http://doc.qt.nokia.com/4.7-snapshot/qml-component.html#createObject-method
> > and ids can simply be assigned like other properties.
> >
>
> Id's aren't anything like properties, so I think you mean ids *cannot*
> be simply assigned like other properties. I would like to be proven
> otherwise, but I don't think it's possible to give an element an id. I
> would think that after object creation, bindings have already been
> setup based on the ids in the scope chain and it's too late to give an
> id after all that. Maybe it makes sense to give an id to
> createComponent().
>
> Girish
> _______________________________________________
> Qt-qml mailing list
> [email protected]
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
>



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

Reply via email to