Priority: P2: Important
Resolution: Won't Do
Affects Version/s: 5.14.0 RC2
Fix Version/s: None
Component/s: Widgets: GraphicsView
This is a very recent issue, and I wasn't having this issue at all before, so I'm assuming it's strictly relevant to a recent version.
In short, QGraphicsItem::setZValue does practically nothing.
I have to reorder how I initialize my graphics items. This however, won't be enough to solve every issue efficiently.
Here's a basic amount of code:
.cpp file (inherits QGraphicsView):
The above code keeps everything in proper order.
However, if I reorder how I initialize things, then the appearance is entirely different, in spite of the fact that I've defined their zValues. That is, whatever is defined first, shows at the back, and whatever is defined last, shows up at the front, regardless of the z-value set.
Even if It set the background brush after initializing the SheetRect, the SheetRect will move behind the the Dense6Pattern. If the SelectionRect is initialized before the SheetRect, then the SelectionRect moves behind the SheetRect.
Again, this wasn't always the case. Setting the z-value did the trick for a while. I'd just prefer the issue be "refixed".