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

    A two-level item model for subtitle tracks and subtitle items on the timeline. More...

    Import Statement: import org.shotcut.qml

    Properties

    Signals

    Methods

    Detailed Description

    SubtitlesModel is available as the subtitlesModel context property in the Subtitles dock. The top level is the list of subtitle tracks; each track row contains the subtitle item rows.

    Roles

    Item data roles returned by data():

    Role nameDescription
    textSubtitle text
    startStart time in milliseconds
    endEnd time in milliseconds
    durationDuration in milliseconds
    startFrameStart position in frames
    endFrameEnd position in frames
    siblingCountNumber of overlapping subtitles at this time

    Property Documentation

    trackCount : int

    The number of subtitle tracks. Read-only.


    Signal Documentation

    modified()

    Emitted whenever any subtitle data is modified.

    Note: The corresponding handler is onModified.


    tracksChanged(int count)

    Emitted when the number of tracks changes. count is the new track count.

    Note: The corresponding handler is onTracksChanged.


    Method Documentation

    int itemCount(int trackIndex)

    Returns the number of subtitle items on the track at trackIndex.


    void moveItems(int trackIndex, int firstItemIndex, int lastItemIndex, int msTime)

    Moves the subtitle items from firstItemIndex to lastItemIndex on trackIndex so that the first item starts at msTime milliseconds.


    QModelIndex trackModelIndex(int trackIndex)

    Returns the QModelIndex for the track row at trackIndex.


    bool validateMove(list items, int msTime)

    Returns true if moving the given items to msTime would not create an overlap.