4#include <QAbstractItemView>
5#include <QAbstractListModel>
16 :
public QAbstractListModel
91 void update(
int row = -1,
int column = -1,
const QList<int>& roles = QList<int>());
104 [[nodiscard]] QVariant
headerData(
int section, Qt::Orientation orientation,
int role)
const override;
109 [[nodiscard]]
int rowCount(
const QModelIndex& parent = QModelIndex())
const override;
114 [[nodiscard]] QVariant
data(
const QModelIndex& index,
int role)
const override;
119 [[nodiscard]]
int columnCount(
const QModelIndex& parent = QModelIndex())
const override;
124 [[nodiscard]] Qt::ItemFlags
flags(
const QModelIndex& index)
const override;
191 bool setData(
const QModelIndex& index,
const QVariant& value,
int role)
override;
221 QList<std::shared_ptr<Variable>> _varList;
233 QList<EField> _columns;
Counted vector having additional methods and operators for ease of usage.
Definition TVector.h:25
Base class used for giving a Variable instance access to a member functions of a derived class....
Definition VariableHandler.h:14
List model for a sf::Variable list.
Definition VariableListModel.h:18
VariableListModel(QObject *parent=nullptr)
Constructor.
void clearVariables()
Clear the variables added.
int nameLevel() const
Gets the levels of names displayed of the variables in the list.
EField
Displayable columns.
Definition VariableListModel.h:53
@ cValue
Definition VariableListModel.h:56
@ cName
Definition VariableListModel.h:55
@ cId
Definition VariableListModel.h:54
@ cUnit
Definition VariableListModel.h:57
QVariant data(const QModelIndex &index, int role) const override
Overridden from base class to provide the data to present.
Q_SIGNAL void changed(const Variable *var)
Signals a change of the Variable's property.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Overridden from base class to provide column display names.
void setRowCheckBox(bool enabled)
Enables the selection of rows. The sf::Variable::getData() returns true when selected.
int getRow(Variable &link) const
Finds the row beloning to the given variable.
void update(int row=-1, int column=-1, const QList< int > &roles=QList< int >())
Update values in the given column and row.
void addVariables(const IdVector &ids, bool desired=true)
Adds local or global variables to this instance.
void addVariable(const Variable &var)
Adds local or global variable to this instance by pointer. Internally a client copy of the sf::Variab...
void updateField(int row, EField field, const QList< int > &roles=QList< int >())
Update the column for the given field for all rows.
void addVariable(id_type id, bool desired=true)
Adds global variable to this instance by id.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Overridden from base class to provide the amount of columns.
Qt::ItemFlags flags(const QModelIndex &index) const override
Overridden from base class to provide flags on an item by index.
void setVariablesConvert(bool enable)
Sets the variable conversion for floating point values.
void setVariables(const Vector &list)
Set local or global variables to this instance.
IdVector getVariablesChecked() const
Gets the Variable id's of all checked items in the list.
bool hasRowCheckBox() const
Gets if the row selection is enabled. By default, the row selection is enabled.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Overridden from base class to provide the amount of rows.
int getColumn(EField field) const
Gets the column position or number where the field is displayed.
void setChecked(int row, bool checked)
Sets or unsets the checkbox of a row.
Variable * getVariable(const QModelIndex &index) const
Gets the underlying variable pointer.
EField getField(int column) const
Gets the field displayed in the column.
void setNameLevel(int level)
Sets the levels of names displayed of the variables in the list.
bool setData(const QModelIndex &index, const QVariant &value, int role) override
Overridden from base class to provide assignment of an item when edited.
void setVariablesChecked(const IdVector &ids)
Gets the Variable id's of all checked items in the list. Returns a list of id numbers to the passed r...
void addVariables(const Vector &list)
Adds local or global variables to this instance.
void refresh()
Refresh the attached viewer.
void setDelegates(QAbstractItemView *view)
Creates a sf::CommonItemDelegate instance for the passed view.
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
#define _GII_CLASS
Definition gii/global.h:38
Definition Application.h:10