[Qt-interest] best way set a background photo for a QGraphicsView?

Jason H scorp1us at yahoo.com
Wed Apr 14 16:04:30 CEST 2010


I'd probably just use a QGraphicsPixmapItem use centerOn(pixItem), and make the drawing elemets a child of this, so they express themselves in relative coordinates tot he  background image. This will make it easy if you have to flatten it. Make sure though, that you don't clip children to parent, which I think is not a problem by default.This should also make zooming trivial as well, as scaling the parent will scale the children





----- Original Message ----
From: nobodyhere <pem.accounts.spam at gmail.com>
To: qt-interest <qt-interest at trolltech.com>
Sent: Tue, April 13, 2010 11:48:23 PM
Subject: [Qt-interest] best way set a background photo for a QGraphicsView?

My app will open a screen shot (photo / png etc) and allow the user to draw objects on it (such as rectangles, polygons, text objects), and resize / move / delete / copy-paste these objects.  The background image (screen shot / photo) will always be the same (but you can zoom in etc).  I should use QGraphicsView for this, with a background image?

What is the correct / optimized way to set a background photo for QGraphicsView?

thank you for any leads
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      



More information about the Qt-interest-old mailing list