• Shotcut QML Scripting API
  • org.shotcut.qml
  • RichText
  • RichText QML Type

    Provides rich-text editing helpers for the Text: Rich filter panel. More...

    Import Statement: import org.shotcut.qml

    Properties

    Signals

    Methods

    Detailed Description

    RichText is available as a context property in the Text: Rich filter QML panel. It bridges the QML TextEdit item to the underlying QTextDocument, enabling character-level formatting, cursor management, and file persistence.

    RichText {
        id: richText
        target: textEditItem
        onTextChanged: filter.set("argument", text)
    }

    Property Documentation

    alignment : int

    The paragraph alignment (Qt.AlignLeft, Qt.AlignCenter, etc.) at the cursor.


    bold : bool

    Whether the text at the cursor/selection is bold.


    cursorPosition : int

    The cursor position within the document.


    fileUrl : url

    The URL of the HTML file backing the document. Setting this loads the file.


    fontFamily : string

    The font family of the text at the cursor or selection.


    fontSize : int

    The font size in points at the cursor or selection.


    fontStyleName : string

    The font style name (e.g. "Bold Italic") at the cursor or selection.


    italic : bool

    Whether the text at the cursor/selection is italic.


    selectionEnd : int

    The end of the current text selection.


    selectionStart : int

    The start of the current text selection.


    size : size

    The natural rendered size of the document (read-only).


    strikeout : bool

    Whether the text at the cursor/selection has strikethrough.


    target : Item

    The QML TextEdit item whose document this object manages.


    text : string

    The full HTML content of the document.


    textColor : color

    The foreground color of the text at (or to be applied to) the selection.


    underline : bool

    Whether the text at the cursor/selection is underlined.


    Signal Documentation

    error(string message)

    Emitted when a file load or save operation fails. message describes the error.

    Note: The corresponding handler is onError.


    Method Documentation

    indentLess()

    Decreases the indentation level of the current paragraph.


    indentMore()

    Increases the indentation level of the current paragraph.


    insertTable(int rows, int columns, int border)

    Inserts a table at the cursor with rows rows, columns columns, and border width.


    pastePlain()

    Pastes clipboard text as plain text, stripping any formatting.


    reset()

    Clears the document content.


    saveAs(url fileUrl, string fileType)

    Saves the document to fileUrl. fileType may be "html" or "txt".