PDA

View Full Version : QGraphicsRectItem rounded corners



forty-two
3rd July 2012, 22:38
Hi,

Since it says nothing about rounding the corners of a QGraphicsRectItem in the Qt-Documentation, I would like to know if it's possible, and if yes how?

Thanks in advance,
forty-two

wysota
3rd July 2012, 23:44
You have to subclass QGraphicsRectItem and call QPainter::drawRoundRect() in your paint() implementation. Implementing shape() would also be advised if you wish to do collision detection.