[Qt-interest] Anchor a QGraphicsPathItem to two QGraphicsWidget
Sean Harmer
sean.harmer at maps-technology.com
Sun Jun 13 17:54:30 CEST 2010
Hi,
On 13/06/2010 14:01, Ori Lahav wrote:
> Hello QTers,
>
> I have a few QGraphicsWidgets in a QGraphicsScene. They are connected to
> each other with a QGraphicsPathItem. Instead of updating the paths
> manually each time an item is moved, is there any way to anchor the path
> to the two items?
Change your QGraphicsPathItem into a QGraphicsWidget sub-class and then
anchor your 3 widgets together using a pair of QGraphicsAnchorLayouts as
needed. Although I am not sure how practical this is if you want to
freely move your two existing widgets in relation to each other. Have a
play around and see.
Cheers.
Sean
More information about the Qt-interest-old
mailing list