A two-level item model for subtitle tracks and subtitle items on the timeline. More...
| Import Statement: | import org.shotcut.qml |
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.
Item data roles returned by data():
| Role name | Description |
|---|---|
text | Subtitle text |
start | Start time in milliseconds |
end | End time in milliseconds |
duration | Duration in milliseconds |
startFrame | Start position in frames |
endFrame | End position in frames |
siblingCount | Number of overlapping subtitles at this time |
trackCount : int |
The number of subtitle tracks. Read-only.
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.
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.