• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sliderMoved函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中sliderMoved函数的典型用法代码示例。如果您正苦于以下问题:C++ sliderMoved函数的具体用法?C++ sliderMoved怎么用?C++ sliderMoved使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sliderMoved函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setPosition

void SliderBase::mouseMoveEvent(QMouseEvent *e)
{
	if (_ignoreMouseMove)
	{
		_ignoreMouseMove = false;
		return;
	}

	double ms = 0.0;
	if (d_scrollMode == ScrMouse)
	{
		setPosition(e->pos());
		if (d_mass > 0.0)
		{
			ms = double(d_time.elapsed());
			if (ms < 1.0) ms = 1.0;
			d_speed = (exactValue() - exactPrevValue()) / ms;
			d_time.start();
		}
		if (value() != prevValue())
		{
			emit sliderMoved(value(), _id);
			emit sliderMoved((int)value(), _id);
		}
	}

}
开发者ID:Adamiko,项目名称:los,代码行数:27,代码来源:sliderbase.cpp


示例2: minValue

void SliderBase::wheelEvent(QWheelEvent *e)
{
	if(_ignoreMouseWheel)
	{
		e->ignore();
		return;
	}

	e->accept();

	float inc = (maxValue() - minValue()) / 40;
	if (e->modifiers() == Qt::ShiftModifier)
		inc = inc / 10;

	if (inc < step())
		inc = step();

	if (e->delta() > 0)
		setValue(value() + inc);
	else
		setValue(value() - inc);

	emit sliderMoved(value(), _id);
	emit sliderMoved((int)value(), _id);
}
开发者ID:Adamiko,项目名称:los,代码行数:25,代码来源:sliderbase.cpp


示例3: qDebug

void CQBarChart::setSlider()
{
#ifdef DEBUG_UI
  qDebug() << "-- in qwt3dPlot.cpp Plot3d::setSlider --";
#endif

  if (mSliderActive)
    if (mData.valueZone != 0)
      {
        mpSliderColumn->setMinimum(0);

        if (mData.columns == 1)
          mpSliderColumn->setMaximum((mData.columns - 1) * 1000);
        else
          mpSliderColumn->setMaximum(mData.columns * 1000);

        mpSliderRow->setMinimum(0);

        if (mData.rows == 1)
          mpSliderRow->setMaximum((mData.rows - 1) * 1000);
        else
          mpSliderRow->setMaximum(mData.rows * 1000);

        sliderMoved(mpSliderColumn->value() / 1000, mpSliderRow->value() / 1000);
      }
}
开发者ID:copasi,项目名称:COPASI,代码行数:26,代码来源:qwt3dPlot.cpp


示例4: qDebug

// Based on code from qslider.cpp
void Slider::mousePressEvent( QMouseEvent *e )
{
	qDebug("pressed (%d, %d)", e->pos().x(), e->pos().y());
	if( e->button() == Qt::LeftButton )
	{
		qDebug( "Left button" );
		QStyleOptionSlider opt;
		initStyleOption( &opt );
		const QRect sliderRect = style()->subControlRect( QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this );
		const QPoint center = sliderRect.center() - sliderRect.topLeft();
		// to take half of the slider off for the setSliderPosition call we use the center - topLeft

		if ( ! sliderRect.contains( e->pos() ) )
		{
			qDebug( "accept" );
			e->accept();

			int v = pixelPosToRangeValue( pick( e->pos() - center ) );
			setSliderPosition( v );
			triggerAction( SliderMove );
			setRepeatAction( SliderNoAction );
			emit sliderMoved( v );//TODO: ok?
			emit sliderPressed(); //TODO: ok?
		}
		else
		{
			QSlider::mousePressEvent( e );
		}
	}
	else
	{
		QSlider::mousePressEvent( e );
	}
}
开发者ID:MarcAntoine-Arnaud,项目名称:QtAV,代码行数:35,代码来源:Slider.cpp


示例5: Q_D

void DSlider::mouseMoveEvent(QMouseEvent *event)
{
    QAbstractSlider::mouseMoveEvent(event);

    Q_D(DSlider);

    if(d->mousePressed) {
        int newPosition = d->pixelPosToRangeValue(d->pick(event->pos()) - d->clickOffset);
        setSliderPosition(newPosition);

        emit sliderMoved(newPosition);
    }

    if (!d->m_hoverShowValue) {
        return;
    }

    QPoint pos = event->pos();
    QRect rect(d->getScalePosition(value()) - CustomDrawingLeftPadding, 10, 20, 20);
    if (d->m_handleHovering) {
        d->m_handleHovering = rect.contains(pos);
    } else {
        d->m_handleHovering = rect.contains(pos);
        if (d->m_handleHovering) {
            d->m_hoverTimout = false;
            if (d->m_hoverShowValueInterval > 0) {
                d->m_hoverTimer.start(d->m_hoverShowValueInterval);
            }
        }
    }

    update();
}
开发者ID:zccrs,项目名称:deepin-tool-kit,代码行数:33,代码来源:dslider.cpp


示例6: setSliderPosition

void Knob::updatePosition(int val)
{
    setSliderPosition(val);
    setToolTip(QString::number(val));
    update();
    emit sliderMoved(val);
}
开发者ID:tedr56,项目名称:Fluxus-Qinterface,代码行数:7,代码来源:knob.cpp


示例7: sliderPressed

void NSlider::mousePressEvent(QMouseEvent *event)
{
	if (event->button() != Qt::RightButton) {
		emit sliderPressed();

		QStyleOptionSlider opt;
		initStyleOption(&opt);
		QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this);
		QRect sr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderHandle, this);

		int pxMin;
		int pxMax;
		if (orientation() == Qt::Horizontal) {
			pxMin = gr.x() +  sr.width() / 2;
			pxMax = gr.right() -  sr.width() / 2 + 1;
		} else {
			pxMin = gr.y() + sr.height() / 2;
			pxMax = gr.bottom() - sr.height() / 2 + 1;
		}

		setValue(QStyle::sliderValueFromPosition(minimum(), maximum(), event->x() - pxMin, pxMax - pxMin, opt.upsideDown));

		emit sliderMoved(value());
	}

	QSlider::mousePressEvent(event);
}
开发者ID:vkolev,项目名称:nulloy,代码行数:27,代码来源:slider.cpp


示例8: rect

void SoundSlider::mouseMoveEvent( QMouseEvent *event )
{
    if( isSliding )
    {
        QRect rect( paddingL - 15,    -1,
                    WLENGTH + 15 * 2 , WHEIGHT + 5 );
        if( !rect.contains( event->pos() ) )
        { /* We are outside */
            if ( !b_mouseOutside )
                setValue( i_oldvalue );
            b_mouseOutside = true;
        }
        else
        { /* We are inside */
            b_mouseOutside = false;
            changeValue( event->x() - paddingL );
            emit sliderMoved( value() );
        }
    }
    else
    {
        int i = ( ( event->x() - paddingL ) * maximum() + 40 ) / WLENGTH;
        i = __MIN( __MAX( 0, i ), maximum() );
        setToolTip( QString("%1  %" ).arg( i ) );
    }
}
开发者ID:RicoP,项目名称:vlcfork,代码行数:26,代码来源:input_slider.cpp


示例9: triggerAction

void ValueSlider::
        triggerAction ( QAbstractSlider::SliderAction action )
{
    qreal d = slider_->maximum () - slider_->minimum ();
    qreal f = slider_->value () - slider_->minimum ();

    f /= d;

    switch(action)
    {
    case QAbstractSlider::SliderNoAction:       break;
    case QAbstractSlider::SliderSingleStepAdd:  f+=0.01; break;
    case QAbstractSlider::SliderSingleStepSub:  f-=0.01; break;
    case QAbstractSlider::SliderPageStepAdd:    f+=0.1; break;
    case QAbstractSlider::SliderPageStepSub:    f-=0.1; break;
    case QAbstractSlider::SliderToMinimum:      f=0; break;
    case QAbstractSlider::SliderToMaximum:      f=1; break;
    case QAbstractSlider::SliderMove:           break;
    }

    if (f<0) f = 0;
    if (f>1) f = 1;

    f *= d;

    slider_->setValue (slider_->minimum () + f);

    sliderMoved(slider_->value ());
}
开发者ID:aveminus,项目名称:freq,代码行数:29,代码来源:valueslider.cpp


示例10: available

void QSlider::moveSlider( int pos )
{
    int  a = available();
    int newPos = QMIN( a, QMAX( 0, pos ) );
    int newVal = valueFromPosition( newPos );
    if ( sliderVal != newVal ) {
	sliderVal = newVal;
	emit sliderMoved( sliderVal );
    }
    if ( tracking() && sliderVal != value() ) {
	setValue( sliderVal );
	// ### Why do we emit the valueChanged signal here?  It will get emitted in 
	// valueChange() anyway...
	//emit valueChanged( sliderVal );
    }

    switch ( (GUIStyle)style() ) {
    case WindowsStyle:
	newPos = positionFromValue( newVal );
	break;
    default:
    case MotifStyle:
	break;
    }

    if ( sliderPos != newPos )
	reallyMoveSlider( newPos );
}
开发者ID:kthxbyte,项目名称:QT2-Linaro,代码行数:28,代码来源:qslider.cpp


示例11: sliderRange

void
ScrollBar::catchSliderMoved(int value)
{
  double min, max;
  sliderRange(value, min, max);
  Q_EMIT sliderMoved(orientation(), min, max);
}
开发者ID:RTXI,项目名称:rtxi,代码行数:7,代码来源:scrollbar.cpp


示例12: processReleasedButton

void SoundSlider::mouseMoveEvent( QMouseEvent *event )
{
    /* handle mouserelease hijacking */
    if ( isSliding && ( event->buttons() & ~Qt::RightButton ) == Qt::NoButton )
        processReleasedButton();

    if( isSliding )
    {
        QRect rect( paddingL - 15,    -1,
                    wlength + 15 * 2 , wheight + 5 );
        if( !rect.contains( event->pos() ) )
        { /* We are outside */
            if ( !b_mouseOutside )
                setValue( i_oldvalue );
            b_mouseOutside = true;
        }
        else
        { /* We are inside */
            b_mouseOutside = false;
            changeValue( event->x() - paddingL );
            emit sliderMoved( value() );
        }
    }
    else
    {
        int i = ( ( event->x() - paddingL ) * maximum() + 40 ) / wlength;
        i = __MIN( __MAX( 0, i ), maximum() );
        setToolTip( QString("%1  %" ).arg( i ) );
    }
}
开发者ID:medoc92,项目名称:upplay,代码行数:30,代码来源:soundslider.cpp


示例13: value

void NSlider::wheelEvent(QWheelEvent *event)
{
    QSlider::wheelEvent(event);

    qreal val = value() / (qreal)maximum();
    emit sliderMoved(val);
}
开发者ID:chillin2,项目名称:nulloy,代码行数:7,代码来源:slider.cpp


示例14: sliderMoved

void PhMediaPanel::onSliderChanged(int position)
{
	PhTime time = position * PhTimeCode::timePerFrame(this->timeCodeType());
	if(_clock)
		_clock->setTime(time);
	emit sliderMoved(time);
}
开发者ID:FeodorFitsner,项目名称:Joker,代码行数:7,代码来源:PhMediaPanel.cpp


示例15: value

void SoundSlider::wheelEvent( QWheelEvent *event )
{
    int newvalue = value() + event->delta() / ( 8 * 15 ) * f_step;
    setValue( __MIN( __MAX( minimum(), newvalue ), maximum() ) );

    emit sliderReleased();
    emit sliderMoved( value() );
}
开发者ID:medoc92,项目名称:upplay,代码行数:8,代码来源:soundslider.cpp


示例16: getScrollMode

void SliderBase::mousePressEvent(QMouseEvent *e)
{
	QPoint p = e->pos();
	const Qt::MouseButton button = e->button();
	d_timerTick = 0;

	getScrollMode(p, button, d_scrollMode, d_direction);
	stopMoving();

	switch (d_scrollMode)
	{
		case ScrPage:
		case ScrTimer:
			d_mouseOffset = 0;
			DoubleRange::incPages(d_direction);
			emit sliderMoved(value(), _id);
			emit sliderMoved((int)value(), _id);
			d_tmrID = startTimer(qwtMax(250, 2 * d_updTime));
			break;

		case ScrMouse:
			d_speed = 0;
			if (button == Qt::RightButton)
			{
				emit sliderRightClicked(e->globalPos(), _id);
				break;
			}
			d_time.start();
			if (_cursorHoming && button == Qt::LeftButton)
			{
				_ignoreMouseMove = true;
				d_mouseOffset = 0.0;
			}
			else
				d_mouseOffset = getValue(p) - value();

			emit sliderPressed(_id);
			break;

		default:
			d_mouseOffset = 0;
			d_direction = 0;
			break;
	}
}
开发者ID:Adamiko,项目名称:los,代码行数:45,代码来源:sliderbase.cpp


示例17: valueAtPos

void NSlider::mouseMoveEvent(QMouseEvent *event)
{
    int pos = (orientation() == Qt::Horizontal) ? event->x() : event->y();
    qreal val = valueAtPos(pos);
    setValue(val);
    emit sliderMoved(val);

    QSlider::mouseMoveEvent(event);
}
开发者ID:chillin2,项目名称:nulloy,代码行数:9,代码来源:slider.cpp


示例18: style

void Plot::mouseMoveEvent(QMouseEvent *event)
{
    if (event->pos().y() > padding_top && event->pos().y() < height() - padding_bottom)
    {
        auto sv = style()->sliderValueFromPosition(softMinimum, softMaximum, event->pos().x() - 50 - 10, width() - 50 - 20);
        setValue(sv);
        emit sliderMoved(sv);
    }
}
开发者ID:regulomics,项目名称:ChromosomeVisualizer,代码行数:9,代码来源:plot.cpp


示例19: width

void NWaveformSlider::mousePressEvent(QMouseEvent *event)
{
    if (event->button() == Qt::RightButton)
        return;

    qreal value = (qreal)event->x() / width();

    emit sliderMoved(value);
    setValue(value);
}
开发者ID:chillin2,项目名称:nulloy,代码行数:10,代码来源:waveformSlider.cpp


示例20: setSliderPosition

void Slider::mousePressEvent(QMouseEvent *e)
{
    int handlePos = QStyle::sliderPositionFromValue(minimum(),maximum(),sliderPosition(),width());
    if(handlePos<e->pos().x()-5||handlePos>e->pos().x()+5)
    {
        int position = QStyle::sliderValueFromPosition(minimum(),maximum(),e->pos().x(),width());
        setSliderPosition(position);
        emit sliderMoved(sliderPosition());
    }
}
开发者ID:raf924,项目名称:iniTunes,代码行数:10,代码来源:slider.cpp



注:本文中的sliderMoved函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sliderPressed函数代码示例发布时间:2022-05-30
下一篇:
C++ slider函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap