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


C++ setMinimum函数代码示例

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


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

示例1: setMinimum

void TimeUnitBox::setDaysOnly( bool daysonly ) {
    if ( daysonly ) {
        setMinimum( 1-DAYUNITS );
        setMaximum( DAYUNITS-1 );
        setValue( 1 ); // Start out with days units

        UnitStep[0] = 0;
        UnitStep[1] = 1;
        UnitStep[2] = 5;
        UnitStep[3] = 8;
        UnitStep[4] = 14;
    } else {
        setMinimum( 1-ALLUNITS );
        setMaximum( ALLUNITS-1 );
        setValue( 1 ); // Start out with seconds units

        UnitStep[0] = 0;
        UnitStep[1] = 4;
        UnitStep[2] = 10;
        UnitStep[3] = 16;
        UnitStep[4] = 21;
        UnitStep[5] = 25;
        UnitStep[6] = 28;
        UnitStep[7] = 34;
    }
}
开发者ID:rajeshwer-s,项目名称:kstars-hackfest,代码行数:26,代码来源:timeunitbox.cpp

示例2: setInfinite

 void setInfinite(bool infinite)
 {
   if(infinite)
   {
     setMinimum(0);
     setMaximum(0);
     setValue(0);
   }
   else
   {
     setMinimum(0);
     setMaximum(maxProgress + 1);
     setValue(0);
   }
 }
开发者ID:gwihlidal,项目名称:renderdoc,代码行数:15,代码来源:QRDUtils.cpp

示例3: setMinimum

//***************************************************************************
void Kwave::InvertableSpinBox::setInverse(bool inverse)
{
    if (m_inverse == inverse) return; // nothing to do
    m_inverse = inverse;

    if (/* now */ inverse) {
        // relax limits by 1
        setMinimum(minimum() - 1);
        setMaximum(maximum() + 1);
    } else {
        // reduce limits by 1
        setMinimum(minimum() + 1);
        setMaximum(maximum() - 1);
    }
}
开发者ID:KDE,项目名称:kwave,代码行数:16,代码来源:InvertableSpinBox.cpp

示例4: QWidget

XFloatWidget::XFloatWidget( qreal val, QWidget *parent ) : QWidget( parent ),
        _layout( new QHBoxLayout( this ) ),
        _spinner( new QDoubleSpinBox( this ) ),
        _slider( new QSlider( Qt::Horizontal, this ) ),
        _setting( false )
    {
    _layout->addWidget( _slider );
    _layout->addWidget( _spinner );
    _layout->setContentsMargins( 0, 0, 0, 0 );
    _layout->setSpacing( 5 );

    connect( _spinner, SIGNAL(valueChanged(double)), this, SLOT(setValueFromSpinner(double)));
    connect( _slider, SIGNAL(valueChanged(int)), this, SLOT(setValueFromSlider(int)));

    _spinner->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );

    _slider->setMaximum( 0x7FFF );
    _slider->setMinimum( -0x7FFF );
    _slider->setSingleStep( 250 );
    _slider->setPageStep( 5000 );

    _spinner->setDecimals( 4 );
    _spinner->setMinimumWidth( 40 );

    setMaximum( HUGE_VAL );
    setMinimum( -HUGE_VAL );
    setValue( val );
    updateUsed();
    }
开发者ID:davidmueller13,项目名称:vexx,代码行数:29,代码来源:XFloatWidget.cpp

示例5: maxValue

void QmitkNumberPropertySlider::adjustFactors(short newDecimalPlaces, bool newShowPercents)
{
  int oldMax = maxValue();
  int oldMin = minValue();

  m_DecimalPlaces = newDecimalPlaces;
  m_ShowPercents = newShowPercents;

  m_FactorPropertyToSlider = pow(10.0,m_DecimalPlaces);
  m_FactorSliderToDisplay = 1.0 / m_FactorPropertyToSlider;

  // commented line would set the default increase/decrease to 1.0, no matter how many decimal places are available
  //setLineStep( ROUND(m_FactorPropertyToSlider) );

  if ( m_ShowPercents )
  {
    m_FactorPropertyToSlider *= 100.0;
    //setLineStep( ROUND(0.01 *m_FactorPropertyToSlider) );
    //setSuffix("%");
  }
  else
  {
    //setSuffix("");
  }

  setMinimum(oldMin);
  setMaximum(oldMax);
}
开发者ID:Maggunator,项目名称:MITK,代码行数:28,代码来源:QmitkNumberPropertySlider.cpp

示例6: MySlider

TimeSlider::TimeSlider( QWidget * parent ) : MySlider(parent)
{
	dont_update = FALSE;
	setMinimum(0);
#ifdef SEEKBAR_RESOLUTION
	setMaximum(SEEKBAR_RESOLUTION);
#else
	setMaximum(100);
#endif

	setFocusPolicy( Qt::NoFocus );
	setSizePolicy( QSizePolicy::Expanding , QSizePolicy::Fixed );

	connect( this, SIGNAL( sliderPressed() ), this, SLOT( stopUpdate() ) );
	connect( this, SIGNAL( sliderReleased() ), this, SLOT( resumeUpdate() ) );
	connect( this, SIGNAL( sliderReleased() ), this, SLOT( mouseReleased() ) );
	connect( this, SIGNAL( valueChanged(int) ), this, SLOT( valueChanged_slot(int) ) );
#if ENABLE_DELAYED_DRAGGING
	connect( this, SIGNAL(draggingPos(int) ), this, SLOT(checkDragging(int)) );
	
	last_pos_to_send = -1;
	timer = new QTimer(this);
	connect( timer, SIGNAL(timeout()), this, SLOT(sendDelayedPos()) );
	timer->start(200);
#endif
}
开发者ID:rdp,项目名称:smplayer-svn,代码行数:26,代码来源:timeslider.cpp

示例7: KIntSpinBox

TimeSpinBox::TimeSpinBox( QWidget *parent, bool _daysonly )
        : KIntSpinBox ( parent )
{
    setDaysOnly( _daysonly );

    setMinimum( -41 );
    setMaximum( 41 );
    setSingleStep( 1 );

    setButtonSymbols( QSpinBox::PlusMinus );
    lineEdit()->setReadOnly( true );
    setValue( 4 ); //1 second (real time)

    //Set width:
    QFontMetrics fm( font() );
    int extra = width() - lineEdit()->width();
    uint wmax = 0;
    for ( int i=0; i < maximum(); ++i ) {
        uint w = fm.width( '-' + TimeString[i] );
        if (  w > wmax ) wmax = w;
    }
    setFixedWidth( wmax + extra );

    connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( reportChange() ) );
    //	updateDisplay();
}
开发者ID:birefringence,项目名称:kstars,代码行数:26,代码来源:timespinbox.cpp

示例8: NSlider

NVolumeSlider::NVolumeSlider(QWidget *parent) : NSlider(parent)
{
    setMinimum(0);
    setMaximum(100);

    connect(this, SIGNAL(valueChanged(int)), this, SLOT(on_valueChanged(int)));
}
开发者ID:nulloy,项目名称:nulloy,代码行数:7,代码来源:volumeSlider.cpp

示例9: value

void KLFUnitSpinBox::setUnit(double unitfactor)
{
  double curValue = value();
  double curMinimum = minimum();
  double curMaximum = maximum();
  double curUnitFactor = pUnitFactor;
  int curPrecision = decimals();

  klfDbg("unitfactor="<<unitfactor<<" cur: val="<<curValue<<",min="<<curMinimum<<",max="<<curMaximum
	 <<",prec="<<curPrecision) ;

  pUnitFactor = unitfactor;

  // calculate the right number of decimal places.
  // due to round-off errors, we need to first determine how many decimals we started
  // off with, then re-calculate the number of decimals.
  int unitRefDecimals = curPrecision - (int)( log((double)curUnitFactor)/log((double)10.0)  + 0.5 );

  setDecimals(unitRefDecimals + (int)( log((double)pUnitFactor)/log((double)10.0) + 0.5 ) );

  // set the appropriate range
  setMinimum(curMinimum * curUnitFactor / pUnitFactor);
  setMaximum(curMaximum * curUnitFactor / pUnitFactor);

  // and set the value
  setValue(curValue * curUnitFactor / pUnitFactor);
}
开发者ID:TobiasWinchen,项目名称:klatexformula_debian,代码行数:27,代码来源:klfunitinput.cpp

示例10: QFrame

XIntegrationControl::XIntegrationControl(InstrumentWindow* instrWindow):
QFrame(instrWindow),
m_instrWindow(instrWindow),
m_totalMinimum(0),
m_totalMaximum(1),
m_minimum(0),
m_maximum(1)
{
  m_scrollBar = new XIntegrationScrollBar(this);
  QHBoxLayout* layout = new QHBoxLayout();
  m_minText = new QLineEdit(this);
  m_minText->setMaximumWidth(100);
  m_minText->setToolTip("Minimum x value");
  m_maxText = new QLineEdit(this);
  m_maxText->setMaximumWidth(100);
  m_maxText->setToolTip("Maximum x value");
  m_units = new QLabel("TOF",this);
  m_setWholeRange = new QPushButton("Reset");
  m_setWholeRange->setToolTip("Reset integration range to maximum");
  
  layout->addWidget(m_units,0);
  layout->addWidget(m_minText,0);
  layout->addWidget(m_scrollBar,1);
  layout->addWidget(m_maxText, 0);
  layout->addWidget(m_setWholeRange, 0);
  setLayout(layout);
  connect(m_scrollBar,SIGNAL(changed(double,double)),this,SLOT(sliderChanged(double,double)));
  connect(m_scrollBar,SIGNAL(running(double,double)),this,SLOT(sliderRunning(double,double)));
  connect(m_minText,SIGNAL(editingFinished()),this,SLOT(setMinimum()));
  connect(m_maxText,SIGNAL(editingFinished()),this,SLOT(setMaximum()));
  connect(m_setWholeRange, SIGNAL(clicked()), this, SLOT(setWholeRange()));
  updateTextBoxes();
}
开发者ID:spaceyatom,项目名称:mantid,代码行数:33,代码来源:XIntegrationControl.cpp

示例11: QPushButton

Controller::Controller(Game *game, QWidget *parent):QWidget(parent),_game(game)
{
    auto button1 = new QPushButton("Start");
    auto button2 = new QPushButton("Pause");
    auto button3 = new QPushButton("Reset");
    auto speed = new QSlider(Qt::Horizontal	);
    speed->setMinimum(1);
    speed->setMaximum(100);
    speed->setTickInterval(1);
    speed->setValue(game->speed());
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(button1);
    layout->addWidget(button2);
    layout->addWidget(button3);

    layout->addWidget(speed);

    //render layout buttons
    //setLayout(layout);

    connect(button1,SIGNAL(clicked()),this,SLOT(start()));
    connect(button2,SIGNAL(clicked()),this,SLOT(pause()));
    connect(button3,SIGNAL(clicked()),this,SLOT(reset()));

    connect(speed,SIGNAL(valueChanged(int)),this, SLOT(changeSpeed(int)));

}
开发者ID:ysei,项目名称:MinestormVectrex,代码行数:27,代码来源:controller.cpp

示例12: setMinimum

void ULongLongSpinBox::setRange(
    qulonglong min,
    qulonglong max)
{
    setMinimum(min);
    setMaximum(max);    
}
开发者ID:cginternals,项目名称:libzeug,代码行数:7,代码来源:ULongLongSpinBox.cpp

示例13: BetterDoubleSpinBox

	BetterDoubleSpinBox(QWidget *parent) : QDoubleSpinBox(parent) {
		setDecimals(5);
		setMinimum(-std::numeric_limits<double>::max());
		setMaximum(std::numeric_limits<double>::max());
		setFrame(false);
		setFocusPolicy(Qt::StrongFocus);
	}
开发者ID:ArtisticCoding,项目名称:gradientdomain-mitsuba,代码行数:7,代码来源:rendersettingsdlg.cpp

示例14: Listener

 ProgressWidget::ProgressWidget(QWidget* parent)
 :QProgressBar(parent)
 {
    m_listener = new Listener(this);
    setMaximum(100);
    setMinimum(0);
 }
开发者ID:ossimlabs,项目名称:ossim-gui,代码行数:7,代码来源:ProgressWidget.cpp

示例15: QSlider

QJackFader::QJackFader(QWidget *parent) :
	QSlider(parent)
{
	setMinimum(0);
	setMaximum(127);
	setMinimumHeight(127);
}
开发者ID:Dagal,项目名称:QJackWidgets,代码行数:7,代码来源:QJackFader.cpp


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