[Interest] Adding objects in QML and scrolling it
Bo Thorsen
bo at fioniasoftware.dk
Fri Oct 5 08:25:57 CEST 2012
Den 04-10-2012 01:11, Николай Шатохин skrev:
> Hello.
>
> Can anybody help me with my problem? I have a scene (Rectangle). I
> need add objects (circles) into scene by signal (signal returns
> coordinates) from C++ class and move all objects on scene to left
> after it (scrolling).
>
> So, how can I add new object (Qml type)?
> How can I move all added objects to left by x coordinate for a custom
> value?
> How can I destroy object when it left screen?
Hi Nick,
Take a look at this page:
http://qt-project.org/doc/qt-4.8/qdeclarativedynamicobjects.html. When
you have tried implementing some of this, you can ask the next questions.
Dynamic object management in QML is pretty difficult, so you have some
work cut out for you. But it is of course possible, so just keep at it.
I know QML claims to be for "dynamic" UIs, but that's just marketing
bullshit. QML is for static UIs with things that can move. Dynamic stuff
like this is just not what it's designed for.
Personally, I prefer doing the dynamic instantiations in C++, but that's
probably just all my C++ experience talking :)
I hope this helps,
Bo Thorsen.
Fionia Software - Qt experts for hire.
More information about the Interest
mailing list