Forums

OverviewV-Play 1 SupportDynamically changing the parent of a QML item › Re: Dynamically changing the parent of a QML item

OverviewV-Play 1 SupportDynamically changing the parent of a QML item › Re: Dynamically changing the parent of a QML item
#4094

Christian
V-Play Team

Quote from Christian on January 3, 2013, 22:41
I’m not sure what you are doing in the level loading with these calls:
1. comp = Qt.createComponent(fileName);
2. item = comp.createObject(loader.parent, {});
.

I made a LevelLoader element which loads the levels like this. It’s from a QT tutorial on how to create dynamic items.
http://doc.qt.digia.com/qt/qdeclarativedynamicobjects.html

Quote from Christian on January 3, 2013, 22:41
How do you load the dynamic levels – with the Loader element?
All the entities get placed as child of this element and you should not remove it. So instead of replacing the entityContainer, use the same one.
.

Ah so that could be the problem – i always delete the entityContainer and make a new one.
Then i should probably try to avoid this?

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support