PDA

View Full Version : Changin the pen width for QGLWidget



sujan.dasmahapatra
4th December 2009, 06:05
Dear Friends
I am trying to change the width of the pen which is currently used by the paintEngine() in QGLWidget. For a particular object being drawn I want to increase the width.But it gives error see below.
////////////////////////////////////////////////
paintEngine()->painter()->pen().setWidth(8);
paintEngine()->painter()->pen().setColor(trolltechPurple);
//errors
rc/graphicsview_mesh.cpp:852: error: passing `const QPen' as `this' argument of `void QPen::setWidth(int)' discards qualifiers
src/graphicsview_mesh.cpp:853: error: passing `const QPen' as `this' argument of `void QPen::setColor(const QColor&)' discards qualifiers

Please someone tell what am I doing wrong.
I want to increase the width and color for a particular object and after drawing that object I want the width and color to be normal.

How can I achieve this. Any help would be appreciated.