Building Qt 4 and PyQt on Mac OS X Leopard
Things we need for a successful build:
- Qt Open Source Edition 4 source tarball from Trolltech
- SIP source tarball from Riverbank
- PyQt source tarball from Riverbank
Just let the built-in Archive Utility to extract the tarballs somewhere on your disk.
1. Building Qt
This is pretty straightforward, just follow the instructions:
cd qt-mac-opensource-src-4.5.0/
./configure
make
sudo make install
2. Building SIP
This needs some tweaking, since SIP’s and PyQt’s setup scripts put the module files into a folder that’s not recognized by Python on the new Leopard OS.
cd sip-4.7.1/
python configure.py -d /Library/Python/2.5/site-packages
make
sudo make install
3. Building PyQt
The same applies here.
cd PyQt-mac-gpl-4.3.1/
python configure.py -q /usr/local/Trolltech/Qt-4.3.2/bin/qmake -d /Library/Python/2.5/site-packages
make
sudo make install
Making the steps above, I was able to run any sample PyQt script. The issue I saw that the menubar constantly says “Python”. I hope one can change this to the application’s title (C++ Qt apps look fine).
沒有留言:
張貼留言