Solved Drawing part of Pixmap onto circular region of widget.
-
As Qt doesn't seem to support (by and large) drawing onto a non-rectangular area, how do I go about copying a portion of a Pixmap onto a circular area of my widget?
I'm guessing that this might involve QPainterPath ...
Thanks, David
-
Hi
It its possible using a mask/region/brush depending on what you really like.https://forum.qt.io/topic/87229/circle-user-avatar-issue
In any case for plain drawing then maybe
QRegion region (0, 0, w,h, QRegion::Ellipse);
is what you want and then use it for clipping. -
Hi
It its possible using a mask/region/brush depending on what you really like.https://forum.qt.io/topic/87229/circle-user-avatar-issue
In any case for plain drawing then maybe
QRegion region (0, 0, w,h, QRegion::Ellipse);
is what you want and then use it for clipping. -
QRegion region (0, 0, w,h, QRegion::Ellipse); is what you want and then use it for clipping.
Works nicely (once I got the sums right for selecting the correct source rectangle).
Red arrow represents where mouse pointer was.
David