-----Original Message----- It is much like the old QGraphicsItem hierarchies, but the context part is different. This is because the context is used for the declarative bindings but is not an item in the item tree. So it looks like you've created an object in the correct context, but you haven't set its parent item yet. Without a parent item it will not be visible in the scene, just like with QGraphicsItem.
You'll have to cast it to a QDeclarativeItem*, and then call setParentItem(gameCanvas) (where gameCanvas is the QDeclarativeItem corresponding to gameCanvas in the samegame example. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Alan, Thanks for your advice. It works for my problem. I rewrite the game logic through C++ to prove that less javascript could improve performance. But for my rewriting game logic, it seems that the performance has not that a big improvement as I expected. Dynamically creating new visual item from .qml component still the big bottleneck for the whole program. So the simple replacement for js through C++ doesn't have any effect for the performance improvement. I am striked! -- Alan Alpert Senior Engineer Nokia, Qt Development Frameworks _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml Disclaimer: The information contained in this transmission, including any attachments, may contain confidential information of Panasonic Avionics Corporation. This transmission is intended only for the use of the addressee(s) listed above. Unauthorized review, dissemination or other use of the information contained in this transmission is strictly prohibited. If you have received this transmission in error or have reason to believe you are not authorized to receive it, please notify the sender by return email and promptly delete the transmission. _______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
