StandardItemModel
Qualified name: mv::StandardItemModel
-
class StandardItemModel : public QStandardItemModel, public mv::util::Serializable
Standard item model class.
Base MV standard item model class
- Author
Thomas Kroes
Subclassed by mv::AbstractActionsModel, mv::AbstractColorSchemesModel, mv::AbstractDataHierarchyModel, mv::AbstractDatasetsModel, mv::AbstractHardwareSpecModel, mv::AbstractHeadsUpDisplayModel, mv::AbstractPluginFactoriesModel, mv::AbstractPluginsModel, mv::AbstractProjectsModel, mv::AbstractRecentFilesModel, mv::AbstractScriptsModel, mv::AbstractTasksModel, mv::LoggingModel, mv::RawDataModel, mv::SelectionsModel
Public Types
-
enum class PopulationMode
Model population modes.
Values:
-
enumerator Automatic
-
enumerator AutomaticSynchronous
Automatically populate the model from the Data Source Names (DSNs)
-
enumerator Manual
Automatically populate the model from the DSNs in a synchronous manner.
Manually populate the model from a JSON file or byte array
-
enumerator Automatic
Public Functions
-
StandardItemModel(QObject *parent = nullptr, const QString &title = "StandardItemModel", const PopulationMode &populationMode = PopulationMode::Automatic)
Construct with pointer to
parentobject.- Parameters:
parent – Pointer to parent object
title – Title of the model
populationMode – Population mode of the model (automatic/manual)
-
PopulationMode getPopulationMode() const
Get the population mode of the model.
- Returns:
Population mode (automatic/manual) of the model
-
void setPopulationMode(const PopulationMode &populationMode)
Set the population mode of the model to
populationMode.- Parameters:
populationMode – Population mode (automatic/manual) of the model
-
inline virtual QString getSettingsPrefix() const
Get settings prefix (Models/<serialization_name>)
- Returns:
Settings prefix for the model, used for saving/loading settings
-
virtual void fromVariantMap(const QVariantMap &variantMap) override
Load from variant map.
- Parameters:
variantMap – Variant map
-
virtual QVariantMap toVariantMap() const override
Save to variant map.
- Returns:
Variant map
-
void populationModeChanged(const PopulationMode &populationMode)
Signals that the population mode changed to
populationMode.- Parameters:
populationMode – New population mode of the model