7 #include <QLinearGradient>
8 #include "trace_profiler.hpp"
21 class GraphWidget : public QWidget
26 GraphWidget(QWidget *parent = 0);
28 void setProfile(trace::Profile* profile, GraphType type);
29 const trace::Profile::Call* callAtPosition(const QPoint& pos);
31 void selectNone(bool notify = false);
32 void selectTime(int64_t start, int64_t end, bool notify = false);
33 void selectProgram(unsigned program, bool notify = false);
36 virtual void paintEvent(QPaintEvent *e);
37 virtual void resizeEvent(QResizeEvent *e);
39 virtual void wheelEvent(QWheelEvent *e);
40 virtual void mouseMoveEvent(QMouseEvent *e);
41 virtual void mousePressEvent(QMouseEvent *e);
42 virtual void mouseReleaseEvent(QMouseEvent *e);
43 virtual void mouseDoubleClickEvent(QMouseEvent *e);
46 void jumpToCall(int no);
47 void viewChanged(int call, int width);
50 void selectedProgram(unsigned program);
51 void selectedTime(int64_t start, int64_t end);
54 void changeView(int call, int width);
59 void paintVerticalAxis(QPainter& painter);
60 void paintHorizontalAxis(QPainter& painter);
64 trace::Profile* m_profile;
82 /* Mouse track data */
84 QPoint m_mousePressPosition;
89 QPen m_axisForeground;
90 QBrush m_axisBackground;
91 QLinearGradient m_graphGradientGpu;
92 QLinearGradient m_graphGradientCpu;
93 QLinearGradient m_graphGradientDeselected;
105 #endif // GRAPHWIDGET_H