The below code worked before, but is not working anymore, to me, for unknown reasons:
import QtQuick 2.2
import QtQuick.Dialogs 1.0
FileDialog {
id: fileDialog
title: ""
folder: "file:///home"
signal file_opened(var filename)
onAccepted: {
file_opened(fileDialog.fileUrls)
fileDialog.close()
}
Component.onCompleted: visible = true
}
I was using shortcuts.home
but that also stopped working. Is there anything inherently wrong with the above?
onAccepted
, it calls its own close function while accepting. – xecofile_opened
was the issue. I had to create a parent item and put thesignal
there and have thefiledialog
call itonAccepted
. – bardao