How can I align certain widgets to specific points in a pixmap edges.



  • I want to have a widget containing a pixmap at the center and some other child widgets aligned to the edges of my pixmap.
    I was thinking of doing this using QGraphicsAnchorLayout
    Like, having the pixmap as a QGraphicsPixmapItem anchored at the center of my anchor-layout. And aligning widgets to the anchors around the pixmap item.

    1. Will it be possible for anchoring to work if the shape of the pixmap item that I'm interested in is the QGraphicsPixmapItem::MaskShape of the pixmap.
    2. Can I have custom anchor points that fall not on Qt::AnchorPoint or Qt::Corner, but on a specific point that I decide?

    Mock-up:
    0_1550225465386_Screenshot 2019-02-15 at 11.03.36.png


  • Lifetime Qt Champion

    Hi,

    From the looks of it, you will likely have to implement your own layout.