From what you saying, I understand this:
1) I have to create a QGraphicsScene item. From all the reading I ve made, this is the class that manages all items inside the area.
2) I have to create a QGraphicsView item. This item is for visualizing the whatever contents of QGraphicsScene.
3) I add items in the QGraphicsScene. I use the function addPixmap. I add them to the scene and display them. However, the documentation says, that items are by default positioned to (0,0). So, if I add 2 items, the second overlaps the first. I can change the position of the item with the use of GraphicsPixmapItem->setOffset(...). What I was trying all along to find out is the following: in order to have several pixmap items in the scene, and order them into a grid, how do I define the position of the items? Is there some function that layouts them like that or I have to define myself the position of the items with setOffset() function ? That is, is there any function that says to the scene:
"ok, put this pixmap from top to right, where there is empty space" because from what I ve read till now(and maybe because I am a beginner in GUIs), the only function I can do is "ok, put the pixmap in (0,0), if the programmer wants sth else, he will change it by himself later".
4) I understand what you are saying with the size and stuff. What I don't understand is the following: I can define the scene rect. When I show the QGraphicsView, doesn't it show this rect ? What do you mean, that the scene size must reflect the view's size. The documentation says, that if you don't mess with QGraphicsView's sceneRect, it takes by default the rect of the QGraphicsScene, which means the one rect relfects to the other. Or not ?




Reply With Quote



Bookmarks