PDA

View Full Version : Tile editor



danca226
10th September 2011, 16:32
Hi. Im new to Qt and Im trying to get a feel for it by implementing a simple level editor. The editor works by allowing you to place tiles in a grid. It should support three layers (back, main, front) of tiles. Before I get to far I wanted to investigate the "best" way of doing this.

This is what I came up with so far


Scrollarea with huge frame and label with pixmaps as tiles (didnt like this idea)
using the graphics scene/view framework (feels better to me but I have the following questions: Is it smart enough to only render whats visible in the view and since QGraphicsScene::drawItems have been deprecated what other options do I have to control the rendering?



Please let me know if you have any other suggestions on how to implement this.

Thanks!

Lykurg
10th September 2011, 19:01
I'd go for QGraphicsView. It is smart enough to only render what is visible. There are also various option to improve the rendering. Furthermore the view will provide scrollbars and you can "fake" the layers by grouping the items. Use the z order for relative positioning. Have a look at the Graphics View Examples.