21 #include <qpaintdevice.h> 22 #include <qpainterpath.h> 25 #include <qtextdocument.h> 26 #include <qabstracttextdocumentlayout.h> 27 #include <qstyleoption.h> 28 #include <qpaintengine.h> 29 #include <qapplication.h> 30 #include <qdesktopwidget.h> 32 #if QT_VERSION < 0x050000 35 #include <qx11info_x11.h> 48 static int isBuggy = -1;
54 QImage image( 2, 3, QImage::Format_ARGB32 );
63 QPainter painter( &image );
64 painter.drawPolyline( p );
67 isBuggy = ( image.pixel( 1, 1 ) == 0 ) ? 1 : 0;
73 #if QT_VERSION < 0x050000 75 #elif QT_VERSION < 0x050100 77 #elif QT_VERSION < 0x050400 85 const QPainter *painter, QRectF &clipRect )
87 bool doClipping =
false;
88 const QPaintEngine *pe = painter->paintEngine();
89 if ( pe && pe->type() == QPaintEngine::SVG )
93 if ( painter->hasClipping() )
96 clipRect = painter->clipRegion().boundingRect();
105 const T *points,
int pointCount,
bool polylineSplitting )
107 bool doSplit =
false;
108 if ( polylineSplitting && pointCount > 3 )
110 const QPaintEngine *pe = painter->paintEngine();
111 if ( pe && pe->type() == QPaintEngine::Raster )
113 if ( painter->pen().width() <= 1 )
134 QPen pen = painter->pen();
136 const int splitSize = 6;
139 && !( painter->renderHints() & QPainter::Antialiasing ) )
143 for (
int i = k + 1; i < pointCount; i++ )
145 const QPointF &p1 = points[i-1];
146 const QPointF &p2 = points[i];
148 const bool isBad = ( qAbs( p2.y() - p1.y() ) <= 1 )
149 && qAbs( p2.x() - p1.x() ) <= 1;
151 if ( isBad || ( i - k >= splitSize ) )
153 painter->drawPolyline( points + k, i - k + 1 );
158 painter->drawPolyline( points + k, pointCount - k );
162 for (
int i = 0; i < pointCount; i += splitSize )
164 const int n = qMin( splitSize + 1, pointCount - i );
165 painter->drawPolyline( points + i, n );
171 painter->drawPolyline( points, pointCount );
177 static QSize screenResolution;
178 if ( !screenResolution.isValid() )
180 QDesktopWidget *desktop = QApplication::desktop();
183 screenResolution.setWidth( desktop->logicalDpiX() );
184 screenResolution.setHeight( desktop->logicalDpiY() );
188 return screenResolution;
193 if ( painter->font().pixelSize() >= 0 )
198 const QPaintDevice *pd = painter->device();
199 if ( pd->logicalDpiX() != screenResolution.width() ||
200 pd->logicalDpiY() != screenResolution.height() )
202 QFont pixelFont( painter->font(), QApplication::desktop() );
203 pixelFont.setPixelSize( QFontInfo( pixelFont ).pixelSize() );
205 painter->setFont( pixelFont );
224 static int onX11 = -1;
228 QPainter painter( &pm );
230 onX11 = ( painter.paintEngine()->type() == QPaintEngine::X11 ) ? 1 : 0;
252 if ( painter && painter->isActive() )
255 painter->paintEngine()->type();
257 if ( type >= QPaintEngine::User )
265 case QPaintEngine::Pdf:
266 case QPaintEngine::SVG:
268 case QPaintEngine::MacPrinter:
276 const QTransform &tr = painter->transform();
277 if ( tr.isRotating() || tr.isScaling() )
326 painter->drawPath( path );
332 drawRect( painter, QRectF( x, y, w, h ) );
338 const QRectF r = rect;
343 if ( deviceClipping )
345 if ( !clipRect.intersects( r ) )
348 if ( !clipRect.contains( r ) )
350 fillRect( painter, r & clipRect, painter->brush() );
353 painter->setBrush( Qt::NoBrush );
361 painter->drawRect( r );
366 const QRectF &rect,
const QBrush &brush )
368 if ( !rect.isValid() )
380 if ( deviceClipping )
381 clipRect &= painter->window();
383 clipRect = painter->window();
385 if ( painter->hasClipping() )
386 clipRect &= painter->clipRegion().boundingRect();
389 if ( deviceClipping )
390 r = r.intersected( clipRect );
393 painter->fillRect( r, brush );
402 if ( deviceClipping && !clipRect.contains( rect ) )
405 painter->drawPie( rect, a, alen );
414 if ( deviceClipping && !clipRect.contains( rect ) )
417 painter->drawEllipse( rect );
422 qreal x, qreal y,
const QString &text )
424 drawText( painter, QPointF( x, y ), text );
429 const QString &text )
434 if ( deviceClipping && !clipRect.contains( pos ) )
440 painter->drawText( pos, text );
446 qreal x, qreal y, qreal w, qreal h,
447 int flags,
const QString &text )
449 drawText( painter, QRectF( x, y, w, h ), flags, text );
454 int flags,
const QString &text )
458 painter->drawText( rect, flags, text );
462 #ifndef QT_NO_RICHTEXT 473 int flags,
const QTextDocument &text )
475 QTextDocument *txt = text.clone();
479 QRectF unscaledRect = rect;
481 if ( painter->font().pixelSize() < 0 )
485 const QPaintDevice *pd = painter->device();
486 if ( pd->logicalDpiX() != res.width() ||
487 pd->logicalDpiY() != res.height() )
489 QTransform transform;
490 transform.scale( res.width() / qreal( pd->logicalDpiX() ),
491 res.height() / qreal( pd->logicalDpiY() ));
493 painter->setWorldTransform( transform,
true );
494 unscaledRect = transform.inverted().mapRect(rect);
498 txt->setDefaultFont( painter->font() );
499 txt->setPageSize( QSizeF( unscaledRect.width(), QWIDGETSIZE_MAX ) );
501 QAbstractTextDocumentLayout* layout = txt->documentLayout();
503 const qreal height = layout->documentSize().height();
504 qreal y = unscaledRect.y();
505 if ( flags & Qt::AlignBottom )
506 y += ( unscaledRect.height() - height );
507 else if ( flags & Qt::AlignVCenter )
508 y += ( unscaledRect.height() - height ) / 2;
510 QAbstractTextDocumentLayout::PaintContext
context;
511 context.palette.setColor( QPalette::Text, painter->pen().color() );
513 painter->translate( unscaledRect.x(), y );
514 layout->draw( painter, context );
520 #endif // !QT_NO_RICHTEXT 525 const QPointF &p1,
const QPointF &p2 )
530 if ( deviceClipping &&
531 !( clipRect.contains( p1 ) && clipRect.contains( p2 ) ) )
540 painter->drawLine( p1, p2 );
549 if ( deviceClipping )
551 painter->drawPolygon(
556 painter->drawPolygon( polygon );
566 if ( deviceClipping )
570 qwtDrawPolyline<QPointF>( painter,
575 qwtDrawPolyline<QPointF>( painter,
582 const QPointF *points,
int pointCount )
587 if ( deviceClipping )
589 QPolygonF polygon( pointCount );
590 std::memcpy( polygon.data(), points, pointCount *
sizeof( QPointF ) );
593 qwtDrawPolyline<QPointF>( painter,
608 if ( deviceClipping )
610 painter->drawPolygon(
615 painter->drawPolygon( polygon );
625 if ( deviceClipping )
629 qwtDrawPolyline<QPoint>( painter,
634 qwtDrawPolyline<QPoint>( painter,
641 const QPoint *points,
int pointCount )
646 if ( deviceClipping )
648 QPolygon polygon( pointCount );
649 std::memcpy( polygon.data(), points, pointCount *
sizeof( QPoint ) );
652 qwtDrawPolyline<QPoint>( painter,
667 if ( deviceClipping && !clipRect.contains( pos ) )
670 painter->drawPoint( pos );
679 if ( deviceClipping )
681 const int minX =
qwtCeil( clipRect.left() );
682 const int maxX =
qwtFloor( clipRect.right() );
683 const int minY =
qwtCeil( clipRect.top() );
684 const int maxY =
qwtFloor( clipRect.bottom() );
686 if ( pos.x() < minX || pos.x() > maxX
687 || pos.y() < minY || pos.y() > maxY )
693 painter->drawPoint( pos );
698 const QPoint *points,
int pointCount )
703 if ( deviceClipping )
705 const int minX =
qwtCeil( clipRect.left() );
706 const int maxX =
qwtFloor( clipRect.right() );
707 const int minY =
qwtCeil( clipRect.top() );
708 const int maxY =
qwtFloor( clipRect.bottom() );
710 const QRect r( minX, minY, maxX - minX, maxY - minY );
712 QPolygon clippedPolygon( pointCount );
713 QPoint *clippedData = clippedPolygon.data();
715 int numClippedPoints = 0;
716 for (
int i = 0; i < pointCount; i++ )
718 if ( r.contains( points[i] ) )
719 clippedData[ numClippedPoints++ ] = points[i];
721 painter->drawPoints( clippedData, numClippedPoints );
725 painter->drawPoints( points, pointCount );
731 const QPointF *points,
int pointCount )
736 if ( deviceClipping )
738 QPolygonF clippedPolygon( pointCount );
739 QPointF *clippedData = clippedPolygon.data();
741 int numClippedPoints = 0;
742 for (
int i = 0; i < pointCount; i++ )
744 if ( clipRect.contains( points[i] ) )
745 clippedData[ numClippedPoints++ ] = points[i];
747 painter->drawPoints( clippedData, numClippedPoints );
751 painter->drawPoints( points, pointCount );
757 const QRectF &rect,
const QImage &image )
759 const QRect alignedRect = rect.toAlignedRect();
761 if ( alignedRect != rect )
763 const QRectF clipRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
766 painter->setClipRect( clipRect, Qt::IntersectClip );
767 painter->drawImage( alignedRect, image );
772 painter->drawImage( alignedRect, image );
778 const QRectF &rect,
const QPixmap &pixmap )
780 const QRect alignedRect = rect.toAlignedRect();
782 if ( alignedRect != rect )
784 const QRectF clipRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
787 painter->setClipRect( clipRect, Qt::IntersectClip );
788 painter->drawPixmap( alignedRect, pixmap );
793 painter->drawPixmap( alignedRect, pixmap );
807 QStyleOptionFocusRect opt;
808 opt.initFrom( widget );
810 opt.state |= QStyle::State_HasFocus;
811 opt.backgroundColor = widget->palette().color( widget->backgroundRole() );
813 widget->style()->drawPrimitive(
814 QStyle::PE_FrameFocusRect, &opt, painter, widget );
829 const QRectF &rect,
const QPalette &palette,
830 int lineWidth,
int frameStyle )
840 if ( (frameStyle & QFrame::Sunken) == QFrame::Sunken )
842 else if ( (frameStyle & QFrame::Raised) == QFrame::Raised )
845 const qreal lw2 = 0.5 * lineWidth;
846 QRectF r = rect.adjusted( lw2, lw2, -lw2, -lw2 );
850 if ( style != Plain )
852 QColor c1 = palette.color( QPalette::Light );
853 QColor c2 = palette.color( QPalette::Dark );
855 if ( style == Sunken )
858 QLinearGradient gradient( r.topLeft(), r.bottomRight() );
859 gradient.setColorAt( 0.0, c1 );
861 gradient.setColorAt( 0.3, c1 );
862 gradient.setColorAt( 0.7, c2 );
864 gradient.setColorAt( 1.0, c2 );
866 brush = QBrush( gradient );
870 brush = palette.brush( QPalette::WindowText );
875 painter->setPen( QPen( brush, lineWidth ) );
876 painter->setBrush( Qt::NoBrush );
878 painter->drawEllipse( r );
895 const QPalette &palette, QPalette::ColorRole foregroundRole,
896 int frameWidth,
int midLineWidth,
int frameStyle )
898 if ( frameWidth <= 0 || rect.isEmpty() )
901 const int shadow = frameStyle & QFrame::Shadow_Mask;
905 if ( shadow == QFrame::Plain )
907 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
908 const QRectF innerRect = outerRect.adjusted(
909 frameWidth, frameWidth, -frameWidth, -frameWidth );
912 path.addRect( outerRect );
913 path.addRect( innerRect );
915 painter->setPen( Qt::NoPen );
916 painter->setBrush( palette.color( foregroundRole ) );
918 painter->drawPath( path );
922 const int shape = frameStyle & QFrame::Shape_Mask;
924 if ( shape == QFrame::Box )
926 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
927 const QRectF midRect1 = outerRect.adjusted(
928 frameWidth, frameWidth, -frameWidth, -frameWidth );
929 const QRectF midRect2 = midRect1.adjusted(
930 midLineWidth, midLineWidth, -midLineWidth, -midLineWidth );
932 const QRectF innerRect = midRect2.adjusted(
933 frameWidth, frameWidth, -frameWidth, -frameWidth );
936 path1.moveTo( outerRect.bottomLeft() );
937 path1.lineTo( outerRect.topLeft() );
938 path1.lineTo( outerRect.topRight() );
939 path1.lineTo( midRect1.topRight() );
940 path1.lineTo( midRect1.topLeft() );
941 path1.lineTo( midRect1.bottomLeft() );
944 path2.moveTo( outerRect.bottomLeft() );
945 path2.lineTo( outerRect.bottomRight() );
946 path2.lineTo( outerRect.topRight() );
947 path2.lineTo( midRect1.topRight() );
948 path2.lineTo( midRect1.bottomRight() );
949 path2.lineTo( midRect1.bottomLeft() );
952 path3.moveTo( midRect2.bottomLeft() );
953 path3.lineTo( midRect2.topLeft() );
954 path3.lineTo( midRect2.topRight() );
955 path3.lineTo( innerRect.topRight() );
956 path3.lineTo( innerRect.topLeft() );
957 path3.lineTo( innerRect.bottomLeft() );
960 path4.moveTo( midRect2.bottomLeft() );
961 path4.lineTo( midRect2.bottomRight() );
962 path4.lineTo( midRect2.topRight() );
963 path4.lineTo( innerRect.topRight() );
964 path4.lineTo( innerRect.bottomRight() );
965 path4.lineTo( innerRect.bottomLeft() );
968 path5.addRect( midRect1 );
969 path5.addRect( midRect2 );
971 painter->setPen( Qt::NoPen );
973 QBrush brush1 = palette.dark().color();
974 QBrush brush2 = palette.light().color();
976 if ( shadow == QFrame::Raised )
977 qSwap( brush1, brush2 );
979 painter->setBrush( brush1 );
980 painter->drawPath( path1 );
981 painter->drawPath( path4 );
983 painter->setBrush( brush2 );
984 painter->drawPath( path2 );
985 painter->drawPath( path3 );
987 painter->setBrush( palette.mid() );
988 painter->drawPath( path5 );
992 const QRectF outerRect = rect.adjusted( 0.0, 0.0, -1.0, -1.0 );
993 const QRectF innerRect = outerRect.adjusted(
994 frameWidth - 1.0, frameWidth - 1.0,
995 -( frameWidth - 1.0 ), -( frameWidth - 1.0 ) );
998 path1.moveTo( outerRect.bottomLeft() );
999 path1.lineTo( outerRect.topLeft() );
1000 path1.lineTo( outerRect.topRight() );
1001 path1.lineTo( innerRect.topRight() );
1002 path1.lineTo( innerRect.topLeft() );
1003 path1.lineTo( innerRect.bottomLeft() );
1007 path2.moveTo( outerRect.bottomLeft() );
1008 path2.lineTo( outerRect.bottomRight() );
1009 path2.lineTo( outerRect.topRight() );
1010 path2.lineTo( innerRect.topRight() );
1011 path2.lineTo( innerRect.bottomRight() );
1012 path2.lineTo( innerRect.bottomLeft() );
1014 painter->setPen( Qt::NoPen );
1016 QBrush brush1 = palette.dark().color();
1017 QBrush brush2 = palette.light().color();
1019 if ( shadow == QFrame::Raised )
1020 qSwap( brush1, brush2 );
1022 painter->setBrush( brush1 );
1023 painter->drawPath( path1 );
1025 painter->setBrush( brush2 );
1026 painter->drawPath( path2 );
1049 const QRectF &rect, qreal xRadius, qreal yRadius,
1050 const QPalette &palette,
int lineWidth,
int frameStyle )
1053 painter->setRenderHint( QPainter::Antialiasing,
true );
1054 painter->setBrush( Qt::NoBrush );
1056 qreal lw2 = lineWidth * 0.5;
1057 QRectF innerRect = rect.adjusted( lw2, lw2, -lw2, -lw2 );
1060 path.addRoundedRect( innerRect, xRadius, yRadius );
1069 Style style = Plain;
1070 if ( (frameStyle & QFrame::Sunken) == QFrame::Sunken )
1072 else if ( (frameStyle & QFrame::Raised) == QFrame::Raised )
1075 if ( style != Plain && path.elementCount() == 17 )
1078 QPainterPath pathList[8];
1080 for (
int i = 0; i < 4; i++ )
1082 const int j = i * 4 + 1;
1084 pathList[ 2 * i ].moveTo(
1085 path.elementAt(j - 1).x, path.elementAt( j - 1 ).y
1088 pathList[ 2 * i ].cubicTo(
1089 path.elementAt(j + 0).x, path.elementAt(j + 0).y,
1090 path.elementAt(j + 1).x, path.elementAt(j + 1).y,
1091 path.elementAt(j + 2).x, path.elementAt(j + 2).y );
1093 pathList[ 2 * i + 1 ].moveTo(
1094 path.elementAt(j + 2).x, path.elementAt(j + 2).y
1096 pathList[ 2 * i + 1 ].lineTo(
1097 path.elementAt(j + 3).x, path.elementAt(j + 3).y
1101 QColor c1( palette.color( QPalette::Dark ) );
1102 QColor c2( palette.color( QPalette::Light ) );
1104 if ( style == Raised )
1107 for (
int i = 0; i < 4; i++ )
1109 const QRectF r = pathList[2 * i].controlPointRect();
1112 arcPen.setCapStyle( Qt::FlatCap );
1113 arcPen.setWidth( lineWidth );
1116 linePen.setCapStyle( Qt::FlatCap );
1117 linePen.setWidth( lineWidth );
1123 arcPen.setColor( c1 );
1124 linePen.setColor( c1 );
1129 QLinearGradient gradient;
1130 gradient.setStart( r.topLeft() );
1131 gradient.setFinalStop( r.bottomRight() );
1132 gradient.setColorAt( 0.0, c1 );
1133 gradient.setColorAt( 1.0, c2 );
1135 arcPen.setBrush( gradient );
1136 linePen.setColor( c2 );
1141 arcPen.setColor( c2 );
1142 linePen.setColor( c2 );
1147 QLinearGradient gradient;
1149 gradient.setStart( r.bottomRight() );
1150 gradient.setFinalStop( r.topLeft() );
1151 gradient.setColorAt( 0.0, c2 );
1152 gradient.setColorAt( 1.0, c1 );
1154 arcPen.setBrush( gradient );
1155 linePen.setColor( c1 );
1161 painter->setPen( arcPen );
1162 painter->drawPath( pathList[ 2 * i] );
1164 painter->setPen( linePen );
1165 painter->drawPath( pathList[ 2 * i + 1] );
1170 QPen pen( palette.color( QPalette::WindowText ), lineWidth );
1171 painter->setPen( pen );
1172 painter->drawPath( path );
1190 const QwtScaleMap &scaleMap, Qt::Orientation orientation,
1191 const QRectF &rect )
1199 const QRect devRect = rect.toAlignedRect();
1206 QPixmap pixmap( devRect.size() );
1207 pixmap.fill( Qt::transparent );
1209 QPainter pmPainter( &pixmap );
1210 pmPainter.translate( -devRect.x(), -devRect.y() );
1212 if ( orientation == Qt::Horizontal )
1217 for (
int x = devRect.left(); x <= devRect.right(); x++ )
1222 c.setRgba( colorMap.
rgb( interval, value ) );
1224 c = colorTable[colorMap.
colorIndex( 256, interval, value )];
1226 pmPainter.setPen( c );
1227 pmPainter.drawLine( x, devRect.top(), x, devRect.bottom() );
1235 for (
int y = devRect.top(); y <= devRect.bottom(); y++ )
1240 c.setRgba( colorMap.
rgb( interval, value ) );
1242 c = colorTable[colorMap.
colorIndex( 256, interval, value )];
1244 pmPainter.setPen( c );
1245 pmPainter.drawLine( devRect.left(), y, devRect.right(), y );
1253 static inline void qwtFillRect(
const QWidget *widget, QPainter *painter,
1254 const QRect &rect,
const QBrush &brush)
1256 if ( brush.style() == Qt::TexturePattern )
1260 painter->setClipRect( rect );
1261 painter->drawTiledPixmap(rect, brush.texture(), rect.topLeft());
1265 else if ( brush.gradient() )
1269 painter->setClipRect( rect );
1270 painter->fillRect(0, 0, widget->width(),
1271 widget->height(), brush);
1277 painter->fillRect(rect, brush);
1295 QPixmap &pixmap,
const QPoint &offset )
1297 const QRect rect( offset, pixmap.size() );
1299 QPainter painter( &pixmap );
1300 painter.translate( -offset );
1302 const QBrush autoFillBrush =
1303 widget->palette().brush( widget->backgroundRole() );
1305 if ( !( widget->autoFillBackground() && autoFillBrush.isOpaque() ) )
1307 const QBrush bg = widget->palette().brush( QPalette::Window );
1311 if ( widget->autoFillBackground() )
1312 qwtFillRect( widget, &painter, rect, autoFillBrush);
1314 if ( widget->testAttribute(Qt::WA_StyledBackground) )
1316 painter.setClipRegion( rect );
1319 opt.initFrom( widget );
1320 widget->style()->drawPrimitive( QStyle::PE_Widget,
1321 &opt, &painter, widget );
1335 const QRectF &rect,
const QWidget *widget )
1337 if ( widget->testAttribute( Qt::WA_StyledBackground ) )
1340 opt.initFrom( widget );
1341 opt.rect = rect.toAlignedRect();
1343 widget->style()->drawPrimitive(
1344 QStyle::PE_Widget, &opt, painter, widget);
1348 const QBrush brush =
1349 widget->palette().brush( widget->backgroundRole() );
1351 painter->fillRect( rect, brush );
1363 const QFontMetrics& fontMetrics,
const QString& text )
1365 #if QT_VERSION >= 0x050b00 1366 return fontMetrics.horizontalAdvance( text );
1368 return fontMetrics.width( text );
1381 const QFontMetricsF& fontMetrics,
const QString& text )
1383 #if QT_VERSION >= 0x050b00 1384 return fontMetrics.horizontalAdvance( text );
1386 return fontMetrics.width( text );
1398 const QFontMetrics& fontMetrics, QChar ch )
1400 #if QT_VERSION >= 0x050b00 1401 return fontMetrics.horizontalAdvance( ch );
1403 return fontMetrics.width( ch );
1415 const QFontMetricsF& fontMetrics, QChar ch )
1417 #if QT_VERSION >= 0x050b00 1418 return fontMetrics.horizontalAdvance( ch );
1420 return fontMetrics.width( ch );
1430 qreal pixelRatio = 0.0;
1432 #if QT_VERSION >= 0x050100 1435 #if QT_VERSION >= 0x050600 1436 pixelRatio = paintDevice->devicePixelRatioF();
1438 pixelRatio = paintDevice->devicePixelRatio();
1442 Q_UNUSED( paintDevice )
1445 #if QT_VERSION >= 0x050000 1446 if ( pixelRatio == 0.0 && qApp )
1447 pixelRatio = qApp->devicePixelRatio();
1450 if ( pixelRatio == 0.0 )
1466 #if QT_VERSION >= 0x050000 1469 pm = QPixmap( size * pixelRatio );
1470 pm.setDevicePixelRatio( pixelRatio );
1472 pm = QPixmap( size );
1478 if ( pm.x11Info().screen() != widget->x11Info().screen() )
1479 pm.x11SetScreen( widget->x11Info().screen() );
static void fillPixmap(const QWidget *, QPixmap &, const QPoint &offset=QPoint())
enum MQTTPropertyCodes value
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
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
A class representing an interval.
static void drawPoints(QPainter *, const QPolygon &)
Wrapper for QPainter::drawPoints()
static void setRoundingAlignment(bool)
static void drawColorBar(QPainter *, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
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 drawPath(QPainter *, const QPainterPath &)
Wrapper for QPainter::drawPath()
static QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
static void drawRoundedFrame(QPainter *, const QRectF &, qreal xRadius, qreal yRadius, const QPalette &, int lineWidth, int frameStyle)
int qwtFloor(qreal value)
static bool isAligning(const QPainter *)
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 drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
static bool qwtIsClippingNeeded(const QPainter *painter, QRectF &clipRect)
static void drawText(QPainter *, qreal x, qreal y, const QString &)
Wrapper for QPainter::drawText()
static int horizontalAdvance(const QFontMetrics &, const QString &)
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.
static void drawBackgound(QPainter *, const QRectF &, const QWidget *)
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 void drawRect(QPainter *, qreal x, qreal y, qreal w, qreal h)
Wrapper for QPainter::drawRect()
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 drawPie(QPainter *, const QRectF &r, int a, int alen)
Wrapper for QPainter::drawPie()
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 &)