Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.6.0 Beta4
-
None
Description
This example works with Qt 6.5.x but not with Qt 6.6.0.
FolderListModel should list the resource entries in /qt/qml. With 6.5 this works, with 6.6 the Repeater does not instantiate any items. However the "count" property of FolderListModel is 1.
I suspect the "dataChanged" signal emission during the beginModelReset/endModelReset causes problems in Qt 6.6. I've noticed this with other models so maybe this problem is not actually in FolderListModel but somewhere in the 6.6 model/view logic.
Please set QT_LOGGING_RULES to qt.labs.folderlistmodel.fileinfothread=true;qt.labs.folderlistmodel=true to trace the signal emission.
import QtQuick import QtQuick.Window import QtQuick.Layouts import Qt.labs.folderlistmodel Window { width: 640 height: 480 visible: true title: qsTr("Hello World") FolderListModel { id: fileModel folder: "qrc:/qt/qml" // << should list /qt/qml/untitled1 } Text { anchors { right: parent.right } text: "count " + fileModel.count } // Connections { // target: fileModel // function onModelReset() { // console.log("model reset workaround...") // repeater.model = null; // repeater.model = fileModel // } // } ColumnLayout { Repeater { id: repeater model: fileModel delegate: Text { required property int index required property url fileUrl text: "Resource Entry " + index + " " + fileUrl } } } }