Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
want to create 3 triangle and widget them in QHVBoxLayout()
houmingc last edited by
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 like