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 ®istrationName) |
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... | |
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.
pqTimelineModel::pqTimelineModel | ( | QObject * | parent = nullptr | ) |
|
override |
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.
type | is always stored under pqTimelineItemRole::TYPE data role. By default |
name | is stored under pqTimelineItemRole::REGISTRATIONNAME but can be overriden by additionalData. |
additionalData | is a map of data associated to their role. |
void pqTimelineModel::clearRows | ( | pqTimelineTrack::TrackType | type | ) |
Clear rows of given type.
void pqTimelineModel::deleteRow | ( | pqTimelineTrack::TrackType | type, |
const QString & | registrationName | ||
) |
Remove row under type with given registrationName.
|
override |
Override to handle checkstate.
void pqTimelineModel::setRowEnabled | ( | pqTimelineTrack::TrackType | type, |
bool | enabled, | ||
const QString & | name = QString() |
||
) |
Set/Get enable state of the row.
bool pqTimelineModel::isRowEnabled | ( | pqTimelineTrack::TrackType | type, |
const QString & | name = QString() |
||
) |
Set/Get enable state of the row.
void pqTimelineModel::toggleRow | ( | pqTimelineTrack::TrackType | type, |
const QString & | name | ||
) |
Set/Get enable state of the row.
void pqTimelineModel::setRowsEnabled | ( | pqTimelineTrack::TrackType | type, |
bool | enabled | ||
) |
Set/Get enable state of the row.
QList<QList<QStandardItem*> > pqTimelineModel::rows | ( | pqTimelineTrack::TrackType | type | ) |
Returns the row list of given type.
QList<QList<QStandardItem*> > pqTimelineModel::uncheckedRows | ( | pqTimelineTrack::TrackType | type | ) |
Returns the unchecked row list of given type.
|
signal |
|
signal |