当前位置: 首页>>代码示例>>C++>>正文


C++ QSlider::minimum方法代码示例

本文整理汇总了C++中QSlider::minimum方法的典型用法代码示例。如果您正苦于以下问题:C++ QSlider::minimum方法的具体用法?C++ QSlider::minimum怎么用?C++ QSlider::minimum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QSlider的用法示例。


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

示例1: setChOutRange

/**
  Sets the minimum/maximum value of the channel 0 to seven output sliders.
  Have to do it here because setMinimum is not a slot.

  One added trick: if the slider is at either its max or its min when the value
  is changed, then keep it on the max/min.
  */
void ConfigServoWidget::setChOutRange()
{
    QSpinBox *spinbox = (QSpinBox*)QObject::sender();

    int index = outMin.indexOf(spinbox); // This is the channel number
    if (index < 0)
        index = outMax.indexOf(spinbox); // We can't know if the signal came from min or max

    QSlider *slider = outSliders[index];

    int oldMini = slider->minimum();
    int oldMaxi = slider->maximum();

    if (outMin[index]->value()<outMax[index]->value())
    {
        slider->setRange(outMin[index]->value(), outMax[index]->value());
        reversals[index]->setChecked(false);
    }
    else
    {
        slider->setRange(outMax[index]->value(), outMin[index]->value());
        reversals[index]->setChecked(true);
    }

    if (slider->value() == oldMini)
        slider->setValue(slider->minimum());

//    if (slider->value() == oldMaxi)
//        slider->setValue(slider->maximum());  // this can be dangerous if it happens to be controlling a motor at the time!
}
开发者ID:zhao0079,项目名称:software,代码行数:37,代码来源:configservowidget.cpp

示例2: setLogoRatio

void SettingsWindow::setLogoRatio(int sliderValue)
{
    QSlider *slider = reinterpret_cast<QSlider *>(sender());
    qreal steps = slider->maximum() - slider->minimum();
    qreal ratio = sliderValue / steps;
    _settings->setLogoSizeRatio(ratio);
}
开发者ID:bimetek,项目名称:SiloGraph,代码行数:7,代码来源:SettingsWindow.cpp

示例3: checkLimits

void checkLimits(HI::GUITestOpStatus &os, int minVal, int maxVal){
    QSlider* thresholdSlider = qobject_cast<QSlider*>(GTWidget::findWidget(os, "thresholdSlider"));
    CHECK_SET_ERR(thresholdSlider != NULL, "thresholdSlider not found");
    int actualSliderMin = thresholdSlider->minimum();
    int actualSliderMax = thresholdSlider->maximum();
    CHECK_SET_ERR(actualSliderMin == minVal, QString("wrong minimal value for slider. Expected: %1, actual: %2").arg(minVal).arg(actualSliderMin));
    CHECK_SET_ERR(actualSliderMax == maxVal, QString("wrong maximim value for slider. Expected: %1, actual: %2").arg(maxVal).arg(actualSliderMin));

    QSpinBox* thresholdSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "thresholdSpinBox"));
    CHECK_SET_ERR(thresholdSpinBox != NULL, "thresholdSpin not found");
    int actualSpinMin = thresholdSpinBox->minimum();
    int actualSpinMax = thresholdSpinBox->maximum();
    CHECK_SET_ERR(actualSpinMin == minVal, QString("wrong minimal value for spin. Expected: %1, actual: %2").arg(minVal).arg(actualSpinMin));
    CHECK_SET_ERR(actualSpinMax == maxVal, QString("wrong maximim value for spin. Expected: %1, actual: %2").arg(maxVal).arg(actualSpinMin));
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:15,代码来源:GTTestsMSAEditorConsensus.cpp

示例4: setZoom

void ZoomWidget::setZoom(qreal zoom)
{
    int intZoom = qRound(zoom * 100);
    d->mZoomLabel->setText(QString("%1%").arg(intZoom));

    // Don't change slider value if we come here because the slider change,
    // avoids choppy sliding scroll.
    if (!d->mZoomUpdatedBySlider) {
        QSlider* slider = d->mZoomSlider->slider();
        SignalBlocker blocker(slider);
        int value = sliderValueForZoom(zoom);

        if (value < slider->minimum()) {
            // It is possible that we are called *before* setMinimumZoom() as
            // been called. In this case, define the minimum ourself.
            d->mZoomSlider->setMinimum(value);
        }
        d->mZoomSlider->setValue(value);
    }
}
开发者ID:theunbelievablerepo,项目名称:gwenview,代码行数:20,代码来源:zoomwidget.cpp


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