unable to select rows in table widget In PyQGIS

199 views Asked by At

In PyQGIS design tablewidget, I have set table widget to be read-only and when I select particular,it is didn't read that row?

self.dlg.ui.tableWidget.item(row, 1).setFlags(Qt.NoItemFlags)

unable to select rows in table widget,to read datas.

1

There are 1 answers

0
eyllanesc On BEST ANSWER

You just have to use bitwise operations to deny the flag Qt.ItemIsEditable

it = self.dlg.ui.tableWidget.item(row, 1)
it.setFlags(it.flags() & ~Qt.ItemIsEditable)