Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.7.0, 5.9.0 Beta 1
-
Windows
-
3841a7dd49667ceabdcbc416fa1e149bed7ed86e
Description
When having the following widget structure:
QWidget / QStackedLayout
-> QScrollArea [widgetResizable = true]
--> QWidget / QBoxLayout (or QGridLayout) [sizeConstraint = SetFixedSize]
---> QPushButton
And resizing the Widget before calling show, causes infinite resize loop due to scrollbars calling setGeometry().
The loop looks like:
- QScrollArea::resizeEvent
↓ - QScrollAreaPrivate::updateScrollBars
↓ - QAbstractSlider::setRange (2 times)
↓ - rangeChanged signal emitted
↓ - slot QAbstractScrollAreaPrivate::_q_showOrHideScrollBars
↓ - QAbstractScrollAreaPrivate::layoutChildren
↓ - QWidget::setGeometry
↓ - QResizeEvent send
↓ - Return to first; QScrollArea::resizeEvent
This problem does not reproduce if show() is called before the resize() for the widget. Documentation states that calling resize() before show() is allowed, but the scrollbars are calling setGeometry(), which is forbidden inside the ResizeEvent according to the documentation.
Steps to reproduce:
- Run attached sample
- Press "Clone" button to create a new widget with specified size
- EXPECTED: Widget is properly created and shown
- ACTUAL: Widget is created, but enters an infinite loop of ResizeEvents
Attachments
Issue Links
- relates to
-
QTBUG-21092 QScrollArea with setWidgetResizable(true) on Mac OS X runs endless recursion when resizing wigdet.
- Closed
-
QTBUG-20677 QPrintPreviewWidget hangs
- Open
-
QTBUG-62818 QPlainTextEdit::setPlainText goes to infinite loop
- Closed
For Gerrit Dashboard: QTBUG-56280 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
214225,1 | Avoid infinite resize loops with scrollbars | 5.9 | qt/qtbase | Status: ABANDONED | -1 | 0 |
214246,4 | Prevent infinite relayout when adding scrollbars | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |