Public Types | Public Member Functions | List of all members
pqCustomFilterDefinitionModel Class Reference

The pqCustomFilterDefinitionModel class stores the sources that define a compound proxy in a hierarchical format. More...

#include <pqCustomFilterDefinitionModel.h>

Inherits QAbstractItemModel.

Public Types

enum  ItemType {
  Invalid = -1, Source = 0, Filter, CustomFilter,
  Link, LastType = Link
}
 

Public Member Functions

 pqCustomFilterDefinitionModel (QObject *parent=nullptr)
 
 ~pqCustomFilterDefinitionModel () override
 
void setContents (const pqProxySelection &items)
 Sets the contents of the custom filter definition model. More...
 
QModelIndex getNextIndex (const QModelIndex &index) const
 Gets the next index in the model's tree hierarchy. More...
 
pqPipelineSourcegetSourceFor (const QModelIndex &index) const
 Gets the source associated with an index. More...
 
QAbstractItemModel Methods
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Gets the number of rows for a given index. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Gets the number of columns for a given index. More...
 
bool hasChildren (const QModelIndex &parent=QModelIndex()) const override
 Gets whether or not the given index has child items. More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 Gets a model index for a given location. More...
 
QModelIndex parent (const QModelIndex &index) const override
 Gets the parent for a given index. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Gets the data for a given model index. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Gets the flags for a given model index. More...
 

Detailed Description

The pqCustomFilterDefinitionModel class stores the sources that define a compound proxy in a hierarchical format.

The hierarchical format is similar to the pqPipelineModel. The custom filter definition model contains only sources. It does not include any server objects, since the custom filter must be defined on one server.

Definition at line 34 of file pqCustomFilterDefinitionModel.h.

Member Enumeration Documentation

◆ ItemType

Enumerator
Invalid 
Source 
Filter 
CustomFilter 
Link 
LastType 

Definition at line 37 of file pqCustomFilterDefinitionModel.h.

Constructor & Destructor Documentation

◆ pqCustomFilterDefinitionModel()

pqCustomFilterDefinitionModel::pqCustomFilterDefinitionModel ( QObject *  parent = nullptr)

◆ ~pqCustomFilterDefinitionModel()

pqCustomFilterDefinitionModel::~pqCustomFilterDefinitionModel ( )
override

Member Function Documentation

◆ rowCount()

int pqCustomFilterDefinitionModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Gets the number of rows for a given index.

Parameters
parentThe parent index.
Returns
The number of rows for the given index.

◆ columnCount()

int pqCustomFilterDefinitionModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Gets the number of columns for a given index.

Parameters
parentThe parent index.
Returns
The number of columns for the given index.

◆ hasChildren()

bool pqCustomFilterDefinitionModel::hasChildren ( const QModelIndex &  parent = QModelIndex()) const
override

Gets whether or not the given index has child items.

Parameters
parentThe parent index.
Returns
True if the given index has child items.

◆ index()

QModelIndex pqCustomFilterDefinitionModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Gets a model index for a given location.

Parameters
rowThe row number.
columnThe column number.
parentThe parent index.
Returns
A model index for the given location.

◆ parent()

QModelIndex pqCustomFilterDefinitionModel::parent ( const QModelIndex &  index) const
override

Gets the parent for a given index.

Parameters
indexThe model index.
Returns
A model index for the parent of the given index.

◆ data()

QVariant pqCustomFilterDefinitionModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Gets the data for a given model index.

Parameters
indexThe model index.
roleThe role to get data for.
Returns
The data for the given model index.

◆ flags()

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

Gets the flags for a given model index.

The flags for an item indicate if it is enabled, editable, etc.

Parameters
indexThe model index.
Returns
The flags for the given model index.

◆ setContents()

void pqCustomFilterDefinitionModel::setContents ( const pqProxySelection items)

Sets the contents of the custom filter definition model.

The items are added to the custom filter definition model in a hierarchy similar to the pipeline model. Only the items in the list are added to the hierarchy.

Parameters
itemsThe list of selected model items.

◆ getNextIndex()

QModelIndex pqCustomFilterDefinitionModel::getNextIndex ( const QModelIndex &  index) const

Gets the next index in the model's tree hierarchy.

Parameters
indexThe current model index.
Returns
A model index for the next item in the hierarchy.

◆ getSourceFor()

pqPipelineSource* pqCustomFilterDefinitionModel::getSourceFor ( const QModelIndex &  index) const

Gets the source associated with an index.

Parameters
indexThe model index to look up.
Returns
A pointer to the source object or null if there is none.

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