Pages
API Documentation
On this page

KDescendantsProxyModel QML Type

Flattens a tree model into a list. More...

Detailed Description

Set model to the source tree model. Each item in the flattened list can be expanded or collapsed using its row in this proxy model.

Property Documentation

[default: " / "] ancestorSeparator : string

The separator between ancestor values when displayAncestorData is true.

[default: false] displayAncestorData : bool

Whether display data includes the item's ancestors.

[default: true] expandsByDefault : bool

Whether all items are expanded when the source model is loaded.

model : var

The source tree model to flatten.

sourceModel : var

The source tree model to flatten. This inherited property refers to the same model as model.

Method Documentation

void collapseChildren(int row)

Collapses the children of the item at row in this proxy model.

void expandChildren(int row)

Expands the children of the item at row in this proxy model.

QModelIndex mapFromSource(QModelIndex sourceIndex)

Returns the proxy model index corresponding to sourceIndex.

See also mapToSource()

QItemSelection mapSelectionFromSource(QItemSelection sourceSelection)

Returns the proxy model selection corresponding to sourceSelection.

QItemSelection mapSelectionToSource(QItemSelection proxySelection)

Returns the source model selection corresponding to proxySelection.

QModelIndex mapToSource(QModelIndex proxyIndex)

Returns the source model index corresponding to proxyIndex.

See also mapFromSource()

void toggleChildren(int row)

Toggles the expansion of the item at row in this proxy model.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.