sirop
24th May 2017, 15:14
Hello.
AttitudeIndicator class within the example "dials" show how to customize a QwtDialNeedle.
Thus one can get some free space within the dial to print the present angle value within the dial
if the space outside the dial is scarce.
I thought that something like:
void AttitudeIndicator::paintEvent( QPaintEvent *event )
{
QPainter painter(this);
painter.save();
painter.drawText(innerRect().center(),QString::num ber(value()));
painter.restore();
}
would help, but this paintEvent function only updates the text without repainting the dial itself.
Is there any elegant workaround for this?
Thanks.
AttitudeIndicator class within the example "dials" show how to customize a QwtDialNeedle.
Thus one can get some free space within the dial to print the present angle value within the dial
if the space outside the dial is scarce.
I thought that something like:
void AttitudeIndicator::paintEvent( QPaintEvent *event )
{
QPainter painter(this);
painter.save();
painter.drawText(innerRect().center(),QString::num ber(value()));
painter.restore();
}
would help, but this paintEvent function only updates the text without repainting the dial itself.
Is there any elegant workaround for this?
Thanks.