I want to implement a tablewidget , The items in it can be Selectable or UnSelectable but non-editable. i tried :
1.
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
To copy to clipboard, switch view to plain text mode
with
self.item(row, col).setFlags(Qt.NoItemFlags)
self.item(row, col).setFlags(Qt.NoItemFlags)
To copy to clipboard, switch view to plain text mode
not working
2.
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
To copy to clipboard, switch view to plain text mode
with
onCellClicked(self,row,col):
if item(row,col) is non-selectable:
self.setCurrentCell(-1,-1)
onCellClicked(self,row,col):
if item(row,col) is non-selectable:
self.setCurrentCell(-1,-1)
To copy to clipboard, switch view to plain text mode
works,but the selected background showed for a while
3.
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
To copy to clipboard, switch view to plain text mode
with
onCellClicked(self,row,col):
if item(row,col) is non-selectable:
self.item(row,col).setSelected (False)
onCellClicked(self,row,col):
if item(row,col) is non-selectable:
self.item(row,col).setSelected (False)
To copy to clipboard, switch view to plain text mode
not working too.
Overriding mousePressEvent may works, But is there any other method?
Thx in advance and sry for my bad english.
Bookmarks