本文整理汇总了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;
}
}
示例2: setInfinite
void setInfinite(bool infinite)
{
if(infinite)
{
setMinimum(0);
setMaximum(0);
setValue(0);
}
else
{
setMinimum(0);
setMaximum(maxProgress + 1);
setValue(0);
}
}
示例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);
}
}
示例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();
}
示例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);
}
示例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
}
示例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();
}
示例8: NSlider
NVolumeSlider::NVolumeSlider(QWidget *parent) : NSlider(parent)
{
setMinimum(0);
setMaximum(100);
connect(this, SIGNAL(valueChanged(int)), this, SLOT(on_valueChanged(int)));
}
示例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);
}
示例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();
}
示例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)));
}
示例12: setMinimum
void ULongLongSpinBox::setRange(
qulonglong min,
qulonglong max)
{
setMinimum(min);
setMaximum(max);
}
示例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);
}
示例14: Listener
ProgressWidget::ProgressWidget(QWidget* parent)
:QProgressBar(parent)
{
m_listener = new Listener(this);
setMaximum(100);
setMinimum(0);
}
示例15: QSlider
QJackFader::QJackFader(QWidget *parent) :
QSlider(parent)
{
setMinimum(0);
setMaximum(127);
setMinimumHeight(127);
}