Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.0.0
-
None
-
-
6512a7fc642c65455db770385c67cfa6d71c294c (qt/qtbase/dev) dca5a2ca39d45ec7ac1472f438328b3b941bcad1 (qt/qtbase/6.1) 249b3100466556ff56f04fbf063f977dbdccbda3 (qt/qtbase/6.0)
Description
QList::fill() (aka QVector::fill() in Qt 5.x) is documented to resize the list to the newSize parameter if this is >= 0.
In Qt 6, it only resizes the list if the new size is larger than the old.
The following example demonstrates (QVector used here to make it portable to Qt 5, but the same happens in Qt 6 if you use QList as well):
#include <QtCore> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QVector<int> ints; ints.fill(123, 100); qDebug() << "Ints size:" << ints.size(); ints.fill(123, 101); qDebug() << "Ints size:" << ints.size(); ints.fill(123, 99); qDebug() << "Ints size:" << ints.size(); return 0; }
The final size of the list is 101, despite being resized to 99.
This is cause of QTBUG-90437.
Attachments
Issue Links
- replaces
-
QTBUG-90437 [REG 5.15 -> 6.0] Syntax Highlighter includes '\n' chars in the length
- Closed
For Gerrit Dashboard: QTBUG-91042 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
333534,4 | Restore pre-Qt6 QList::fill() behavior | dev | qt/qtbase | Status: MERGED | +2 | 0 |
333815,2 | Restore pre-Qt6 QList::fill() behavior | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 |
333816,2 | Restore pre-Qt6 QList::fill() behavior | 6.0 | qt/qtbase | Status: MERGED | +2 | 0 |