Make QGraphicsItem cover items under it
Solved
General and Desktop
-
I'm working with the graphics view framework on a project and I've run into a problem where I'm adding a
QGraphicsRectItem
to a scene and setting its brush, but the item under it is still visible. I've tried setting the Z value, but the items aren't exactly siblings so it has no effect. The hierarchy is:Measure - Line - Beat - Note
I'm trying to make the note cover the line that it is on. As you can see in the screenshot, the line is still visible over the red background of the note. Anyone have any ideas?
-
@mbise1993 Did you try to set opacity https://doc.qt.io/qt-5/qgraphicsitem.html#setOpacity ?
-
@mbise1993 Try to set ItemIgnoresParentOpacity via https://doc.qt.io/qt-5/qgraphicsitem.html#setFlags