Seeking inspiration for direction orientation.
-
Good day everyone,
After months of exploring Qt, I decided to refine my Design through Qt Widgets (Not QML). I would like to create something similar as shown below (Not sure what this is called but seems to be for direction orientation). I got the photo from google under search name ship conning display.
As far as to replicate it, Qt only provide bar widget. But how about the curve such as shown?
Another similar direction orientation is from a game "Rules of survival". How do I make such bar to be interactive (Moving left and right upon movement along with the numbers )? Can Qt Widget replicate the 2 followings examples?
Thank you and lets hope to have a great discussion.
-
hi @Faruq
to answer your question, there is, in principle, nothing in QWidgets that would prevent you from creating the 2 examples.
But, the fancier the ui, so more difficult and complex its going to be.
The first example, I would simply print as a Image to the background, and using an overwritten paintEvent to draw the green&curved reactangle according to some value(position)
The 2nd example, seems like a tumbler-esk item. There's no native QWidget for that. You would have to create your own or search the internet/github :-)
-
@Faruq
QML (usingCanvas
element) and QtQWidgets (usingQPainter
in combination withQPainterPath
) is capable of drawing such things.
In either way it's all about the math and doing the calculations of each shape (arcs, lines, texts, ...)
The bottom image is rather easy. Yyou just need to calculate the translation along the x-axis based on your input values which make up the direction.