33 seriesItem->
drawSeries( painter, xMap, yMap, canvasRect, from, to );
175 if ( seriesItem == NULL || seriesItem->
plot() == NULL )
178 QWidget* canvas = seriesItem->
plot()->
canvas();
179 const QRect canvasRect = canvas->contentsRect();
181 QwtPlotCanvas* plotCanvas = qobject_cast< QwtPlotCanvas* >( canvas );
183 if ( plotCanvas && qwtHasBackingStore( plotCanvas ) )
185 QPainter painter(
const_cast< QPixmap*
>( plotCanvas->
backingStore() ) );
187 if ( m_data->hasClipping )
188 painter.setClipRegion( m_data->clipRegion );
190 qwtRenderItem( &painter, canvasRect, seriesItem, from, to );
196 plotCanvas->repaint();
201 bool immediatePaint =
true;
202 if ( !canvas->testAttribute( Qt::WA_WState_InPaintEvent ) )
204#if QT_VERSION < 0x050000
205 if ( !canvas->testAttribute( Qt::WA_PaintOutsidePaintEvent ) )
207 immediatePaint =
false;
210 if ( immediatePaint )
212 if ( !m_data->painter.isActive() )
216 m_data->painter.begin( canvas );
217 canvas->installEventFilter(
this );
220 if ( m_data->hasClipping )
222 m_data->painter.setClipRegion(
223 QRegion( canvasRect ) & m_data->clipRegion );
227 if ( !m_data->painter.hasClipping() )
228 m_data->painter.setClipRect( canvasRect );
231 qwtRenderItem( &m_data->painter, canvasRect, seriesItem, from, to );
239 if ( m_data->hasClipping )
240 m_data->painter.setClipping(
false );
247 m_data->seriesItem = seriesItem;
252 if ( m_data->hasClipping )
255 canvas->installEventFilter(
this );
257 canvas->removeEventFilter(
this );
259 m_data->seriesItem = NULL;
279 if ( event->type() == QEvent::Paint )
283 if ( m_data->seriesItem )
285 const QPaintEvent* pe =
static_cast< QPaintEvent*
>( event );
287 QWidget* canvas = m_data->seriesItem->
plot()->
canvas();
289 QPainter painter( canvas );
290 painter.setClipRegion( pe->region() );
297 qobject_cast< QwtPlotCanvas* >( canvas );
300 doCopyCache = qwtHasBackingStore( plotCanvas );
303 painter.drawPixmap( plotCanvas->rect().topLeft(),
311 qwtRenderItem( &painter, canvas->contentsRect(),
312 m_data->seriesItem, m_data->from, m_data->to );
virtual void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const =0