SceneTreeModel
The scene tree as a Qt item model (scene-tree-model-view §TMB-3).
| Inherits | QAbstractItemModel |
In the namespace construct::model. Declared in src/libs/libconstruct/construct/model/SceneTreeModel.hpp.
Detailed description
One node is one row, and every row is one grid cell (§TMB-2). An Item row is a scene item. Its children are its Field rows first, each followed by its Span rows, then its child items: the order inside a box of the old tree (TMP-52). A Note row stands in for "no parameters".
The model reads only IScenePanelModel. It loads an item's rows in fetchMore(), on the first expand, so a scene whose items are all collapsed holds nodes for its top level only.
Changes come from the panel model's settled signals. A structure change carries no detail, so the model compares the child list of each parent it has loaded with the source, and turns each difference into the smallest row signal: a remove, an insert or a move. A rename, an update and a selection change are dataChanged on their rows. The model never resets for an edit, because a reset destroys every open editor; setSource() is the only reset.
The model is read-only. Every action goes through the SceneTreeController (§TMB-12).