Priority: P2: Important
Affects Version/s: 5.15.2
Fix Version/s: None
Component/s: Widgets: GraphicsView
The issue appeares when size of scrollbars is controlled by qss. For example:
The size of availabe area to show a scene should be decreased by these values when scroll bars are visible. But that doesn't happen. Scroll bars by themself look smaller according to style.
Here is how it looks without stylesheet with scroll bars at maximum value where red line is border of the scene:
And here us with stylesheets. Here you can see gap between red line and scroll bars.
I checked code of QGraphicsView relateted classes and think that problem is in QGraphicsViewPrivate::recalculateContentSize()
The size needed for scrollbars is returned from objects style
I see next problems in this code:
- q here is pointer to QGraphicsView. Probably pyxelMetric need to be called with pointer to particular scroll bar;
- options parameter is not used for pixelMetric. Probably options need to be used here and initialilzed for each scroll bar;
- the value is the same for horizontal and vertical scroll bars. But it's possible that developer would like to have scroll bars with different size.
Test project reproducing the bug is attached. MainWindow.cpp file contains commented macro
Uncomment it to see the bug in application.