Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.5.5-1, 6.7.0 RC2
-
None
Description
Code
import QtQuick import QtQuick.Controls.Basic Window { id: root width: 640 height: 480 visible: true property list<int> numbers: [1, 2, 3, 4, 5] onNumbersChanged: console.log("Updated list:", numbers) Button { text: "Shift" onClicked: { console.log("=== Starting shift ===") root.numbers.shift() console.log("=== Finished shift ===") } } }
Steps to reproduce
Run the above code and click the button
Expected outcomes
qml: === Starting shift === qml: Updated list: [2,3,4,5] qml: === Finished shift ===
Actual outcomes
qml: === Starting shift === qml: Updated list: [2,2,3,4,5] qml: Updated list: [2,3,3,4,5] qml: Updated list: [2,3,4,4,5] qml: Updated list: [2,3,4,5,5] qml: Updated list: [2,3,4,5,0] qml: Updated list: [2,3,4,5] qml: === Finished shift ===
Notes
There is a similar issue for pop():
qml: === Starting pop === qml: Updated list: [1,2,3,4,0] qml: Updated list: [1,2,3,4] qml: === Finished pop ===
Attachments
Issue Links
- resulted in
-
QTBUG-123842 Excessive delegate creation+destruction when calling list<T>.shift() on ListView.model
- Reported