PDA

View Full Version : QPainter::drawLineSegments



lni
4th October 2009, 17:05
Hi,

In Qt3, there is QPainter::drawLineSegments, what is the replacement in Qt4?

Thanks...

scascio
4th October 2009, 17:46
I don't know what QPainter::drawLineSegments does,
but among all the drawing methods of QPainter didn't you find any that fits your needs?

lni
5th October 2009, 19:39
I don't know what QPainter::drawLineSegments does,
but among all the drawing methods of QPainter didn't you find any that fits your needs?

There is a workaround, but required extra coding...

scascio
5th October 2009, 22:16
Maybe you can use std::copy to convert your array into a QVector,
then use drawPolygon since a QPolygon is a QVector<QPoint>


QPointArray yourArray;
QPolygon polygon(yourArray.size());
std::copy(yourArray.begin(), yourArray.end(), polygon.begin())
painter->drawPolygon(polygon);

Or maybe Qt provides container algorithm too.

hope this helped you...