C++ (Qt)QWidget *YourDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex &/* index */) const{ QLineEdit *editor = new QLineEdit(parent); editor->setInputMask("bla-bla-bla"); return editor;}
C++ (Qt)... editor->setInputMask("bla-bla-bla");...
C++ (Qt)editor->setValidator(new QDoubleValidator(editor));
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindowClass){ ui->setupUi(this); ui->deformationInput->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->deformationInput, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(contexMenu(const QPoint &))); tabledelegate tbldelegate; ui->deformationInput->setItemDelegate(&tbldelegate); createActions(); createMenus();}
C++ (Qt)...tabledelegate tbldelegate;ui->deformationInput->setItemDelegate(&tbldelegate);...
C++ (Qt)...ui->deformationInput->setItemDelegate(new tabledelegate);...