17 #include <qapplication.h> 21 QPainter *painter,
const QRect &canvasRect,
31 painter->setRenderHint( QPainter::Antialiasing,
33 seriesItem->
drawSeries( painter, xMap, yMap, canvasRect, from, to );
176 if ( seriesItem == NULL || seriesItem->
plot() == NULL )
179 QWidget *canvas = seriesItem->
plot()->
canvas();
180 const QRect canvasRect = canvas->contentsRect();
186 QPainter painter( const_cast<QPixmap *>( plotCanvas->
backingStore() ) );
197 plotCanvas->repaint();
202 bool immediatePaint =
true;
203 if ( !canvas->testAttribute( Qt::WA_WState_InPaintEvent ) )
205 #if QT_VERSION < 0x050000 206 if ( !canvas->testAttribute( Qt::WA_PaintOutsidePaintEvent ) )
208 immediatePaint =
false;
211 if ( immediatePaint )
218 canvas->installEventFilter(
this );
256 canvas->installEventFilter(
this );
257 canvas->repaint(clipRegion);
258 canvas->removeEventFilter(
this );
271 w->removeEventFilter(
this );
280 if ( event->type() == QEvent::Paint )
286 const QPaintEvent *pe =
static_cast< QPaintEvent *
>( event );
290 QPainter painter( canvas );
291 painter.setClipRegion( pe->region() );
304 painter.drawPixmap( plotCanvas->rect().topLeft(),
static void qwtRenderItem(QPainter *painter, const QRect &canvasRect, QwtPlotSeriesItem *seriesItem, int from, int to)
Attribute
Paint attributes.
int xAxis() const
Return xAxis.
void drawSeries(QwtPlotSeriesItem *, int from, int to)
Draw a set of points of a seriesItem.
bool testAttribute(Attribute) const
QwtPlot * plot() const
Return attached plot.
QwtPlotDirectPainter::Attributes attributes
bool testPaintAttribute(PaintAttribute) const
virtual ~QwtPlotDirectPainter()
Destructor.
void setAttribute(Attribute, bool on)
QwtPlotSeriesItem * seriesItem
const QPixmap * backingStore() const
void reset()
Close the internal QPainter.
bool testRenderHint(RenderHint) const
virtual bool eventFilter(QObject *, QEvent *)
Event filter.
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0
virtual QwtScaleMap canvasMap(int axisId) const
int yAxis() const
Return yAxis.
QRegion clipRegion() const
TFSIMD_FORCE_INLINE const tfScalar & w() const
QFlags< Attribute > Attributes
Paint attributes.
void setClipRegion(const QRegion &)
Assign a clip region and enable clipping.
QwtPlotDirectPainter(QObject *parent=NULL)
Constructor.
static bool qwtHasBackingStore(const QwtPlotCanvas *canvas)
Base class for plot items representing a series of samples.
Paint double buffered reusing the content of the pixmap buffer when possible.