Beispiel #1
0
void Knob::valueChange()
{
	recalcAngle();
	d_newVal++;
	repaint(kRect);
	SliderBase::valueChange();
}
/*!
  \brief Notify a change of the range

  Called by QwtAbstractSlider
*/
void QwtKnob::rangeChange()
{
    if ( autoScale() )
        rescale( minValue(), maxValue() );

    layoutKnob( true );
    recalcAngle();
}
Beispiel #3
0
/*!
  \brief Notify a change of the range

  Called by QwtSliderBase
*/
void QwtKnob::rangeChange()
{
    if (!hasUserScale())
    {
        scaleDraw()->setScale(minValue(), maxValue(),
            scaleMaxMajor(), scaleMaxMinor());
    }
    layoutKnob();
    recalcAngle();
}
Beispiel #4
0
void Knob::rangeChange()
{
    if (!hasUserScale())
    {
  d_scale.setScale(minValue(), maxValue(),
       d_maxMajor, d_maxMinor);
    }
    recalcAngle();
    resize(size());
    repaint();
}
void QwtKnob::initKnob()
{
    d_data = new PrivateData;

    setScaleDraw( new QwtRoundScaleDraw() );

    setUpdateTime( 50 );
    setTotalAngle( 270.0 );
    recalcAngle();
    setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) );

    setRange( 0.0, 10.0, 1.0 );
    setValue( 0.0 );
}
Beispiel #6
0
void QwtKnob::initKnob()
{
#if QT_VERSION < 0x040000
    setWFlags(Qt::WNoAutoErase);
#endif

    d_data = new PrivateData;

    setScaleDraw(new QwtRoundScaleDraw());

    setUpdateTime(50);
    setTotalAngle( 270.0 );
    recalcAngle();
    setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));

    setRange(0.0, 10.0, 1.0);
    setValue(0.0);
}
Beispiel #7
0
void Knob::valueChange()
      {
      recalcAngle();
      d_newVal++;
      repaint(kRect);
      
      // HACK
      // In direct mode let the inherited classes (this) call these in their valueChange() methods, 
      //  so that they may be called BEFORE valueChanged signal is emitted by the setPosition() call above.
      // ScrDirect mode only happens once upon press with a modifier. After that, another mode is set.
      // Hack: Since valueChange() is NOT called if nothing changed, in that case these are called for us by the SliderBase.
      if(d_scrollMode == ScrDirect)
      {
        processSliderPressed(id());
        emit sliderPressed(id());
      }
      
      // Emits valueChanged if tracking enabled.
      SliderBase::valueChange();
      }
Beispiel #8
0
/*!
  \brief Constructor
  \param parent Parent widget
  \param name Name
*/
QwtKnob::QwtKnob(QWidget* parent, const char *name): 
    QwtSliderBase(Qt::Horizontal, parent, name, 
                Qt::WRepaintNoErase|Qt::WResizeNoErase)
{
    d_angle = 0.0;
    d_oldAngle = 0.0;
    d_nTurns = 0.0;
    d_borderWidth = 2;
    d_borderDist = 4;
    d_totalAngle = 270.0;
    d_scaleDist = 4;
    d_hasScale = 0;
    d_symbol = Line;
    d_maxScaleTicks = 11;
    d_knobWidth = 50;
    d_dotWidth = 8;

    scaleDraw()->setGeometry(
        0, 0, d_knobWidth + 2 * d_scaleDist, QwtScaleDraw::Round );
    setUpdateTime(50);
    setTotalAngle( 270.0 );
    recalcAngle();
    setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
}
/*!
  \brief Notify change of value

  Sets the knob's value to the nearest multiple
  of the step size.
*/
void QwtKnob::valueChange()
{
    recalcAngle();
    update();
    QwtAbstractSlider::valueChange();
}
Beispiel #10
0
/*!
  \brief Notify change of value

  Sets the slider's value to the nearest multiple
  of the step size.
*/
void QwtKnob::valueChange()
{
    recalcAngle();
    update();
    QwtSliderBase::valueChange();
}