View Single Post
Old 01-04-2022, 04:38 AM   #41
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by thiago.eec View Post
Not tested, but a suggestion based on the problems I found porting my plugins... maybe you should use:
Code:
QTableWidgetItem.ItemType.UserType
https://doc.qt.io/qt-6/qtablewidgeti...#ItemType-enum
That didn't work here. I had to use:

Code:
QTableWidgetItem.ItemType.UserType.value
And that doesn't work with Qt5. I get:

Code:
AttributeError: 'ItemType' object has no attribute 'value'
for the lines that use the above.

And with out the ".value", with Qt6, the error is:


Code:
TypeError: QTableWidgetItem(): arguments did not match any overloaded call:
  overload 1: argument 1 has unexpected type 'str'
  overload 2: argument 2 has unexpected type 'ItemType'
  overload 3: argument 1 has unexpected type 'str'
  overload 4: argument 1 has unexpected type 'str'
The line is:

Code:
super(ReadOnlyTableWidgetItem, self).__init__(text, QTableWidgetItem.ItemType.UserType)
With the ".value" for the Qt6 version.

What have I missed?
davidfor is offline   Reply With Quote