15 #include <qwindowdefs.h> 21 #include <qpaintdevice.h> 24 #include <qtextdocument.h> 25 #include <qabstracttextdocumentlayout.h> 26 #include <qstyleoption.h> 27 #include <qpaintengine.h> 28 #include <qapplication.h> 29 #include <qdesktopwidget.h> 31 #if QT_VERSION >= 0x050000 35 #if QT_VERSION < 0x050000 38 #include <qx11info_x11.h> 49 static int isBuggy = -1;
55 QImage image( 2, 3, QImage::Format_ARGB32 );
64 QPainter painter( &image );
65 painter.drawPolyline( p );
68 isBuggy = ( image.pixel( 1, 1 ) == 0 ) ? 1 : 0;
74 #if QT_VERSION < 0x040800 76 #elif QT_VERSION < 0x050000 78 #elif QT_VERSION < 0x050100 80 #elif QT_VERSION < 0x050400 88 const QPainter *painter, QRectF &clipRect )
90 bool doClipping =
false;
91 const QPaintEngine *pe = painter->paintEngine();
92 if ( pe && pe->type() == QPaintEngine::SVG )
96 if ( painter->hasClipping() )
99 clipRect = painter->clipRegion().boundingRect();
108 const T *points,
int pointCount,
bool polylineSplitting )
110 bool doSplit =
false;
111 if ( polylineSplitting && pointCount > 3 )
113 const QPaintEngine *pe = painter->paintEngine();
114 if ( pe && pe->type() == QPaintEngine::Raster )
116 if ( painter->pen().width() <= 1 )
118 #if QT_VERSION < 0x040800 119 if ( painter->renderHints() & QPainter::Antialiasing )
148 QPen pen = painter->pen();
150 const int splitSize = 6;
153 && !( painter->renderHints() & QPainter::Antialiasing ) )
157 for (
int i = k + 1;
i < pointCount;
i++ )
159 const QPointF &p1 = points[
i-1];
160 const QPointF &p2 = points[
i];
162 const bool isBad = ( qAbs( p2.y() - p1.y() ) <= 1 )
163 && qAbs( p2.x() - p1.x() ) <= 1;
165 if ( isBad || (
i - k >= splitSize ) )
167 painter->drawPolyline( points + k,
i - k + 1 );
172 painter->drawPolyline( points + k, pointCount - k );
176 for (
int i = 0;
i < pointCount;
i += splitSize )
178 const int n = qMin( splitSize + 1, pointCount -
i );
179 painter->drawPolyline( points +
i, n );
185 painter->drawPolyline( points, pointCount );
191 static QSize screenResolution;
192 if ( !screenResolution.isValid() )
194 QDesktopWidget *desktop = QApplication::desktop();
197 screenResolution.setWidth( desktop->logicalDpiX() );
198 screenResolution.setHeight( desktop->logicalDpiY() );
202 return screenResolution;
207 if ( painter->font().pixelSize() >= 0 )
212 const QPaintDevice *pd = painter->device();
213 if ( pd->logicalDpiX() != screenResolution.width() ||
214 pd->logicalDpiY() != screenResolution.height() )
216 QFont pixelFont( painter->font(), QApplication::desktop() );
217 pixelFont.setPixelSize( QFontInfo( pixelFont ).pixelSize() );
219 painter->setFont( pixelFont );
232 #if QT_VERSION < 0x050000 233 static int onX11 = -1;
237 QPainter painter( &pm );
239 onX11 = ( painter.paintEngine()->type() == QPaintEngine::X11 ) ? 1 : 0;
266 if ( painter && painter->isActive() )
268 switch ( painter->paintEngine()->type() )
270 case QPaintEngine::Pdf:
271 case QPaintEngine::SVG:
277 const QTransform tr = painter->transform();
278 if ( tr.isRotating() || tr.isScaling() )
327 painter->drawPath( path );
333 drawRect( painter, QRectF( x, y, w, h ) );
339 const QRectF r = rect;
344 if ( deviceClipping )
346 if ( !clipRect.intersects( r ) )
349 if ( !clipRect.contains( r ) )
351 fillRect( painter, r & clipRect, painter->brush() );
354 painter->setBrush( Qt::NoBrush );
362 painter->drawRect( r );
367 const QRectF &rect,
const QBrush &brush )
369 if ( !rect.isValid() )
381 if ( deviceClipping )
382 clipRect &= painter->window();
384 clipRect = painter->window();
386 if ( painter->hasClipping() )
387 clipRect &= painter->clipRegion().boundingRect();
390 if ( deviceClipping )
391 r = r.intersected( clipRect );
394 painter->fillRect( r, brush );
403 if ( deviceClipping && !clipRect.contains( rect ) )
406 painter->drawPie( rect, a, alen );
415 if ( deviceClipping && !clipRect.contains( rect ) )
418 painter->drawEllipse( rect );
423 const QString &text )
425 drawText( painter, QPointF( x, y ), text );
430 const QString &text )
435 if ( deviceClipping && !clipRect.contains( pos ) )
441 painter->drawText( pos, text );
447 double x,
double y,
double w,
double h,
448 int flags,
const QString &text )
450 drawText( painter, QRectF( x, y, w, h ), flags, text );
455 int flags,
const QString &text )
459 painter->drawText( rect, flags, text );
463 #ifndef QT_NO_RICHTEXT 474 int flags,
const QTextDocument &text )
476 QTextDocument *txt = text.clone();
480 QRectF unscaledRect = rect;
482 if ( painter->font().pixelSize() < 0 )
486 const QPaintDevice *pd = painter->device();
487 if ( pd->logicalDpiX() != res.width() ||
488 pd->logicalDpiY() != res.height() )
490 QTransform transform;
491 transform.scale( res.width() / double( pd->logicalDpiX() ),
492 res.height() / double( pd->logicalDpiY() ));
494 painter->setWorldTransform( transform,
true );
495 unscaledRect = transform.inverted().mapRect(rect);
499 txt->setDefaultFont( painter->font() );
500 txt->setPageSize( QSizeF( unscaledRect.width(), QWIDGETSIZE_MAX ) );
502 QAbstractTextDocumentLayout* layout = txt->documentLayout();
504 const double height = layout->documentSize().height();
505 double y = unscaledRect.y();
506 if ( flags & Qt::AlignBottom )
507 y += ( unscaledRect.height() - height );
508 else if ( flags & Qt::AlignVCenter )
509 y += ( unscaledRect.height() - height ) / 2;
511 QAbstractTextDocumentLayout::PaintContext context;
512 context.palette.setColor( QPalette::Text, painter->pen().color() );
514 painter->translate( unscaledRect.x(), y );
515 layout->draw( painter, context );
521 #endif // !QT_NO_RICHTEXT 526 const QPointF &p1,
const QPointF &p2 )
531 if ( deviceClipping &&
532 !( clipRect.contains( p1 ) && clipRect.contains( p2 ) ) )
541 painter->drawLine( p1, p2 );
550 if ( deviceClipping )
552 painter->drawPolygon(
557 painter->drawPolygon( polygon );
567 if ( deviceClipping )
571 qwtDrawPolyline<QPointF>( painter,
576 qwtDrawPolyline<QPointF>( painter,
583 const QPointF *points,
int pointCount )
588 if ( deviceClipping )
590 QPolygonF polygon( pointCount );
591 ::memcpy( polygon.data(), points, pointCount *
sizeof( QPointF ) );
594 qwtDrawPolyline<QPointF>( painter,
609 if ( deviceClipping )
611 painter->drawPolygon(
616 painter->drawPolygon( polygon );
626 if ( deviceClipping )
630 qwtDrawPolyline<QPoint>( painter,
635 qwtDrawPolyline<QPoint>( painter,
642 const QPoint *points,
int pointCount )
647 if ( deviceClipping )
649 QPolygon polygon( pointCount );
650 ::memcpy( polygon.data(), points, pointCount *
sizeof( QPoint ) );
653 qwtDrawPolyline<QPoint>( painter,
668 if ( deviceClipping && !clipRect.contains( pos ) )
671 painter->drawPoint( pos );
680 if ( deviceClipping )
682 const int minX = qCeil( clipRect.left() );
683 const int maxX = qFloor( clipRect.right() );
684 const int minY = qCeil( clipRect.top() );
685 const int maxY = qFloor( clipRect.bottom() );
687 if ( pos.x() < minX || pos.x() > maxX
688 || pos.y() < minY || pos.y() > maxY )
694 painter->drawPoint( pos );
699 const QPoint *points,
int pointCount )
704 if ( deviceClipping )
706 const int minX = qCeil( clipRect.left() );
707 const int maxX = qFloor( clipRect.right() );
708 const int minY = qCeil( clipRect.top() );
709 const int maxY = qFloor( clipRect.bottom() );
711 const QRect r( minX, minY, maxX - minX, maxY - minY );
713 QPolygon clippedPolygon( pointCount );
714 QPoint *clippedData = clippedPolygon.data();
716 int numClippedPoints = 0;
717 for (
int i = 0;
i < pointCount;
i++ )
719 if ( r.contains( points[
i] ) )
720 clippedData[ numClippedPoints++ ] = points[i];
722 painter->drawPoints( clippedData, numClippedPoints );
726 painter->drawPoints( points, pointCount );
732 const QPointF *points,
int pointCount )
737 if ( deviceClipping )
739 QPolygonF clippedPolygon( pointCount );
740 QPointF *clippedData = clippedPolygon.data();
742 int numClippedPoints = 0;
743 for (
int i = 0;
i < pointCount;
i++ )
745 if ( clipRect.contains( points[
i] ) )
746 clippedData[ numClippedPoints++ ] = points[i];
748 painter->drawPoints( clippedData, numClippedPoints );
752 painter->drawPoints( points, pointCount );
758 const QRectF &rect,
const QImage &image )
760 const QRect alignedRect = rect.toAlignedRect();
762 if ( alignedRect != rect )
764 const QRectF clipRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
767 painter->setClipRect( clipRect, Qt::IntersectClip );
768 painter->drawImage( alignedRect, image );
773 painter->drawImage( alignedRect, image );
779 const QRectF &rect,
const QPixmap &pixmap )
781 const QRect alignedRect = rect.toAlignedRect();
783 if ( alignedRect != rect )
785 const QRectF clipRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
788 painter->setClipRect( clipRect, Qt::IntersectClip );
789 painter->drawPixmap( alignedRect, pixmap );
794 painter->drawPixmap( alignedRect, pixmap );
808 QStyleOptionFocusRect opt;
811 opt.state |= QStyle::State_HasFocus;
812 opt.backgroundColor = widget->palette().color( widget->backgroundRole() );
814 widget->style()->drawPrimitive(
815 QStyle::PE_FrameFocusRect, &opt, painter, widget );
830 const QRectF &rect,
const QPalette &palette,
831 int lineWidth,
int frameStyle )
841 if ( (frameStyle & QFrame::Sunken) == QFrame::Sunken )
843 else if ( (frameStyle & QFrame::Raised) == QFrame::Raised )
846 const double lw2 = 0.5 * lineWidth;
847 QRectF r = rect.adjusted( lw2, lw2, -lw2, -lw2 );
851 if ( style != Plain )
853 QColor c1 = palette.color( QPalette::Light );
854 QColor c2 = palette.color( QPalette::Dark );
856 if ( style == Sunken )
859 QLinearGradient gradient( r.topLeft(), r.bottomRight() );
860 gradient.setColorAt( 0.0, c1 );
862 gradient.setColorAt( 0.3, c1 );
863 gradient.setColorAt( 0.7, c2 );
865 gradient.setColorAt( 1.0, c2 );
867 brush = QBrush( gradient );
871 brush = palette.brush( QPalette::WindowText );
876 painter->setPen( QPen( brush, lineWidth ) );
877 painter->setBrush( Qt::NoBrush );
879 painter->drawEllipse( r );
896 const QPalette &palette, QPalette::ColorRole foregroundRole,
897 int frameWidth,
int midLineWidth,
int frameStyle )
899 if ( frameWidth <= 0 || rect.isEmpty() )
902 const int shadow = frameStyle & QFrame::Shadow_Mask;
906 if ( shadow == QFrame::Plain )
908 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
909 const QRectF innerRect = outerRect.adjusted(
910 frameWidth, frameWidth, -frameWidth, -frameWidth );
913 path.addRect( outerRect );
914 path.addRect( innerRect );
916 painter->setPen( Qt::NoPen );
917 painter->setBrush( palette.color( foregroundRole ) );
919 painter->drawPath( path );
923 const int shape = frameStyle & QFrame::Shape_Mask;
925 if ( shape == QFrame::Box )
927 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
928 const QRectF midRect1 = outerRect.adjusted(
929 frameWidth, frameWidth, -frameWidth, -frameWidth );
930 const QRectF midRect2 = midRect1.adjusted(
931 midLineWidth, midLineWidth, -midLineWidth, -midLineWidth );
933 const QRectF innerRect = midRect2.adjusted(
934 frameWidth, frameWidth, -frameWidth, -frameWidth );
937 path1.moveTo( outerRect.bottomLeft() );
938 path1.lineTo( outerRect.topLeft() );
939 path1.lineTo( outerRect.topRight() );
940 path1.lineTo( midRect1.topRight() );
941 path1.lineTo( midRect1.topLeft() );
942 path1.lineTo( midRect1.bottomLeft() );
945 path2.moveTo( outerRect.bottomLeft() );
946 path2.lineTo( outerRect.bottomRight() );
947 path2.lineTo( outerRect.topRight() );
948 path2.lineTo( midRect1.topRight() );
949 path2.lineTo( midRect1.bottomRight() );
950 path2.lineTo( midRect1.bottomLeft() );
953 path3.moveTo( midRect2.bottomLeft() );
954 path3.lineTo( midRect2.topLeft() );
955 path3.lineTo( midRect2.topRight() );
956 path3.lineTo( innerRect.topRight() );
957 path3.lineTo( innerRect.topLeft() );
958 path3.lineTo( innerRect.bottomLeft() );
961 path4.moveTo( midRect2.bottomLeft() );
962 path4.lineTo( midRect2.bottomRight() );
963 path4.lineTo( midRect2.topRight() );
964 path4.lineTo( innerRect.topRight() );
965 path4.lineTo( innerRect.bottomRight() );
966 path4.lineTo( innerRect.bottomLeft() );
969 path5.addRect( midRect1 );
970 path5.addRect( midRect2 );
972 painter->setPen( Qt::NoPen );
974 QBrush brush1 = palette.dark().color();
975 QBrush brush2 = palette.light().color();
977 if ( shadow == QFrame::Raised )
978 qSwap( brush1, brush2 );
980 painter->setBrush( brush1 );
981 painter->drawPath( path1 );
982 painter->drawPath( path4 );
984 painter->setBrush( brush2 );
985 painter->drawPath( path2 );
986 painter->drawPath( path3 );
988 painter->setBrush( palette.mid() );
989 painter->drawPath( path5 );
996 else if ( shape == QFrame::WinPanel )
998 painter->setRenderHint( QPainter::NonCosmeticDefaultPen,
true );
999 qDrawWinPanel ( painter, rect.toRect(), palette,
1000 frameStyle & QFrame::Sunken );
1002 else if ( shape == QFrame::StyledPanel )
1008 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
1009 const QRectF innerRect = outerRect.adjusted(
1010 frameWidth - 1.0, frameWidth - 1.0,
1011 -( frameWidth - 1.0 ), -( frameWidth - 1.0 ) );
1014 path1.moveTo( outerRect.bottomLeft() );
1015 path1.lineTo( outerRect.topLeft() );
1016 path1.lineTo( outerRect.topRight() );
1017 path1.lineTo( innerRect.topRight() );
1018 path1.lineTo( innerRect.topLeft() );
1019 path1.lineTo( innerRect.bottomLeft() );
1023 path2.moveTo( outerRect.bottomLeft() );
1024 path2.lineTo( outerRect.bottomRight() );
1025 path2.lineTo( outerRect.topRight() );
1026 path2.lineTo( innerRect.topRight() );
1027 path2.lineTo( innerRect.bottomRight() );
1028 path2.lineTo( innerRect.bottomLeft() );
1030 painter->setPen( Qt::NoPen );
1032 QBrush brush1 = palette.dark().color();
1033 QBrush brush2 = palette.light().color();
1035 if ( shadow == QFrame::Raised )
1036 qSwap( brush1, brush2 );
1038 painter->setBrush( brush1 );
1039 painter->drawPath( path1 );
1041 painter->setBrush( brush2 );
1042 painter->drawPath( path2 );
1065 const QRectF &rect,
double xRadius,
double yRadius,
1066 const QPalette &palette,
int lineWidth,
int frameStyle )
1069 painter->setRenderHint( QPainter::Antialiasing,
true );
1070 painter->setBrush( Qt::NoBrush );
1072 double lw2 = lineWidth * 0.5;
1073 QRectF r = rect.adjusted( lw2, lw2, -lw2, -lw2 );
1076 path.addRoundedRect( r, xRadius, yRadius );
1085 Style style = Plain;
1086 if ( (frameStyle & QFrame::Sunken) == QFrame::Sunken )
1088 else if ( (frameStyle & QFrame::Raised) == QFrame::Raised )
1091 if ( style != Plain && path.elementCount() == 17 )
1094 QPainterPath pathList[8];
1096 for (
int i = 0;
i < 4;
i++ )
1098 const int j =
i * 4 + 1;
1100 pathList[ 2 *
i ].moveTo(
1101 path.elementAt(j - 1).x, path.elementAt( j - 1 ).y
1104 pathList[ 2 *
i ].cubicTo(
1105 path.elementAt(j + 0).x, path.elementAt(j + 0).y,
1106 path.elementAt(j + 1).x, path.elementAt(j + 1).y,
1107 path.elementAt(j + 2).x, path.elementAt(j + 2).y );
1109 pathList[ 2 *
i + 1 ].moveTo(
1110 path.elementAt(j + 2).x, path.elementAt(j + 2).y
1112 pathList[ 2 *
i + 1 ].lineTo(
1113 path.elementAt(j + 3).x, path.elementAt(j + 3).y
1117 QColor c1( palette.color( QPalette::Dark ) );
1118 QColor c2( palette.color( QPalette::Light ) );
1120 if ( style == Raised )
1123 for (
int i = 0;
i < 4;
i++ )
1125 QRectF r = pathList[2 *
i].controlPointRect();
1128 arcPen.setCapStyle( Qt::FlatCap );
1129 arcPen.setWidth( lineWidth );
1132 linePen.setCapStyle( Qt::FlatCap );
1133 linePen.setWidth( lineWidth );
1139 arcPen.setColor( c1 );
1140 linePen.setColor( c1 );
1145 QLinearGradient gradient;
1146 gradient.setStart( r.topLeft() );
1147 gradient.setFinalStop( r.bottomRight() );
1148 gradient.setColorAt( 0.0, c1 );
1149 gradient.setColorAt( 1.0, c2 );
1151 arcPen.setBrush( gradient );
1152 linePen.setColor( c2 );
1157 arcPen.setColor( c2 );
1158 linePen.setColor( c2 );
1163 QLinearGradient gradient;
1165 gradient.setStart( r.bottomRight() );
1166 gradient.setFinalStop( r.topLeft() );
1167 gradient.setColorAt( 0.0, c2 );
1168 gradient.setColorAt( 1.0, c1 );
1170 arcPen.setBrush( gradient );
1171 linePen.setColor( c1 );
1177 painter->setPen( arcPen );
1178 painter->drawPath( pathList[ 2 *
i] );
1180 painter->setPen( linePen );
1181 painter->drawPath( pathList[ 2 * i + 1] );
1186 QPen pen( palette.color( QPalette::WindowText ), lineWidth );
1187 painter->setPen( pen );
1188 painter->drawPath( path );
1206 const QwtScaleMap &scaleMap, Qt::Orientation orientation,
1207 const QRectF &rect )
1209 QVector<QRgb> colorTable;
1215 const QRect devRect = rect.toAlignedRect();
1222 QPixmap pixmap( devRect.size() );
1223 pixmap.fill( Qt::transparent );
1225 QPainter pmPainter( &pixmap );
1226 pmPainter.translate( -devRect.x(), -devRect.y() );
1228 if ( orientation == Qt::Horizontal )
1233 for (
int x = devRect.left();
x <= devRect.right();
x++ )
1238 c.setRgba( colorMap.
rgb( interval, value ) );
1240 c = colorTable[colorMap.
colorIndex( 256, interval, value )];
1242 pmPainter.setPen( c );
1243 pmPainter.drawLine(
x, devRect.top(),
x, devRect.bottom() );
1251 for (
int y = devRect.top();
y <= devRect.bottom();
y++ )
1256 c.setRgba( colorMap.
rgb( interval, value ) );
1258 c = colorTable[colorMap.
colorIndex( 256, interval, value )];
1260 pmPainter.setPen( c );
1261 pmPainter.drawLine( devRect.left(),
y, devRect.right(),
y );
1269 static inline void qwtFillRect(
const QWidget *widget, QPainter *painter,
1270 const QRect &rect,
const QBrush &brush)
1272 if ( brush.style() == Qt::TexturePattern )
1276 painter->setClipRect( rect );
1277 painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
1281 else if ( brush.gradient() )
1285 painter->setClipRect( rect );
1286 painter->fillRect(0, 0, widget->width(),
1287 widget->height(), brush);
1293 painter->fillRect(rect, brush);
1311 QPixmap &pixmap,
const QPoint &offset )
1313 const QRect rect( offset, pixmap.size() );
1315 QPainter painter( &pixmap );
1316 painter.translate( -offset );
1318 const QBrush autoFillBrush =
1319 widget->palette().brush( widget->backgroundRole() );
1321 if ( !( widget->autoFillBackground() && autoFillBrush.isOpaque() ) )
1323 const QBrush bg = widget->palette().brush( QPalette::Window );
1327 if ( widget->autoFillBackground() )
1328 qwtFillRect( widget, &painter, rect, autoFillBrush);
1330 if ( widget->testAttribute(Qt::WA_StyledBackground) )
1332 painter.setClipRegion( rect );
1335 opt.initFrom( widget );
1336 widget->style()->drawPrimitive( QStyle::PE_Widget,
1337 &opt, &painter, widget );
1351 const QRectF &rect,
const QWidget *widget )
1353 if ( widget->testAttribute( Qt::WA_StyledBackground ) )
1356 opt.initFrom( widget );
1357 opt.rect = rect.toAlignedRect();
1359 widget->style()->drawPrimitive(
1360 QStyle::PE_Widget, &opt, painter, widget);
1364 const QBrush brush =
1365 widget->palette().brush( widget->backgroundRole() );
1367 painter->fillRect( rect, brush );
1377 qreal pixelRatio = 0.0;
1379 #if QT_VERSION >= 0x050100 1382 #if QT_VERSION >= 0x050600 1383 pixelRatio = paintDevice->devicePixelRatioF();
1385 pixelRatio = paintDevice->devicePixelRatio();
1389 Q_UNUSED( paintDevice )
1392 #if QT_VERSION >= 0x050000 1393 if ( pixelRatio == 0.0 && qApp )
1394 pixelRatio = qApp->devicePixelRatio();
1397 if ( pixelRatio == 0.0 )
1413 #if QT_VERSION >= 0x050000 1416 pm = QPixmap( size * pixelRatio );
1417 pm.setDevicePixelRatio( pixelRatio );
1419 pm = QPixmap( size );
1425 if ( pm.x11Info().screen() != widget->x11Info().screen() )
1426 pm.x11SetScreen( widget->x11Info().screen() );
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
static void drawLine(QPainter *, double x1, double y1, double x2, double y2)
Wrapper for QPainter::drawLine()
static void drawImage(QPainter *, const QRectF &, const QImage &)
Wrapper for QPainter::drawImage()
static void fillRect(QPainter *, const QRectF &, const QBrush &)
Wrapper for QPainter::fillRect()
static void drawFocusRect(QPainter *, const QWidget *)
Draw a focus rectangle on a widget using its style.
virtual QVector< QRgb > colorTable256() const
A class representing an interval.
static void drawPoints(QPainter *, const QPolygon &)
Wrapper for QPainter::drawPoints()
static void setRoundingAlignment(bool)
static void drawText(QPainter *, double x, double y, const QString &)
Wrapper for QPainter::drawText()
static void drawRoundFrame(QPainter *, const QRectF &, const QPalette &, int lineWidth, int frameStyle)
static void drawPixmap(QPainter *, const QRectF &, const QPixmap &)
Wrapper for QPainter::drawPixmap()
static bool isX11GraphicsSystem()
static void drawSimpleRichText(QPainter *, const QRectF &, int flags, const QTextDocument &)
static void drawBackgound(QPainter *painter, const QRectF &rect, const QWidget *widget)
static void drawPath(QPainter *, const QPainterPath &)
Wrapper for QPainter::drawPath()
TFSIMD_FORCE_INLINE const tfScalar & y() const
static QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
static void setPolylineSplitting(bool)
En/Disable line splitting for the raster paint engine.
static QPolygon clippedPolygon(const QRect &, const QPolygon &, bool closePolygon=false)
virtual uint colorIndex(int numColors, const QwtInterval &interval, double value) const
Map a value of a given interval into a color index.
static void drawRoundedFrame(QPainter *, const QRectF &, double xRadius, double yRadius, const QPalette &, int lineWidth, int frameStyle)
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
static bool qwtIsClippingNeeded(const QPainter *painter, QRectF &clipRect)
GraphId path[kMaxDeadlockPathLen]
static void drawRect(QPainter *, double x, double y, double w, double h)
Wrapper for QPainter::drawRect()
static qreal devicePixelRatio(const QPaintDevice *)
static void clipPolygonF(const QRectF &, QPolygonF &, bool closePolygon=false)
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
static QSize qwtScreenResolution()
static void drawFrame(QPainter *, const QRectF &rect, const QPalette &palette, QPalette::ColorRole foregroundRole, int lineWidth, int midLineWidth, int frameStyle)
QwtColorMap is used to map values into colors.
TFSIMD_FORCE_INLINE const tfScalar & x() const
static bool qwtIsRasterPaintEngineBuggy()
double invTransform(double p) const
The map is intended to map into RGB values.
static void drawEllipse(QPainter *, const QRectF &)
Wrapper for QPainter::drawEllipse()
static void qwtFillRect(const QWidget *widget, QPainter *painter, const QRect &rect, const QBrush &brush)
static bool d_roundingAlignment
static void drawPolyline(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolyline()
static void qwtDrawPolyline(QPainter *painter, const T *points, int pointCount, bool polylineSplitting)
virtual QRgb rgb(const QwtInterval &interval, double value) const =0
static void qwtUnscaleFont(QPainter *painter)
static void drawColorBar(QPainter *painter, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
static void drawPie(QPainter *, const QRectF &r, int a, int alen)
Wrapper for QPainter::drawPie()
static bool isAligning(QPainter *painter)
static void drawPoint(QPainter *, const QPoint &)
Wrapper for QPainter::drawPoint()
static bool d_polylineSplitting
static void clipPolygon(const QRect &, QPolygon &, bool closePolygon=false)
static QPixmap backingStore(QWidget *, const QSize &)