hivemind 1.0.0
Loading...
Searching...
No Matches
timeline.h
Go to the documentation of this file.
1#pragma once
2
3#include <QComboBox>
4#include <QResizeEvent>
5#include <QWidget>
6
7namespace Gui
8{
9
10 /// \class Timeline
11 /// \brief A custom QWidget to represent a timeline with keyframes.
12 class Timeline : public QWidget
13 {
14 Q_OBJECT
15 public:
16 ///
17 /// \brief Constructor for the Timeline class.
18 /// \param parent The parent QWidget
19 ///
20 explicit Timeline(QWidget* parent = nullptr);
21
22 ///
23 /// \brief Get the active agent ID
24 /// \return The ID of the active agent
25 ///
26 inline int
28 {
29 return m_activeAgentId;
30 }
31
32 ///
33 /// \brief Get the current timestamp
34 /// \return The current timestamp
35 ///
36 inline float
38 {
39 return m_timeStamp;
40 }
41
42 protected:
43 ///
44 /// \brief Paint event handler
45 /// \param event The paint event
46 ///
47 void paintEvent(QPaintEvent* event) override;
48
49 ///
50 /// \brief Mouse release event handler
51 /// \param event The mouse release event
52 ///
53 void mouseReleaseEvent(QMouseEvent* event) override;
54
55 ///
56 /// \brief Resize event handler
57 /// \param event The resize event
58 ///
59 void resizeEvent(QResizeEvent* event) override;
60 signals:
61 ///
62 /// \brief Signal that is emitted when a timestamp is selected
63 /// \param timeStamp The selected timestamp
64 ///
65 void timeStampSelected(float timeStamp);
66
67 private:
68 float m_timeStamp; ///< The current timestamp
69 int m_activeAgentId; ///< ID of the active agent
70 float m_pixelsPerSecond; ///< Pixels per second on the timeline
71 };
72
73} // namespace Gui
A custom QWidget to represent a timeline with keyframes.
Definition: timeline.h:13
float m_timeStamp
The current timestamp.
Definition: timeline.h:68
void mouseReleaseEvent(QMouseEvent *event) override
Mouse release event handler.
Definition: timeline.cpp:66
int GetActiveAgent()
Get the active agent ID.
Definition: timeline.h:27
int m_activeAgentId
ID of the active agent.
Definition: timeline.h:69
void timeStampSelected(float timeStamp)
Signal that is emitted when a timestamp is selected.
void resizeEvent(QResizeEvent *event) override
Resize event handler.
Definition: timeline.cpp:116
void paintEvent(QPaintEvent *event) override
Paint event handler.
Definition: timeline.cpp:25
float GetTimeStamp()
Get the current timestamp.
Definition: timeline.h:37
float m_pixelsPerSecond
Pixels per second on the timeline.
Definition: timeline.h:70
Definition: action.h:6