[Qt-interest] Changin the pen width for QGLWidget
Ross Driedger
ross at earz.ca
Fri Dec 4 14:06:13 CET 2009
On Fri, 04 Dec 2009 01:35:38 -0500, <qt-interest-request at trolltech.com>
wrote:
> 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
I can't tell exactly what the problem in your code is, but if you come
across: "...discards qualifiers", this usually means you are passing a
const object (or reference or pointer) to a function that is expecting or
needing to be non-const.
--
"My music is not difficult, my music is played badly."
Arnold Schoenberg
Ross Driedger
ross_at_earz.ca
More information about the Qt-interest-old
mailing list