[Qt-interest] QGraphicsView scaled background image and fixed foreground item - is that possible?

Jason H scorp1us at yahoo.com
Mon Jun 6 16:16:01 CEST 2011


Simply, don't make the buttons children.Have a item group instead, with the background and buttons as children of the group. Continue to scale the background as you currently do.




________________________________
From: franki <franki at franki.eu.org>
To: qt-interest at qt.nokia.com
Sent: Monday, June 6, 2011 10:00 AM
Subject: [Qt-interest] QGraphicsView scaled background image and fixed foreground item - is that possible?

Hi all,

Is this possible?
I want to have background image (QGraphicsPixmapItem) with some items as a 
child items, and that will be scaled by fitInView, so the user can see complete 
image, or a part of the image if I scale to some rectangle (fitInView(RectF)).
On the same view I need to draw some buttons (from time to time), eg. when 
user clicks external (outside from QGraphicsView) button, I need to draw some 
buttons on top of the background image, but regardless of the scale of 
background image, buttons should have the same fixed size, and position. 
    Currently I draw the buttons earlier, hide them, and when user needs to 
see them I rescale, reposition, and then show them in QGraphicsView 
accordingly to the scale of the background image, but it would be great to 
draw in fixed coordinates regardless of the scale of the background image.

best regards
Marek

  
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110606/af209035/attachment.html 


More information about the Qt-interest-old mailing list