Fix Alt-Gr and add shortcut to create copy again (#1544)

* Set QT_QPA_PLATFORM for Win on recent Qt versions

Erroneously dropped for Qt 5.15.1+.

* Enable original shortcut to create copy

* minor tweaks to comment to make it clearer (dae)
This commit is contained in:
RumovZ 2021-12-10 08:52:08 +01:00 committed by GitHub
parent 1fb026cce9
commit 65f6728454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -523,12 +523,10 @@ def _run(argv: Optional[list[str]] = None, exec: bool = True) -> Optional[AnkiAp
if os.environ.get("ANKI_SOFTWAREOPENGL"):
QCoreApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL)
if (
is_win
and qtmajor == 5
and (qtminor == 14 or (qtminor == 15 and qtpoint == 0))
and "QT_QPA_PLATFORM" not in os.environ
):
# fix an issue on Windows, where Ctrl+Alt shortcuts are triggered by AltGr,
# preventing users from typing things like "@" through AltGr+Q on a German
# keyboard.
if is_win and "QT_QPA_PLATFORM" not in os.environ:
os.environ["QT_QPA_PLATFORM"] = "windows:altgr"
# create the app

View File

@ -666,6 +666,9 @@
<property name="text">
<string>actions_create_copy</string>
</property>
<property name="shortcut">
<string notr="true">Ctrl+Alt+E</string>
</property>
</action>
</widget>
<resources>