PDA

View Full Version : QwtKnob with icons/pixmap for ticks



roger1977
26th November 2013, 10:30
Hello,
I am trying to implement a QwtKnob with symbols. So far I am using a QwtCompassScaleDraw with a LabelMap (QMap<double, QString>) of doubles and QChars for qreek symbols e.g. map.insert( 2.0, QString( QChar(0x03A9) ) ) and use setScaleDraw for the knob. This is working quite well but what if I need to use a image for a symbol which is not in the charset. Is there a way for settings an image as a tick?
Best,
Roger

roger1977
26th November 2013, 14:19
Hi,
I did find a solution: I subclassed QwtRoundScaleDraw and implemented drawLabel but instead to draw the label I use the painter to draw a corresponding pixmap which depends on the value passed to drawLabel.
Best,
Roger