[SOLVED]How enable editing to QTableWidgetItem?
-
you should disable in a different way:
@
void enableEdit(QTableWidgetItem* pItem)
{
Qt::ItemFlags eFlags = pItem->flags();
eFlags |= Qt::ItemIsEditable;
pItem->setFlags(eFlags);
}void disableEdit(QTableWidgetItem* pItem)
{
Qt::ItemFlags eFlags = pItem->flags();
eFlags &= ~Qt::ItemIsEditable;
pItem->setFlags(eFlags);
}
@All flags must be or'ed together, otherwise you set/remove other needed flags.
See "QTableWidgetItem::flags":http://doc.qt.nokia.com/latest/qtablewidgetitem.html#flags and "Qt::ItemFlags":http://doc.qt.nokia.com/latest/qt.html#ItemFlag-enum