1

I have to render using QT a map defined by a matrix of cells in overview mode (think GPS map). I'd like to be able to zoom on it and each cell is defined by its color and some properties (bitmaps to put on the cell). I also need, like in a GPS, to be able to move around (using the directional arrows) in the map.

Right now, I'm thinking about drawing a matrix of QImages on my screen, and loading each one of them with the info of the cells I need, but it doesn't seem like a very good solution.

Thank you for every possibility you might provide.

Tuxer
  • 753
  • 1
  • 6
  • 20

1 Answers1

1

Your initial idea is a reasonable one, but put all the QImages and info you need into a custom QGraphicsItem and add them to a QGraphicsScene (and fix their position) - then you only need a QGraphicsView to visualise everything. This way you get the BSP painting and selection optimisations, view transformations, and nice animations (if required!) for free.

cmannett85
  • 21,725
  • 8
  • 76
  • 119
  • Thanks for your answer. I also found on stackoverflow a post speaking about qgraphicsviews, if anyone is interested : http://stackoverflow.com/questions/8279567/qt-gui-development-displaying-a-2d-grid-using-qgraphicsview – Tuxer Nov 01 '12 at 22:34