Reputation: 41347
If I have multiple non-rectangular custom QWidget
s (e.g. circle-shaped buttons), can I overlap them?
It seems there is no way to let Qt know which parts of the widgets are opaque, so mouse event are delivered to the correct QWidget
(It looks like Qt assumes each widget occupies its bounding rectangle).
Should I turn these widgets into QGraphicsItem
s instead?
Upvotes: 1
Views: 899
Reputation: 5718
You can give QWidgets a mask if you want them to be non-rectangular. This should work, but it's not always straightforward to create the mask region. QGraphicsItem certainly makes handling non-rectangular shapes much easier.
Upvotes: 3