Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pqExpressionsTableModel Class Reference

#include <pqExpressionsTableModel.h>

Inherits QAbstractTableModel.

Public Types

enum  ColumnKey { GroupColumn = 0, NameColumn, ExpressionColumn, NumberOfColumns }
 

Public Member Functions

 pqExpressionsTableModel (QObject *parent=nullptr)
 
 ~pqExpressionsTableModel () override=default
 
QModelIndex addNewExpression ()
 Add a new empty expression. More...
 
QList< pqExpressionsManager::pqExpressiongetExpressions ()
 Get all expressions. More...
 
QList< pqExpressionsManager::pqExpressiongetExpressions (const QString &group)
 Get expressions list for given group. More...
 
QString getExpressionAsString (const QModelIndex &idx)
 Get the expression at idx. More...
 
QModelIndex expressionIndex (const pqExpressionsManager::pqExpression &expression)
 Find the given expression and return the index of the first matching row, at ExpressionColumn. More...
 
QString getGroup (const QModelIndex &idx)
 Get the group at idx. More...
 
void setExpressions (const QList< pqExpressionsManager::pqExpression > &expressions)
 Set expressions. More...
 
void addExpressions (const QList< pqExpressionsManager::pqExpression > &expressions)
 Add expressions to the current one. More...
 
QSet< QString > getGroups ()
 Get the available groups. More...
 
bool setExpressionName (int idx, const QString &group)
 Set the expression name for the expression at idx. More...
 
bool setExpressionGroup (int idx, const QString &group)
 Set the group name for the expression at idx. More...
 
void removeExpressions (const QModelIndexList &index)
 Remove the expressions pointed by the list of indices. More...
 
void removeAllExpressions ()
 Remove all expressions. More...
 
int rowCount (const QModelIndex &parent) const override
 Reimplements Superclass API to manage items. More...
 
int columnCount (const QModelIndex &parent) const override
 Reimplements Superclass API to manage items. More...
 
QVariant data (const QModelIndex &index, int role) const override
 Reimplements Superclass API to manage items. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Reimplements Superclass API to manage items. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Reimplements Superclass API to manage items. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role) override
 Reimplements Superclass API to manage items. More...
 
bool insertRows (int position, int rows, const QModelIndex &parent) override
 Reimplements Superclass API to manage items. More...
 
bool removeRows (int position, int rows, const QModelIndex &parent) override
 Reimplements Superclass API to manage items. More...
 

Protected Member Functions

bool setExpression (int idx, const QString &expression)
 Set expression value at given idx. More...
 
bool removeExpression (int idx)
 Remove expression at given idx. More...
 

Protected Attributes

QList< pqExpressionsManager::pqExpressionExpressions
 

Detailed Description

Definition at line 14 of file pqExpressionsTableModel.h.

Member Enumeration Documentation

◆ ColumnKey

Enumerator
GroupColumn 
NameColumn 
ExpressionColumn 
NumberOfColumns 

Definition at line 23 of file pqExpressionsTableModel.h.

Constructor & Destructor Documentation

◆ pqExpressionsTableModel()

pqExpressionsTableModel::pqExpressionsTableModel ( QObject *  parent = nullptr)

◆ ~pqExpressionsTableModel()

pqExpressionsTableModel::~pqExpressionsTableModel ( )
overridedefault

Member Function Documentation

◆ addNewExpression()

QModelIndex pqExpressionsTableModel::addNewExpression ( )

Add a new empty expression.

Return the index of the created item

◆ getExpressions() [1/2]

QList<pqExpressionsManager::pqExpression> pqExpressionsTableModel::getExpressions ( )

Get all expressions.

◆ getExpressions() [2/2]

QList<pqExpressionsManager::pqExpression> pqExpressionsTableModel::getExpressions ( const QString &  group)

Get expressions list for given group.

◆ getExpressionAsString()

QString pqExpressionsTableModel::getExpressionAsString ( const QModelIndex &  idx)

Get the expression at idx.

◆ expressionIndex()

QModelIndex pqExpressionsTableModel::expressionIndex ( const pqExpressionsManager::pqExpression expression)

Find the given expression and return the index of the first matching row, at ExpressionColumn.

Retrun invalid index if nothing found.

◆ getGroup()

QString pqExpressionsTableModel::getGroup ( const QModelIndex &  idx)

Get the group at idx.

◆ setExpressions()

void pqExpressionsTableModel::setExpressions ( const QList< pqExpressionsManager::pqExpression > &  expressions)

Set expressions.

Erase any previous content.

◆ addExpressions()

void pqExpressionsTableModel::addExpressions ( const QList< pqExpressionsManager::pqExpression > &  expressions)

Add expressions to the current one.

This does not remove duplicates.

◆ getGroups()

QSet<QString> pqExpressionsTableModel::getGroups ( )

Get the available groups.

◆ setExpressionName()

bool pqExpressionsTableModel::setExpressionName ( int  idx,
const QString &  group 
)

Set the expression name for the expression at idx.

◆ setExpressionGroup()

bool pqExpressionsTableModel::setExpressionGroup ( int  idx,
const QString &  group 
)

Set the group name for the expression at idx.

◆ removeExpressions()

void pqExpressionsTableModel::removeExpressions ( const QModelIndexList &  index)

Remove the expressions pointed by the list of indices.

◆ removeAllExpressions()

void pqExpressionsTableModel::removeAllExpressions ( )

Remove all expressions.

◆ rowCount()

int pqExpressionsTableModel::rowCount ( const QModelIndex &  parent) const
override

Reimplements Superclass API to manage items.

◆ columnCount()

int pqExpressionsTableModel::columnCount ( const QModelIndex &  parent) const
override

Reimplements Superclass API to manage items.

◆ data()

QVariant pqExpressionsTableModel::data ( const QModelIndex &  index,
int  role 
) const
override

Reimplements Superclass API to manage items.

◆ headerData()

QVariant pqExpressionsTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Reimplements Superclass API to manage items.

◆ flags()

Qt::ItemFlags pqExpressionsTableModel::flags ( const QModelIndex &  index) const
override

Reimplements Superclass API to manage items.

◆ setData()

bool pqExpressionsTableModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
override

Reimplements Superclass API to manage items.

◆ insertRows()

bool pqExpressionsTableModel::insertRows ( int  position,
int  rows,
const QModelIndex &  parent 
)
override

Reimplements Superclass API to manage items.

◆ removeRows()

bool pqExpressionsTableModel::removeRows ( int  position,
int  rows,
const QModelIndex &  parent 
)
override

Reimplements Superclass API to manage items.

◆ setExpression()

bool pqExpressionsTableModel::setExpression ( int  idx,
const QString &  expression 
)
protected

Set expression value at given idx.

◆ removeExpression()

bool pqExpressionsTableModel::removeExpression ( int  idx)
protected

Remove expression at given idx.

Member Data Documentation

◆ Expressions

QList<pqExpressionsManager::pqExpression> pqExpressionsTableModel::Expressions
protected

Definition at line 123 of file pqExpressionsTableModel.h.


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