#ifndef DOUBLESPINBOXDELEGATE_H #define DOUBLESPINBOXDELEGATE_H #include class DoubleSpinBoxDelegate : public QItemDelegate { Q_OBJECT public: DoubleSpinBoxDelegate(unsigned int decimals=3); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: unsigned int decimalPlaces; }; #endif // DOUBLESPINBOXDELEGATE_H