Qt 6.11 is out! See what's new in the release
blog
want to create 3 triangle and widget them in QHVBoxLayout()
General and Desktop
2
Posts
2
Posters
536
Views
2
Watching
-
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
paintEventthen it should be something likeQPainter painter(this);.