1 #ifndef TIMELINEWIDGET_H
2 #define TIMELINEWIDGET_H
7 #include "trace_profiler.hpp"
11 const trace::Profile::Frame* frame;
12 const trace::Profile::Call* call;
15 class TimelineWidget : public QWidget
27 TimelineWidget(QWidget *parent = 0);
29 void setProfile(trace::Profile* profile);
32 virtual void wheelEvent(QWheelEvent *e);
33 virtual void mousePressEvent(QMouseEvent *e);
34 virtual void mouseMoveEvent(QMouseEvent *e);
35 virtual void mouseReleaseEvent(QMouseEvent *e);
36 virtual void mouseDoubleClickEvent(QMouseEvent *e);
38 virtual void paintEvent(QPaintEvent *e);
39 virtual void resizeEvent(QResizeEvent *e);
42 void setHorizontalScrollValue(int value);
43 void setVerticalScrollValue(int value);
46 void verticalScrollMaxChanged(int max);
47 void verticalScrollValueChanged(int value);
49 void horizontalScrollMaxChanged(int max);
50 void horizontalScrollValueChanged(int value);
52 void jumpToCall(int call);
54 void selectionChanged(int64_t start, int64_t end);
57 void setSelection(int64_t start, int64_t end, bool notify = false);
58 void setRowScroll(int position, bool notify = true);
59 void setTimeScroll(int64_t time, bool notify = true);
61 void paintHeatmapColumn(int x, QPainter& painter, QVector<uint64_t>& rows);
63 double timeToPosition(int64_t time);
64 int64_t positionToTime(int pos);
66 const VisibleItem* itemAtPosition(const QPoint& pos);
72 trace::Profile* m_profile;
73 QList<int> m_programRowMap;
74 QList<VisibleItem> m_visibleItems;
91 int64_t m_timeWidthMin;
92 int64_t m_timeWidthMax;
93 int64_t m_timeSelectionStart;
94 int64_t m_timeSelectionEnd;
102 int64_t m_mousePressTime;
103 QPoint m_mousePosition;
104 QPoint m_mousePressPosition;
105 MousePressMode m_mousePressMode;
112 QBrush m_axisBackground;
114 QPen m_itemForeground;
115 QBrush m_itemBackground;
116 QPen m_selectionBorder;
117 QBrush m_selectionBackground;
119 QBrush m_zoomBackground;
122 #endif // TIMELINEWIDGET_H