Last edited by invictus; 10th August 2007 at 18:33.
The count starts at 0.
Also, the view also has some borders that you must consider, since they are part of the bounding box.
I guess you have to query the current style for the border
width and subtract it from the rect size, in order to get the same results for different styles.
Regards
I wish I were...but I really can not get this to work. Perhaps there is something wrong with my computer system as I am running gnome to test this? No matter what I do and how adjusted the rect is, the item will always be partially outside the view... but if I can scroll I can scroll it "back" into the view. This is really weird I think
I was wondering...is there any other widget than QGraphicsView I can use for 2D graphics? And can I render SVG/Vector graphics on this (if such a widget exists)? I think perhaps GraphicsView is too complicated for my use when all I want is to do some custom drawings on a given portion of the application window.
My book doesnt cover graphicsview either, while it has a short chapter on 2D using QPainter...
You can render a svg on virtually any paint device by using QSvgRenderer.I was wondering...is there any other widget than QGraphicsView I can use for 2D graphics? And can I render SVG/Vector graphics on this (if such a widget exists)? I think perhaps GraphicsView is too complicated for my use when all I want is to do some custom drawings on a given portion of the application window.
This includes widgets and pixmaps. You could use, for example a QWidget, or a QLabel if you wish.
Because the Graphics View Framework is relatively new.My book doesnt cover graphicsview either, while it has a short chapter on 2D using QPainter...
Try this: http://doc.trolltech.com/4.3/graphicsview.html\
Regards
If I can do that, why would I use graphicsview to begin with? Sorry if my questions are too stupid to be answered
To be honest, what I am trying to do is to create a small puzzle game using SVG images for scalability.
The disadvantage, as I see it, when using widgets is that you will have to provide your own item interaction implementation( move puzzle pieces around, etc ).If I can do that, why would I use graphicsview to begin with?
With a QGraphicsView/scene these things are built-in.
Basically, all you have to do is concern on the drawing stuff.
Regards
Bookmarks