本文整理汇总了C++中QSpinBox::minimum方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::minimum方法的具体用法?C++ QSpinBox::minimum怎么用?C++ QSpinBox::minimum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::minimum方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shouldChangeMaximumValue
void TextGoToLineWidgetTest::shouldChangeMaximumValue()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QCOMPARE(line->value(), 1);
QCOMPARE(line->minimum(), 1);
edit.setMaximumLineCount(50);
QCOMPARE(line->value(), 1);
QCOMPARE(line->minimum(), 1);
QCOMPARE(line->maximum(), 50);
edit.setMaximumLineCount(10);
QCOMPARE(line->value(), 1);
QCOMPARE(line->minimum(), 1);
QCOMPARE(line->maximum(), 10);
}
示例2: shouldHaveDefaultValuesOnCreation
void TextGoToLineWidgetTest::shouldHaveDefaultValuesOnCreation()
{
KPIMTextEdit::TextGoToLineWidget edit;
edit.show();
QTest::qWaitForWindowExposed(&edit);
QSpinBox *line = edit.findChild<QSpinBox *>(QStringLiteral("line"));
QVERIFY(line);
QCOMPARE(line->minimum(), 1);
QPushButton *gotolinebutton = edit.findChild<QPushButton *>(QStringLiteral("gotoline"));
QVERIFY(gotolinebutton);
QToolButton *closebutton = edit.findChild<QToolButton *>(QStringLiteral("closebutton"));
QVERIFY(closebutton);
QVERIFY(line->hasFocus());
}
示例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));
}
示例4: getConfig
void PreferencesDlg::getConfig()
{
LayeredConfiguration &config = BasicApplication::instance().config();
// Assign some default values where the "guessing" method in the next
// loop is not appropriate.
if (!config.hasProperty("browser.processCreation.overlap")) {
config.setDouble("browser.processCreation.overlap",
config.getDouble("blissart.fft.overlap", 0.5));
}
if (!config.hasProperty("browser.processCreation.windowSizeMS")) {
config.setInt("browser.processCreation.windowSizeMS",
config.getDouble("blissart.fft.windowsize", 25));
}
if (!config.hasProperty("browser.processCreation.numComponents")) {
config.setInt("browser.processCreation.numComponents", 20);
}
if (!config.hasProperty("browser.processCreation.maxIterations")) {
config.setInt("browser.processCreation.maxIterations", 100);
}
// Iterate over the _configMap and set the widgets' values to whatever the
// configuration says depending on the respective widget type.
QMutableMapIterator<QWidget *, const char *> kvp(_configMap);
while (kvp.hasNext()) {
kvp.next();
if (kvp.key()->inherits("QCheckBox")) {
QCheckBox *cb = static_cast<QCheckBox*>(kvp.key());
cb->setChecked(config.getBool(kvp.value(), true));
}
else if (kvp.key()->inherits("QComboBox")) {
QComboBox *cb = static_cast<QComboBox*>(kvp.key());
cb->setCurrentIndex(config.getInt(kvp.value(), 0));
}
else if (kvp.key()->inherits("QSpinBox")) {
QSpinBox *sb = static_cast<QSpinBox*>(kvp.key());
sb->setValue(config.getInt(kvp.value(), sb->minimum()));
}
else if (kvp.key()->inherits("QDoubleSpinBox")) {
QDoubleSpinBox *dsb = static_cast<QDoubleSpinBox*>(kvp.key());
dsb->setValue(config.getDouble(kvp.value(), dsb->minimum()));
}
else {
throw Poco::NotImplementedException("Unknown configuration widget.");
}
}
}
示例5: saveLimits
void Moto::saveLimits( QSettings & set )
{
QStringList names;
QList<QSpinBox *> boxes;
names << "maxThrottleCwMin" << "maxThrottleCwMax" << "maxThrottleCwVal"
<< "maxThrottleCcwMin" << "maxThrottleCcwMax" << "maxThrottleCcwVal"
<< "maxSpeedCwMin" << "maxSpeedCwMax" << "maxSpeedCwVal"
<< "maxSpeedCcwMin" << "maxSpeedCcwMax" << "maxSpeedCcwVal"
<< "throttleRampUpCwMin" << "throttleRampUpCwMax" << "throttleRampUpCwVal"
<< "throttleRampUpCcwMin" << "throttleRampUpCcwMax" << "throttleRampUpCcwVal"
<< "throttleRampDownCwMin" << "throttleRampDownCwMax" << "throttleRampDownCwVal"
<< "throttleRampDownCcwMin" << "throttleRampDownCcwMax" << "throttleRampDownCcwVal"
<< "stallThresholdMin" << "stallThresholdMax" << "stallThresholdVal"
<< "undervoltageCtrlMin" << "undervoltageCtrlMax" << "undervoltageCtrlVal"
<< "motorOvertempMin" << "motorOvertempMax" << "motorOvertempVal"
<< "controllerOvertempMin" << "cotrollerOvertempMax" << "controllerOvertempVal";
boxes << ui.maxThrottleCw << ui.maxThrottleCcw << ui.maxSpeedCw << ui.maxSpeedCcw
<< ui.throttleRampUpCw << ui.throttleRampUpCcw << ui.throttleRampDownCw << ui.throttleRampDownCcw
<< ui.stallThreshold << ui.undervoltageCtrl << ui.motorOvertemp << ui.controllerOvertemp;
int index = 0;
int cnt = boxes.size();
for ( int i=0; i<cnt; i++ )
{
QSpinBox * s = boxes[i];
int f = s->minimum();
int t = s->maximum();
int v = s->value();
QString from = names.at( index );
QString to = names.at( index+1 );
QString val = names.at( index+2 );
index += 3;
set.setValue( from, f );
set.setValue( to, t );
set.setValue( val, v );
}
int v = ui.throttleMode->currentIndex();
set.setValue( "throttleModeVal", v );
v = ui.throttleType->currentIndex();
set.setValue( "throttleTypeVal", v );
v = ui.commutationMode->currentIndex();
set.setValue( "commutationModeVal", v );
v = set.value( "currentLimitVal", 0 ).toInt();
ui.currentLimit->setCurrentIndex( v );
}
示例6: eventFilter
bool CDlgAlmECG::eventFilter(QObject *o,QEvent *e)
{
QObject *obj[]={
m_cmbb_xinlv
,m_spb_xinlv_high
,m_spb_xinlv_low
,m_cmbb_st
,m_spb_st_high
,m_spb_st_low
,m_btn_ok,
m_btn_cancel
};
int iTotalObj = 8;//11
int iOkPos = iTotalObj -2;
int iCancelPos = iTotalObj -1;
if(e->type() == QEvent::KeyPress)
{
QKeyEvent *event=(QKeyEvent *)e;
switch (event->key()) {
case Qt::Key_Up:
case Qt::Key_Left:
if(bCursorSta == false)
{
if(iCursor == 0)
{
iCursor = iTotalObj-1;
}
else
{
iCursor -=1;
}
if((iCursor>=0) &&(iCursor<iOkPos))
{
QComboBox *p = (QComboBox *)obj[iCursor];
p->setFocus();
}
else
{
QPushButton *p = (QPushButton *)obj[iCursor];
p->setFocus();
}
}
else
{
if((iCursor == 1)||
(iCursor == 5)||
(iCursor == 2)||
(iCursor == 4)
)
{
QSpinBox *p = (QSpinBox *)obj[iCursor];
if(p->value()!= p->minimum())
{
p->setValue(p->value()-1);
}
else
{
p->setValue(p->maximum());
}
}
}
return true;
break;
case Qt::Key_Down:
case Qt::Key_Right:
if(bCursorSta == false)
{
if(iCursor == iTotalObj-1)
{
iCursor = 0;
}
else
{
iCursor +=1;
}
if((iCursor>=0) &&(iCursor<(iOkPos-1)))
{
QComboBox *p = (QComboBox *)obj[iCursor];
p->setFocus();
}
else
{
QPushButton *p = (QPushButton *)obj[iCursor];
p->setFocus();
}
}
else
{
if((iCursor == 1)||
(iCursor == 5)||
(iCursor == 2)||
(iCursor == 4)
//.........这里部分代码省略.........
示例7: GenHTMLForm
QByteArray TableItem::GenHTMLForm() {
QString ret;
QString objTypeName = obj->metaObject()->className();
if(objTypeName == "QPlainTextEdit") {
QPlainTextEdit *item = (QPlainTextEdit *) obj;
#if 0
ret = QString("<form method=\"post\">"
" <input type=\"hidden\" name=\"action\" value=\"%2\">"
"<div class=\"form_info\">%1</div>"
"<div class=\"form_editor\"><textarea name=\"%2\" cols=\"20\" rows=\"4\">%3</textarea></div>"
"<div class=\"form_submitter\"><input type=\"submit\" value=\">>\"></div>"
"<div class=\"form_tooltip\">%4</div>"
"</form>")
.arg(desc).arg(short_d).arg(item->toPlainText()).arg(item->toolTip());
#endif
ret = QString("<form method=\"post\"><input type=\"hidden\" name=\"action\" value=\"%2\" />"
"<div class=\"row\">"
"<div class=\"prop\"><p>%1:</p></div>"
"<div class=\"val\"><p><textarea name=\"%2\" cols=\"16\" rows=\"3\">%3</textarea></p></div>"
"<div class=\"submit\"><p> %4</p></div>"
"<div class=\"tooltip\"><p> %5</p></div>"
"</div></form>\n")
.arg(desc)
.arg(short_d)
.arg(item->toPlainText())
.arg((!item->isEnabled() || item->isReadOnly()) ? "" : "<input type=\"submit\" value=\">>\" />")
.arg(item->toolTip());
}
else if(objTypeName == "QLineEdit") {
QLineEdit *item = (QLineEdit *) obj;
ret = QString("<form method=\"post\"><input type=\"hidden\" name=\"action\" value=\"%2\" />"
"<div class=\"row\">"
"<div class=\"prop\"><p>%1:</p></div>"
"<div class=\"val\"><p><input type=\"text\" name=\"%2\" value=\"%3\" /></p></div>"
"<div class=\"submit\"><p> %4</p></div>"
"<div class=\"tooltip\"><p> %5</p></div>"
"</div></form>\n")
.arg(desc)
.arg(short_d)
.arg(item->text())
.arg((!item->isEnabled() || item->isReadOnly()) ? "" : "<input type=\"submit\" value=\">>\" />")
.arg(item->toolTip());
}
else if(objTypeName == "QCheckBox") {
QCheckBox *item = (QCheckBox *) obj;
ret = QString("<form method=\"post\"><input type=\"hidden\" name=\"action\" value=\"%2\" />"
"<div class=\"row\">"
"<div class=\"prop\"><p>%1:</p></div>"
"<div class=\"val\"><p><input type=\"checkbox\" name=\"%2\" value=\"true\" %3/></p></div>"
"<div class=\"submit\"><p> %4</p></div>"
"<div class=\"tooltip\"><p> %5</p></div>"
"</div></form>\n")
.arg(desc)
.arg(short_d)
.arg(item->isChecked() ? "checked" : "")
.arg((!item->isEnabled()) ? "" : "<input type=\"submit\" value=\">>\" />")
.arg(item->toolTip());
}
else if(objTypeName == "QSpinBox") {
QSpinBox *item = (QSpinBox *) obj;
ret = QString("<form method=\"post\"><input type=\"hidden\" name=\"action\" value=\"%2\" />"
"<div class=\"row\">"
"<div class=\"prop\"><p>%1:</p></div>"
"<div class=\"val\"><p><input type=\"number\" name=\"%2\" value=\"%3\" min=\"%4\" max=\"%5\" step=\"%6\" /></p></div>"
"<div class=\"submit\"><p> %7</p></div>"
"<div class=\"tooltip\"><p> %8</p></div>"
"</div></form>\n")
.arg(desc)
.arg(short_d)
.arg(item->value())
.arg(item->minimum())
.arg(item->maximum())
.arg(item->singleStep())
.arg((!item->isEnabled() || item->isReadOnly()) ? "" : "<input type=\"submit\" value=\">>\" />")
.arg(item->toolTip());
}
else if(objTypeName == "QDoubleSpinBox") {
QDoubleSpinBox *item = (QDoubleSpinBox *) obj;
ret = QString("<form method=\"post\"><input type=\"hidden\" name=\"action\" value=\"%2\" />"
"<div class=\"row\">"
"<div class=\"prop\"><p>%1:</p></div>"
"<div class=\"val\"><p><input type=\"number\" name=\"%2\" value=\"%3\" min=\"%4\" max=\"%5\" step=\"%6\" /></p></div>"
"<div class=\"submit\"><p> %7</p></div>"
"<div class=\"tooltip\"><p> %8</p></div>"
"</div></form>\n")
.arg(desc)
.arg(short_d)
.arg(item->value())
.arg(item->minimum())
.arg(item->maximum())
.arg(item->singleStep())
.arg((!item->isEnabled() || item->isReadOnly()) ? "" : "<input type=\"submit\" value=\">>\" />")
.arg(item->toolTip());
}
else if(objTypeName == "QComboBox") {
//.........这里部分代码省略.........
示例8: load
void DesignerFields::load( DesignerFields::Storage *storage )
{
QStringList keys = storage->keys();
// clear all custom page widgets
// we can't do this in the following loop, as it works on the
// custom fields of the vcard, which may not be set.
QMap<QString, QWidget *>::ConstIterator widIt;
for ( widIt = mWidgets.constBegin(); widIt != mWidgets.constEnd(); ++widIt ) {
QString value;
if ( widIt.value()->inherits( "QLineEdit" ) ) {
QLineEdit *wdg = static_cast<QLineEdit*>( widIt.value() );
wdg->setText( QString() );
} else if ( widIt.value()->inherits( "QSpinBox" ) ) {
QSpinBox *wdg = static_cast<QSpinBox*>( widIt.value() );
wdg->setValue( wdg->minimum() );
} else if ( widIt.value()->inherits( "QCheckBox" ) ) {
QCheckBox *wdg = static_cast<QCheckBox*>( widIt.value() );
wdg->setChecked( false );
} else if ( widIt.value()->inherits( "QDateTimeEdit" ) ) {
Q3DateTimeEdit *wdg = static_cast<Q3DateTimeEdit*>( widIt.value() );
wdg->setDateTime( QDateTime::currentDateTime() );
} else if ( widIt.value()->inherits( "KDateTimeWidget" ) ) {
KDateTimeWidget *wdg = static_cast<KDateTimeWidget*>( widIt.value() );
wdg->setDateTime( QDateTime::currentDateTime() );
} else if ( widIt.value()->inherits( "KDatePicker" ) ) {
KDatePicker *wdg = static_cast<KDatePicker*>( widIt.value() );
wdg->setDate( QDate::currentDate() );
} else if ( widIt.value()->inherits( "QComboBox" ) ) {
QComboBox *wdg = static_cast<QComboBox*>( widIt.value() );
wdg->setCurrentIndex( 0 );
} else if ( widIt.value()->inherits( "QTextEdit" ) ) {
QTextEdit *wdg = static_cast<QTextEdit*>( widIt.value() );
wdg->setPlainText( QString() );
}
}
QStringList::ConstIterator it2;
for ( it2 = keys.constBegin(); it2 != keys.constEnd(); ++it2 ) {
QString value = storage->read( *it2 );
QMap<QString, QWidget *>::ConstIterator it = mWidgets.constFind( *it2 );
if ( it != mWidgets.constEnd() ) {
if ( it.value()->inherits( "QLineEdit" ) ) {
QLineEdit *wdg = static_cast<QLineEdit*>( it.value() );
wdg->setText( value );
} else if ( it.value()->inherits( "QSpinBox" ) ) {
QSpinBox *wdg = static_cast<QSpinBox*>( it.value() );
wdg->setValue( value.toInt() );
} else if ( it.value()->inherits( "QCheckBox" ) ) {
QCheckBox *wdg = static_cast<QCheckBox*>( it.value() );
wdg->setChecked( value == "true" || value == "1" );
} else if ( it.value()->inherits( "QDateTimeEdit" ) ) {
Q3DateTimeEdit *wdg = static_cast<Q3DateTimeEdit*>( it.value() );
wdg->setDateTime( QDateTime::fromString( value, Qt::ISODate ) );
} else if ( it.value()->inherits( "KDateTimeWidget" ) ) {
KDateTimeWidget *wdg = static_cast<KDateTimeWidget*>( it.value() );
wdg->setDateTime( QDateTime::fromString( value, Qt::ISODate ) );
} else if ( it.value()->inherits( "KDatePicker" ) ) {
KDatePicker *wdg = static_cast<KDatePicker*>( it.value() );
wdg->setDate( QDate::fromString( value, Qt::ISODate ) );
} else if ( it.value()->inherits( "QComboBox" ) ) {
QComboBox *wdg = static_cast<QComboBox*>( it.value() );
wdg->setItemText( wdg->currentIndex(), value );
} else if ( it.value()->inherits( "QTextEdit" ) ) {
QTextEdit *wdg = static_cast<QTextEdit*>( it.value() );
wdg->setPlainText( value );
}
}
}
}
示例9:
void AlignShortReadsFiller::setBowtie2AdditionalParameters(Bowtie2Parameters* bowtie2Parameters, QWidget* dialog) {
// Parameters
QComboBox* modeComboBox = qobject_cast<QComboBox*>(GTWidget::findWidget(os, "modeComboBox", dialog));
CHECK_OP(os, );
GT_CHECK(modeComboBox, "modeComboBox is NULL");
GTComboBox::setIndexWithText(os, modeComboBox, bowtie2Parameters->getMode());
CHECK_OP(os, );
QSpinBox* mismatchesSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "mismatchesSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(mismatchesSpinBox, "mismatchesSpinBox is NULL");
GTSpinBox::setValue(os, mismatchesSpinBox, bowtie2Parameters->numberOfMismatches);
CHECK_OP(os, );
QCheckBox* seedlenCheckBox = qobject_cast<QCheckBox*>(GTWidget::findWidget(os, "seedlenCheckBox", dialog));
CHECK_OP(os, );
GT_CHECK(seedlenCheckBox, "seedlenCheckBox is NULL");
GTCheckBox::setChecked(os, seedlenCheckBox, bowtie2Parameters->seedLengthCheckBox);
CHECK_OP(os, );
QSpinBox* seedlenSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "seedlenSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(seedlenSpinBox, "seedlenSpinBox is NULL");
if(seedlenCheckBox->isChecked()){
GTSpinBox::setValue(os, seedlenSpinBox, bowtie2Parameters->seedLength);
}
CHECK_OP(os, );
QCheckBox* dpadCheckBox = qobject_cast<QCheckBox*>(GTWidget::findWidget(os, "dpadCheckBox", dialog));
CHECK_OP(os, );
GT_CHECK(dpadCheckBox, "dpadCheckBox is NULL");
GTCheckBox::setChecked(os, dpadCheckBox, bowtie2Parameters->addColumnsToAllowGapsCheckBox);
CHECK_OP(os, );
QSpinBox* dpadSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "dpadSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(dpadSpinBox, "dpadSpinBox is NULL");
if(dpadCheckBox->isChecked()){
GTSpinBox::setValue(os, dpadSpinBox, bowtie2Parameters->addColumnsToAllowGaps);
}
CHECK_OP(os, );
QCheckBox* gbarCheckBox = qobject_cast<QCheckBox*>(GTWidget::findWidget(os, "gbarCheckBox", dialog));
CHECK_OP(os, );
GT_CHECK(gbarCheckBox, "gbarCheckBox is NULL");
GTCheckBox::setChecked(os, gbarCheckBox, bowtie2Parameters->disallowGapsCheckBox);
CHECK_OP(os, );
QSpinBox* gbarSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "gbarSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(gbarSpinBox, "gbarSpinBox is NULL");
if(gbarCheckBox->isChecked()){
GTSpinBox::setValue(os, gbarSpinBox, bowtie2Parameters->disallowGaps);
}
CHECK_OP(os, );
QCheckBox* seedCheckBox = qobject_cast<QCheckBox*>(GTWidget::findWidget(os, "seedCheckBox", dialog));
CHECK_OP(os, );
GT_CHECK(seedCheckBox, "seedCheckBox is NULL");
GTCheckBox::setChecked(os, seedCheckBox, bowtie2Parameters->seedCheckBox);
CHECK_OP(os, );
QSpinBox* seedSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "seedSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(seedSpinBox, "seedSpinBox is NULL");
if(seedCheckBox->isChecked()){
GTSpinBox::setValue(os, seedSpinBox, bowtie2Parameters->seed);
}
CHECK_OP(os, );
#ifndef Q_OS_WIN
QSpinBox* threadsSpinBox = qobject_cast<QSpinBox*>(GTWidget::findWidget(os, "threadsSpinBox", dialog));
CHECK_OP(os, );
GT_CHECK(threadsSpinBox, "threadsSpinBox is NULL");
if ( threadsSpinBox->minimum( ) <= bowtie2Parameters->threads
&& threadsSpinBox->maximum( ) >= bowtie2Parameters->threads )
{
GTSpinBox::setValue(os, threadsSpinBox, bowtie2Parameters->threads);
CHECK_OP(os, );
}