FastTrack 6.1.0
Tracks multiples objects dealing with occlusion and identities.
Loading...
Searching...
No Matches
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(const Timeline &T) = delete;
32 Timeline &operator=(const Timeline &T) = delete;
33 Timeline &operator=(Timeline &&T) = delete;
34 Timeline(Timeline &&T) = delete;
35 ~Timeline();
36 void setValue(const int index);
37 void setCursorValue(const int index);
38 void setMaximum(const int max);
39 void setMinimum(const int min);
40 int value();
41 int currentValue();
42 void togglePlay();
43 int isAutoplay;
44
45 private:
46 Ui::Timeline *ui;
47
48 int m_imageNumber;
49 int m_imageMin;
50 int m_width;
51 int m_offset;
52 int m_currentIndex;
53 int m_currentIndexLeft;
54 int m_scale;
55 QTimer *timer;
56
57 QGraphicsScene *timelineScene;
58 QGraphicsLineItem *cursor;
59 QGraphicsLineItem *cursorLeft;
60 QGraphicsSimpleTextItem *indexNumber;
61
62 QList<int> markers;
63
64 void setLayout(const int width, const int imageNumber);
65 void resizeEvent(QResizeEvent *event) override;
66 bool eventFilter(QObject *target, QEvent *event) override;
67 void drawMarker(const int index);
68 void clearMarker(const int index);
69 void update(const int index);
70
71 signals:
72 void valueChanged(int value);
73};
74#endif // TIMELINE_H
void update(const int index)
Redraw the widget keeping markers and cursors.
Definition timeline.cpp:211
void setMaximum(const int max)
Set the maximum value.
Definition timeline.cpp:281
void setMinimum(const int min)
Set the minimum value, currently forced to zero.
Definition timeline.cpp:289
void setCursorValue(const int index)
Set the cursor at a given value.
Definition timeline.cpp:226
void drawMarker(const int index)
Draw a line marker at a given index.
Definition timeline.cpp:191
bool eventFilter(QObject *target, QEvent *event) override
Handle the pointer event, click and hover.
Definition timeline.cpp:139
void setValue(const int index)
Set the left cursor (left click cursor) at a given value.
Definition timeline.cpp:246
int value()
Return the last left value.
Definition timeline.cpp:266
void setLayout(const int width, const int imageNumber)
Set the layout of the timeline.
Definition timeline.cpp:90
void clearMarker(const int index)
Delete a line marker at a given index.
Definition timeline.cpp:202
int currentValue()
Return the current value.
Definition timeline.cpp:273
void togglePlay()
Start/Stop the autoplay of the replay.
Definition timeline.cpp:296
void resizeEvent(QResizeEvent *event) override
Handle the widget redrawing when resized.
Definition timeline.cpp:130