Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.6.3
-
None
-
3e59a88e8968c6cdac788926bec34c259146b6a8 , 8c18a245b (dev), 0c9787bab (6.6), c26e7f278 (6.5)
Description
I noticed that QTreeView::sizeHint() with setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents) was correct when the widget got already shown, but was to small in height when asking sizeHint before show.
By looking into the source code it is obvious that this is broken, as isVisible() is used to check header visibility which would also be false if the parent (treeview) is no visible ...
so, that should be either d->header->isVisibleTo(this) ... or !isHeaderHidden(), is Hidden works as it is not implicit bubbling through the children
... scrollbars will probably need a similar treatment, but as I was only interested in height, I haven't verified
... QTableView::viewportSizeHint seems to have only wrong scrollbars, but headers are done properly
Btw. I reporting that with 5.6 as I still have to use that ... but the implementation is the same in 5.11.1 sourcecode
Attachments
Issue Links
- resulted in
-
QTBUG-113552 Wrong sizeHint for QTreeWidget having an AdjustToContents sizeAndAdjustPolicy
- Closed
-
QTBUG-109326 QTableView and QTreeView with Fixed vertical size policy and AdjustToContents sizeAdjustPolicy always reserve space for horizontal scroll bar
- Closed
For Gerrit Dashboard: QTBUG-69120 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
235582,9 | QAbstractScrollArea: fix sizeHint when widget is not visible | dev | qt/qtbase | Status: MERGED | +2 | 0 |
489004,12 | QAbstractScrollArea: Don't include size of invisible scrollbars | dev | qt/qtbase | Status: MERGED | +2 | 0 |
490551,2 | QAbstractScrollArea: Don't include size of invisible scrollbars | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
490552,2 | QAbstractScrollArea: Don't include size of invisible scrollbars | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |