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

    A native color-chooser dialog. More...

    Import Statement: import Shotcut.Controls

    Properties

    Signals

    Methods

    Detailed Description

    import Shotcut.Controls as Shotcut
    
    Shotcut.ColorDialog {
        id: colorDialog
        title: qsTr("Choose Color")
        onAccepted: filter.set("color", colorDialog.selectedColor)
    }
    
    Button {
        onClicked: colorDialog.open()
    }

    Property Documentation

    selectedColor : color

    The color currently selected in the dialog. Set this before calling open() to pre-populate the dialog. Read it in the accepted signal handler to retrieve the chosen color.


    showAlpha : bool

    Whether the alpha (opacity) slider is shown. Defaults to true.


    title : string

    The window title shown in the dialog's title bar.


    Signal Documentation

    accepted()

    Emitted when the user clicks OK. Read selectedColor for the result.

    Note: The corresponding handler is onAccepted.


    selectedColorChanged(color color)

    Emitted whenever selectedColor changes. color is the new value.

    Note: The corresponding handler is onSelectedColorChanged.


    Method Documentation

    open()

    Opens the native color dialog modally. Emits accepted if the user confirms, or no signal if cancelled.