[PyQt] Labelled QGraphicsItem

Jeffrey Spies jspies at gmail.com
Mon Sep 6 03:30:49 BST 2010


Hi, all,

I'd like to have QGraphicsItems (squares and circles) that have editable
QGraphicsTextItems attached to them.  I can do this with a
QGraphicsItemGroup or use two items (connected with an instance variable),
but I want the ability to, at times, move the labels around the item
(independent of the group moving), edit them, and even do batch moves like
"center all selected item labels inside the attached QGraphicsItem".  I'll
be adding/removing these labelled items to/from a QGraphicsScene using the
QUndoStack.

Does anyone know of a simpler/better way to do this or perhaps have a class
already made to be used directly or as an example?

Thanks!

Jeff.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100905/1d9ecc23/attachment.html>


More information about the PyQt mailing list