feat: floating edge gradient
This commit is contained in:
@@ -20,7 +20,16 @@ QRectF FloatingEdgeGraphic::boundingRect() const
|
||||
|
||||
void FloatingEdgeGraphic::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
painter->setPen(QPen("white"));
|
||||
// auto pen = QPen("white");
|
||||
|
||||
QLinearGradient gradient(socket1_->scenePos(), floatPos_);
|
||||
gradient.setColorAt(0.0, QColor(255, 255, 255, 255));
|
||||
gradient.setColorAt(1.0, QColor(255, 255, 255, 50));
|
||||
|
||||
QPen pen(QBrush(gradient), 1);
|
||||
|
||||
pen.setCapStyle(Qt::RoundCap);
|
||||
painter->setPen(pen);
|
||||
painter->drawLine(socket1_->scenePos(),floatPos_);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user