Arc gauge
-
@Mark81 I think, this will get complicated quite quickly, if you want to do it in pure qml & canvas.
I would suggest looking into subclassing QQuickPaintedItem that way you can just partially draw the 2nd image, depending on your gauge value.
-
-
@J.Hilk said in Arc gauge:
that way you can just partially draw the 2nd image, depending on your gauge value.Interesting. Following your approach could not be even easier to draw the colored scale into a
Shape
element withclip
property true. The shape will be a trapezoid with an inclined side starting from the center of the gauges (bound to the value property).I would try it when I understand why "module "QtQuick.Shapes" version 1.12 is not installed" on my system!
-
@raven-worx this does nothing but paints one image one on top of the other....
-
@raven-worx this does nothing but paints one image one on top of the other....
i thought you get a separate image for each possible value.
If you want to keep going the QML-only way take a look at OpacityMask
Again for the mask shape you can use a Canvas element drawing an arc to cover the unneeded sectors. -
@raven-worx said in Arc gauge:
If you want to keep going the QML-only way take a look at OpacityMask
Again for the mask shape you can use a Canvas element drawing an arc to cover the unneeded sectors.Got it. This is a good advice. I'm going to try it and I'll report back the result.
Thanks for the patience! -
Hi Mark81 - did you achieve your goal?, I realise this question is around 5 years old, but I'm curious to know if you found/created a solution?
I have created similar software using CircularSlider/Progress (https://github.com/arunpkio/CircularSlider) with a Repeater, including using Canvas for added circular effects.
-
Qt 6.8 has just what the doctor ordered (see https://www.youtube.com/watch?v=iXLoC06CKOc):