[PyQt] Access QObject's staticQtMetaObject private member

Kernc kerncece at gmail.com
Wed Nov 25 17:34:06 GMT 2015


On Sun, Nov 15, 2015 at 9:48 AM, Florian Bruhin <me at the-compiler.org> wrote:

>
> FWIW, I have some code to do this which also works for values without
> a staticMetaObject:
>
>
> https://github.com/The-Compiler/qutebrowser/blob/master/qutebrowser/utils/debug.py#L91-L167
>
> https://github.com/The-Compiler/qutebrowser/blob/master/tests/unit/utils/test_debug.py#L125-L185
>

Seems like I can use this. Thanks!

You may have a minor bug there on line 159:

https://github.com/The-Compiler/qutebrowser/blob/master/qutebrowser/utils/debug.py#L159

With condition not being less-than-or-equal, you miss 'LeftButton' in
QFlags like:

>>> flags = (Qt.LeftButton | Qt.LeftButton)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20151125/f4302f1a/attachment.html>


More information about the PyQt mailing list