is it possibel to add a background-imnage to the QDial?
-
No. ancestor of QDial is QWidget, which does not directly support images. QLabel, which is on a different inheritance branch of QWidget does support.
You would have to design a custom widget to do what you want to do. It's not possible with the canned widget, unless some transparency witchcraft of overlaid widgets will work...
-
https://doc.qt.io/qt-5/stylesheet-reference.html#background-prop
This property is supported by QAbstractItemView subclasses, QAbstractSpinBox subclasses, QCheckBox, QComboBox, QDialog, QFrame, QGroupBox, QLabel, QLineEdit, QMenu, QMenuBar, QPushButton, QRadioButton, QSplitter, QTextEdit, QToolTip, and plain QWidgets.
https://bugreports.qt.io/browse/QTBUG-61481
It would be useful if QDial had support for stylesheets.
The only stylesheet property that works with QDial is background. It should have ::handle and ::groove sub controls like QSlider as long as it inherits QAbstractSlider.
However, if you don't use a stylesheet then according to https://www.qtcentre.org/threads/29003-Trying-to-create-custom-QDial?p=136681#post136681
I think I will have to subclass QDial and overload paintEvent(). I am able to achieve desired behavior doing so. Wanted to use Stylesheet for this. Let me know if you have a solution with Stylesheet.