static inline void qwtDrawPolyline( QPainter *painter, const T *points, int pointCount, bool polylineSplitting ) { bool doSplit = false; if ( polylineSplitting && pointCount > 3 ) { const QPaintEngine *pe = painter->paintEngine(); if ( pe && pe->type() == QPaintEngine::Raster ) { if ( painter->pen().width() <= 1 ) { #if QT_VERSION < 0x040800 if ( painter->renderHints() & QPainter::Antialiasing ) { /* all versions <= 4.7 have issues with antialiased lines */ doSplit = true; } #else // all version < 4.8 don't have the bug for // short lines below 2 pixels difference // in height and width doSplit = qwtIsRasterPaintEngineBuggy(); #endif } else { /* Raster paint engine is much faster when splitting the polygon, but of course we might see some issues where the pieces are joining */ doSplit = true; } } } if ( doSplit ) { QPen pen = painter->pen(); const int splitSize = 6; if ( pen.width() <= 1 && pen.isSolid() && qwtIsRasterPaintEngineBuggy() && !( painter->renderHints() & QPainter::Antialiasing ) ) { int k = 0; for ( int i = k + 1; i < pointCount; i++ ) { const QPointF &p1 = points[i-1]; const QPointF &p2 = points[i]; const bool isBad = ( qAbs( p2.y() - p1.y() ) <= 1 ) && qAbs( p2.x() - p1.x() ) <= 1; if ( isBad || ( i - k >= splitSize ) ) { painter->drawPolyline( points + k, i - k + 1 ); k = i; } } painter->drawPolyline( points + k, pointCount - k ); } else { for ( int i = 0; i < pointCount; i += splitSize ) { const int n = qMin( splitSize + 1, pointCount - i ); painter->drawPolyline( points + i, n ); } } } else { painter->drawPolyline( points, pointCount ); } }