PDA

View Full Version : drawing problem



boss_bhat
20th September 2006, 10:43
Hi all,
Can some body explain how to draw a polygon in a Widget. I just want something
like this,
587




Thanks in advance,
Boss

wysota
20th September 2006, 10:49
void myWidget::paintEvent(QPaintEvent *e){
QPainter painter(this);
QPoint points[] = { QPoint(100, 100), QPoint(150, 80), QPoint(200, 150), QPoint(140, 200) };
painter.drawPolygon(points, 4); // you can use polyline instead of polygon too
}