plotlegend.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef PLOTLEGEND_H
8 #define PLOTLEGEND_H
9 
10 #include <QObject>
11 #include "qwt_plot_legenditem.h"
12 #include "qwt_plot.h"
13 
14 class PlotLegend : public QObject, public QwtPlotLegendItem
15 {
16  Q_OBJECT
17 public:
18  PlotLegend(QwtPlot* parent);
19 
20  QRectF hideButtonRect() const;
21 
22  const QwtPlotItem* processMousePressEvent(QMouseEvent* mouse_event);
23 
24 private:
25  virtual void draw(QPainter* p, const QwtScaleMap& xMap, const QwtScaleMap& yMap,
26  const QRectF& rect) const override;
27 
28  virtual void drawLegendData(QPainter* painter, const QwtPlotItem*, const QwtLegendData&,
29  const QRectF&) const override;
30 
31  virtual void drawBackground(QPainter* painter, const QRectF& rect) const override;
32 
34  bool _collapsed;
35 };
36 
37 #endif // PLOTLEGEND_H
bool _collapsed
Definition: plotlegend.h:34
const QwtPlotItem * processMousePressEvent(QMouseEvent *mouse_event)
Definition: plotlegend.cpp:142
QwtPlot * _parent_plot
Definition: plotlegend.h:33
A class which draws a legend inside the plot canvas.
virtual void drawBackground(QPainter *painter, const QRectF &rect) const override
Definition: plotlegend.cpp:127
A 2-D plotting widget.
Definition: qwt_plot.h:78
virtual void drawLegendData(QPainter *painter, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const override
Definition: plotlegend.cpp:80
QRectF hideButtonRect() const
Definition: plotlegend.cpp:39
A scale map.
Definition: qwt_scale_map.h:26
PlotLegend(QwtPlot *parent)
Definition: plotlegend.cpp:17
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const override
Definition: plotlegend.cpp:50
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:66
Attributes of an entry on a legend.


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38