How do I Build this Widget for Automotive Application in GUI
-
It's a 4-way button with some sort of display in the middle, right?!
You could use single components and design a composed widget or you paint everything yourself using a custom widget and itspaintEvent
Edit:
A custom widget acting like two spinBoxes together (thinking kinda abstract) might also work, since you have increase/decrease functions on X- and Y-axis (temperature and fan speed)
Btw: QML or QtWidget? And have you looked if there's something similar around yet?
-
With Qt widgets you can make a new custom QWidget and do the paint yourself, ask your graphics team to provide you pre-rendered button background image + graphics do a few simple QPainter draw operations to blit the background image and button icons and the text.
Other possible solution is to create some custom GLSL shaders with GL paointer.
-
Use some creativity and basic software engineering principles.
You could start by subclassing QWidget and overriding
void paintEvent(QPaintEvent * e);
and also
void mousePressEvent(QMouseEvent *); void mouseMoveEvent(QMouseEvent *); void mouseReleaseEvent(QMouseEvent *);
then implementing the graphics and functional behaviour you wish to see and support.
This at least means using classes like QPainter, QBrush, QPen, QTransform, QImage, QPixmap, and maybe QRegion.QTimer, QVariantAnimation will assist with the look and feel of the result.
You presumably have some underlying model that the UI interacts with, so use signals and slots for that.There is probably more than just this one widget in the dashboard, if so structure your graphical widgets hierarchically where common functionality is provided by base classes.
-
@KenAppleby-0
I could Implement this much -