Porting enums from PyQT5 to PyQt6

Florian Bruhin me at the-compiler.org
Wed Oct 19 18:15:26 BST 2022


Hey,

On Tue, Oct 18, 2022 at 01:32:00PM -0800, Patrick Stinson wrote:
> Just double checking here before I port a whole bunch of code.
> 
> It looks like Qt enums in PyQt6 now subclass python's `Enum` class - and so
> need to have the enum class name added whenever referencing enum values.
> Correct?
> 
> For example: QFont.Medium
> 
> must become QFont.Weight.Medium

Correct.

> Or is there a way to avoid changing all references to Qt enum values while
> staying with good practices?

There are at least three tools available to automate the changes:
https://www.riverbankcomputing.com/pipermail/pyqt/2022-June/044728.html

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20221019/47dfb93b/attachment.sig>


More information about the PyQt mailing list