PyQt: Get the position of QGraphicsWidgets in a QGraphicsGridLayout
Posted
by Chris Phillips
on Stack Overflow
See other posts from Stack Overflow
or by Chris Phillips
Published on 2010-05-10T00:45:19Z
Indexed on
2010/05/10
0:48 UTC
Read the original article
Hit count: 390
I have a fairly simple PyQt application in which I'm placing instances of a QGraphicsWidget in a QGraphicsGridLayout and want to connect the widgets with lines drawn with a QGraphicsPath. Unfortunately, no matter what I try, I always get (0, 0) back as the position for both the start and end widgets.
I'm constructing the graph with a recursive function that adds widgets to the scene and layout. Once the recursive function is complete, the layout is added to a new widget, which is added to the scene to show everything. The edges are added to the scene as widgets are created.
How do I get a non-zero position of any of the widgets in the grid layout?
© Stack Overflow or respective owner