[QT][QML][C++] Draw an interpolated polygon using C++ painter
-
Something like spline interpolation?!
This example is for
QChart
but maybe you can use spline interpolation for your polygon. -
@Pl45m4 Thanks but not; this is not the way; as told in my question, I already tried but it works only in a chart. And I should draw a free polygon outside a chart. Any other idea?
(No, SPline in a drawPolyline give an error; only under a chart I can use it).
-
@Shadow-01 said in [QT][QML][C++] Draw an interpolated polygon using C++ painter:
thanks; rounded polygon doesn't exist under the item that QT creator suggested me in the list of figure I can draw; should I import something
Yes, the link has a that class in the bottom. ITs not a default Qt one.
The effect sounds like what you want.
but might end being too round. I have not tried it with a shape like yours.
-
@Shadow-01
Hi
but look at the airplane. it does touch the edges.
Outside of such rounded polygon im not sure what to use. -
@Shadow-01 said in [QT][QML][C++] Draw an interpolated polygon using C++ painter:
(No, SPline in a drawPolyline give an error; only under a chart I can use it).
Read my answer again.
I know that you can't useQSplineSeries
outside ofQChart
but you should take a took at it (spline interpolation) and the Wikipedia page, I linked.If there's nothing like this in Qt you have to draw it yourself using mathematics.
-
@Shadow-01
You could show an image of the final result :) 🙄
So did you use code from link or did you make some yourself ?