Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.15
-
None
Description
This is similar to some other bugs that have been filed: QTBUG-103775, QTBUG-85909, QTBUG-79223, but none are exactly the same.
There was a change to cause QList to warn when adding items outside of the range (https://codereview.qt-project.org/registerc/qt/qtbase/+/276371), which affects a few different components.
In this case it is QGraphicsLayout. For example in this code:
QGraphicsLinearLayout* layout = new QGraphicsLinearLayout; QGraphicsWidget* widget = new QGraphicsWidget; widget->setLayout(layout); widget->addStretch(); widget->addItem(new QGraphicsWidget);
This will (as of Qt 5.15) print a (debug-mode) warning "QList::insert(): Index out of range", which I understand will become an assert in Qt 6.
Is this code valid? If so, is it possible to make it not warn/assert? I am concerned that this case isn't accounted for with the QList change. (Example now attached)
Attachments
Issue Links
- relates to
-
QTBUG-79223 Graphics view flow layout example crashes
- Closed
-
QTBUG-85909 QList::insert(): Index out of range
- Closed
-
QTBUG-103775 Downstream crash when bad index passed to insert methods of QBoxLayout
- Closed