Customized QDial with QSS Support

Coding | Projects 15 15 Comments

custom dialGoogling “customize QDial” will generate a lot of results telling you to sub-class QDial and create your own paintEvent.  Of course, there are precious few examples floating around of exactly how to do that, namely rotating and scaling images.  As I had to create a customized QDial recently, I thought I’d share the class I wrote for doing it, which allows each dial to be skinned via QSS, making it play nicely with Qt Designer (hint: promote your QDial to this class).  The QDial to the right here serves as an excellent example of what you can do.

So, without further ado, the code is behind the cut:

Read More