Set the item non-editable (view only), and non-selectable

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-06-26 14:38:44 +03:00
parent 1608599795
commit 7450ddf790

View file

@ -115,6 +115,12 @@ void VWidgetDetails::FillTable(const QHash<quint32, VDetail> *details)
item = new QTableWidgetItem(name);
item->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter);
// set the item non-editable (view only), and non-selectable
Qt::ItemFlags flags = item->flags();
flags &= ~(Qt::ItemIsEditable); // reset/clear the flag
item->setFlags(flags);
ui->tableWidget->setItem(currentRow, 1, item);
++i;
}