QML cannot open file dialog
I am trying to create a simple dialog using QML:
import QtQuick 2.2
import QtQuick.Dialogs 1.0
FileDialog {
id: fileDialog
title: "Please choose a file"
onAccepted: {
console.log("You chose: " + fileDialog.fileUrls)
Qt.quit()
}
onRejected: {
console.log("Canceled")
Qt.quit()
}
Component.onCompleted: visible = true
}
However, when I try to view it, I get the following errors / warnings:
QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory
Invalid URL: QUrl( "" )
Invalid URL: QUrl( "" )
Invalid URL: QUrl( "" )
Invalid URL: QUrl( "" )
kf5.kio.core: KLocalSocket(0x1a51cf0) Jumbo packet of 35946 bytes
As far as I understand, the QUrl settings are not needed to display the dialog. If so, is it possible to install it to the user's home folder in a cross-platform way? I also tried to start the ibus daemon as I found on google that it throws the first line of errors, but it still doesn't work.
I am using Arch (fully updated) with KF5 and QT5.4 installed.
Thanks for the help!
source to share
There is a bug with KF5, or rather with the interaction between the QML FileDialog and the KDE platform dialog, see https://bugs.kde.org/show_bug.cgi?id=334963 . Still pending.
You can work around this (and get the dialog to display) by adding "modality: Qt.NonModal" to the FileDialog.
source to share