[SOLVED] Limit QPainter to a defined area
General and Desktop
4
Posts
3
Posters
2.8k
Views
1
Watching
-
Hey there
Is there any possibility to define an area, let's say a rectangle in which the QPainter is visible only? So if I'm painting e.g. a line that starts outside this area and passes it, I will only see the part of the line which is inside that area.
Thanks for any help.
-
I think what your after is setting the clip region. Try QPainter::setClipRect. I haven't actually tried it, but I've used the same concept in other drawing systems, and I think it's what you're asking for.
-
Exactly what I was looking for, thx!