QWidget* SubNumberDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option,
const QModelIndex &index) const
{
QLineEdit *editor = new QLineEdit(parent);
editor->setPlaceholderText("_0");//提示符
QString range = "([_][0-9])";
QRegExp regex(range);
QRegExpValidator *validator = new QRegExpValidator(regex, NULL);
editor->setValidator(validator);
editor->setCursorPosition(0);//光标位置
return editor;
}