FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
timeline.h
1#ifndef TIMELINE_H
2#define TIMELINE_H
3
4#include <QBrush>
5#include <QColor>
6#include <QGraphicsLineItem>
7#include <QGraphicsRectItem>
8#include <QGraphicsScene>
9#include <QGraphicsSimpleTextItem>
10#include <QKeySequence>
11#include <QMouseEvent>
12#include <QPen>
13#include <QScrollBar>
14#include <QShortcut>
15#include <QString>
16#include <QTimer>
17#include <QVector>
18#include <QWidget>
19
20QT_BEGIN_NAMESPACE
21namespace Ui {
22class Timeline;
23}
24QT_END_NAMESPACE
25
26class Timeline : public QWidget {
27 Q_OBJECT
28
29 public:
30 Timeline(QWidget *parent = nullptr);
31 ~Timeline();
32 void setValue(const int index);
33 void setCursorValue(const int index);
34 void setMaximum(const int max);
35 void setMinimum(const int min);
36 int value();
37 int currentValue();
38 void togglePlay();
39 int isAutoplay;
40
41 private:
42 Ui::Timeline *ui;
43
44 int m_imageNumber;
45 int m_imageMin;
46 int m_width;
47 int m_offset;
48 int m_currentIndex;
49 int m_currentIndexLeft;
50 int m_scale;
51 QTimer *timer;
52
53 QGraphicsScene *timelineScene;
54 QGraphicsLineItem *cursor;
55 QGraphicsLineItem *cursorLeft;
56 QGraphicsSimpleTextItem *indexNumber;
57
58 QList<int> markers;
59
60 void setLayout(const int width, const int imageNumber);
61 void resizeEvent(QResizeEvent *event);
62 bool eventFilter(QObject *target, QEvent *event);
63 void drawMarker(const int index);
64 void clearMarker(const int index);
65 void update(const int index);
66
67 signals:
68 void valueChanged(int value);
69};
70#endif // TIMELINE_H
Draw a time line with cursor, hover and marker set.
Definition: timeline.h:26
void update(const int index)
Redraw the widget keeping markers and cursors.
Definition: timeline.cpp:222
void setMaximum(const int max)
Set the maximum value.
Definition: timeline.cpp:292
void setMinimum(const int min)
Set the minimum value, currently forced to zero.
Definition: timeline.cpp:300
void resizeEvent(QResizeEvent *event)
Handle the widget redrawing when resized.
Definition: timeline.cpp:140
void setCursorValue(const int index)
Set the cursor at a given value.
Definition: timeline.cpp:237
void drawMarker(const int index)
Draw a line marker at a given index.
Definition: timeline.cpp:202
void setValue(const int index)
Set the left cursor (left click cursor) at a given value.
Definition: timeline.cpp:257
int value()
Return the last left value.
Definition: timeline.cpp:277
void setLayout(const int width, const int imageNumber)
Set the layout of the timeline.
Definition: timeline.cpp:100
void clearMarker(const int index)
Delete a line marker at a given index.
Definition: timeline.cpp:213
int currentValue()
Return the current value.
Definition: timeline.cpp:284
bool eventFilter(QObject *target, QEvent *event)
Handle the pointer event, click and hover.
Definition: timeline.cpp:149
void togglePlay()
Start/Stop the autoplay of the replay.
Definition: timeline.cpp:307