23 QPixmap ViewPointStyle::pixmapForCurrentSettings ()
const
28 QPolygonF polygonUnscaled = m_pointStyle.
polygon();
31 double xMinGot = polygonUnscaled.boundingRect().left();
32 double xMaxGot = polygonUnscaled.boundingRect().right();
33 double yMinGot = polygonUnscaled.boundingRect().top();
34 double yMaxGot = polygonUnscaled.boundingRect().bottom();
36 QPolygonF polygonScaled;
37 for (
int i = 0; i < polygonUnscaled.length(); i++) {
38 QPointF pOld = polygonUnscaled.at(i);
39 polygonScaled.append (QPointF ((width () - 1) * (pOld.x() - xMinGot) / (xMaxGot - xMinGot),
40 (height () - 1) * (pOld.y() - yMinGot) / (yMaxGot - yMinGot)));
46 color = QColor (Qt::black);
52 QImage::Format_RGB32);
53 QPainter painter (&img);
62 painter.setPen (QPen (color, m_pointStyle.
lineWidth()));
63 painter.drawPolygon (polygonScaled);
67 QPixmap pixmap = QPixmap::fromImage (img);
75 <<
" enabled=" << (enabled ?
"true" :
"false");
78 setPixmap (pixmapForCurrentSettings ());
85 m_pointStyle = pointStyle;
86 setPixmap (pixmapForCurrentSettings ());
93 QPixmap pEmpty (width (),