本文整理汇总了C++中QDoubleSpinBox::minimum方法的典型用法代码示例。如果您正苦于以下问题:C++ QDoubleSpinBox::minimum方法的具体用法?C++ QDoubleSpinBox::minimum怎么用?C++ QDoubleSpinBox::minimum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDoubleSpinBox
的用法示例。
在下文中一共展示了QDoubleSpinBox::minimum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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.");
}
}
}
示例2: test_constructor
void GraphicalIntTest::test_constructor()
{
GraphicalInt * value = new GraphicalInt(false);
QDoubleSpinBox * spinBox = findSpinBox(value);
QVERIFY( is_not_null(spinBox) );
// 1. check the range
QCOMPARE( spinBox->minimum(), Consts::int_min() );
QCOMPARE( spinBox->maximum(), Consts::int_max() );
// 2. value is empty, the line edit should be empty as well
QCOMPARE( int(spinBox->value()), 0 );
delete value;
value = new GraphicalInt(false, 1456);
spinBox = findSpinBox(value);
// 3. value is not empty
QVERIFY( is_not_null(spinBox) );
QCOMPARE( int(spinBox->value()), 1456 );
delete value;
}
示例3: 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") {
//.........这里部分代码省略.........