showcomments icon indicating copy to clipboard operation
showcomments copied to clipboard

Not working on Python 3.10.0 or below

Open loqstrz opened this issue 4 weeks ago • 3 comments

Errors in "OnCreate", "Populate Form", "reset_and_populate", "headerData"

AttributeError: Error calling Python override of QAbstractTableModel::headerData(): module 'PtQt5.QtCore' has no attribute 'QVariant'

Please support this py version, this plugin is one of the bests 🙏

loqstrz avatar Dec 02 '25 06:12 loqstrz

Thanks for the compliments. :)

I've switched to Python 3.10.0 and the plugin works fine. See:

Image

What is your IDA version?

merces avatar Dec 06 '25 01:12 merces

That is very strange. I am on 9.2 but I will send the full log later on.

loqstrz avatar Dec 06 '25 03:12 loqstrz

Sorry for the late reply, but here we go:

IDA Pro 9.2 Python Version: 3.10.0 (exact version according to IDA: 3.10.150.1013)

Log:

IDAPython: Error while calling Python callback <OnCreate>:
Traceback (most recent call last):
  File "C:/Users/t6/AppData/Roaming/Hex-Rays/IDA Pro/plugins/showcomments.py", line 71, in OnCreate
    self.PopulateForm()
  File "C:/Users/t6/AppData/Roaming/Hex-Rays/IDA Pro/plugins/showcomments.py", line 86, in PopulateForm
    self.reset_and_populate()
  File "C:/Users/t6/AppData/Roaming/Hex-Rays/IDA Pro/plugins/showcomments.py", line 153, in reset_and_populate
    self.table.setModel(self.proxy_model)
  File "C:/Users/t6/AppData/Roaming/Hex-Rays/IDA Pro/plugins/showcomments.py", line 50, in headerData
    return QtCore.QVariant()
AttributeError: Error calling Python override of QAbstractTableModel::headerData(): module 'PyQt5.QtCore' has no attribute 'QVariant'

The UI is attempted to be drawn but it is in a broken/incomplete state and nothing can be really used. The logs mention Qt5 but starting with IDA Pro 9.2, QT5 was replaced with QT6. Is that maybe what's causing this?

loqstrz avatar Dec 07 '25 06:12 loqstrz

Thanks for the detailed logs!

Yeah, certainly it's Qt. What version are you using? I'm on 5.15.3:

Image

Also, can you check if https://github.com/merces/showcomments/tree/fix/qt5-variant fixes it?

Thanks!

merces avatar Dec 08 '25 13:12 merces

QT_VERSION_STR=6.8.2

Will test that fix asap

loqstrz avatar Dec 09 '25 00:12 loqstrz

Just tried it out and that new version works! Thanks a lot!

loqstrz avatar Dec 10 '25 08:12 loqstrz