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

    A native message/confirmation dialog with configurable buttons. More...

    Import Statement: import Shotcut.Controls

    Properties

    Signals

    Methods

    Detailed Description

    StandardButtons enum

    ValueButton shown
    MessageDialog.OkOK
    MessageDialog.YesYes
    MessageDialog.NoNo
    MessageDialog.CancelCancel

    Combine values with | to show multiple buttons.

    import Shotcut.Controls as Shotcut
    
    Shotcut.MessageDialog {
        title: qsTr("Confirm")
        text: qsTr("Are you sure?")
        buttons: MessageDialog.Yes | MessageDialog.No
        onAccepted: doSomething()
    }

    Property Documentation

    buttons : int

    A bitwise OR of StandardButtons values controlling which buttons appear.


    text : string

    The message text displayed inside the dialog.


    title : string

    The dialog window title.


    Signal Documentation

    accepted()

    Emitted when the user clicks an affirmative button (OK or Yes).

    Note: The corresponding handler is onAccepted.


    rejected()

    Emitted when the user clicks a negative button (No or Cancel) or closes the dialog.

    Note: The corresponding handler is onRejected.


    Method Documentation

    open()

    Opens the dialog modally. Emits accepted or rejected depending on which button the user clicks.