PDA

View Full Version : QtCanvasPolygon does not paint



YuriyRusinov
9th August 2007, 09:00
Hello, All !

I want to draw polygon on QtCanvasView. I make


QtCanvasView *view;
QtCanvasPolygon scrPol (view->canvas());
scrPol.setPoints (scrPts);
QPen selPen (Qt::red);
scrPol.setPen (selPen);

QBrush selBrush (Qt::red, Qt::DiagCrossPattern);
scrPol.setBrush (selBrush);
view->repaint ();

But my polygon doesn't paint, I check coordinates of vertexes, all are correct.

Thanks in advance.

marcel
9th August 2007, 09:26
Are you sure you are not drawing off screen?

BTW, the code you posted is not exactly valid. Is that what you really use, or is it something you just gave as an example?

Regards

YuriyRusinov
9th August 2007, 09:55
something you just gave as an example?
I put this view on frame and another objects draws successfully.

marcel
10th August 2007, 18:56
Have you tried setting a width for the pen?