Logo Search packages:      
Sourcecode: cantor version File versions  Download package

Classes | Public Slots | Public Member Functions | Protected Types | Protected Member Functions | Properties | Private Attributes

Cantor::DefaultVariableModel Class Reference

This DefaultVariableModel class is an implementation of QAbstractItemModel that can be used with the Variable Manager plugin. More...

#include <defaultvariablemodel.h>

Collaboration diagram for Cantor::DefaultVariableModel:
Collaboration graph
[legend]

List of all members.

Classes

struct  Variable

Public Slots

void addVariable (const QString &name, const QString &value)
void addVariable (const Variable &variable)
void clearVariables ()
void removeVariable (const QString &name)
void removeVariable (const Variable &variable)

Public Member Functions

 DefaultVariableModel (Session *session)
Sessionsession () const

Protected Types

enum  Column { NameColumn = 0, ValueColumn = 1, ColumnCount = 2 }

Protected Member Functions

virtual int columnCount (const QModelIndex &parent=QModelIndex()) const
virtual QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
virtual Qt::ItemFlags flags (const QModelIndex &index) const
virtual QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)

Properties

Session session

Private Attributes

DefaultVariableModelPrivate *const d_ptr

Detailed Description

This DefaultVariableModel class is an implementation of QAbstractItemModel that can be used with the Variable Manager plugin.

For most uses the addVariable(), removeVariable() and clearVariables() methods are sufficient. They can be used from session (directly or by connecting signals to them), or called from a subclass.

DefaultVariableModel uses the session to run expressions for changing variables, and it gets the commands from the backend's VariableManagementExtension. If you do not want this behavior, you can subclass it and reimplement data() and/or setData().

See also:
Session::variableModel()

Definition at line 47 of file defaultvariablemodel.h.


The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index