[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Defining hotspots on a picture
From: "Rabson, Hugo SPC MIL USA USARPAC" <hugo.rabson () us ! army ! mil>
Date: 2009-09-23 23:42:29
Message-ID: 1253749349.3869.9.camel () HugoNB205
[Download RAW message or body]
I'm trying to populate a QGraphicsView.scene() with user-adjustable
boxes. In theory, the QGraphicsView will display a picture to display on
the scene, then the scene will let the user draw boxes on top of that
scene. I'm trying to find a way to make those boxes adjustable.
Chapter 12 of Mark Summerfield's book has some sample code but it
doesn't permit adjustment of a box after it is dropped onto the picture.
-Hugo
P.S. My sample code (ugly):-
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import sys
app = QApplication(sys.argv)
app = QApplication(sys.argv)
graphicsview = QGraphicsView()
graphicsview.setDragMode(QGraphicsView.RubberBandDrag)
scene = QGraphicsScene(graphicsview)
graphicsview.setScene(scene)
scene.clear()
# TODO - use QPixmap to import a picture here ...
graphicsview.show()
box = scene.addBox(QBoxF(....)) # FIXME - this is not real code
txt - scene.addText("inside")
txt.setPos(50,50)
# ... Somehow make the box user-adjustable
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic