Disable particular cell of QTablewiget using pyqt5
-
Hi ,
Can Someone please provide some guidance or suggestions on how to effectively disable a cell within a QTableWidget using PyQt5? I'm looking to programmatically control the cell's functionality and appearance in my application.
-
@Shashanksd07
Depending on what exactly you mean by "disable" a cell, for an individualQTableWidgetItem
you have Qt::ItemFlags QTableWidgetItem::flags() constReturns the flags used to describe the item. These determine whether the item can be checked, edited, and selected.
For "functionality and appearance" you may have to use a
QStyledItemDelegate
. By the time you are altering like this you might consider moving to your ownQTableView
and model, rather thanQTableWidget
which is a "convenience" widget wrapping both of these.