ObjectModel: unknown [uncreatable]

import Quickshell

View into a list of objets More

Properties

Functions

Signals

Detailed Description

Typed view into a list of objects.

An ObjectModel works as a QML Data Model, allowing efficient interaction with components that act on models. It has a single role named modelData, to match the behavior of lists. The same information contained in the list model is available as a normal list via the values property.

Differences from a list

Unlike with a list, the following property binding will never be updated when model[3] changes.

// will not update reactively
property var foo: model[3]

You can work around this limitation using the values property of the model to view it as a list.

// will update reactively
property var foo: model.values[3]

Property Details

[readonly]

values: list<QtObject>

The content of the object model, as a QML list. The values of this property will always be of the type of the model.

Function Details

int indexOf(object: QtObject)

No details provided.

Signal Details

objectInsertedPost(object: QtObject, index: int)

Sent immediately after an object is inserted into the list.

objectInsertedPre(object: QtObject, index: int)

Sent immediately before an object is inserted into the list.

objectRemovedPost(object: QtObject, index: int)

Sent immediately after an object is removed from the list.

objectRemovedPre(object: QtObject, index: int)

Sent immediately before an object is removed from the list.