Public Slots | Signals | Public Member Functions | Protected Attributes | List of all members
pqTimelineItemDelegate Class Reference

pqTimelineItemDelegate draws timeline in cells and add some associated widgets. More...

#include <pqTimelineItemDelegate.h>

Inherits QStyledItemDelegate.

Public Slots

void setActiveSceneConnections (pqAnimationScene *scene)
 Set the active scene connections. More...
 
void updateSceneTimeRange ()
 Update cache of start/end time of the scene. More...
 

Signals

void needsRepaint ()
 

Public Member Functions

 pqTimelineItemDelegate (QObject *parent=nullptr, QWidget *parentWidget=nullptr)
 
 ~pqTimelineItemDelegate () override
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Render the timelines. More...
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Reimplemented to change row height. More...
 
bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 Reimplemented to handle mouse events. More...
 
bool eventFilter (QObject *watched, QEvent *event) override
 Reimplemented to handle more mouse events from parent view. More...
 

Protected Attributes

double Zoom = 1.
 

Detailed Description

pqTimelineItemDelegate draws timeline in cells and add some associated widgets.

This handles connection with the active scene to keep the timelines up to date.

Start and End scene times are editable and can be locked with dedicated button, integrated in the pqTimelineTrack::TIME item.

Definition at line 25 of file pqTimelineItemDelegate.h.

Constructor & Destructor Documentation

◆ pqTimelineItemDelegate()

pqTimelineItemDelegate::pqTimelineItemDelegate ( QObject *  parent = nullptr,
QWidget *  parentWidget = nullptr 
)

◆ ~pqTimelineItemDelegate()

pqTimelineItemDelegate::~pqTimelineItemDelegate ( )
override

Member Function Documentation

◆ paint()

void pqTimelineItemDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Render the timelines.

Depends on the type (time, animation) stored in a custom item role

◆ sizeHint()

QSize pqTimelineItemDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Reimplemented to change row height.

◆ editorEvent()

bool pqTimelineItemDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
override

Reimplemented to handle mouse events.

So we can handle clicking on the timeline to edit start / end time.

◆ eventFilter()

bool pqTimelineItemDelegate::eventFilter ( QObject *  watched,
QEvent *  event 
)
override

Reimplemented to handle more mouse events from parent view.

editorEvent is useful to get the concerned index and option, but it is pretty restricted. For instance no release event is catched if it occurs outside of the index that received the corresponding press event. Thus we need this eventFilter, to watch the full pqTimelineView.

◆ setActiveSceneConnections

void pqTimelineItemDelegate::setActiveSceneConnections ( pqAnimationScene scene)
slot

Set the active scene connections.

◆ updateSceneTimeRange

void pqTimelineItemDelegate::updateSceneTimeRange ( )
slot

Update cache of start/end time of the scene.

◆ needsRepaint

void pqTimelineItemDelegate::needsRepaint ( )
signal

Member Data Documentation

◆ Zoom

double pqTimelineItemDelegate::Zoom = 1.
protected

Definition at line 78 of file pqTimelineItemDelegate.h.


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