34 #include <QDoubleSpinBox> 47 const QModelIndex & index)
const 50 QVariant data = index.model()->data(index, Qt::EditRole);
52 case QVariant::Double:
54 QDoubleSpinBox* editor =
new QDoubleSpinBox(parent);
56 editor->setMinimum(-INFINITY);
57 editor->setMaximum(INFINITY);
62 case QVariant::String:
64 return QStyledItemDelegate::createEditor(parent, option, index);
67 return QStyledItemDelegate::createEditor(parent, option, index);
72 QStyledItemDelegate::setEditorData(editor, index);
77 QStyledItemDelegate::setModelData(editor, model, index);
81 const QModelIndex & index)
const 83 QStyledItemDelegate::updateEditorGeometry(editor, option, index);
88 if(value.type() == QVariant::Double) {
91 return QStyledItemDelegate::displayText(value, locale);
virtual ~XmlRpcItemDelegate()
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
void setEditorData(QWidget *editor, const QModelIndex &index) const
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
unsigned int doubleDecimals
QString displayText(const QVariant &value, const QLocale &locale) const
XmlRpcItemDelegate(QObject *parent=NULL)