Knob: draw arc around knob

Initial work on improved knob usability by drawing an arc around knob
indicating current state as well.
This commit is contained in:
Tobias Doerffel
2014-01-23 23:35:44 +01:00
parent 5540a356f7
commit f2bfa3b4d2
2 changed files with 10 additions and 7 deletions

View File

@@ -132,6 +132,11 @@ private:
void setPosition( const QPoint & _p );
bool updateAngle();
int angleFromValue( float value, float minValue, float maxValue, float totalAngle ) const
{
return static_cast<int>( ( value - 0.5 * ( minValue + maxValue ) ) / ( maxValue - minValue ) * m_totalAngle ) % 360;
}
inline float pageSize() const
{
return( qMax<float>( ( model()->maxValue() -