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


C++ QDoubleSpinBox::minimum方法代码示例

本文整理汇总了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.");
        }
    }
}
开发者ID:Spencerx,项目名称:openBliSSART,代码行数:47,代码来源:PreferencesDlg.cpp

示例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;
}
开发者ID:,项目名称:,代码行数:24,代码来源:

示例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=\"&gt;&gt;\"></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=\"&gt;&gt;\" />")
                .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=\"&gt;&gt;\" />")
                .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=\"&gt;&gt;\" />")
                .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=\"&gt;&gt;\" />")
                .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=\"&gt;&gt;\" />")
                .arg(item->toolTip());
    }
    else if(objTypeName == "QComboBox") {
//.........这里部分代码省略.........
开发者ID:ghostro,项目名称:fmstick,代码行数:101,代码来源:tableitem.cpp


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