<div dir="ltr"><div>Hi Phil,</div><div><br></div><div>Thanks for the reply.</div><div><br></div><div>I don't see anything particular in that file, except a difference: my enum is not declared in the same file/class that the one emitting the signal. Is there some kind of include I could add, or some method code in the signal?</div><div><br></div><div>Otherwise, I could not find any ScopesStripped annotation. Is it worth a try? Do you have any example?</div><div><br></div><div>Cheers,</div><div>Denis</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le sam. 5 oct. 2019 à 10:44, Phil Thompson <<a href="mailto:phil@riverbankcomputing.com">phil@riverbankcomputing.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 02/10/2019 07:48, Denis Rouzaud wrote:<br>
> Hi list,<br>
> <br>
> I have a scoped enum in a class, a signal emitting this enum.<br>
> <br>
> So something like<br>
> <br>
> MyClass<br>
> {<br>
> public:<br>
> enum class MyEnum<br>
> {<br>
> .....<br>
> };<br>
> <br>
> signals:<br>
> void mySignal( MyEnum enum );<br>
> }<br>
> <br>
> <br>
> If in Python, I do:<br>
> <br>
> def slot( enum ):<br>
> print( enum );<br>
> myClassInstance.mySignal.connect(slot)<br>
> <br>
> I get this error:<br>
> TypeError: unable to convert a C++ MyClass::MyEnum instance to a Python<br>
> object<br>
> <br>
> <br>
> Any idea how to solve this?<br>
<br>
The following seems to work fine...<br>
<br>
from PyQt5.QtNetworkAuth import QOAuth1<br>
<br>
def slot(e):<br>
print(e)<br>
<br>
auth = QOAuth1()<br>
auth.statusChanged.connect(slot)<br>
<br>
...so I'd suggest looking at qabstractoauth.sip (and maybe the <br>
ScopesStripped annotation).<br>
<br>
Phil<br>
</blockquote></div></div>