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
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:36
QwtPlotLegendItem
A class which draws a legend inside the plot canvas.
Definition: qwt_plot_legenditem.h:41
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:78
PlotLegend::draw
virtual void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &rect) const override
Definition: plotlegend.cpp:50
PlotLegend::PlotLegend
PlotLegend(QwtPlot *parent)
Definition: plotlegend.cpp:17
qwt_plot_legenditem.h
PlotLegend
Definition: plotlegend.h:14
PlotLegend::processMousePressEvent
const QwtPlotItem * processMousePressEvent(QMouseEvent *mouse_event)
Definition: plotlegend.cpp:142
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:66
PlotLegend::_collapsed
bool _collapsed
Definition: plotlegend.h:34
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
PlotLegend::_parent_plot
QwtPlot * _parent_plot
Definition: plotlegend.h:33
PlotLegend::drawBackground
virtual void drawBackground(QPainter *painter, const QRectF &rect) const override
Definition: plotlegend.cpp:127
PlotLegend::drawLegendData
virtual void drawLegendData(QPainter *painter, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const override
Definition: plotlegend.cpp:80
PlotLegend::hideButtonRect
QRectF hideButtonRect() const
Definition: plotlegend.cpp:39
qwt_plot.h


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45