want to create 3 triangle and widget them in QHVBoxLayout()
-
why is my code not working?
want to create 3 triangle and widget them in QHVBoxLayout().QRectF rect= QRectF(0,0,100,100); QPainterPath path; path.moveTo(rect.topLeft(),rect.left()); path.lineTo(rect.bottomLeft()); path.lineTo(rect.topRight()); QPainter painter; painter.setPen(Qt:: NoPen); painter.fillPath(path, QBrush(QColor("blue")) );
-
Your painter doesn't have anything to paint on. If the above code is inside an overriden
paintEvent
then it should be something likeQPainter painter(this);
.