]> git.cworth.org Git - apitrace/blob - gui/graphing/histogramview.h
Merge remote-tracking branch 'github/master' into d2d
[apitrace] / gui / graphing / histogramview.h
1 #ifndef HISTOGRAMVIEW_H
2 #define HISTOGRAMVIEW_H
3
4 #include "graphview.h"
5
6 /**
7  * Histogram graph view.
8  *
9  * When the view is zoomed such that there is more than one item occupying
10  * a single pixel the one with the highest value will be displayed.
11  */
12 class HistogramView : public GraphView {
13 public:
14     HistogramView(QWidget* parent);
15
16     void setDataProvider(GraphDataProvider* data);
17     void setSelectionState(SelectionState* state);
18
19     /* Gradient colours for selected and unselected items */
20     void setSelectedGradient(const QLinearGradient& gradient);
21     void setUnelectedGradient(const QLinearGradient& gradient);
22
23     virtual void mouseMoveEvent(QMouseEvent *e);
24     virtual void mouseDoubleClickEvent(QMouseEvent *e);
25
26     virtual void update();
27     virtual void resizeEvent(QResizeEvent *e);
28     virtual void paintEvent(QPaintEvent *e);
29
30 protected:
31     qint64 itemAtPosition(QPoint pos);
32     qint64 valueAtPosition(QPoint pos);
33
34 protected:
35     QLinearGradient m_gradientSelected;
36     QLinearGradient m_gradientUnselected;
37
38     GraphDataProvider* m_data;
39 };
40
41 #endif