I found out, that in Q3, this operation was able to be performed with the use of Q3Canvas and tiles. Is that right?
I found out, that in Q3, this operation was able to be performed with the use of Q3Canvas and tiles. Is that right?
Last edited by aurelius; 30th October 2008 at 16:54.
Yes, that's more or less correct.
No, this is wrong. You need to use QGraphicsItem::setPos().I can change the position of the item with the use of GraphicsPixmapItem->setOffset(...).
You have to set positions of each of the pixmaps in such way that each consecutive pixmap is moved to the right by the sum of widths of all previous pixmaps. When you don't have enough space left, reset the x coordinate and instead increase the y coordinate by the height of the previous row.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?
Yes, it does.I can define the scene rect. When I show the QGraphicsView, doesn't it show this rect ?
You always want to show the whole width of the scene. If you don't change the scene but reduce the size of the view that displays it, you'll get scrollbars which is probably not what you want.What do you mean, that the scene size must reflect the view's size.
Yes, but you might want to resize the view, right? The scene won't accomodate - it doesn't work both ways.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 ?
Last edited by wysota; 30th October 2008 at 23:05.
This is what I was trying to say from the beginning.
Now, I try to synchronize the size of the sceneRect with the size of the View window.
When I catch the event for resizing the window, I resize the sceneRect as well. But it doesn't. Also, when I use the setPos, (I had already tried that), it puts the pixmaps in irrelevant places. I guess, the coordinated I give are for the sceneRect, and I want the coordinates for the view windows. For example when I say: put it to (0,0), it puts it to sceneRect's (0,0), not to the window's. Right ?
Ok, I did most of what I wanted.
The ResizeEvent is activated when you push the mouse button and then release it. If I want to activate it, when you just press the mouse button, what should I do. Should I reimplement the event ???
I wanted to ask as well, why when I open the QGraphicsView window, it does'nt open it with the scrolls in the start but from the middle.
Also, I added a hover event on the pixmaps and when i hover them, I am scaling them in order to give the feeling of slight zoom. When I leave the pixmap it returns to its original position. However, it doesn't work quite well. Theoretically, it takes its original size, but if i hover again multiple times over the same pixmap, it slightly changes slowly size. I guess this has sth to do with the accuracy of the numbers. I use double variables though, so I don't know why it's happening. Should I declare variables like qfloat etc? Will there be any difference ?
Last edited by aurelius; 31st October 2008 at 15:06.
Bookmarks