[PyKDE] How to inherit from QWidget

Paul F. Kunz Paul_Kunz at SLAC.Stanford.EDU
Mon Jan 20 23:10:01 GMT 2003

>>>>> On Mon, 20 Jan 2003 13:02:06 -0800 (PST), Jim Bublitz <jbublitz at nwinternet.com> said:

> On 20-Jan-03 Paul F. Kunz wrote:
>> I have a class, QtViewWidget which in C++ in herits from QWidget
>> and class in my C++ library.  How do I tell SIP to use QWidget from
>> PyQt instead of creating a local QWidget in my build directory?

> Are you using sip to write bindings for your C++ lib? In that case
> you need to:

> 1. %Import qtmod.sip before your list of %Includes for your own
> files

> 2. When you run sip to generate code for the bindings, add a -I
> switch with the path to qtmod.sip, for example:

>     sip ... -I /usr/local/PyQt/sip ...

  Also add -t Qt_3_1_1 -t WS_X11 to the sip command, right?

> 3. For gcc, add a -l qtcmodule wherever you specify the libs to be
> linked with your module (and -L ...python/site-packages or wherever
> libqtcmodule.so is located if you don't already have that), and a -I
> for the path to the Qt h files (not the same path as in (2))

> That will also add a bunch of sipqt*.h files to the directory where
> your sip-generated C++ code is located.

> Jim

More information about the PyQt mailing list