Hello!
I am trying to dynamically assign a namefilter to a FileDialog, but this does not seem to work at all.
import QtQuick 2.2
import QtQuick.Dialogs 1.1
FileDialog {
title: qsTr("Export to File")
selectExisting: false
onVisibleChanged: {
if(visible)
nameFilters = ["Image files (*.jpg *.png)", "All files (*)"]
}
}
import QtQuick 2.2
import QtQuick.Dialogs 1.1
FileDialog {
title: qsTr("Export to File")
selectExisting: false
onVisibleChanged: {
if(visible)
nameFilters = ["Image files (*.jpg *.png)", "All files (*)"]
}
}
To copy to clipboard, switch view to plain text mode
Obviously this is just a test case, in real life I need to determine the available plugins of my application at runtime and assign the nameFilters accordingly. If I add
console.log(nameFilters)
console.log(nameFilters)
To copy to clipboard, switch view to plain text mode
after I set them, they show up just fine. So why does this fail I wonder?
Best Regards
Bookmarks