[PyQt] How to fix "sip: Q_PID is undefined"?

Hans Meine meine at informatik.uni-hamburg.de
Fri Apr 4 12:59:33 BST 2008


Am Freitag, 04. April 2008 13:40:48 schrieb Hans Meine:
> In order to do so, I figured it would be easiest to write a small python
> script that I'll call from QMake's project file:

> | import PyQt4.pyqtconfig, subprocess
> |
> | config = PyQt4.pyqtconfig.Configuration()
> |
> | command = [config.sip_bin,
> | 		   config.pyqt_sip_flags,
> | 		   "-I", config.pyqt_sip_dir,
> | 		   "VigraQtmod.sip"]
> | print " ".join(command)
> | subprocess.call(command)

Bummer.  I just realized that copy-pasting the displayed command works, and 
found my mistake: Of course, I must not pass pyqt_sip_flags as a single 
argument. ;-/

For the records: Since subprocess is to be preferred over os.system for 
platform independence, I have now changed the command as follows:

command = [config.sip_bin] + \
		  config.pyqt_sip_flags.split() + \
		  ["-I", config.pyqt_sip_dir, "VigraQtmod.sip"]

(I am still interested in your experience with sip+qmake.)

Ciao, /  /
     /--/
    /  / ANS


More information about the PyQt mailing list