yonutix
yonutix

Reputation: 2439

QML FileDialog missing properties

The following FileDialog is inside an ApplicationWindow, it should allow the user to create a file (at least getting the path and the file name so I can create the file).

FileDialog {
    id: fileExport_FileDialog
    title: "Please choose the YAML file name to export."

    onAccepted: {
        console.log("You chose: " + fileExport_FileDialog.currentFile)
        fileManagerId.exportPeople(fileExport_FileDialog.currentFile)
    }
    onRejected: {
        console.log("Canceled")
    }
    Component.onCompleted: visible = false
}

Instead, I get the following error:

The selectExisting : bool, selectFolder : bool are missing.

Any idea on how I can create a save file dialog?

Upvotes: 0

Views: 488

Answers (1)

Stephen Quan
Stephen Quan

Reputation: 25871

There are at least two implementations of FileDialog:

Your description of missing properties sounds like you have implemented one of the FileDialogs but am reading the documentation of the other.

The former is one that's completely rendered in Qt. The latter is somewhat experimental and your mileage may vary. Both behave differently and DO have different properties. I highly recommend you review your imports and favor QtQuick.Dialogs over Qt.labs.platform.

Upvotes: 1

Related Questions