4 #ifndef pqTimelinePainter_h 5 #define pqTimelinePainter_h 14 class QStyleOptionViewItem;
32 typedef QObject Superclass;
41 void paint(QPainter* painter,
const QModelIndex&
index,
const QStyleOptionViewItem& option);
48 void setSceneStartTime(
double time);
52 void setSceneEndTime(
double time);
54 void setSceneCurrentTime(
double time);
56 double getSceneCurrentTime();
58 void setSceneLockStart(
bool lock);
60 void setSceneLockEnd(
bool lock);
67 void setDisplayTimeRange(
double start,
double end);
68 QPair<double, double> displayTimeRange();
74 bool hasStartEndLabels();
78 QRect getStartLabelRect();
80 QRect getEndLabelRect();
89 double positionFromTime(
double time,
const QStyleOptionViewItem& option);
90 double positionFromTime(
double time);
97 double indexTimeFromPosition(
99 double pos,
const QStyleOptionViewItem& option,
const QModelIndex& index);
100 double timeFromPosition(
double pos,
const QStyleOptionViewItem& option);
101 double timeFromPosition(
double pos);
107 bool isTimeTrack(QStandardItem* item);
111 bool isAnimationTrack(QStandardItem* item);
113 std::vector<double> getTimes(QStandardItem* item);
115 double getSourceTime(QStandardItem* item);
117 QString getLabel(QStandardItem* item,
int index);
126 void paintBackground(QPainter* painter,
const QStyleOptionViewItem& option,
bool alternate);
131 void paintTimeline(QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item,
132 bool paintLabels,
const QStyleOptionViewItem& labelsOption);
134 void paintTimeTrack(QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item);
136 void paintSourceTrack(QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item);
138 void paintAnimationTrack(
139 QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item);
141 void paintSourcePipelineTime(
142 QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item);
144 void paintSceneCurrentTime(QPainter* painter,
const QStyleOptionViewItem& option);
148 bool paintTick(QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item,
149 double time,
bool paintLabels,
const QStyleOptionViewItem& labelsOption,
const QString& label);
151 void paintTimeMark(QPainter* painter,
const QStyleOptionViewItem& option,
double pos);
154 bool paintLabel(QPainter* painter,
const QStyleOptionViewItem& option, QStandardItem* item,
155 double time,
const QString& label);
158 double SceneCurrentTime = 0;
159 double SceneStartTime = 0;
160 double SceneEndTime = 1;
162 double DisplayStartTime = 0.;
163 double DisplayEndTime = 1.;
165 bool SceneLockStart =
false;
166 bool SceneLockEnd =
false;
170 std::unique_ptr<pqInternals> Internals;
#define PQAPPLICATIONCOMPONENTS_EXPORT
pqTimelineItemDelegate draws timeline in cells.