本文整理汇总了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;
}
示例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:
//.........这里部分代码省略.........