The add-on in question last worked on Anki 2.1.35, and I’d like to get it working with 23.x. My python skills are tic-tac-toe level.
The add-on is trying to inherit from the QSvgWidget class, and is giving a name error. I believe it’s one of the things meant to be imported with “from aqt.qt import *” - meaning, no other import in that file has an asterisk which would conceal the name of the class being imported. So far that makes sense - it seems you’d normally access it with PyQt6.QtSvgWidgets.QSvgWidget or PyQt5.QtSvg.QSvgWidget, and I’m led to believe aqt.qt manages the differences between Qt5 and Qt6.
However, obvious approaches (like trying to import QtSvgWidgets or QtSvg from aqt.qt to see if they’re available) haven’t borne fruit. I had a look at aqt/qt.py in the source code of the last working Anki version, but it’s not clear to me why it worked then, so that hasn’t taught me much unfortunately. If I punch “aqt.qt.” into pycharm, I can see a lot of options in the suggested completions that come from PyQt6/QtCore, or /QtWidgets, or /QtGUI, but not /QtSvgWidgets. I wonder if I’m barking up the wrong tree with aqt.qt, but if so, about all I can think to do is rummage through the other imports to see if something is meant to smuggle the class in.
Unsurprisingly the immediate question is: how exactly do I reference the class correctly? But moreover, I’d like to know how I ought to reach that conclusion. Sadly I expect to have to wrangle more such issues before the add-on works with the current version. Thanks in advance for your thoughts.