[PyQt] QMetaEnum from PyQt?

J Barchan jnbarchan at gmail.com
Thu Nov 23 19:03:54 GMT 2017


Thanks, looks great.‚Äč

On 23 November 2017 at 18:53, Florian Bruhin <me at 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 at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20171123/a9cb68a4/attachment.html>


More information about the PyQt mailing list