Ctrl+Enter doesn't work on KDE Plasma if Anki is ran through pip/aqt

When running Anki on KDE Plasma through the aqt module, the Ctrl+Enter shortcut to add a new card doesn’t work
I originally reported the issue on the anki-bin Arch Linux AUR package but I tested and following the official instructions to run Anki through pip results in the same issue (and I can confirm it’s still an issue on 24.11rc1)

Same in issue in the Flathub package:

Cross-reference: 24.11 might be broken in linux

2 Likes

Looking into the flatpak, it’s ran using aqt, so it makes sense - also now that I read the cross-referenced post, I realized I forgot to mention the very important detail that this issue wasn’t present before… HOWEVER, until very recently it did work on the flatpak, but I don’t know until when since I stopped using that in favour of running the installer from GitHub (when another annoying bug presented itself, namely the one where MathJax wouldn’t render properly and would just show as \(\) or \[\] while editing a card)
EDIT: read next post, this part below is not necessary
But the most baffling thing is that, I tried to make a venv and download some older version of the aqt package, even all the way back to 2023 when the issue definitely wasn’t present, and in no version did Ctrl+Enter work, so at this point I don’t even know what could be causing the issue

Now I found out something else! If I create a venv without --system-site-packages and manually install the dependencies inside the venv (pip install PyQt6-WebEngine aqt seem to be sufficient, as they pull all the other needed packages as dependencies), the shortcut works

The version with system site packages reports this:
Version ⁨24.11 (87ccd24e)⁩
Python 3.12.7 Qt 6.8.0 PyQt 6.8.0.dev2410211537
(leave it to the Arch Linux maintainers to ship dev packages in the stable repos)

While the one without:
Version 24.11 (87ccd24e)⁩
Python 3.12.7 Qt 6.7.3 PyQt 6.7.1

So, at this point, I think the issue is caused may be caused by the system wide PyQt package? Or maybe Qt 6.8.0 itself. However, if you go to the Arch Linux AUR page for the anki-bin package, the maintainer states that there’s no issue on his machine where he’s using GNOME as a DE, and so are other people using GNOME in the cross-referenced thread, so maybe it’s a combination of the two? It doesn’t help that dev/prerelease packages of PyQt don’t seem to be published on PyPi, and there’s no easy way or, more realistically, one that I could be bothered to downgrade packages on Arch Linux

EDIT
The flatpak is reporting
Version ⁨24.11 (87ccd24e)⁩
Python 3.11.10 Qt 6.7.3 PyQt 6.7.1
However, installing PyQt 6.7.1 in the venv (keeping in mind it’s still Python 3.12.7) does NOT cause the issue
:thinking:

Hi, as @derivativeoflog7 requested on the other thread, here is my config:

Version ⁨24.11 (87ccd24e)⁩
Python 3.11.10 Qt 6.7.3 PyQt 6.7.1

On Fedora 41 Kinoite (KDE)

@eatse If you want, can you try manually installing and running Anki through aqt and see if the issue is present there too? Instructions here: Intro & Downloads - Anki Betas