16 #include <qpainterpath.h> 18 #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 )
72 QSize size = symbol.
size();
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() );
186 const QSize size = symbol.
size();
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 )
225 const QSize size = symbol.
size();
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 )
270 const QSize size = symbol.
size();
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,
325 const QSize size = symbol.
size();
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();
340 sw2 = std::floor( sw2 );
341 sh2 = std::floor( sh2 );
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 )
428 const QSize size = symbol.
size();
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 =
qwtFloor( size.width() );
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 )
497 const QSize size = symbol.
size();
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 )
557 const QSize size = symbol.
size();
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;
737 x1 = std::ceil( x1 );
738 y1 = std::ceil( y1 );
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;
970 d_data->path.path = path;
971 d_data->path.graphic.reset();
980 return d_data->path.path;
996 d_data->pixmap.pixmap = pixmap;
1005 return d_data->pixmap.pixmap;
1021 d_data->graphic.graphic = graphic;
1030 return d_data->graphic.graphic;
1048 if ( d_data->svg.renderer == NULL )
1049 d_data->svg.renderer =
new QSvgRenderer();
1051 d_data->svg.renderer->load( svgDocument );
1070 if ( ( width >= 0 ) && ( height < 0 ) )
1073 setSize( QSize( width, height ) );
1084 if ( size.isValid() && size != d_data->size )
1086 d_data->size = size;
1097 return d_data->size;
1110 if ( brush != d_data->brush )
1112 d_data->brush = brush;
1116 d_data->path.graphic.reset();
1126 return d_data->brush;
1143 qreal width, Qt::PenStyle style )
1145 setPen( QPen( color, width, style ) );
1158 if ( pen != d_data->pen )
1164 d_data->path.graphic.reset();
1189 switch ( d_data->style )
1202 if ( d_data->brush.color() != color )
1204 d_data->brush.setColor( color );
1215 if ( d_data->pen.color() != color )
1217 d_data->pen.setColor( color );
1224 if ( d_data->brush.color() != color ||
1225 d_data->pen.color() != color )
1230 d_data->brush.setColor( color );
1231 d_data->pen.setColor( color );
1252 if ( d_data->pinPoint != pos )
1254 d_data->pinPoint = pos;
1255 if ( d_data->isPinPointEnabled )
1261 setPinPointEnabled( enable );
1270 return d_data->pinPoint;
1281 if ( d_data->isPinPointEnabled != on )
1283 d_data->isPinPointEnabled = on;
1294 return d_data->isPinPointEnabled;
1309 const QPointF *points,
int numPoints )
const 1311 if ( numPoints <= 0 )
1314 bool useCache =
false;
1320 !painter->transform().isScaling() )
1328 switch( painter->paintEngine()->type() )
1330 case QPaintEngine::OpenGL:
1331 case QPaintEngine::OpenGL2:
1337 case QPaintEngine::OpenVG:
1338 case QPaintEngine::SVG:
1339 case QPaintEngine::Pdf:
1340 case QPaintEngine::Picture:
1346 case QPaintEngine::X11:
1348 switch( d_data->style )
1364 if ( d_data->size.isEmpty() ||
1365 d_data->size == d_data->pixmap.pixmap.size() )
1389 const QRect br = boundingRect();
1391 if ( d_data->cache.pixmap.isNull() )
1394 d_data->cache.pixmap.fill( Qt::transparent );
1396 QPainter p( &d_data->cache.pixmap );
1397 p.setRenderHints( painter->renderHints() );
1398 p.translate( -br.topLeft() );
1400 const QPointF pos( 0.0, 0.0 );
1401 renderSymbols( &p, &pos, 1 );
1404 const int dx = br.left();
1405 const int dy = br.top();
1407 for (
int i = 0; i < numPoints; i++ )
1409 const int left = qRound( points[i].x() ) + dx;
1410 const int top = qRound( points[i].y() ) + dy;
1412 painter->drawPixmap( left, top, d_data->cache.pixmap );
1418 renderSymbols( painter, points, numPoints );
1442 d_data->graphic.graphic.render(
1443 painter, rect, Qt::KeepAspectRatio );
1447 if ( d_data->path.graphic.isNull() )
1450 d_data->path.path, d_data->pen, d_data->brush );
1453 d_data->path.graphic.render(
1454 painter, rect, Qt::KeepAspectRatio );
1460 if ( d_data->svg.renderer )
1464 QSizeF sz = d_data->svg.renderer->viewBoxF().size();
1465 if ( !sz.isEmpty() )
1467 sz.scale( rect.size(), Qt::KeepAspectRatio );
1468 scaledRect.setSize( sz );
1469 scaledRect.moveCenter( rect.center() );
1476 d_data->svg.renderer->render(
1477 painter, scaledRect );
1483 const QRect br = boundingRect();
1487 const double ratio = qMin( rect.width() / br.width(),
1488 rect.height() / br.height() );
1492 painter->translate( rect.center() );
1493 painter->scale( ratio, ratio );
1495 const bool isPinPointEnabled = d_data->isPinPointEnabled;
1496 d_data->isPinPointEnabled =
false;
1499 renderSymbols( painter, &pos, 1 );
1501 d_data->isPinPointEnabled = isPinPointEnabled;
1515 const QPointF *points,
int numPoints )
const 1517 switch ( d_data->style )
1537 points, numPoints, *
this );
1549 points, numPoints, *
this );
1555 points, numPoints, *
this );
1561 points, numPoints, *
this );
1567 points, numPoints, *
this );
1573 points, numPoints, *
this );
1579 points, numPoints, *
this );
1599 if ( d_data->path.graphic.isNull() )
1602 d_data->pen, d_data->brush );
1606 d_data->path.graphic, *
this );
1617 d_data->graphic.graphic, *
this );
1624 d_data->svg.renderer, *
this );
1642 bool pinPointTranslation =
false;
1644 switch ( d_data->style )
1651 if ( d_data->pen.style() != Qt::NoPen )
1654 rect.setSize( d_data->size + QSizeF( pw, pw ) );
1655 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1670 if ( d_data->pen.style() != Qt::NoPen )
1673 rect.setSize( d_data->size + QSizeF( 2 * pw, 2 * pw ) );
1674 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1679 if ( d_data->path.graphic.isNull() )
1682 d_data->path.path, d_data->pen, d_data->brush );
1686 d_data->path.graphic, d_data->size );
1687 pinPointTranslation =
true;
1693 if ( d_data->size.isEmpty() )
1694 rect.setSize( d_data->pixmap.pixmap.size() );
1696 rect.setSize( d_data->size );
1698 pinPointTranslation =
true;
1705 d_data->graphic.graphic, d_data->size );
1706 pinPointTranslation =
true;
1713 if ( d_data->svg.renderer )
1714 rect = d_data->svg.renderer->viewBoxF();
1716 if ( d_data->size.isValid() && !rect.isEmpty() )
1718 QSizeF sz = rect.size();
1720 const double sx = d_data->size.width() / sz.width();
1721 const double sy = d_data->size.height() / sz.height();
1723 QTransform transform;
1724 transform.scale( sx, sy );
1726 rect = transform.mapRect( rect );
1728 pinPointTranslation =
true;
1734 rect.setSize( d_data->size );
1735 rect.moveCenter( QPointF( 0.0, 0.0 ) );
1739 if ( pinPointTranslation )
1741 QPointF pinPoint( 0.0, 0.0 );
1742 if ( d_data->isPinPointEnabled )
1743 pinPoint = rect.center() - d_data->pinPoint;
1745 rect.moveCenter( pinPoint );
1749 r.setLeft(
qwtFloor( rect.left() ) );
1750 r.setTop(
qwtFloor( rect.top() ) );
1751 r.setRight(
qwtCeil( rect.right() ) );
1752 r.setBottom(
qwtCeil( rect.bottom() ) );
1755 r.adjust( -1, -1, 1, 1 );
1773 if ( !d_data->cache.pixmap.isNull() )
1774 d_data->cache.pixmap = QPixmap();
1785 if ( d_data->style != style )
1787 d_data->style = style;
1798 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
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)
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
virtual void renderSymbols(QPainter *, const QPointF *, int numPoints) const
void setBrush(const QBrush &)
Assign a brush.
const QPixmap & pixmap() const
QRectF scaledBoundingRect(qreal sx, qreal sy) const
Calculate the target rectangle for scaling the graphic.
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)
int qwtFloor(qreal value)
void setRenderHint(RenderHint, bool on=true)
void setSvgDocument(const QByteArray &)
QRectF controlPointRect() const
static qreal effectivePenWidth(const QPen &)
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)
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.
bool isPinPointEnabled() const
const QPainterPath & path() const
static void drawEllipse(QPainter *, const QRectF &)
Wrapper for QPainter::drawEllipse()
void setPixmap(const QPixmap &)
static void drawRect(QPainter *, qreal x, qreal y, qreal w, qreal h)
Wrapper for QPainter::drawRect()
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)
void setSize(const QSize &)
CachePolicy cachePolicy() const
static QRectF qwtScaledBoundingRect(const QwtGraphic &graphic, const QSizeF size)
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.