Signals | Public Member Functions | List of all members
pqTimelineModel Class Reference

pqTimelineModel is a standard item model for ParaView timelines, intended to be used with pqTimelineView, and mainly through pqTimelineWidget. More...

#include <pqTimelineModel.h>

Inherits QStandardItemModel.

Signals

void sourceStateChanged ()
 
void animationStateChanged ()
 

Public Member Functions

 pqTimelineModel (QObject *parent=nullptr)
 
 ~pqTimelineModel () override
 
QList< QStandardItem * > createRow (pqTimelineTrack::TrackType type, const QString &name, QMap< int, QVariant > additionalData={})
 Create items under appropriate parent, and set some data on it. More...
 
void clearRows (pqTimelineTrack::TrackType type)
 Clear rows of given type. More...
 
void deleteRow (pqTimelineTrack::TrackType type, const QString &registrationName)
 Remove row under type with given registrationName. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::DisplayRole) override
 Override to handle checkstate. More...
 
QList< QList< QStandardItem * > > rows (pqTimelineTrack::TrackType type)
 Returns the row list of given type. More...
 
QList< QList< QStandardItem * > > uncheckedRows (pqTimelineTrack::TrackType type)
 Returns the unchecked row list of given type. More...
 
void setRowEnabled (pqTimelineTrack::TrackType type, bool enabled, const QString &name=QString())
 Set/Get enable state of the row. More...
 
bool isRowEnabled (pqTimelineTrack::TrackType type, const QString &name=QString())
 Set/Get enable state of the row. More...
 
void toggleRow (pqTimelineTrack::TrackType type, const QString &name)
 Set/Get enable state of the row. More...
 
void setRowsEnabled (pqTimelineTrack::TrackType type, bool enabled)
 Set/Get enable state of the row. More...
 

Detailed Description

pqTimelineModel is a standard item model for ParaView timelines, intended to be used with pqTimelineView, and mainly through pqTimelineWidget.

A timeline correspond to any element containing a list of meaningful times, as temporal sources and animation cue (see pqTimelineWidget).

This is a tree-like structure with only two levels. Each model row is known as a "Track", than can be of several type (see pqTimelineTrack enum). SOURCE and ANIMATION tracks are grouped under a parent track, resp. TIME and ANIMATION_HEADER making it easier to have dedicated code path.

One column contains the timeline itself, while others contains associated data such as name and custom widget. See pqTimelineColumn enum.

Definition at line 64 of file pqTimelineModel.h.

Constructor & Destructor Documentation

◆ pqTimelineModel()

pqTimelineModel::pqTimelineModel ( QObject *  parent = nullptr)

◆ ~pqTimelineModel()

pqTimelineModel::~pqTimelineModel ( )
override

Member Function Documentation

◆ createRow()

QList<QStandardItem*> pqTimelineModel::createRow ( pqTimelineTrack::TrackType  type,
const QString &  name,
QMap< int, QVariant >  additionalData = {} 
)

Create items under appropriate parent, and set some data on it.

Parent is computed depending on type: SOURCE goes under TIME, ANIMATION under ANIMATION_HEADER. Themself are under the root.

Parameters
typeis always stored under pqTimelineItemRole::TYPE data role. By default
nameis stored under pqTimelineItemRole::REGISTRATIONNAME but can be overriden by additionalData.
additionalDatais a map of data associated to their role.

◆ clearRows()

void pqTimelineModel::clearRows ( pqTimelineTrack::TrackType  type)

Clear rows of given type.

◆ deleteRow()

void pqTimelineModel::deleteRow ( pqTimelineTrack::TrackType  type,
const QString &  registrationName 
)

Remove row under type with given registrationName.

◆ setData()

bool pqTimelineModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::DisplayRole 
)
override

Override to handle checkstate.

◆ setRowEnabled()

void pqTimelineModel::setRowEnabled ( pqTimelineTrack::TrackType  type,
bool  enabled,
const QString &  name = QString() 
)

Set/Get enable state of the row.

◆ isRowEnabled()

bool pqTimelineModel::isRowEnabled ( pqTimelineTrack::TrackType  type,
const QString &  name = QString() 
)

Set/Get enable state of the row.

◆ toggleRow()

void pqTimelineModel::toggleRow ( pqTimelineTrack::TrackType  type,
const QString &  name 
)

Set/Get enable state of the row.

◆ setRowsEnabled()

void pqTimelineModel::setRowsEnabled ( pqTimelineTrack::TrackType  type,
bool  enabled 
)

Set/Get enable state of the row.

◆ rows()

QList<QList<QStandardItem*> > pqTimelineModel::rows ( pqTimelineTrack::TrackType  type)

Returns the row list of given type.

◆ uncheckedRows()

QList<QList<QStandardItem*> > pqTimelineModel::uncheckedRows ( pqTimelineTrack::TrackType  type)

Returns the unchecked row list of given type.

◆ sourceStateChanged

void pqTimelineModel::sourceStateChanged ( )
signal

◆ animationStateChanged

void pqTimelineModel::animationStateChanged ( )
signal

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