Skip to main content

LensStudio:Ui.ScriptableModel

Class

Base class for custom item models implemented in plugin script; subclasses override rowCount, columnCount, data, headerData, flags, index, and roleNames to f…

Base class for custom item models implemented in plugin script; subclasses override rowCount, columnCount, data, headerData, flags, index, and roleNames to feed views like AbstractItemView.

Index

Extends

Properties

isNull

readonly isNull: boolean

Whether the underlying native model object has been destroyed.


onChanged

readonly onChanged: signal0<void>

Signal fired when the model's overall layout or contents change.


onDataChanged

readonly onDataChanged: signal3<ModelIndex, ModelIndex, number[], void>

Signal fired when data in a contiguous range of cells changes, carrying the top-left and bottom-right indices and the affected roles.


onModelReset

readonly onModelReset: signal0<void>

Signal fired when the model is reset and views must re-read all data.


onRowsInserted

readonly onRowsInserted: signal3<ModelIndex, number, number, void>

Signal fired after rows have been inserted under a parent, carrying the parent index and the inserted row range.


onRowsRemoved

readonly onRowsRemoved: signal3<ModelIndex, number, number, void>

Signal fired after rows have been removed under a parent, carrying the parent index and the removed row range.

Methods

columnCount()

columnCount(parent): number

Override that returns the number of columns under the given parent index.

Parameters

ParameterType
parentModelIndex

Returns

number


data()

data(index, role): any

Override that returns the value at the given index for the given role (for example display or decoration).

Parameters

ParameterType
indexModelIndex
rolenumber

Returns

any


flags()

flags(index): number

Override that returns the ItemFlag bitmask describing the cell's interactive capabilities.

Parameters

ParameterType
indexModelIndex

Returns

number


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

QtObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

QtObject.getTypeName


headerData()

headerData(section, orientation, role): any

Override that returns the header value for the given section, orientation, and role.

Parameters

ParameterType
sectionnumber
orientationOrientation
rolenumber

Returns

any


index()

index(row, column, parent): ModelIndex

Override that constructs a ModelIndex for the cell at the given row and column under the given parent.

Parameters

ParameterType
rownumber
columnnumber
parentModelIndex

Returns

ModelIndex


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

QtObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

QtObject.isSame


roleNames()

roleNames(): any

Override that returns the mapping from numeric role identifiers to role name strings used by views.

Returns

any


rowCount()

rowCount(parent): number

Override that returns the number of rows under the given parent index.

Parameters

ParameterType
parentModelIndex

Returns

number