Unlucky-Life / ankimon

Ankimon is a Anki Addon to Gamify your learning experience
Other
35 stars 4 forks source link

Support for both PyQt5 and PyQt6 #10

Open shigeyukey opened 3 months ago

shigeyukey commented 3 months ago

Maybe you already know, aqt can be used to support both PyQt5 and PyQt6. For example,

from PyQt6.QtWidgets import QApplication, QMainWindow, QPushButton, QDialog, QVBoxLayout, QLabel
from aqt import QApplication, QMainWindow, QPushButton, QDialog, QVBoxLayout, QLabel

Since Anki 23.10, enumeration is required for PyQt6.

⭕it works, anki Qt5 & Qt6

from aqt import Qt
Qt.AlignmentFlag.AlignCenter

❌doesn't work, anki Qt6 (Since Anki 23.10)

from aqt import Qt
Qt.AlignCenter

But some features don't work, so maybe you are doing that intentionally. (e.g., Qt Designer)

Unlucky-Life commented 3 months ago

exactly there are some features not working yet in pyqt5 and pyqt6 - so i would update this code for pyqt6 and pyqt5 soon but yea issue being: pyqt6 has functions that might not work in pyqt5 anki versions - thats the problem

shigeyukey commented 3 months ago

I see, thanks!