#196 QwtKnob with a 360 degree scale

None
closed
nobody
None
5
2014-09-11
2013-10-27
Uwe Rathmann
No

Several issues are wrong with QwtKnob with a closed scale ( 360 degrees )-

1) the first/last is not accessible using the mouse
2) when wrapping is false wrapping is still possible using the mouse

when wrapping is true what to do with first/last as they are on the same position ?

The following code demonstrates the situation:

int main(int argc, char ** argv)
{
QApplication app(argc, argv) ;

QwtKnob *knob = new QwtKnob ;
QLabel  *label = new QLabel ;
QObject::connect(knob, SIGNAL(valueChanged(double)),
    label,SLOT(setNum(double))) ;

knob->setWrapping( true );
knob->setTotalAngle(360);
knob->setScaleStepSize( 30.0 );
knob->setScale( 0, 360 );
knob->setTotalSteps( 360 );
knob->setValue( 355 );

QWidget w;
QVBoxLayout* l = new QVBoxLayout( &w );
l->addWidget( knob );
l->addWidget( label );

w.resize( 200, 200 );
w.show();

return app.exec() ;

}

Discussion


Anonymous


Cancel   Add attachments