Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.8.5, 5.2.1
-
None
Description
In QScrollArea::sizeHint(), the return value is bounded to 36*fontHeight / 24*fontHeight:
int h = fontMetrics().height();
...
return sz.boundedTo(QSize(36 * h, 24 * h));
In QGraphicsView::sizeHint(), the return value is bounded to 3/4 of the desktop size:
...
baseSize = baseSize.boundedTo((3 * QApplication::desktop()->size()) / 4);
...
This puts some restrictions on using QScrollArea or QGraphicsView in a layout, since the layout might not resize the component as large as it could, but instead showing scrollbars while there is still enough space available around the scroll area. This can also lead to some subtle application bugs, since it only occurs when the preferred size of the components (the size of the widget or graphics scene which is scrolled) exceeds those bounds.
The framework should not impose such a restriction (especially not with magic values like 3/4 or 36/24) on the return value of sizeHint().