Yutsuten / anki-lifedrain

Anki add-on that adds a life bar to anki while reviewing.
https://ankiweb.net/shared/info/715575551
GNU Affero General Public License v3.0
23 stars 2 forks source link

Incompatibility with Qt6 #133

Closed Yutsuten closed 2 years ago

Yutsuten commented 2 years ago

Anki version & Operating System: Anki 2.1.53, Arch Linux

When does the crash happens? At the deck overview screen.

Traceback:

Anki 2.1.53 (96bacf79) Python 3.10.5 Qt 6.3.1 PyQt 6.3.1
Platform: Linux
Flags: frz=False ao=True sv=2
Add-ons, last update check: 2022-06-20 18:17:48
アドオンが関連している可能性があります:⁨lifedrain⁩

Caught exception:
Traceback (most recent call last):
  File "/home/mateus/.local/lib/python3.10/site-packages/aqt/main.py", line 1072, in onStudyKey
    self.moveToState("overview")
  File "/home/mateus/.local/lib/python3.10/site-packages/aqt/main.py", line 672, in moveToState
    gui_hooks.state_will_change(state, oldState)
  File "/home/mateus/.local/lib/python3.10/site-packages/aqt/hooks_gen.py", line 3910, in __call__
    hook(new_state, old_state)
  File "/home/mateus/.local/share/Anki2/addons21/lifedrain/main.py", line 52, in <lambda>
    lambda *args: lifedrain.screen_change(args[0]))
  File "/home/mateus/.local/share/Anki2/addons21/lifedrain/lifedrain.py", line 169, in screen_change
    self.deck_manager.update()
  File "/home/mateus/.local/share/Anki2/addons21/lifedrain/deck_manager.py", line 51, in update
    self._update_progress_bar_style()
  File "/home/mateus/.local/share/Anki2/addons21/lifedrain/deck_manager.py", line 160, in _update_progress_bar_style
    self._progress_bar.dock_at(conf['barPosition'])
  File "/home/mateus/.local/share/Anki2/addons21/lifedrain/progress_bar.py", line 158, in dock_at
    dock_area = self._qt.Qt.BottomDockWidgetArea
AttributeError: type object 'Qt' has no attribute 'BottomDockWidgetArea'
Yutsuten commented 2 years ago

Qt5 Documentation

> python
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aqt.qt import Qt
Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
>>> Qt.BottomDockWidgetArea
<stdin>:1:'Qt.BottomDockWidgetArea' will stop working. Please use 'Qt.DockWidgetArea.BottomDockWidgetArea' instead.
<DockWidgetArea.BottomDockWidgetArea: 8>
>>> Qt.TopDockWidgetArea
<stdin>:1:'Qt.TopDockWidgetArea' will stop working. Please use 'Qt.DockWidgetArea.TopDockWidgetArea' instead.
<DockWidgetArea.TopDockWidgetArea: 4>
>>> exit()

Qt6 Documentation

> env DISABLE_QT5_COMPAT=1 python
Python 3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from aqt.qt import Qt
>>> [a for a in Qt.DockWidgetArea]
[<DockWidgetArea.LeftDockWidgetArea: 1>, <DockWidgetArea.RightDockWidgetArea: 2>, <DockWidgetArea.TopDockWidgetArea: 4>, <DockWidgetArea.BottomDockWidgetArea: 8>, <DockWidgetArea.AllDockWidgetAreas: 15>, <DockWidgetArea.NoDockWidgetArea: 0>]
>>> Qt.DockWidgetArea.TopDockWidgetArea
<DockWidgetArea.TopDockWidgetArea: 4>
>>> Qt.DockWidgetArea.BottomDockWidgetArea
<DockWidgetArea.BottomDockWidgetArea: 8>
>>> exit()