I'd like to perform a custom painting of my qgraphicsrectitem.
I don't understand the why the Rect is painted, using this code:
Code:
painter->setPen(Qt::NoPen); /*My Custom Painting*/ }
Printable View
I'd like to perform a custom painting of my qgraphicsrectitem.
I don't understand the why the Rect is painted, using this code:
Code:
painter->setPen(Qt::NoPen); /*My Custom Painting*/ }
The QGraphicsRectItem has it's pen attribute and use it to draw it's shape.
you can do this
Code:
{ this->setPen(p); /*My Custom Painting*/ }
ok, thanks!
You are using - painter->setPen(Qt::NoPen);
How come u are getting a rect drawn ?? Or u mean the rect shape is filled ??
Theres a difference between pen and brush. Brush is used to fill the shape, while pen is used to draw lines/shape.