cantor/src/lib
defaultvariablemodel.cpp
Go to the documentation of this file.
46 d->extension = dynamic_cast<Cantor::VariableManagementExtension*>(session->backend()->extension("VariableManagementExtension"));
74 QVariant DefaultVariableModel::headerData(int section, Qt::Orientation orientation, int role) const
126 d->session->evaluateExpression(d->extension->setValue(name, value.toString()), Expression::DeleteOnFinish);
134 d->session->evaluateExpression(d->extension->addVariable(value.toString(), variableValue), Expression::DeleteOnFinish);
135 d->session->evaluateExpression(d->extension->removeVariable(oldName), Expression::DeleteOnFinish);
169 void DefaultVariableModel::removeVariable(const Cantor::DefaultVariableModel::Variable& variable)
194 bool operator==(const Cantor::DefaultVariableModel::Variable& one, const Cantor::DefaultVariableModel::Variable& other)
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: defaultvariablemodel.cpp:95
This DefaultVariableModel class is an implementation of QAbstractItemModel that can be used with the ...
Definition: defaultvariablemodel.h:47
A structure representing a variable.
Definition: defaultvariablemodel.h:57
Session * session() const
Get the session which created this Model and whose variables it contains.
Extension * extension(const QString &name) const
Returns an Extension of this backend for the given name, or null if the Backend doesn't have an exten...
Definition: backend.cpp:176
void removeVariable(const QString &name)
Remove the variable name from the model.
Definition: defaultvariablemodel.cpp:162
void beginResetModel()
const char * name() const
bool isValid() const
< The Object will delete itself when finished.
Definition: expression.h:64
void endInsertRows()
bool operator==(const Cantor::DefaultVariableModel::Variable &one, const Cantor::DefaultVariableModel::Variable &other)
Definition: defaultvariablemodel.cpp:194
void beginRemoveRows(const QModelIndex &parent, int first, int last)
int row() const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: defaultvariablemodel.cpp:56
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Definition: defaultvariablemodel.cpp:89
DefaultVariableModel(Session *session)
Default constructor If you are constructing a DefaultVariableModel without subclassing, the session must be valid and its backends must support a VariableManagementExtension.
Definition: defaultvariablemodel.cpp:39
void beginInsertRows(const QModelIndex &parent, int first, int last)
void addVariable(const QString &name, const QString &value)
Adds a variable to the model.
Definition: defaultvariablemodel.cpp:142
virtual ~DefaultVariableModel()
Definition: defaultvariablemodel.cpp:51
QModelIndex sibling(int row, int column) const
virtual bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
Definition: defaultvariablemodel.cpp:114
int column() const
bool isValid() const
virtual Qt::ItemFlags flags(const QModelIndex &index) const
void endRemoveRows()
void endResetModel()
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: defaultvariablemodel.cpp:62
QString toString() const
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Definition: defaultvariablemodel.cpp:74
typedef ItemFlags
The Session object is the main class used to interact with a Backend.
Definition: session.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:16:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.