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  _parent_plot(parent),
14  _collapsed(false)
15  {
16  this->attach(parent);
17  }
18 
19  QRectF hideButtonRect() const;
20 
21  bool processWheelEvent(QWheelEvent* ev);
22 
23  const QwtPlotItem *processMousePressEvent(QMouseEvent* mouse_event);
24 
25 private:
26 
27  virtual void draw( QPainter *p,
28  const QwtScaleMap &xMap, const QwtScaleMap &yMap,
29  const QRectF &rect ) const override;
30 
31  virtual void drawLegendData( QPainter *painter,
32  const QwtPlotItem *, const QwtLegendData &,
33  const QRectF & ) const override;
34 
36  bool _collapsed;
37 
38 signals:
39  void legendSizeChanged(int point_size);
40 };
41 
42 #endif // PLOTLEGEND_H
bool _collapsed
Definition: plotlegend.h:36
const QwtPlotItem * processMousePressEvent(QMouseEvent *mouse_event)
Definition: plotlegend.cpp:117
QwtPlot * _parent_plot
Definition: plotlegend.h:35
A class which draws a legend inside the plot canvas.
A 2-D plotting widget.
Definition: qwt_plot.h:74
virtual void drawLegendData(QPainter *painter, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const override
Definition: plotlegend.cpp:48
A scale map.
Definition: qwt_scale_map.h:30
QRectF hideButtonRect() const
Definition: plotlegend.cpp:7
void attach(QwtPlot *plot)
Attach the item to a plot.
PlotLegend(QwtPlot *parent)
Definition: plotlegend.h:12
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const override
Definition: plotlegend.cpp:17
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:64
bool processWheelEvent(QWheelEvent *ev)
Definition: plotlegend.cpp:94
Attributes of an entry on a legend.
void legendSizeChanged(int point_size)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17