How to create Pie object?
Solved
General and Desktop
-
Hello,
I would like to check if the QPoint is inside a pie, which I create using QPainter:
drawPie(int x, int y, int width, int height, int startAngle, int spanAngle)
So I would like something like:
QPie pie(int x, int y, int width, int height, int startAngle, int spanAngle); if(pie.contains(myPoint)) { }
Is a simple way to do that?
-
@TomNow99 well it still holds true, just that you have to 2 additional boundary checks.
I don't have those at hand, from the top of my head. But this stack overflow thread has it:
https://stackoverflow.com/a/51896645 -
@TomNow99 said in How to create Pie object?:
I would like to check if the QPoint is inside a pi
you know, that's basic Pythagoras
(x - centerX) * (x - centerX) + (y - centerY)*(y - centerY) < radius *radius
-
@TomNow99 well it still holds true, just that you have to 2 additional boundary checks.
I don't have those at hand, from the top of my head. But this stack overflow thread has it:
https://stackoverflow.com/a/51896645