Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Qt5 attributes with Qt6 ones #203

Merged
merged 3 commits into from
Oct 29, 2023
Merged

Conversation

aplaice
Copy link
Collaborator

@aplaice aplaice commented Oct 22, 2023

This allows CrowdAnki on Anki 23.10rc1 to run without ENABLE_QT5_COMPAT=1.

I believe that compatibility with Qt5 and Anki 2.1.50->2.1.66 is preserved.

The Qt6 version of the code is in the try clause, while the Qt5 one is in the except. Hopefully, this will make clean up (once Qt5 is dropped by Anki) simple.

There are still some Qt-unrelated deprecation warnings (but no errors) with 23.10rc1, but it's probably cleanest to deal with them separately, since I'm not sure how easy it will be to make the relevant changes backwards-compatible.

This allows CrowdAnki on Anki 23.10rc1 to run without
ENABLE_QT5_COMPAT=1.

I believe that compatibility with Qt5 and Anki 2.1.50->2.1.66 is
preserved.

The Qt6 version of the code is in the try clause, while the Qt5 one is
in the except.  Hopefully, this will make clean up (once Qt5 is
dropped by Anki) simple.

There are still some Qt-unrelated deprecation warning with 23.10rc1,
but it's probably cleanest to deal with them separately, since I'm not
sure how easy it will be to make the relevant changes
backwards-compatible.
@aplaice aplaice added the compatibility Compatibility with latest Anki label Oct 22, 2023
After explicitly testing, it seems that the "Qt6" versions also seem
to just work for Qt5 (at least going back down to 2.1.50), so there's
no need for the two options.

It seems that exec_ was needed for python2 compat:

https://stackoverflow.com/questions/22610720/should-i-use-app-exec-or-app-exec-in-my-pyqt-application

(PyQt6 only supports exec; PyQt5 supports both exec and exec_.)

I'm keeping the previous commit unsquashed (for now?), for reference,
just in case something is broken here.
This allows changing note type and opening the config window to work.

I think that this is now all the breakage, for now.

Compat with 2.1.50+ is AFAICT preserved.
@aplaice aplaice merged commit 30a82ec into Stvad:master Oct 29, 2023
2 checks passed
@aplaice aplaice deleted the qt6_code_compat branch October 29, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with latest Anki
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant