Old topic, but I have a similar issue. I did a lot of trolling but couldn't find anything.
With mine it allows you to type 9.00
I think your supposed to use QValidate::fixUp(), but I am unsure on how to do this.
{
val->setRange(0, 5.1, 2);
editor->setValidator(val);
return editor;
}
QWidget* StringDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &,const QModelIndex &) const
{
QLineEdit *editor = new QLineEdit(parent);
QDoubleValidator* val = new QDoubleValidator(editor);
val->setNotation(QDoubleValidator::StandardNotation);
val->setRange(0, 5.1, 2);
editor->setValidator(val);
return editor;
}
To copy to clipboard, switch view to plain text mode
Anyone got some tips please?
Bookmarks