tags:

views:

50

answers:

1

I'm trying to create python bindings for source-highlight-qt using sip.

I'm working on ubuntu - I've installed python-qt4-dev, which has installed the pyqt sip files to /usr/share/sip/PyQt4/

In my sip file, I've got this import:

%Import QtCore/qstring.sip

I'm getting this error when I run my configure.py:

sip: Unable to find file "QtCore/qstring.sip"

How do I get sip to find the pyqt .sip files?

A: 

This is how I solved it:

In my configure.py, I needed to create a pyqtconfig:

from PyQt4 import pyqtconfig
config = pyqtconfig.Configuration()

and then add directories for sip to include:

command = " ".join(
    [config.sip_bin, "-c", ".", "-b", build_file,
     "-I"+config.pyqt_sip_dir,
     "-I"+config.qt_inc_dir, config.pyqt_sip_flags,
     "lib/GNUSyntaxHighlighter.sip"]
    )
Gary van der Merwe