10#include "qwt_plot_graphicitem.h"
11#include "qwt_scale_map.h"
12#include "qwt_painter.h"
14#include "qwt_graphic.h"
16class QwtPlotGraphicItem::PrivateData
59void QwtPlotGraphicItem::init()
61 m_data =
new PrivateData();
83 const QRectF& rect,
const QwtGraphic& graphic )
85 m_data->boundingRect = rect;
98 return m_data->graphic;
104 return m_data->boundingRect;
117 const QRectF& canvasRect )
const
119 if ( m_data->graphic.
isEmpty() )
124 if ( !r.intersects( canvasRect ) )
129 r.setLeft ( qRound( r.left() ) );
130 r.setRight ( qRound( r.right() ) );
131 r.setTop ( qRound( r.top() ) );
132 r.setBottom ( qRound( r.bottom() ) );
135 m_data->graphic.
render( painter, r );
A paint device for scalable graphics.
void render(QPainter *) const
Replay all recorded painter commands.
static bool roundingAlignment()
void setGraphic(const QRectF &rect, const QwtGraphic &)
virtual ~QwtPlotGraphicItem()
Destructor.
QwtGraphic graphic() const
virtual QRectF boundingRect() const override
Bounding rectangle of the item.
QwtPlotGraphicItem(const QString &title=QString())
Constructor.
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override
virtual int rtti() const override
Base class for items on the plot canvas.
virtual void legendChanged()
void setZ(double z)
Set the z value.
void setItemAttribute(ItemAttribute, bool on=true)
@ Rtti_PlotGraphic
For QwtPlotGraphicItem, QwtPlotSvgItem.
virtual void itemChanged()
@ Legend
The item is represented on the legend.
virtual QRectF boundingRect() const
double transform(double s) const
A class representing a text.