Skip to content

Instantly share code, notes, and snippets.

@Kakadu
Last active August 29, 2015 14:04
Show Gist options
  • Save Kakadu/4e11ec3e82b485932497 to your computer and use it in GitHub Desktop.
Save Kakadu/4e11ec3e82b485932497 to your computer and use it in GitHub Desktop.
Demo for opening a dialog. I can't set initial directory for the fialog. Is it a bug?
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.0
ApplicationWindow {
width: 640
height: 480
FileDialog {
id: theFileDialog
//folder: folderModel.folder
selectFolder: true
selectMultiple: true
selectExisting: true
title: "Add directory to search path"
onAccepted: {
console.log(theFileDialog.folder);
console.log(fileUrl);
}
}
Button {
text: "click"
onClicked: {
theFileDialog.folder = "file:///home/kakadu/";
console.log(theFileDialog.folder);
theFileDialog.open();
console.log(theFileDialog.folder);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment