Installing qt/pyqt commercial under windows XP with MinGW

The problem

Currently, there are no binaries for py-qt commercial version because of the many different ways that Qt can be built. This tutorial will try to explain how to compile and install QT/QScintilla/Sip/Pyqt using the GPL MinGW tools. Note that this is not the only way to install it, you may prefer using the M$ compiler, which is faster.

Pre requisites

Of course you will need a python version (mine is 2.3.3), also make sure that you don't have a compiler like Borland or M$ in your PATH environnement variable.

For the installation, you'll need:

Tweaking python dll

As explained here, you need to tweak the python dll.

Here's what you need to do:

pexports c:\Windows\System32\python23.dll > python23.def
dlltool --dllname python23.dll --def python23.def --output-lib libpython23.a
copy libpython23.a c:\python23\libs\

Installing MinGW

You need to install MinGW, mingw32-make and the win32-api files.

Installing QT

First, read the docs provided. Here's what I have done:

Installing sip

First, read the docs provided. Here's the procedure:

c:\python23\python configure.py -p win32-g++
make
make install

Installing QScintilla

First, read the docs provided. Here's the procedure:

c:\python23\python configure.py
make
make install

Installing PyQT

First, read the docs provided. Here's the procedure:

c:\python23\python configure.py
make
make install

Testing

Ok, that should be ok. Here's a test script (from the PyQT tutorial 1):

import sys
import qt

a = qt.QApplication(sys.argv)

hello = qt.QPushButton("Hello world!", None)
hello.resize(100, 30)

a.setMainWidget(hello)
hello.show()
sys.exit(a.exec_loop())

If the script runs OK your done !

PyQtWiki: InstallingPyQTCommercialWin (last edited 2009-04-14 07:27:21 by localhost)