Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.12.3
-
None
Description
It seems that ListModel now also sets the modelData property for delegates, in case there's only one role for each ListElement. Before, modelData was always undefined for ListModel types. This caused an issue in our application. See this example code:
import QtQuick 2.9 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("ListModel with modelData") ListView { anchors.fill: parent model: ListModel { ListElement { name: "Apple" } ListElement { name: "Orange" } ListElement { name: "Banana" } } delegate: Text { text: modelData } } }
This example prints this names for the delegate text. When adding another role to a ListElement, modelData becomes undefined. Was this change planned, or do you consider this a bug?