![]() |
NDEVR
API Documentation
|
Filters and sorts Models from a ModelManager for views such as in a table or in a tree view. More...
Public Member Functions | |
| ProxyModelViewFilter (QTModelManager *manager, QObject *parent=nullptr) | |
| Constructs a proxy filter using a model manager as the data source. | |
| ProxyModelViewFilter (QTModelManagerView *view, QObject *parent=nullptr) | |
| Constructs a proxy filter using a model manager view as the data source. | |
| Qt::CheckState | checkState (const Model &model) const |
| Gets the check state of the given model. | |
| void | clearCheckStates () |
| Clears all check states to unchecked. | |
| QModelIndex | getIndex (const Model &model, int column) const |
| Gets the proxy index for the given model and column. | |
| QModelIndex | getIndex (const UUID &id, int column) const |
| Gets the proxy index for the given UUID and column. | |
| UUID | getMaterialID (const QModelIndex &index) const |
| Gets the material UUID at the given proxy index. | |
| UUID | getModelID (const QModelIndex &index) const |
| Gets the model UUID at the given proxy index. | |
| Buffer< UUID > | getModelRoots () const |
| Gets the UUIDs of all root models in the view. | |
| Buffer< UUID > | getSelectedModelRoots () const |
| Gets the UUIDs of all checked root models. | |
| bool | hasIndex (const UUID &id) const |
| Checks whether the given UUID exists in the proxy model. | |
| QIcon::Mode | iconMode (const QModelIndex &index) const |
| Gets the icon mode for the given proxy index based on the model state. | |
| void | invalidate () |
| Invalidates the current filter and triggers re-evaluation. | |
| QTModelManager & | manager () const |
| Gets the model manager associated with this filter. | |
| Model | model (const QModelIndex &index) const |
| Gets the Model object at the given proxy index. | |
| void | refreshAll () |
| Forces a complete refresh of all filtered data. | |
| void | selectAllVisible () |
| Sets all currently visible models to checked. | |
| void | setAllowEdits (bool allow) |
| Sets whether editing model names is allowed in the view. | |
| void | setAllowSelections (bool allow) |
| Sets whether checkbox selection is allowed. | |
| void | setCheckState (const Model &model, Qt::CheckState check_state) |
| Sets the check state of a single model. | |
| void | setCheckStateAll (const std::function< bool(const Model &model)> &model_type, Qt::CheckState check_state) |
| Sets the check state of all models matching a custom predicate. | |
| void | setCheckStateAll (const String &model_type, GeometryType type, Qt::CheckState check_state) |
| Sets the check state of all models matching a model type and geometry type. | |
| void | setCheckStateAll (const String &model_type, Qt::CheckState check_state) |
| Sets the check state of all models matching the given model type. | |
| void | setCheckStateAll (GeometryType type, Qt::CheckState check_state) |
| Sets the check state of all models matching the given geometry type. | |
| void | setCheckStateAll (Qt::CheckState check_state) |
| Sets the check state of all models. | |
| void | setCheckStateRecursive (const Model &model, Qt::CheckState check_state) |
| Sets the check state of a model and all its descendants recursively. | |
| void | setCustomHeader (const TranslatedString &header_title, const StringView &header_icon) |
| Sets a custom header title and icon for the view. | |
| void | setGreyHidden (bool grey_hidden) |
| Sets whether hidden models should be displayed with greyed-out icons. | |
| void | setIsRootFilter (const std::function< bool(const Model &)> &filter) |
| Sets a filter function that determines whether a model is treated as a root. | |
| void | setRootModels (const Buffer< UUID > &ids) |
| Sets the root model UUIDs to display in the filtered view. | |
| void | setSelectedModelRoots (const Buffer< UUID > &roots, bool only_visible_children) |
| Sets check states based on model root UUIDs with optional child visibility filtering. | |
| void | setShowMaterials (bool show_materials) |
| Sets whether material entries are shown in the view. | |
| void | setShowSelected (bool show_selected) |
| Sets whether to visually indicate selected models. | |
| void | setVisibleFilter (const std::function< bool(const Model &)> &filter) |
| Sets a custom filter function that determines whether a model is visible. | |
Filters and sorts Models from a ModelManager for views such as in a table or in a tree view.
Definition at line 46 of file ProxyModelViewFilter.h.
|
explicit |
|
explicit |
Constructs a proxy filter using a model manager view as the data source.
| [in] | view | The model manager view providing the data. |
| [in] | parent | The parent QObject. |
| Qt::CheckState ProxyModelViewFilter::checkState | ( | const Model & | model | ) | const |
| QModelIndex ProxyModelViewFilter::getIndex | ( | const Model & | model, |
| int | column ) const |
| QModelIndex ProxyModelViewFilter::getIndex | ( | const UUID & | id, |
| int | column ) const |
| UUID ProxyModelViewFilter::getMaterialID | ( | const QModelIndex & | index | ) | const |
| UUID ProxyModelViewFilter::getModelID | ( | const QModelIndex & | index | ) | const |
Gets the UUIDs of all root models in the view.
Gets the UUIDs of all checked root models.
| bool ProxyModelViewFilter::hasIndex | ( | const UUID & | id | ) | const |
| QIcon::Mode ProxyModelViewFilter::iconMode | ( | const QModelIndex & | index | ) | const |
Gets the icon mode for the given proxy index based on the model state.
| [in] | index | The proxy model index. |
| QTModelManager & ProxyModelViewFilter::manager | ( | ) | const |
Gets the model manager associated with this filter.
Referenced by ProxyModelViewFilter().
| Model ProxyModelViewFilter::model | ( | const QModelIndex & | index | ) | const |
Gets the Model object at the given proxy index.
| [in] | index | The proxy model index. |
Referenced by checkState(), getIndex(), setCheckState(), setCheckStateAll(), and setCheckStateRecursive().
| void ProxyModelViewFilter::setAllowEdits | ( | bool | allow | ) |
Sets whether editing model names is allowed in the view.
| [in] | allow | Whether edits are allowed. |
| void ProxyModelViewFilter::setAllowSelections | ( | bool | allow | ) |
Sets whether checkbox selection is allowed.
| [in] | allow | Whether selections are allowed. |
| void ProxyModelViewFilter::setCheckState | ( | const Model & | model, |
| Qt::CheckState | check_state ) |
| void ProxyModelViewFilter::setCheckStateAll | ( | const std::function< bool(const Model &model)> & | model_type, |
| Qt::CheckState | check_state ) |
Sets the check state of all models matching a custom predicate.
| [in] | model_type | The predicate function returning true for matching models. |
| [in] | check_state | The check state to apply. |
References model().
| void ProxyModelViewFilter::setCheckStateAll | ( | const String & | model_type, |
| GeometryType | type, | ||
| Qt::CheckState | check_state ) |
Sets the check state of all models matching a model type and geometry type.
| [in] | model_type | The model type string to match. |
| [in] | type | The geometry type to match. |
| [in] | check_state | The check state to apply. |
| void ProxyModelViewFilter::setCheckStateAll | ( | const String & | model_type, |
| Qt::CheckState | check_state ) |
Sets the check state of all models matching the given model type.
| [in] | model_type | The model type string to match. |
| [in] | check_state | The check state to apply. |
| void ProxyModelViewFilter::setCheckStateAll | ( | GeometryType | type, |
| Qt::CheckState | check_state ) |
Sets the check state of all models matching the given geometry type.
| [in] | type | The geometry type to match. |
| [in] | check_state | The check state to apply. |
| void ProxyModelViewFilter::setCheckStateAll | ( | Qt::CheckState | check_state | ) |
Sets the check state of all models.
| [in] | check_state | The check state to apply. |
| void ProxyModelViewFilter::setCheckStateRecursive | ( | const Model & | model, |
| Qt::CheckState | check_state ) |
| void ProxyModelViewFilter::setCustomHeader | ( | const TranslatedString & | header_title, |
| const StringView & | header_icon ) |
Sets a custom header title and icon for the view.
| [in] | header_title | The header title text. |
| [in] | header_icon | The header icon resource name. |
| void ProxyModelViewFilter::setGreyHidden | ( | bool | grey_hidden | ) |
Sets whether hidden models should be displayed with greyed-out icons.
| [in] | grey_hidden | Whether to grey out hidden models. |
| void ProxyModelViewFilter::setIsRootFilter | ( | const std::function< bool(const Model &)> & | filter | ) |
Sets a filter function that determines whether a model is treated as a root.
| [in] | filter | The filter function returning true for root models. |
Sets the root model UUIDs to display in the filtered view.
| [in] | ids | The UUIDs of the root models. |
| void ProxyModelViewFilter::setSelectedModelRoots | ( | const Buffer< UUID > & | roots, |
| bool | only_visible_children ) |
Sets check states based on model root UUIDs with optional child visibility filtering.
| [in] | roots | The root model UUIDs to check. |
| [in] | only_visible_children | Whether to only check visible children. |
| void ProxyModelViewFilter::setShowMaterials | ( | bool | show_materials | ) |
Sets whether material entries are shown in the view.
| [in] | show_materials | Whether to show materials. |
| void ProxyModelViewFilter::setShowSelected | ( | bool | show_selected | ) |
Sets whether to visually indicate selected models.
| [in] | show_selected | Whether to show selection indicators. |
| void ProxyModelViewFilter::setVisibleFilter | ( | const std::function< bool(const Model &)> & | filter | ) |
Sets a custom filter function that determines whether a model is visible.
| [in] | filter | The filter function returning true for visible models. |