You are drawing outside your boundingRect(). Calling setPos() in the item constructor doesn't make much sense either.
You are drawing outside your boundingRect(). Calling setPos() in the item constructor doesn't make much sense either.
Do you mean adding adjust*2 when I specify rectf width and height?
Qt Code:
{ qreal adjust = 0.5; , iRadius*2 + adjust*2); return rectf; }To copy to clipboard, switch view to plain text mode
Simplify the code (QRectF has a bunch of nice methods). And what's the purpose of calling setPos() in the constructor?
I am going to rewrite it so it will look better.
If it comes to constructor, hmm well it is a remaining from my try-outs, setPos() is going to be removed. Now I know it is not the best way to do so, but when I started with QGraphics... stuff I didn't know that.
Bookmarks