QTreeWidget editItem fails with “edit: editing failed”
I have a QTreeWidgetItem added to a QTreeWidget : QTreeWidgetItem* item = new QTreeWidgetItem(ui->trwPairs); item->setFlags(item->flags() | Qt::ItemIsEditable); If the item is edited, I want to do a few checks on the new value: Pairs::Pairs(QWidget *parent) : QWidget(parent), ui(new Ui::Pairs) { ui->setupUi(this); connect(this->ui->trwPairs, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(Validate(QTreeWidgetItem*,int))); } void Pairs::Validate(QTreeWidgetItem* item, int column) { if (item->text(column).toInt() < 1) { QMessageBox::critical(this, "Error", QString("Node ID ") + item->text