I'd like to perform a custom painting of my qgraphicsrectitem.
I don't understand the why the Rect is painted, using this code:
Qt Code:
 painter->setPen(Qt::NoPen); /*My Custom Painting*/ }To copy to clipboard, switch view to plain text mode
							
						
					
					
						
    
    
    
    
    
    
  
    
    
    
    
    
  I'd like to perform a custom painting of my qgraphicsrectitem.
I don't understand the why the Rect is painted, using this code:
Qt Code:
 painter->setPen(Qt::NoPen); /*My Custom Painting*/ }To copy to clipboard, switch view to plain text mode
The QGraphicsRectItem has it's pen attribute and use it to draw it's shape.
you can do this
Qt Code:
 { this->setPen(p); /*My Custom Painting*/ }To copy to clipboard, switch view to plain text mode
A camel can go 14 days without drink,
I can't!!!
							
						
					
					
						
    
    
    
    
    
    
  
    
    
    
    
    
  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.
Bookmarks