I stumbled across QDoubleSpinBox, that fixed it for me.

Qt Code:
  1. QWidget* StringDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &,const QModelIndex &) const
  2. {
  3. QDoubleSpinBox *dspin = new QDoubleSpinBox(parent);
  4.  
  5. dspin->setRange(0, 5.1);
  6. return dspin;
  7. }
To copy to clipboard, switch view to plain text mode