1 #ifndef TIMELINEWIDGET_H
2 #define TIMELINEWIDGET_H
7 #include "trace_profiler.hpp"
9 class TimelineWidget : public QWidget
21 TimelineWidget(QWidget *parent = 0);
23 void setProfile(trace::Profile* profile);
26 virtual void wheelEvent(QWheelEvent *e);
27 virtual void mousePressEvent(QMouseEvent *e);
28 virtual void mouseMoveEvent(QMouseEvent *e);
29 virtual void mouseReleaseEvent(QMouseEvent *e);
30 virtual void mouseDoubleClickEvent(QMouseEvent *e);
32 virtual void paintEvent(QPaintEvent *e);
33 virtual void resizeEvent(QResizeEvent *e);
36 void setHorizontalScrollValue(int value);
37 void setVerticalScrollValue(int value);
40 void verticalScrollMaxChanged(int max);
41 void verticalScrollValueChanged(int value);
43 void horizontalScrollMaxChanged(int max);
44 void horizontalScrollValueChanged(int value);
46 void jumpToCall(int call);
48 void selectionChanged(int64_t start, int64_t end);
51 void setSelection(int64_t start, int64_t end, bool notify = false);
52 void setRowScroll(int position, bool notify = true);
53 void setTimeScroll(int64_t time, bool notify = true);
55 void drawHeat(QPainter& painter, int x, int64_t heat, bool isCpu);
57 double timeToPosition(int64_t time);
58 int64_t positionToTime(int pos);
62 const trace::Profile::Frame* frameAtTime(int64_t time);
63 const trace::Profile::CpuCall* cpuCallAtTime(int64_t time);
64 const trace::Profile::DrawCall* drawCallAtTime(int program, int64_t time);
68 trace::Profile* m_profile;
69 std::vector<int> m_rowPrograms;
86 int64_t m_timeWidthMin;
87 int64_t m_timeWidthMax;
88 int64_t m_timeSelectionStart;
89 int64_t m_timeSelectionEnd;
97 int64_t m_mousePressTime;
98 QPoint m_mousePosition;
99 QPoint m_mousePressPosition;
100 MousePressMode m_mousePressMode;
108 QPen m_axisForeground;
109 QBrush m_axisBackground;
111 QPen m_itemForeground;
112 QBrush m_itemBackground;
113 QPen m_selectionBorder;
114 QBrush m_selectionBackground;
116 QBrush m_zoomBackground;
119 #endif // TIMELINEWIDGET_H