how to get qtablewidgetitem from qstandarditem?
-
Hi, I have a tableview and set a checkbox at the first column. What I want to do is to make the checkbox at certain rows disable and cannot be checked. I can get the qstandarditem of the cell. I want to get qtablewidgetitem from it and set the checkbox disabled.But I cant find any function to realize it.
What method can I use to realize the function?
thanks -
A QTableWidgetItem is a special item of a QTableWidget and can't be used in a plain QTableView.
So what do you really do and what are you trying to achieve? -
I want to make the checkbox in some rows disabled.
-
@yangyanhui4
enum Qt::ItemFlag hasQt::ItemIsUserCheckable 16 It can be checked or unchecked by the user.
You want that to be unset on the items where the checkbox is to be disabled. See e.g. https://forum.qt.io/topic/120725/qtableview-show-checkbox-but-keep-it-disabled/8.