Quote:
Originally Posted by kovidgoyal
@davidfor: That's a bug in PyQt6. Just use the literal 1000 it should work in both. Or if you want to be elegant:
Code:
try:
MyType = QTableWidgetItem.ItemType.UserType.value
except AttributeError:
MyType = QTableWidgetItem.UserType
|
I'd already realised that this works:
Code:
QTableWidgetItem.__init__(self, text, 1000)
but thanks for the elegant option which also works.
I'm fairly sure the code both @davidfor and myself are using originates from @kiwidude's early plugins. Sorry if this is a dumb question, is there a good reason why a UserType needs to be specified at all, because this also appears to work? Presumably it defaults to a UserType of zero:
Code:
QTableWidgetItem.__init__(self, text)