plotlegend.h
Go to the documentation of this file.
1 #ifndef PLOTLEGEND_H
2 #define PLOTLEGEND_H
3 
4 #include <QObject>
5 #include "qwt_plot_legenditem.h"
6 #include "qwt_plot.h"
7 
8 class PlotLegend : public QObject, public QwtPlotLegendItem
9 {
10  Q_OBJECT
11 public:
12  PlotLegend(QwtPlot* parent);
13 
14  QRectF hideButtonRect() const;
15 
16  const QwtPlotItem* processMousePressEvent(QMouseEvent* mouse_event);
17 
18 private:
19  virtual void draw(QPainter* p, const QwtScaleMap& xMap, const QwtScaleMap& yMap, const QRectF& rect) const override;
20 
21  virtual void drawLegendData(QPainter* painter, const QwtPlotItem*, const QwtLegendData&,
22  const QRectF&) const override;
23 
24  virtual void drawBackground(QPainter* painter, const QRectF& rect) const override;
25 
27  bool _collapsed;
28 
29 };
30 
31 #endif // PLOTLEGEND_H
bool _collapsed
Definition: plotlegend.h:27
const QwtPlotItem * processMousePressEvent(QMouseEvent *mouse_event)
Definition: plotlegend.cpp:133
QwtPlot * _parent_plot
Definition: plotlegend.h:26
A class which draws a legend inside the plot canvas.
virtual void drawBackground(QPainter *painter, const QRectF &rect) const override
Definition: plotlegend.cpp:118
A 2-D plotting widget.
Definition: qwt_plot.h:75
virtual void drawLegendData(QPainter *painter, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const override
Definition: plotlegend.cpp:71
A scale map.
Definition: qwt_scale_map.h:26
QRectF hideButtonRect() const
Definition: plotlegend.cpp:32
PlotLegend(QwtPlot *parent)
Definition: plotlegend.cpp:11
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const override
Definition: plotlegend.cpp:43
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:65
Attributes of an entry on a legend.


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10