[Gllug] QT drawPoints help

Wenceslao Requejo W.Requejo at student.westminster.ac.uk
Sat Mar 17 20:17:39 UTC 2007


Hi everyone, 

I am trying  to draw a series of points an a line joining those points
together using the, and optionally just the line and/or the points, but
for some reason whatever the width of the pen I use, the points just
look like one pixel wide. Has anyone any tip to go around this, appart
for using the paintEllipse function for each point.

This is  part of the code involved:


    	QPen linepen, pointpen;
	pointpen.setWidth(10);
   	pointpen.setColor(red);
   	linepen.setStyle(SolidLine);
   	linepen.setWidth(2);

		....
    	painter->setPen(linepen);
	painter->drawPolyline(points);
	painter->setPen(pointpen);
	painter->drawPoints(points);

Where points is a  QPointArray
According to the QT documentation drawPoints

void QPainter::drawPoints ( const QPointArray & a, int index = 0, int
npoints = -1 ) 
Draws/plots an array of points, a, using the current pen. 

Are there any restrictions on the points width ??

Many thanks

Wenceslao Requejo


-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list