<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks, looks great.​</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 November 2017 at 18:53, Florian Bruhin <span dir="ltr"><<a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Thu, Nov 23, 2017 at 04:39:55PM +0000, J Barchan wrote:<br>
> I would like to convert an enum to its string (in this case, for a<br>
> QProcess.ProcessError).  C++ code would be as per e.g.<br>
> <a href="https://stackoverflow.com/a/34282031/489865" target="_blank" rel="noreferrer">https://stackoverflow.com/a/<wbr>34282031/489865</a>, or possibly one of the other<br>
> solutions there or elsewhere.  Note that this is only for Qt5, but I do<br>
> have to support 5.5 onward, which rules out one of the answers there.<br>
><br>
> Is this possible from PyQt/Python, and if so would you be kind enough to<br>
> show Python/PyQt code, as it's a bit hard to figure with those C++ type<br>
> statements etc.?<br>
<br>
</span>Here's what I use to do that:<br>
<a href="https://github.com/qutebrowser/qutebrowser/blob/v1.0.3/qutebrowser/utils/debug.py#L95-L131" target="_blank" rel="noreferrer">https://github.com/<wbr>qutebrowser/qutebrowser/blob/<wbr>v1.0.3/qutebrowser/utils/<wbr>debug.py#L95-L131</a><br>
<a href="https://github.com/qutebrowser/qutebrowser/blob/v1.0.3/tests/unit/utils/test_debug.py#L125-L154" target="_blank" rel="noreferrer">https://github.com/<wbr>qutebrowser/qutebrowser/blob/<wbr>v1.0.3/tests/unit/utils/test_<wbr>debug.py#L125-L154</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Florian<br>
<br>
--<br>
<a href="https://www.qutebrowser.org" target="_blank" rel="noreferrer">https://www.qutebrowser.org</a>  | <a href="mailto:me@the-compiler.org">me@the-compiler.org</a> (Mail/XMPP)<br>
   GPG: 916E B0C8 FD55 A072  | <a href="https://the-compiler.org/pubkey.asc" target="_blank" rel="noreferrer">https://the-compiler.org/<wbr>pubkey.asc</a><br>
         I love long mails!  | <a href="https://email.is-not-s.ms/" target="_blank" rel="noreferrer">https://email.is-not-s.ms/</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</div>