13 #include <qapplication.h> 15 #include <qpainterpath.h> 17 #include <qpaintengine.h> 20 #include <qsvgrenderer.h> 35 const QPen &pen,
const QBrush& brush )
40 QPainter painter( &graphic );
41 painter.setPen( pen );
42 painter.setBrush( brush );
43 painter.drawPath( path );
52 QSizeF scaledSize = size;
53 if ( scaledSize.isEmpty() )
59 if ( sz.width() > 0.0 )
60 sx = scaledSize.width() / sz.width();
63 if ( sz.height() > 0.0 )
64 sy = scaledSize.height() / sz.height();
70 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
74 size = symbol.
pixmap().size();
76 const QTransform transform = painter->transform();
77 if ( transform.isScaling() )
79 const QRect r( 0, 0, size.width(), size.height() );
80 size = transform.mapRect( r ).size();
83 QPixmap pm = symbol.
pixmap();
84 if ( pm.size() != size )
85 pm = pm.scaled( size );
87 QPointF pinPoint( 0.5 * size.width(), 0.5 * size.height() );
91 painter->resetTransform();
93 for (
int i = 0;
i < numPoints;
i++ )
95 const QPointF pos = transform.map( points[
i] ) - pinPoint;
98 QRect( pos.toPoint(), pm.size() ), pm );
105 const QPointF *points,
int numPoints,
106 QSvgRenderer *renderer,
const QwtSymbol &symbol )
108 if ( renderer == NULL || !renderer->isValid() )
111 const QRectF viewBox = renderer->viewBoxF();
112 if ( viewBox.isEmpty() )
115 QSizeF sz = symbol.
size();
119 const double sx = sz.width() / viewBox.width();
120 const double sy = sz.height() / viewBox.height();
122 QPointF pinPoint = viewBox.center();
126 const double dx = sx * ( pinPoint.x() - viewBox.left() );
127 const double dy = sy * ( pinPoint.y() - viewBox.top() );
129 for (
int i = 0;
i < numPoints;
i++ )
131 const double x = points[
i].x() - dx;
132 const double y = points[
i].y() - dy;
134 renderer->render( painter,
135 QRectF( x, y, sz.width(), sz.height() ) );
142 const QPointF *points,
int numPoints,
const QwtGraphic &graphic,
146 if ( pointRect.isEmpty() )
152 const QSize sz = symbol.
size();
155 sx = sz.width() / pointRect.width();
156 sy = sz.height() / pointRect.height();
159 QPointF pinPoint = pointRect.center();
163 const QTransform transform = painter->transform();
165 for (
int i = 0;
i < numPoints;
i++ )
167 QTransform tr = transform;
168 tr.translate( points[
i].
x(), points[
i].
y() );
170 tr.translate( -pinPoint.x(), -pinPoint.y() );
172 painter->setTransform( tr );
174 graphic.
render( painter );
177 painter->setTransform( transform );
181 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
183 painter->setBrush( symbol.
brush() );
184 painter->setPen( symbol.
pen() );
190 const int sw = size.width();
191 const int sh = size.height();
192 const int sw2 = size.width() / 2;
193 const int sh2 = size.height() / 2;
195 for (
int i = 0;
i < numPoints;
i++ )
197 const int x = qRound( points[
i].x() );
198 const int y = qRound( points[
i].y() );
200 const QRectF r( x - sw2, y - sh2, sw, sh );
206 const double sw = size.width();
207 const double sh = size.height();
208 const double sw2 = 0.5 * size.width();
209 const double sh2 = 0.5 * size.height();
211 for (
int i = 0;
i < numPoints;
i++ )
213 const double x = points[
i].x();
214 const double y = points[
i].y();
216 const QRectF r( x - sw2, y - sh2, sw, sh );
223 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
227 QPen pen = symbol.
pen();
228 pen.setJoinStyle( Qt::MiterJoin );
229 painter->setPen( pen );
230 painter->setBrush( symbol.
brush() );
231 painter->setRenderHint( QPainter::Antialiasing,
false );
235 const int sw = size.width();
236 const int sh = size.height();
237 const int sw2 = size.width() / 2;
238 const int sh2 = size.height() / 2;
240 for (
int i = 0;
i < numPoints;
i++ )
242 const int x = qRound( points[
i].x() );
243 const int y = qRound( points[
i].y() );
245 const QRect r( x - sw2, y - sh2, sw, sh );
251 const double sw = size.width();
252 const double sh = size.height();
253 const double sw2 = 0.5 * size.width();
254 const double sh2 = 0.5 * size.height();
256 for (
int i = 0;
i < numPoints;
i++ )
258 const double x = points[
i].x();
259 const double y = points[
i].y();
261 const QRectF r( x - sw2, y - sh2, sw, sh );
268 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
272 QPen pen = symbol.
pen();
273 pen.setJoinStyle( Qt::MiterJoin );
274 painter->setPen( pen );
275 painter->setBrush( symbol.
brush() );
279 for (
int i = 0;
i < numPoints;
i++ )
281 const int x = qRound( points[
i].x() );
282 const int y = qRound( points[
i].y() );
284 const int x1 = x - size.width() / 2;
285 const int y1 = y - size.height() / 2;
286 const int x2 = x1 + size.width();
287 const int y2 = y1 + size.height();
290 polygon += QPointF( x, y1 );
291 polygon += QPointF( x1, y );
292 polygon += QPointF( x, y2 );
293 polygon += QPointF( x2, y );
300 for (
int i = 0;
i < numPoints;
i++ )
302 const QPointF &pos = points[
i];
304 const double x1 = pos.x() - 0.5 * size.width();
305 const double y1 = pos.y() - 0.5 * size.height();
306 const double x2 = x1 + size.width();
307 const double y2 = y1 + size.height();
310 polygon += QPointF( pos.x(), y1 );
311 polygon += QPointF( x2, pos.y() );
312 polygon += QPointF( pos.x(), y2 );
313 polygon += QPointF( x1, pos.y() );
322 const QPointF *points,
int numPoints,
327 QPen pen = symbol.
pen();
328 pen.setJoinStyle( Qt::MiterJoin );
329 painter->setPen( pen );
331 painter->setBrush( symbol.
brush() );
335 double sw2 = 0.5 * size.width();
336 double sh2 = 0.5 * size.height();
344 QPolygonF triangle( 3 );
345 QPointF *trianglePoints = triangle.data();
347 for (
int i = 0;
i < numPoints;
i++ )
349 const QPointF &pos = points[
i];
360 const double x1 = x - sw2;
361 const double x2 = x1 + size.width();
362 const double y1 = y - sh2;
363 const double y2 = y1 + size.height();
369 trianglePoints[0].rx() = x2;
370 trianglePoints[0].ry() = y1;
372 trianglePoints[1].rx() = x1;
373 trianglePoints[1].ry() = y;
375 trianglePoints[2].rx() = x2;
376 trianglePoints[2].ry() = y2;
382 trianglePoints[0].rx() = x1;
383 trianglePoints[0].ry() = y1;
385 trianglePoints[1].rx() = x2;
386 trianglePoints[1].ry() = y;
388 trianglePoints[2].rx() = x1;
389 trianglePoints[2].ry() = y2;
395 trianglePoints[0].rx() = x1;
396 trianglePoints[0].ry() = y2;
398 trianglePoints[1].rx() = x;
399 trianglePoints[1].ry() = y1;
401 trianglePoints[2].rx() = x2;
402 trianglePoints[2].ry() = y2;
408 trianglePoints[0].rx() = x1;
409 trianglePoints[0].ry() = y1;
411 trianglePoints[1].rx() = x;
412 trianglePoints[1].ry() = y2;
414 trianglePoints[2].rx() = x2;
415 trianglePoints[2].ry() = y1;
425 QPainter *painter,
int orientations,
426 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
432 QPen pen = symbol.
pen();
433 if ( pen.width() > 1 )
435 pen.setCapStyle( Qt::FlatCap );
439 painter->setPen( pen );
440 painter->setRenderHint( QPainter::Antialiasing,
false );
444 const int sw = qFloor( size.width() );
445 const int sh = qFloor( size.height() );
446 const int sw2 = size.width() / 2;
447 const int sh2 = size.height() / 2;
449 for (
int i = 0;
i < numPoints;
i++ )
451 if ( orientations & Qt::Horizontal )
453 const int x = qRound( points[
i].x() ) - sw2;
454 const int y = qRound( points[
i].y() );
458 if ( orientations & Qt::Vertical )
460 const int x = qRound( points[
i].x() );
461 const int y = qRound( points[
i].y() ) - sh2;
469 const double sw = size.width();
470 const double sh = size.height();
471 const double sw2 = 0.5 * size.width();
472 const double sh2 = 0.5 * size.height();
474 for (
int i = 0;
i < numPoints;
i++ )
476 if ( orientations & Qt::Horizontal )
478 const double x = points[
i].x() - sw2;
479 const double y = points[
i].y();
483 if ( orientations & Qt::Vertical )
485 const double y = points[
i].y() - sh2;
486 const double x = points[
i].x();
495 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
500 QPen pen = symbol.
pen();
501 if ( pen.width() > 1 )
503 pen.setCapStyle( Qt::FlatCap );
506 painter->setPen( pen );
511 const int sw = size.width();
512 const int sh = size.height();
513 const int sw2 = size.width() / 2;
514 const int sh2 = size.height() / 2;
516 for (
int i = 0;
i < numPoints;
i++ )
518 const QPointF &pos = points[
i];
520 const int x = qRound( pos.x() );
521 const int y = qRound( pos.y() );
523 const int x1 = x - sw2;
524 const int x2 = x1 + sw + off;
525 const int y1 = y - sh2;
526 const int y2 = y1 + sh + off;
534 const double sw = size.width();
535 const double sh = size.height();
536 const double sw2 = 0.5 * size.width();
537 const double sh2 = 0.5 * size.height();
539 for (
int i = 0;
i < numPoints;
i++ )
541 const QPointF &pos = points[
i];
543 const double x1 = pos.x() - sw2;
544 const double x2 = x1 + sw;
545 const double y1 = pos.y() - sh2;
546 const double y2 = y1 +
sh;
555 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
558 painter->setPen( symbol.
pen() );
562 QRect r( 0, 0, size.width(), size.height() );
564 for (
int i = 0;
i < numPoints;
i++ )
566 r.moveCenter( points[
i].toPoint() );
568 const double sqrt1_2 = 0.70710678118654752440;
570 const double d1 = r.width() / 2.0 * ( 1.0 - sqrt1_2 );
573 qRound( r.left() + d1 ), qRound( r.top() + d1 ),
574 qRound( r.right() - d1 ), qRound( r.bottom() - d1 ) );
576 qRound( r.left() + d1 ), qRound( r.bottom() - d1 ),
577 qRound( r .right() - d1), qRound( r.top() + d1 ) );
579 const QPoint c = r.center();
582 c.x(), r.top(), c.x(), r.bottom() );
584 r.left(), c.y(), r.right(), c.y() );
589 QRectF r( 0, 0, size.width(), size.height() );
591 for (
int i = 0;
i < numPoints;
i++ )
593 r.moveCenter( points[
i] );
595 const double sqrt1_2 = 0.70710678118654752440;
597 const QPointF c = r.center();
598 const double d1 = r.width() / 2.0 * ( 1.0 - sqrt1_2 );
601 r.left() + d1, r.top() + d1,
602 r.right() - d1, r.bottom() - d1 );
604 r.left() + d1, r.bottom() - d1,
605 r.right() - d1, r.top() + d1 );
617 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
619 QPen pen = symbol.
pen();
620 if ( pen.width() > 1 )
621 pen.setCapStyle( Qt::FlatCap );
622 pen.setJoinStyle( Qt::MiterJoin );
623 painter->setPen( pen );
625 painter->setBrush( symbol.
brush() );
627 const double cos30 = 0.866025;
629 const double dy = 0.25 * symbol.
size().height();
630 const double dx = 0.5 * symbol.
size().width() * cos30 / 3.0;
632 QPolygonF
star( 12 );
633 QPointF *starPoints = star.data();
637 for (
int i = 0;
i < numPoints;
i++ )
639 double x = points[
i].x();
640 double y = points[
i].y();
647 double x1 = x - 3 * dx;
648 double y1 = y - 2 * dy;
651 x1 = qRound( x - 3 * dx );
652 y1 = qRound( y - 2 * dy );
655 const double x2 = x1 + 1 * dx;
656 const double x3 = x1 + 2 * dx;
657 const double x4 = x1 + 3 * dx;
658 const double x5 = x1 + 4 * dx;
659 const double x6 = x1 + 5 * dx;
660 const double x7 = x1 + 6 * dx;
662 const double y2 = y1 + 1 * dy;
663 const double y3 = y1 + 2 * dy;
664 const double y4 = y1 + 3 * dy;
665 const double y5 = y1 + 4 * dy;
667 starPoints[0].rx() = x4;
668 starPoints[0].ry() = y1;
670 starPoints[1].rx() = x5;
671 starPoints[1].ry() = y2;
673 starPoints[2].rx() = x7;
674 starPoints[2].ry() = y2;
676 starPoints[3].rx() = x6;
677 starPoints[3].ry() = y3;
679 starPoints[4].rx() = x7;
680 starPoints[4].ry() = y4;
682 starPoints[5].rx() = x5;
683 starPoints[5].ry() = y4;
685 starPoints[6].rx() = x4;
686 starPoints[6].ry() = y5;
688 starPoints[7].rx() = x3;
689 starPoints[7].ry() = y4;
691 starPoints[8].rx() = x1;
692 starPoints[8].ry() = y4;
694 starPoints[9].rx() = x2;
695 starPoints[9].ry() = y3;
697 starPoints[10].rx() = x1;
698 starPoints[10].ry() = y2;
700 starPoints[11].rx() = x3;
701 starPoints[11].ry() = y2;
708 const QPointF *points,
int numPoints,
const QwtSymbol &symbol )
710 painter->setBrush( symbol.
brush() );
711 painter->setPen( symbol.
pen() );
713 const double cos30 = 0.866025;
714 const double dx = 0.5 * ( symbol.
size().width() - cos30 );
716 const double dy = 0.25 * symbol.
size().height();
718 QPolygonF hexaPolygon( 6 );
719 QPointF *hexaPoints = hexaPolygon.data();
723 for (
int i = 0;
i < numPoints;
i++ )
725 double x = points[
i].x();
726 double y = points[
i].y();
734 double y1 = y - 2 * dy;
741 const double x2 = x1 + 1 * dx;
742 const double x3 = x1 + 2 * dx;
744 const double y2 = y1 + 1 * dy;
745 const double y3 = y1 + 3 * dy;
746 const double y4 = y1 + 4 * dy;
748 hexaPoints[0].rx() = x2;
749 hexaPoints[0].ry() = y1;
751 hexaPoints[1].rx() = x3;
752 hexaPoints[1].ry() = y2;
754 hexaPoints[2].rx() = x3;
755 hexaPoints[2].ry() = y3;
757 hexaPoints[3].rx() = x2;
758 hexaPoints[3].ry() = y4;
760 hexaPoints[4].rx() = x1;
761 hexaPoints[4].ry() = y3;
763 hexaPoints[5].rx() = x1;
764 hexaPoints[5].ry() = y2;
774 const QPen &pn,
const QSize &sz ):
779 isPinPointEnabled( false )
845 d_data =
new PrivateData( style, QBrush( Qt::gray ),
846 QPen( Qt::black, 0 ), QSize() );
859 const QPen &pen,
const QSize &size )
861 d_data =
new PrivateData( style, brush, pen, size );
879 const QBrush &brush,
const QPen &pen )
902 if ( d_data->cache.policy != policy )
904 d_data->cache.policy = policy;
915 return d_data->cache.policy;
968 d_data->path.path = path;
969 d_data->path.graphic.reset();
978 return d_data->path.path;
994 d_data->pixmap.pixmap = pixmap;
1003 return d_data->pixmap.pixmap;
1019 d_data->graphic.graphic = graphic;
1028 return d_data->graphic.graphic;
1046 if ( d_data->svg.renderer == NULL )
1047 d_data->svg.renderer =
new QSvgRenderer();
1049 d_data->svg.renderer->load( svgDocument );
1068 if ( ( width >= 0 ) && ( height < 0 ) )
1071 setSize( QSize( width, height ) );
1082 if ( size.isValid() && size != d_data->size )
1084 d_data->size = size;
1095 return d_data->size;
1108 if ( brush != d_data->brush )
1110 d_data->brush = brush;
1114 d_data->path.graphic.reset();
1124 return d_data->brush;
1141 qreal width, Qt::PenStyle style )
1143 setPen( QPen( color, width, style ) );
1156 if ( pen != d_data->pen )
1162 d_data->path.graphic.reset();
1187 switch ( d_data->style )
1200 if ( d_data->brush.color() != color )
1202 d_data->brush.setColor( color );
1213 if ( d_data->pen.color() != color )
1215 d_data->pen.setColor( color );
1222 if ( d_data->brush.color() != color ||
1223 d_data->pen.color() != color )
1228 d_data->brush.setColor( color );
1229 d_data->pen.setColor( color );
1250 if ( d_data->pinPoint != pos )
1252 d_data->pinPoint = pos;
1253 if ( d_data->isPinPointEnabled )
1259 setPinPointEnabled( enable );
1268 return d_data->pinPoint;
1279 if ( d_data->isPinPointEnabled != on )
1281 d_data->isPinPointEnabled = on;
1292 return d_data->isPinPointEnabled;
1307 const QPointF *points,
int numPoints )
const 1309 if ( numPoints <= 0 )
1312 bool useCache =
false;
1318 !painter->transform().isScaling() )
1326 switch( painter->paintEngine()->type() )
1328 case QPaintEngine::OpenGL:
1329 #if QT_VERSION >= 0x040600 1330 case QPaintEngine::OpenGL2:
1337 #if QT_VERSION >= 0x040500 1338 case QPaintEngine::OpenVG:
1340 case QPaintEngine::SVG:
1341 case QPaintEngine::Pdf:
1342 case QPaintEngine::Picture:
1348 case QPaintEngine::X11:
1350 switch( d_data->style )
1366 if ( d_data->size.isEmpty() ||
1367 d_data->size == d_data->pixmap.pixmap.size() )
1391 const QRect br = boundingRect();
1393 if ( d_data->cache.pixmap.isNull() )
1396 d_data->cache.pixmap.fill( Qt::transparent );
1398 QPainter p( &d_data->cache.pixmap );
1399 p.setRenderHints( painter->renderHints() );
1400 p.translate( -br.topLeft() );
1402 const QPointF pos( 0.0, 0.0 );
1403 renderSymbols( &p, &pos, 1 );
1406 const int dx = br.left();
1407 const int dy = br.top();
1409 for (
int i = 0;
i < numPoints;
i++ )
1411 const int left = qRound( points[
i].
x() ) + dx;
1412 const int top = qRound( points[
i].
y() ) + dy;
1414 painter->drawPixmap( left, top, d_data->cache.pixmap );
1420 renderSymbols( painter, points, numPoints );
1444 d_data->graphic.graphic.render(
1445 painter, rect, Qt::KeepAspectRatio );
1449 if ( d_data->path.graphic.isNull() )
1452 d_data->path.path, d_data->pen, d_data->brush );
1455 d_data->path.graphic.render(
1456 painter, rect, Qt::KeepAspectRatio );
1462 if ( d_data->svg.renderer )
1466 QSizeF sz = d_data->svg.renderer->viewBoxF().size();
1467 if ( !sz.isEmpty() )
1469 sz.scale( rect.size(), Qt::KeepAspectRatio );
1470 scaledRect.setSize( sz );
1471 scaledRect.moveCenter( rect.center() );
1478 d_data->svg.renderer->render(
1479 painter, scaledRect );
1485 const QRect br = boundingRect();
1489 const double ratio = qMin( rect.width() / br.width(),
1490 rect.height() / br.height() );
1494 painter->translate( rect.center() );
1495 painter->scale( ratio, ratio );
1497 const bool isPinPointEnabled = d_data->isPinPointEnabled;
1498 d_data->isPinPointEnabled =
false;
1501 renderSymbols( painter, &pos, 1 );
1503 d_data->isPinPointEnabled = isPinPointEnabled;
1517 const QPointF *points,
int numPoints )
const 1519 switch ( d_data->style )
1539 points, numPoints, *
this );
1551 points, numPoints, *
this );
1557 points, numPoints, *
this );
1563 points, numPoints, *
this );
1569 points, numPoints, *
this );
1575 points, numPoints, *
this );
1581 points, numPoints, *
this );
1601 if ( d_data->path.graphic.isNull() )
1604 d_data->pen, d_data->brush );
1608 d_data->path.graphic, *
this );
1619 d_data->graphic.graphic, *
this );
1626 d_data->svg.renderer, *
this );
1644 bool pinPointTranslation =
false;
1646 switch ( d_data->style )
1653 if ( d_data->pen.style() != Qt::NoPen )
1654 pw = qMax( d_data->pen.widthF(), qreal( 1.0 ) );
1656 rect.setSize( d_data->size + QSizeF( pw, pw ) );
1657 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1672 if ( d_data->pen.style() != Qt::NoPen )
1673 pw = qMax( d_data->pen.widthF(), qreal( 1.0 ) );
1675 rect.setSize( d_data->size + QSizeF( 2 * pw, 2 * pw ) );
1676 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1681 if ( d_data->path.graphic.isNull() )
1684 d_data->path.path, d_data->pen, d_data->brush );
1688 d_data->path.graphic, d_data->size );
1689 pinPointTranslation =
true;
1695 if ( d_data->size.isEmpty() )
1696 rect.setSize( d_data->pixmap.pixmap.size() );
1698 rect.setSize( d_data->size );
1700 pinPointTranslation =
true;
1707 d_data->graphic.graphic, d_data->size );
1708 pinPointTranslation =
true;
1715 if ( d_data->svg.renderer )
1716 rect = d_data->svg.renderer->viewBoxF();
1718 if ( d_data->size.isValid() && !rect.isEmpty() )
1720 QSizeF sz = rect.size();
1722 const double sx = d_data->size.width() / sz.width();
1723 const double sy = d_data->size.height() / sz.height();
1725 QTransform transform;
1726 transform.scale( sx, sy );
1728 rect = transform.mapRect( rect );
1730 pinPointTranslation =
true;
1736 rect.setSize( d_data->size );
1737 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1741 if ( pinPointTranslation )
1743 QPointF pinPoint( 0.0, 0.0 );
1744 if ( d_data->isPinPointEnabled )
1745 pinPoint = rect.center() - d_data->pinPoint;
1747 rect.moveCenter( pinPoint );
1751 r.setLeft( qFloor( rect.left() ) );
1752 r.setTop( qFloor( rect.top() ) );
1753 r.setRight( qCeil( rect.right() ) );
1754 r.setBottom( qCeil( rect.bottom() ) );
1757 r.adjust( -1, -1, 1, 1 );
1775 if ( !d_data->cache.pixmap.isNull() )
1776 d_data->cache.pixmap = QPixmap();
1787 if ( d_data->style != style )
1789 d_data->style = style;
1800 return d_data->style;
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
virtual QRect boundingRect() const
static void qwtDrawPixmapSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
QwtSymbol::CachePolicy policy
static void drawLine(QPainter *, double x1, double y1, double x2, double y2)
Wrapper for QPainter::drawLine()
void render(QPainter *) const
Replay all recorded painter commands.
static void qwtDrawTriangleSymbols(QPainter *painter, QwtTriangle::Type type, const QPointF *points, int numPoints, const QwtSymbol &symbol)
static void qwtDrawRectSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
static void qwtDrawStar2Symbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
QwtSymbol(Style=NoSymbol)
virtual void renderSymbols(QPainter *, const QPointF *, int numPoints) const
const QPixmap & pixmap() const
static void drawPixmap(QPainter *, const QRectF &, const QPixmap &)
Wrapper for QPainter::drawPixmap()
void setGraphic(const QwtGraphic &)
QSizeF defaultSize() const
Default size.
const QwtGraphic & graphic() const
A class for drawing symbols.
static void qwtDrawSvgSymbols(QPainter *painter, const QPointF *points, int numPoints, QSvgRenderer *renderer, const QwtSymbol &symbol)
TFSIMD_FORCE_INLINE const tfScalar & y() const
void setRenderHint(RenderHint, bool on=true)
void setSvgDocument(const QByteArray &)
QRectF controlPointRect() const
const QSize & size() const
static void qwtDrawDiamondSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
static void qwtDrawEllipseSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
GraphId path[kMaxDeadlockPathLen]
static void drawRect(QPainter *, double x, double y, double w, double h)
Wrapper for QPainter::drawRect()
static void qwtDrawHexagonSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
PrivateData(QwtSymbol::Style st, const QBrush &br, const QPen &pn, const QSize &sz)
static void qwtDrawLineSymbols(QPainter *painter, int orientations, const QPointF *points, int numPoints, const QwtSymbol &symbol)
void setPinPoint(const QPointF &pos, bool enable=true)
Set and enable a pin point.
virtual ~QwtSymbol()
Destructor.
void setCachePolicy(CachePolicy)
static void qwtDrawXCrossSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
backward::SignalHandling sh
static QwtGraphic qwtPathGraphic(const QPainterPath &path, const QPen &pen, const QBrush &brush)
A paint device for scalable graphics.
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
TFSIMD_FORCE_INLINE const tfScalar & x() const
bool isPinPointEnabled() const
const QPainterPath & path() const
static void drawEllipse(QPainter *, const QRectF &)
Wrapper for QPainter::drawEllipse()
void setPixmap(const QPixmap &)
void setPath(const QPainterPath &)
Set a painter path as symbol.
Triangle pointing upwards.
static void qwtDrawGraphicSymbols(QPainter *painter, const QPointF *points, int numPoints, const QwtGraphic &graphic, const QwtSymbol &symbol)
static void qwtDrawStar1Symbols(QPainter *painter, const QPointF *points, int numPoints, const QwtSymbol &symbol)
Triangle pointing upwards.
void setPinPointEnabled(bool)
QRectF scaledBoundingRect(double sx, double sy) const
Calculate the target rectangle for scaling the graphic.
void setSize(const QSize &)
CachePolicy cachePolicy() const
static QRectF qwtScaledBoundingRect(const QwtGraphic &graphic, const QSizeF size)
void setBrush(const QBrush &b)
Assign a brush.
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
Always use a pixmap cache.
const QBrush & brush() const
virtual void setColor(const QColor &)
Set the color of the symbol.
static bool roundingAlignment()
Triangle pointing downwards.
static QPixmap backingStore(QWidget *, const QSize &)
No Style. The symbol cannot be drawn.