Ubuntu 16.04 Qt, .qml
Hi, I am trying to loop over Urls received from user by calling
console.log(fileDialogDCM.fileUrls.count)
after user successfully selects files from directory in FileDialog (to get their maximum number). However, I received "undefined" instead. Object fileDialogDCM.fileUrls should be of type QList<QUrl>
. I can access individual Url by calling
console.log(fileDialogDCM.fileUrls[i])
so I expect that considered QList is not empty. Consider me a noob in qml, what am I doing wrong? Here is minimum not working example:
FileDialog {
id: fileDialogDCM
selectMultiple: true
}
Button {
id: loadDCM
text: qsTr("Load DCM")
property var aListOfPlans: fileDialogDCM.fileUrls
onClicked: {
for(var i=0; i<4; i++) {
console.log(aListOfPlans[i])
} //writes URLs of first 4 selected plans
console.log(aListOfPlans.count) //gives undefined
}
}
Thanks a lot