Not sure how it works on Arch, but couldn't you just check the Calibre version, then import QT5 for <= 5.x, and QT6 for >= 6? Instead of using a try-catch-block to detect QT5 vs QT6? Surely there's some kind of Calibre API to get the Calibre version? (EDIT: Like described in the next post).
Or, do "from qt.core import yada" in a try-except-block, and if that fails, it's Calibre 5 or older and you can import QT5.
Last edited by Leseratte_10; 01-05-2022 at 03:22 PM.
|