[PyQt] Goods news about the "menu text missing in PyKDE apps with Oxygen " bug

Detlev Offenbach detlev at die-offenbachs.de
Sun Apr 13 09:30:41 BST 2008


Hi Simon,

that works and seems to be a more general fix for the problem.

Thanks for helping.

Detlev

On Samstag, 12. April 2008, Simon Edwards wrote:
> Detlev Offenbach wrote:
> > On Donnerstag, 10. April 2008, Simon Edwards wrote:
> >> Hello all,
> >>
> >> Some people here might have crossed paths with the "menu text missing in
> >> PyKDE apps with Oxygen" bug. Basically menu labels are not rendered when
> >> a PyKDE4 application is used with the Oxygen widget style. After quite a
> >> lot of hair-pulling work over the last few days I've figured out what
> >> the problem is.
> >>
> >> First, a solution. Put the following lines in your PyKDE4/__init__.py
> >> file in your Python installation's site-packages directory. (typically
> >> /lib/python2.5/site-packages/PyKDE4/__init__.py).
> >>
> >>    import sys, dl
> >>    sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> >
> > Python seems to be broken on openSUSE 10.3 64-bit. It doesn't contain the
> > dl.so library. Any help is appreciated.
>
> Looking at the dl docs I see:
>
> """
> Note: This module will not work unless sizeof(int) == sizeof(long) ==
> sizeof(char *) If this is not the case, SystemError will be raised on
> import.
> """
>
> That explains why it is not there for 64bit.
>
> Docs for sys.setdlopenflags():
>
> """
> setdlopenflags(  n)
>   Set the flags used by the interpreter for dlopen() calls, such as when
> the interpreter loads extension modules. Among other things, this will
> enable a lazy resolving of symbols when importing a module, if called as
> sys.setdlopenflags(0). To share symbols across extension modules, call
> as sys.setdlopenflags(dl.RTLD_NOW | dl.RTLD_GLOBAL). Symbolic names for
> the flag modules can be either found in the dl module, or in the DLFCN
> module. If DLFCN is not available, it can be generated from
> /usr/include/dlfcn.h using the h2py script. Availability: Unix. New in
> version 2.2.
> """
>
> Try this:
>
>      import sys,DLFCN
>      sys.setdlopenflags(DLFCN.RTLD_NOW|DLFCN.RTLD_GLOBAL)
>
> cheers,


-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list