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


C++ DoubleSpinBox::setFrame方法代码示例

本文整理汇总了C++中DoubleSpinBox::setFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleSpinBox::setFrame方法的具体用法?C++ DoubleSpinBox::setFrame怎么用?C++ DoubleSpinBox::setFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DoubleSpinBox的用法示例。


在下文中一共展示了DoubleSpinBox::setFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoubleSpinBox

QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent,
    const QStyleOptionViewItem &/* option */,
    const QModelIndex &/* index */) const
{
    DoubleSpinBox *editor = new DoubleSpinBox(parent);
    editor->setFrame(false);
    editor->setMinimum(0.);
    editor->setMaximum(10000000.);

    return editor;
}
开发者ID:teugen,项目名称:Chart-builder,代码行数:11,代码来源:doublespinboxdelegate.cpp

示例2: createEditor

QWidget* SettingsDelegate::createEditor(QWidget* parent,
                                        const QStyleOptionViewItem& /*option*/,
                                        const QModelIndex& index) const
{
    // Get the setting type.
    int type = index.model()->data(index, SettingsModel::TypeRole).toInt();

    // Create the appropriate editor.
    QWidget* editor = 0;
    switch (type)
    {
        case SettingsValue::INT:
        {
            // Spin box editors.
            QSpinBox* spinner = new QSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(-INT_MAX, INT_MAX);
            editor = spinner;
            break;
        }
        case SettingsValue::UNSIGNED_INT:
        {
            // Spin box editors.
            QSpinBox* spinner = new QSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(0, INT_MAX);
            editor = spinner;
            break;
        }
        case SettingsValue::INT_POSITIVE:
        {
            // Spin box editors.
            QSpinBox* spinner = new QSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(1, INT_MAX);
            editor = spinner;
            break;
        }
        case SettingsValue::UNSIGNED_DOUBLE:
        {
            // Double spin box editors.
            DoubleSpinBox* spinner = new DoubleSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(0, DBL_MAX);
            editor = spinner;
            break;
        }
        case SettingsValue::DOUBLE:
        {
            // Double spin box editors.
            DoubleSpinBox* spinner = new DoubleSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(-DBL_MAX, DBL_MAX);
            editor = spinner;
            break;
        }
        case SettingsValue::DOUBLE_RANGE:
        {
            // Double spin box editors.
            DoubleSpinBox* spinner = new DoubleSpinBox(parent);
            QVariant v = index.model()->data(index, SettingsModel::RangeRole);
            QList<QVariant> range = v.toList();
            double min_ = range[0].toDouble();
            double max_ = range[1].toDouble();
            spinner->setFrame(false);
            spinner->setRange(min_, max_);
            editor = spinner;
            break;
        }
        case SettingsValue::DOUBLE_RANGE_EXT:
        {
            QVariant v = index.model()->data(index, SettingsModel::ExtRangeRole);
            QList<QVariant> range = v.toList();
            double min_ = range[0].toDouble();
            double max_ = range[1].toDouble();
            QString ext_min_ = range[2].toString();
            DoubleSpinBox* spinner = new DoubleSpinBox(parent);
            spinner->setFrame(false);
            spinner->setRange(min_, max_);
            spinner->setMinText(ext_min_);
            editor = spinner;
            break;
        }
        case SettingsValue::DATE_TIME:
        {
            // Date and time editors.
            QLineEdit* line = new QLineEdit(parent);
            line->setFrame(false);
            editor = line;
            break;
        }
        case SettingsValue::TIME:
        {
            // Time editors.
            QLineEdit* line = new QLineEdit(parent);
            line->setFrame(false);
            editor = line;
            break;
        }
        case SettingsValue::RANDOM_SEED:
//.........这里部分代码省略.........
开发者ID:OxfordSKA,项目名称:OSKAR,代码行数:101,代码来源:oskar_SettingsDelegate.cpp


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