[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: PyQt6: pyqtSignal with an enum raises an SystemError
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2021-04-25 11:17:28
Message-ID: 38c67aee753abc13eb0fcfd6636b644b () riverbankcomputing ! com
[Download RAW message or body]

On 23/04/2021 15:03, Ales Erjavec wrote:
> Hi,
> 
> Declaring a pyqtSignal with an Enum type raises a SystemError:
> ```
> import enum
> from PyQt6.QtCore import QObject, pyqtSignal
> 
> 
> class E(enum.Enum):
>     A = 1
>     B = 2
> 
> 
> class Obj(QObject):
>     sig = pyqtSignal(E)  # << SystemError
> ```
> 
> The error is:
> ```
> Traceback (most recent call last):
>   File "C:\<...>\Python38\lib\enum.py", line 380, in __getattr__
>     raise AttributeError(name)
> AttributeError: __sip__
> 
> The above exception was the direct cause of the following exception:
> 
> Traceback (most recent call last):
>   File "test.py", line 10, in <module>
>     class Obj(QObject):
>   File "test.py", line 15, in Obj
>     sig = pyqtSignal(E)
> SystemError: <class 'PyQt6.QtCore.pyqtSignal'> returned a result with
> an error set
> ```
> This worked in PyQt5 where `pyqtSignal(E)` would simply be a
> equivalent to pyqtSignal(object).

I think this has been fixed.

Phil
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic