本文整理汇总了C++中QSpinBox::maximum方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::maximum方法的具体用法?C++ QSpinBox::maximum怎么用?C++ QSpinBox::maximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::maximum方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
void TerrainWeightEditor::Initialize()
{
if (fw_->IsHeadless())
return;
QUiLoader loader;
loader.setLanguageChangeEnabled(true);
QString str("./data/ui/terrainwtex_editor.ui");
QFile file(str);
if(!file.exists())
{
EnvironmentModule::LogError("Cannot find " +str.toStdString()+ " file");
return;
}
editor_widget_ = loader.load(&file, this);
if (editor_widget_ == 0)
return;
// UiProxyWidget *editor_proxy = fw_->Ui()->AddWidgetToScene(this);
// if (editor_proxy == 0)
// return;
// ui->AddWidgetToMenu(this, tr("Terrain Texture Weightmap Editor"));
// ui->RegisterUniversalWidget("Weights", editor_proxy);
QSpinBox *box = editor_widget_->findChild<QSpinBox*>("brush_size");
if(box)
{
brush_size_max_ = box->maximum();
brush_size_ = box->value();
}
box = editor_widget_->findChild<QSpinBox*>("brush_modifier");
if(box)
brush_modifier_ = box->maximum();
QDoubleSpinBox *dbox = editor_widget_->findChild<QDoubleSpinBox*>("brush_falloff");
if(dbox)
falloff_percentage_ = dbox->value();
InitializeCanvases();
InitializeConnections();
emit BrushValueChanged();
}
示例2: 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);
}
示例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: 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 );
}
示例5: 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)
//.........这里部分代码省略.........
示例6: 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") {
//.........这里部分代码省略.........
示例7:
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, );
}