I'm working on porting an application I wrote in OpenGL (glut) to Qt. I'm very happy with what I've seen of Qt so far. There seems to be many ways that I can do this and I'll be using this project for years, so I'm looking for some expert advice on what the Best way to do it would be.
I have a data visualization that is a grid of squares, each of which are assigned a color. Basically, I have a grid of pixels, but they aren't always 1:1 with screen pixels. I display each square in the order that you would display pixels in an image, starting at upper left, moving to the right until I reach the width at which point I wrap to the next line. The catch is that the width is adjustable by the user so the "pixels" can migrate around on the screen. The visualization is rectangular, but the dimensions change based on user input.
Design priorities:
1) Layout can be easily changed
2) Runs in real-time even with 100,000+ "pixels" on the screen
3) Should be able to smoothly zoom in an out (basically scale the image).
4) Ability to easily select 1 "pixel" using mouse input.
The ability to select 1 pixel with a mouse is last on the list because zooming in/out and changing the width are used >100 times more often. If need be I could capture what screen pixel was clicked on and do the math to convert that to data points myself.
I've been looking at the Qt example Graphic View > Diagram Scene as a good starting point for the kind of interface I'm shooting for. I can see using Bitmap, QPixelMap, a group of QGraphicsPolygonItem or several others. I'll probably implement my own class that either inherits or contains a Qt class. Thanks for the advice. Making the right decision here will make a big difference to me.
Bookmarks