PDA

View Full Version : how to color the top edge of a rect



dreamer
15th May 2008, 13:58
How can i color the top edge of my custom QGraphicsRectItem......?????
i perhaps guess reimplementing the paint() event........
Can i have an example??

jpn
15th May 2008, 14:03
There's an example in QGraphicsItem::paint() docs.

dreamer
15th May 2008, 14:32
reimplementing the paint() virtual function, i obtain my behaviour but then i can't set other parameters like the color inside my rect.
I'd just like to color the top edge of my rect and to leave the building of the other attributes to its parent class.......

jpn
15th May 2008, 15:10
Call the base class implementation:


void SubClass::function()
{
BaseClass::function(); // <--

... // do something else
}

dreamer
15th May 2008, 15:15
thx.......:D