Changing QDial angle range, zero-point, and pointer image
-
wrote on 4 Nov 2023, 05:05 last edited by
By default, it looks like the
QDial
has a ~270 degree range, with its zero-point at a roughly 225° angle, and a pointer image that is pretty much just a little circle (this part seems platform dependent?).All of these are things I'd like to change. My first intuition is to change
paintEvent
to change the range, zero-point, and the image (likely by drawing a custom pointer withQPainter
), and perhaps also changemouseEvent
to accommodate these changes.However, I'm not entirely sure how this would be done, as it would effectively mean completely redoing QDial's paint and mouse events that handle all the logic that results in the defaults mentioned above... any help?
-
@SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.
(It would also be a valuable learning experience to reimplement much of QDial to my needs.)
@swurl then the most simple is to read the code of QDial and create your own based on it.
-
Hi,
Before trying to rebuild QDial from scratch, did you check the Qwt librairie Dial components ?
-
Hi,
Before trying to rebuild QDial from scratch, did you check the Qwt librairie Dial components ?
wrote on 5 Nov 2023, 20:44 last edited by@SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.
(It would also be a valuable learning experience to reimplement much of QDial to my needs.)
-
@SGaist Yeah, I've seen that many times... I'd like to remove external dependencies as much as possible outside of what's actually necessary.
(It would also be a valuable learning experience to reimplement much of QDial to my needs.)
@swurl then the most simple is to read the code of QDial and create your own based on it.
-
1/4