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

List:       pykde
Subject:    Re: [PyQt] QMetaEnum from PyQt?
From:       J Barchan <jnbarchan () gmail ! com>
Date:       2017-11-23 19:03:54
Message-ID: CABz3M_80dBPNmPXTSAaseBQqk8b9YWVeYN+hUjsWV6KxHYXv_g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks, looks great.​

On 23 November 2017 at 18:53, Florian Bruhin <me@the-compiler.org> wrote:

> On Thu, Nov 23, 2017 at 04:39:55PM +0000, J Barchan wrote:
> > I would like to convert an enum to its string (in this case, for a
> > QProcess.ProcessError).  C++ code would be as per e.g.
> > https://stackoverflow.com/a/34282031/489865, or possibly one of the
> other
> > solutions there or elsewhere.  Note that this is only for Qt5, but I do
> > have to support 5.5 onward, which rules out one of the answers there.
> >
> > Is this possible from PyQt/Python, and if so would you be kind enough to
> > show Python/PyQt code, as it's a bit hard to figure with those C++ type
> > statements etc.?
>
> Here's what I use to do that:
> https://github.com/qutebrowser/qutebrowser/blob/v1.0.3/qutebrowser/utils/
> debug.py#L95-L131
> https://github.com/qutebrowser/qutebrowser/blob/
> v1.0.3/tests/unit/utils/test_debug.py#L125-L154
>
> Florian
>
> --
> https://www.qutebrowser.org  | me@the-compiler.org (Mail/XMPP)
>    GPG: 916E B0C8 FD55 A072  | https://the-compiler.org/pubkey.asc
>          I love long mails!  | https://email.is-not-s.ms/
>



-- 
Kindest,
Jonathan

[Attachment #5 (text/html)]

<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">&lt;<a href="mailto:me@the-compiler.org" \
target="_blank">me@the-compiler.org</a>&gt;</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> &gt; I would like to convert an enum to its string (in this case, for \
a<br> &gt; QProcess.ProcessError).   C++ code would be as per e.g.<br>
&gt; <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> &gt; solutions there or elsewhere.   Note that this is only for \
Qt5, but I do<br> &gt; have to support 5.5 onward, which rules out one of the answers \
there.<br> &gt;<br>
&gt; Is this possible from PyQt/Python, and if so would you be kind enough to<br>
&gt; show Python/PyQt code, as it&#39;s a bit hard to figure with those C++ type<br>
&gt; statements etc.?<br>
<br>
</span>Here&#39;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>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

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

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