iguana: The Tilley Hemp Hat (Default)
Iguana ([personal profile] iguana) wrote2014-10-02 10:46 am

PyQt4 over ssh X-forwarding

I know I'm a bit behind with my monthly updates (August was a big month and I have been busy throughout September too) but I like noting down code help things as-and-when.

So, I have a PyQt4 application (and presumably this is an issue for a regular Qt program too) that doesn't like being X-forwarded - I just get a grey window that never renders, and the following errors on the console. xclock and xeyes work fine.

X Error: BadAccess (attempt to access private resource denied) 10
  Extension:    130 (MIT-SHM)
  Minor opcode: 1 (X_ShmAttach)
  Resource id:  0x1e0000b
X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 3 (X_ShmPutImage)
  Resource id:  0x1e0000a


Turns out I had to tell Qt to use the "native" (X11) graphics system:

QT_GRAPHICSSYSTEM=native DISPLAY=:10 python curses_smels.py

Apparently this needs Qt 4.7 minimum.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org