#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::pqExpression > | getExpressions () |
Get all expressions. More... | |
QList< pqExpressionsManager::pqExpression > | getExpressions (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::pqExpression > | Expressions |
Definition at line 14 of file pqExpressionsTableModel.h.
Enumerator | |
---|---|
GroupColumn | |
NameColumn | |
ExpressionColumn | |
NumberOfColumns |
Definition at line 23 of file pqExpressionsTableModel.h.
pqExpressionsTableModel::pqExpressionsTableModel | ( | QObject * | parent = nullptr | ) |
|
overridedefault |
QModelIndex pqExpressionsTableModel::addNewExpression | ( | ) |
Add a new empty expression.
Return the index of the created item
QList<pqExpressionsManager::pqExpression> pqExpressionsTableModel::getExpressions | ( | ) |
Get all expressions.
QList<pqExpressionsManager::pqExpression> pqExpressionsTableModel::getExpressions | ( | const QString & | group | ) |
Get expressions list for given group.
QString pqExpressionsTableModel::getExpressionAsString | ( | const QModelIndex & | idx | ) |
Get the expression at idx.
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.
QString pqExpressionsTableModel::getGroup | ( | const QModelIndex & | idx | ) |
Get the group at idx.
void pqExpressionsTableModel::setExpressions | ( | const QList< pqExpressionsManager::pqExpression > & | expressions | ) |
Set expressions.
Erase any previous content.
void pqExpressionsTableModel::addExpressions | ( | const QList< pqExpressionsManager::pqExpression > & | expressions | ) |
Add expressions to the current one.
This does not remove duplicates.
QSet<QString> pqExpressionsTableModel::getGroups | ( | ) |
Get the available groups.
Set the expression name for the expression at idx.
Set the group name for the expression at idx.
void pqExpressionsTableModel::removeExpressions | ( | const QModelIndexList & | index | ) |
Remove the expressions pointed by the list of indices.
void pqExpressionsTableModel::removeAllExpressions | ( | ) |
Remove all expressions.
Reimplements Superclass API to manage items.
Reimplements Superclass API to manage items.
Reimplements Superclass API to manage items.
|
override |
Reimplements Superclass API to manage items.
|
override |
Reimplements Superclass API to manage items.
|
override |
Reimplements Superclass API to manage items.
|
override |
Reimplements Superclass API to manage items.
|
override |
Reimplements Superclass API to manage items.
Set expression value at given idx.
|
protected |
Remove expression at given idx.
|
protected |
Definition at line 123 of file pqExpressionsTableModel.h.