• Shotcut QML Scripting API
  • Shotcut.Controls
  • FileDialog
  • FileDialog QML Type

    A native file open/save dialog. More...

    Import Statement: import Shotcut.Controls

    Properties

    Signals

    Methods

    Detailed Description

    FileMode enum

    ValueDescription
    FileDialog.OpenFileSelect an existing file to open (default)
    FileDialog.SaveFileChoose a filename to save
    import Shotcut.Controls as Shotcut
    
    Shotcut.FileDialog {
        id: fileDialog
        title: qsTr("Open File")
        fileMode: Shotcut.FileDialog.OpenFile
        nameFilters: ["GPS files (*.gpx *.kml)", "All files (*)"]
        onFileSelected: myFile.url = file
    }

    Property Documentation

    fileMode : int

    Whether the dialog is for opening or saving. One of FileDialog.OpenFile or FileDialog.SaveFile.


    nameFilters : list<string>

    The list of file type filters shown in the dialog (e.g. ["Images (*.png *.jpg)", "All files (*)"] ).


    selectedFile : string

    The full file path of the last selected file (read-only). Available after fileSelected is emitted.


    title : string

    The dialog window title.


    Signal Documentation

    accepted()

    Emitted when the user confirms the dialog.

    Note: The corresponding handler is onAccepted.


    fileSelected(string file)

    Emitted when the user confirms a selection. file is the full path.

    Note: The corresponding handler is onFileSelected.


    rejected()

    Emitted when the user cancels or closes the dialog.

    Note: The corresponding handler is onRejected.


    Method Documentation

    open()

    Opens the native file dialog modally.