-
Put figure in a grid
I'd like to write an application(QMainWindow) where i have some geometric figure on a toolbar that i can drag and drop on central widget.
What kind of widget (or QPaintDevice in general) can i put as central widget?
The central widget may contain a grid(i'd like to riceive the x,y coordinate), where i can move my object(rectangle, square) throw it.
-
Re: Put figure in a grid
-
Re: Put figure in a grid
Or you could use QGraphicsView, take a look at Diagram Scene
-
Re: Put figure in a grid
I looked Qgraphview and Qgraphscene and i'd like to have a simplest kind of widget where i can drag and drop my Rectangolar object.
I also desire a grid:
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
. . . . . . . . . . . . .
where i can move my geometric figure and resize it....(my figure have to follow just the points on the grid.....)
Any idea?
-
Re: Put figure in a grid
You pretty much described a typical use case for the graphics view framework.
You could do it without graphicsview, but why go to the extra work?