本文整理汇总了C++中QDateTimeEdit::setFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ QDateTimeEdit::setFrame方法的具体用法?C++ QDateTimeEdit::setFrame怎么用?C++ QDateTimeEdit::setFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDateTimeEdit
的用法示例。
在下文中一共展示了QDateTimeEdit::setFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLabel
QWidget *reDefaultItemEditorFactory::createEditor(QVariant::Type type, QWidget *parent) const
{
switch (type) {
case QVariant::Bool: {
QBooleanComboBox *cb = new QBooleanComboBox(parent);
return cb;
}
case QVariant::UInt: {
QSpinBox *sb = new QSpinBox(parent);
sb->setFrame(false);
sb->setMaximum(INT_MAX);
return sb;
}
case QVariant::Int: {
QSpinBox *sb = new QSpinBox(parent);
sb->setFrame(false);
sb->setMinimum(INT_MIN);
sb->setMaximum(INT_MAX);
return sb;
}
case QVariant::Date: {
QDateTimeEdit *ed = new QDateEdit(parent);
ed->setFrame(false);
return ed;
}
case QVariant::Time: {
QDateTimeEdit *ed = new QTimeEdit(parent);
ed->setFrame(false);
return ed;
}
case QVariant::DateTime: {
QDateTimeEdit *ed = new QDateTimeEdit(parent);
ed->setFrame(false);
return ed;
}
case QVariant::Pixmap:
return new QLabel(parent);
case QVariant::Double: {
QDoubleSpinBox *sb = new QDoubleSpinBox(parent);
sb->setFrame(false);
sb->setMinimum(-DBL_MAX);
sb->setMaximum(DBL_MAX);
return sb;
}
case QVariant::StringList: {
QComboBox* cb = new QComboBox(parent);
return cb;
}
case QVariant::String:
default: {
// the default editor is a lineedit
QLineEdit *le = new QLineEdit(parent);
//le->setFrame(le->style()->styleHint(QStyle::SH_ItemView_DrawDelegateFrame, 0, le));
//if (!le->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, le))
//le->setWidgetOwnsGeometry(true);
return le;
}
}
return 0;
}
示例2: QLabel
QWidget *QDefaultItemEditorFactory::createEditor(QVariant::Type type, QWidget *parent) const
{
switch (type) {
#ifndef QT_NO_COMBOBOX
case QVariant::Bool: {
QBooleanComboBox *cb = new QBooleanComboBox(parent);
cb->setFrame(false);
return cb;
}
#endif
#ifndef QT_NO_SPINBOX
case QVariant::UInt: {
QSpinBox *sb = new QSpinBox(parent);
sb->setFrame(false);
sb->setMaximum(INT_MAX);
return sb;
}
case QVariant::Int: {
QSpinBox *sb = new QSpinBox(parent);
sb->setFrame(false);
sb->setMinimum(INT_MIN);
sb->setMaximum(INT_MAX);
return sb;
}
#endif
#ifndef QT_NO_DATETIMEEDIT
case QVariant::Date: {
QDateTimeEdit *ed = new QDateEdit(parent);
ed->setFrame(false);
return ed;
}
case QVariant::Time: {
QDateTimeEdit *ed = new QTimeEdit(parent);
ed->setFrame(false);
return ed;
}
case QVariant::DateTime: {
QDateTimeEdit *ed = new QDateTimeEdit(parent);
ed->setFrame(false);
return ed;
}
#endif
case QVariant::Pixmap:
return new QLabel(parent);
#ifndef QT_NO_SPINBOX
case QVariant::Double: {
QDoubleSpinBox *sb = new QDoubleSpinBox(parent);
sb->setFrame(false);
sb->setMinimum(-DBL_MAX);
sb->setMaximum(DBL_MAX);
return sb;
}
#endif
#ifndef QT_NO_LINEEDIT
case QVariant::String:
default: {
// the default editor is a lineedit
QExpandingLineEdit *le = new QExpandingLineEdit(parent);
le->setFrame(le->style()->styleHint(QStyle::SH_ItemView_DrawDelegateFrame, 0, le));
if (!le->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, le))
le->setWidgetOwnsGeometry(true);
return le;
}
#else
default:
break;
#endif
}
return 0;
}