Painter object trying to paint incrementally. More...
#include <qwt_plot_directpainter.h>
Public Types | |
enum | Attribute { AtomicPainter = 1, FullRepaint = 2 } |
Public Member Functions | |
QwtPlotDirectPainter (QObject *parent=NULL) | |
virtual | ~QwtPlotDirectPainter () |
void | setAttribute (Attribute, bool on) |
bool | testAttribute (Attribute) const |
void | drawSeries (QwtPlotAbstractSeriesItem *, int from, int to) |
void | reset () |
virtual bool | eventFilter (QObject *, QEvent *) |
Painter object trying to paint incrementally.
Often applications want to display samples while they are collected. When there are too many samples complete replots will be expensive to be processed in a collection cycle.
QwtPlotDirectPainter offers an API to paint subsets ( f.e all additions points ) without erasing/repainting the plot canvas.
QwtPlotDirectPainter::QwtPlotDirectPainter | ( | QObject * | parent = NULL |
) |
Constructor.
QwtPlotDirectPainter::~QwtPlotDirectPainter | ( | ) | [virtual] |
Destructor.
void QwtPlotDirectPainter::drawSeries | ( | QwtPlotAbstractSeriesItem * | seriesItem, | |
int | from, | |||
int | to | |||
) |
Draw a set of points of a seriesItem.
When observing an measurement while it is running, new points have to be added to an existing seriesItem. drawSeries can be used to display them avoiding a complete redraw of the canvas.
Setting plot()->canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true); will result in faster painting, if the paint engine of the canvas widget supports this feature.
seriesItem | Item to be painted | |
from | Index of the first point to be painted | |
to | Index of the last point to be painted. If to < 0 the series will be painted to its last point. |
bool QwtPlotDirectPainter::eventFilter | ( | QObject * | , | |
QEvent * | event | |||
) | [virtual] |
Event filter.
void QwtPlotDirectPainter::reset | ( | ) |
Close the internal QPainter.
void QwtPlotDirectPainter::setAttribute | ( | Attribute | attribute, | |
bool | on | |||
) |
Change an attribute
attribute | Attribute to change | |
on | On/Off |
bool QwtPlotDirectPainter::testAttribute | ( | Attribute | attribute | ) | const |
Check if a attribute is set.
attribute | Attribute to be tested |