HighSidePath.addPolygon(UpperPolygon);
QQPainterPath LowSidePath;
LowSidePath.addPolygon(LowerPolygon);
QPainterPath UpperSidePath;
QPolygonF UpperPolygon;
UpperPolygon << QPointF(0,0) << QPointF(60,0) << QPointF(0,60);
HighSidePath.addPolygon(UpperPolygon);
QQPainterPath LowSidePath;
QPolygonF LowerPolygon;
LowerPolygon << QPointF(60,0) << QPointF(0,60) << QPointF(60,60);
LowSidePath.addPolygon(LowerPolygon);
To copy to clipboard, switch view to plain text mode
UpperRegion.begin(this);
UpperRegion.
setRenderHint(QPainter::Antialiasing);
UpperRegion.scale(width() / 60, height() / 60);
UpperRegion.
setPen(QPen(Qt
::blue,
2, Qt
::SolidLine, Qt
::RoundCap, Qt
::RoundJoin));
UpperRegion.setClipping(true);
UpperRegion.setClipPath(UpperSidePath);
UpperRegion.
setBrush(QColor(0xff, 0x00, 0x04
));
UpperRegion.drawRoundedRect(rectangle, 20.0, 15.0);
UpperRegion.drawLine(line);
UpperRegion.end();
LowerRegion.begin(this);
LowerRegion.
setRenderHint(QPainter::Antialiasing);
LowerRegion.scale(width() / 60, height() / 60);
LowerRegion.
setPen(QPen(Qt
::blue,
2, Qt
::SolidLine, Qt
::RoundCap, Qt
::RoundJoin));
LowLoadedGradient.setColorAt(0.0, Qt::white);
LowLoadedGradient.setColorAt(0.2, Qt::green);
LowLoadedGradient.setColorAt(1.0, Qt::black);
LowerRegion.setBrush(LowLoadedGradient);
LowerRegion.setClipping(true);
LowerRegion.setClipPath(LowSidePath);
LowerRegion.drawRoundedRect(rectangle, 20.0, 15.0);
LowerRegion.end();
QPainter UpperRegion;
UpperRegion.begin(this);
UpperRegion.setRenderHint(QPainter::Antialiasing);
UpperRegion.scale(width() / 60, height() / 60);
UpperRegion.setPen(QPen(Qt::blue, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
UpperRegion.setClipping(true);
UpperRegion.setClipPath(UpperSidePath);
UpperRegion.setBrush(QColor(0xff, 0x00, 0x04));
UpperRegion.drawRoundedRect(rectangle, 20.0, 15.0);
UpperRegion.drawLine(line);
UpperRegion.end();
QPainter LowerRegion;
LowerRegion.begin(this);
LowerRegion.setRenderHint(QPainter::Antialiasing);
LowerRegion.scale(width() / 60, height() / 60);
LowerRegion.setPen(QPen(Qt::blue, 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
LowLoadedGradient.setColorAt(0.0, Qt::white);
LowLoadedGradient.setColorAt(0.2, Qt::green);
LowLoadedGradient.setColorAt(1.0, Qt::black);
LowerRegion.setBrush(LowLoadedGradient);
LowerRegion.setClipping(true);
LowerRegion.setClipPath(LowSidePath);
LowerRegion.drawRoundedRect(rectangle, 20.0, 15.0);
LowerRegion.end();
To copy to clipboard, switch view to plain text mode
Bookmarks