Initial import of python-qt3

Timothy Pearson 12 years ago
commit b388516ca2

File diff suppressed because it is too large Load Diff

@ -0,0 +1,280 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.


@ -0,0 +1,570 @@
v3.18.1 16th June 2009
- A bug fix release.
v3.18 5th June 2009
- Changes to be able to be built by SIP v4.8 and later.
v3.17.6 17th November 2008
- A bug fix release.
v3.17.5 8th November 2008
- Added the /Constrained/ argument annotations for enums needed by SIP v4.7.8
and later.
- Added the missing QRegion.rects() (based on a patch from Hans-Peter
- Added the missing QWidget.stackUnder() slot.
v3.17.4 6th December 2007
- Changes to be able to be built by SIP v4.7.2 and later.
v3.17.3 30th July 2007
- A minor bug fix release.
- Changes to be able to be built by SIP v4.7.
v3.17.2 25th April 2007
- A minor bug fix release for a regression in v3.17.1.
v3.17.1 10th April 2007
- This version requires SIP v4.6 (or later).
- Changes to ensure compatibility with future SIP releases.
v3.17 4th November 2006
- Added support for Python v2.5.
- Added the missing QImage.bitBlt() function.
- Added the missing QListView.setSelectionAnchor() method.
- Added the missing QStringList.__iadd__(QString) method.
- Updated the QScintilla bindings for v1.17.
v3.16 24th March 2006
- This version requires SIP v4.4 (or later).
- PyQt3 can be installed alongside PyQt4.
- Concatenating Python strings and QStrings is now supported.
- QString now supports the * and *= operators that behave as they do for
Python strings.
- Removed some QString methods that weren't appropriate in a Python context
and would have caused problems had they ever been used.
- QString is more interoperable with Python string and unicode objects. For
example they can be passed as arguments to open() and to most (but not all)
string methods.
- QObject.sender() now handles Python signals.
- Added the missing MacintoshVersion enum.
- The convention for converting between a C/C++ null pointer and Python's
None object has now been universally applied. In previous versions a null
pointer to, for example, a Qt list container would often be converted to an
empty list rather than None.
- PYQT_BUILD has been removed.
- QPopupMenu (and sub-classes) instances now transfer ownership of the menu
to Python in the call to exec_loop(). This means the menu's resources are
all released when the Python wrapper is garbage collected without needing
to call QObject.deleteLater().
v3.15.1 14th November 2005
- Added the missing QApplication constructor.
- Added the -f flag to to use any existing features file (by
default it is recreated).
v3.15 30th August 2005
- This version requires SIP v4.3 (or later).
- Added registerWeakActiveObject() and revokeActiveObject() to QAxBase.
- Added the missing QString + operator.
- PyQt classes now support Python's cyclic garbage collector.
- QDialog (and sub-classes) instances now transfer ownership of the dialog to
Python in the call to exec_loop(). This means the dialog's resources are
all released when the Python wrapper is garbage collected without needing
to call QObject.deleteLater().
- Automatic type conversion to more specific sub-classes using available
real-time type information has been improved so that, if a sub-class isn't
recognised then the most specific sub-class is used rather than the base
- Automatic type conversion for QLayoutItem and sub-classes has been added.
- Added support for QScintilla v1.6.
v3.14.1 6th March 2005
- A minor bug fix release.
v3.14 19th February 2005
- This version requires SIP v4.2 (or later) or SIP v3.12 (or later).
- Added the qInstallMsgHandler() function.
- Added support for QScintilla v1.5.
- Added support for the VendorID package.
- Added the example.
v3.13 21st September 2004
- Added the QUuid, QMetaObject and QMetaProperty classes.
- Added metaObject() to QObject.
- Added the comparison operators between QChar and QChar and char.
- Added all the QDataStream << and >> operators for classes.
- Added support for QScintilla v1.4.
- Added explicit support for QScintilla to pyuic.
v3.12 25th May 2004
- QValueList<QVariant> is implemented as a Python list of QVariant instances.
- Added support for QScintilla v1.3.
- Compiler error messages are suppressed during configuration but can be seen
using the new -w flag to
v3.11 11th March 2004
- Added the QIconDragEvent and QLocale classes from Qt v3.3.0.
- Updated all existing classes to Qt v3.3.1.
- Added the missing QSocketDevice class.
- Added the missing QString += operators.
v3.10 16th January 2004
- Added the QFtp, QHttp, QHttpHeader, QHttpRequestHeader,
QHttpResponseHeader, QLocalFs classes.
v3.9 7th December 2003
- This version requires SIP v3.9 (or later) or SIP v4.0rc1 (or later).
- is now documented.
- Added the QImageIO and QListViewItemIterator classes.
- Added the QDockArea << and >> operators.
- Added readBoolEntry() to QSettings.
- Added qInstallPath(), qInstallPathDocs(), qInstallPathHeaders(),
qInstallPathLibs(), qInstallPathBins(), qInstallPathPlugins(),
qInstallPathData(), qInstallPathTranslations(), qInstallPathSysconf().
- A new ( build system has been added which is independent of
tmake and qmake and installs a pyqtconfig module. The old ( build
system remains.
- Added the -r flag to the build systems to enable tracing.
- Added the -v flag to the build systems to specify the default location for
.sip files.
v3.8.1 6th September 2003
- Added the missing QWMatrix.mapRect() * operators.
- The supported educational version is now Qt v3.2.0.
v3.8 17th August 2003
- Added the -k flag to to build the PyQt modules as static
- Added operators to QBrush, QColor, QDate, QDateTime, QDir, QDomeNode,
QFont, QImage, QKeySequence, QPalette, QPen, QPoint, QRect, QRegExp,
QRegion, QSize, QString, QTime, QUrl and QWMatrix (thanks to Torsten
- Added the missing Qt.MetaButton.
- Updated all classes for Qt v3.2.0.
- Added the QSplashScreen, QSqlSelectCursor and QToolBox classes for Qt
- Added support for QScintilla v1.2.
v3.7 5th July 2003
- Implemented __setitem__(), __delitem__(), __add__(), __iadd__(), __mul__(),
__imul__(), __eq__() and __ne__() for QStringList.
- Lots of new examples from Jorge Arroyo.
- dir() of a PyQt class now returns all attributes.
- Added bits(), scanLine(), jumpTable() and colorTable() to QImage.
- Added toShort(), toUShort(), toInt(), toUInt(), toLong(), toULong(),
toFloat() and toDouble() to QCString and QString.
- Added the QWindowsXPStyle (Windows XP only), QextScintillaLexerHTML,
QextScintillaLexerSQL and QSignalMapper classes.
- pyuic (for Qt v3) now accepts a "-test" command line argument to allow
generated code to be run to completion without needing any user
- Added modificationAttempted() to QextScintilla.
v3.6 26th April 2003
- Added the QextScintillaAPIs, QextScintillaCommand, QextScintillaCommandSet,
QextScintillaMacros and QextScintillaPrinter classes to the qtext module.
- Added the QCopEnvelope class to the qtpe module.
- QString.startsWith() was missing for Qt v2 starting with Qt v2.2.0.
- Implemented the QTextStream << QMainWindow and QTextStream >> QMainWindow
- pyuic will now extract Python code from the comments section of a .ui file.
- pyuic now supports PEP 263.
- Added the,, and modified
examples from Oleksandr Yakovlyev.
- Added the qtui module (thanks to Hans-Peter Jansen).
- Support for Qt v3.1.2 added.
- PYQT_VERSION is now the version encoded as a hexadecimal value.
v3.5 11th December 2002
- Added the qtext module containing the bindings for QScintilla.
- Added the missing QDockWindow.drawFrame(), QGLWidget.reparent() and
QMainWindow.lineUpDockWindows() methods.
- Added the missing QGLColorMap class.
- Support for Qt v3.0.6, v3.1.0 and v3.1.1 added.
- Added the Qt v3.1.x QAssistantClient, QEventLoop, QIconFactory,
- QIMComposeEvent, QMutexLocker and QSyntaxHighlighter classes, and
qCompress() and qUncompress functions.
- Removed eric from the distribution as it is now packaged separately.
- The SQL examples now support PostgreSQL as well as MySQL.
- Added the Qtopia v1.5.0 AppLnk, AppLnkSet, Config, DateFormat, DocLnk,
DocLnkSet, FileManager, FileSelector, FileSelectorItem, FontDatabase,
Global, MenuButton, QDawg, QList<AppLnk>, QList<DocLnk> and Resource
v3.4 10th September 2002
- More eric updates from Detlev Offenbach, including pylupdate.
- helpviewer is now installed as a standalone application.
- Added the example from Hans-Peter Jansen.
- Added the and examples from Sadi Kose.
- Added QApplication.winEventFilter(), QWidget.winEvent(), MSG and POINT
under Windows.
- PyQt is now licensed under several licenses including the GPL and a
commercial license.
v3.3.2 12th July 2002
- Build system changes.
v3.3.1 9th July 2002
- Support for Qt v3.0.5 added.
v3.3 7th July 2002
- Added README.SunOS.
- QValueList<QPixmap> is now fully implemented as a mapping to a Python list
of QPixmap instances.
- QSqlRecordInfo is now implemented as a Python list of QSqlFieldInfo
- Added the missing QDoubleValidator.setBottom(),
QDoubleValidator.setDecimals(), QDoubleValidator.setTop,
QFontMetrics.boundingRect(), QFontMetrics.size(),
QIntValidator.setBottom(), QIntValidator.setTop(), and
- Added the qmake based build system.
- Added lots of eric patches from Detlev Offenbach. (eric should now work
again and has new features.)
- Added the SQL examples from Hans-Peter Jansen.
- pyuic for Qt v3 can now extract Python code from .ui files (thanks to
Christian Bird).
v3.2.4 18th May 2002
- Bug fixes only from the latest SIP. (Skipped v3.2.3 to keep the version
number in line with SIP.)
v3.2.2 11th May 2002
- Bug fixes only.
v3.2.1 5th May 2002
- Bug fixes only from the latest SIP.
v3.2 5th May 2002
- Instances that are sub-classes of QObject and created by Qt (by factory
methods, or plugin managers for example) will now have the correct Python
- Added the missing QToolTip.setEnabled() and QToolTip.enabled().
- Added support for MacOS X.
- Added PYQT_VERSION as the PyQt release number as a string.
- Added the example.
- Any Python object can now be passed as the data element of a QCustomEvent.
- configure now searches for Qt v3.0.4.
v3.1 23rd March 2002
- Removed the internal QDateTimeEditBase and QDragResponseEvent classes.
- Added the QValueList<QImageTextLangKey> mapped class.
- Added the missing QImageTextLangKey class.
- Added the missing QActionGroup.add(), QActionGroup.addSeparator(),
QImage.dotsPerMeterX(), QImage.dotsPerMeterY(), QImage.setDotsPerMeterX(),
QImage.setDotsPerMeterY(), QImage.offset(), QImage.setOffset(),
QImage.textList(), QImage.textLanguages(), QImage.textKeys(), QImage.text()
and QImage.setText() methods.
- Added support for Qt/Embedded on the Sharp Zaurus.
- Added the start of the qtpe (Qt Palmtop Environment) module.
- Changes required for Qt v3.0.1 and v3.0.2.
- configure now allows the location of zlib to be specified.
- configure now allows the directory to where the Python modules are
installed to be specified.
- configure now searches for Qt v3.0.1, v3.0.2 and v3.0.3.
- Changes required by the latest SIP.
- Added the dragdrop example from Issac Trotts.
- Added /ReleaseLock/ to everything that might block.
- Upgraded to autoconf-2.53 and automake-1.6.
v3.0 17th November 2001
- Added the missing QChar.nbsp class variable.
- Added the missing QChar.isLetterOrNumber(), QChar.mirroredChar(),
QColorDialog.customColor(), QCustomDialog.customCount(),
QColorDialog.getRgba(), QCustomDialog.setCustomColor(), QFileDialog.done(),
QHeader.setUpdatesEnabled(), QHeader.showEvent(), QIconView.dropped(),
QIconViewItem.dropped(), QImage.inputFormatList(),
QImage.outputFormatList(),, QLineEdit.displayText(),
QListBox.isRubberSelecting(), QMenuBar.activateItemAt(),
QMenuBar.focusInEvent(), QMenuBar.isDefaultUp(), QMenuBar.minimumSize(),
QMenuBar.minimumSizeHint(), QMenuBar.setDefaultUp(), QMenuData.findItem(),
QMimeSourceFactory.filePath(), QMimeSourceFactory.addFilePath(),
QMotifPlusStyle.drawMenuBarItem(), QMotifPlusStyle.drawPopupMenuItem(),
QMotifStyle.drawPopupMenuItem(), QMotifStyle.extraPopupMenuItemWidth(),
QMotifStyle.popupMenuItemHeight(), QNetworkProtocol.newChildren(),
QPlatinumStyle.popupMenuItemHeight(), QPainter.pos(), QPalette.inactive(),
QPopupMenu.drawItem(), QPopupMenu.itemHeight(), QPrintDialog.addButton(),
QProgressDialog.forceShow(), QScrollBar.lineStep(), QScrollBar.maxValue(),
QScrollBar.minValue(), QScrollBar.pageStep(), QScrollBar.setLineStep(),
QScrollBar.setMaxValue(), QScrollBar.setMinValue(),
QScrollBar.setPageStep(), QScrollBar.setValue(), QScrollBar.value(),
QStyle.drawPopupMenuItem(), QStyle.drawMenuBarItem(),
QStyle.extraPopupMenuItemWidth(), QStyle.popupMenuItemHeight(),
QToolTip.hide(), QToolTipGroup.enabled(), QToolTipGroup.setEnabled(),
QTranslator.messages(), QUrlOperator.newChildren(),
QUrlOperator.startNextCopy(), QWindowsStyle.drawPopupMenuItem(),
QWindowsStyle.extraPopupMenuItemWidth() and
QWindowsStyle.popupMenuItemHeight() methods.
- Added all missing methods that use QDataStream.
- Added the missing QDir.match(), QObject.connect(), QRect.contains(),
QString.append() and QString.prepend() variants.
- Added the missing QAccel and QImage ctors.
- Added the missing QColorDrag, QDns, QIconDrag, QIconDragItem, QMenuItem,
QSGIStyle and QSound classes.
- Renamed QDate.isValidDate() to QDate.isValid(), QFile.fileExists() to
QFile.exists(), QFile.removeFile() to QFile.remove(), QLineEdit.del() to
QLineEdit.delChar(), QMultiLineEdit.deleteChar() to
QMultiLineEdit.delChar(), and QTime.IsValidTime() to QTime.isValid().
- Added the QCanvasSpline, QCheckTableItem, QComboTableItem,
QCustomMenuEvent, QDataBrowser, QDataTable, QDataView, QDateEdit,
QDateTimeEdit, QDesktopWidget, QDockArea, QDockWindow, QEditorFactory,
QErrorMessage, QGridView, QIMEvent, QKeySequence, QLibrary,
QObjectCleanupHandler, QPixmapCache, QProcess, QRegExpValidator, QSettings,
QSql, QSqlCursor, QSqlDatabase, QSqlDriver, QSqlEditorFactory, QSqlError,
QSqlField, QSqlFieldInfo, QSqlForm, QSqlIndex, QSqlPropertyMap, QSqlQuery,
QSqlRecord, QSqlRecordInfo, QSqlResult, QStyleFactory, QStyleOption,
QTabletEvent, QTextEdit, QTimeEdit and QWindowsMime Qt3 classes.
- Added the missing qInitNetworkProtocols() function to the qtnetwork module.
- Removed the QTableHeader class and QTabWidget.selected() as they are not
part of the documented API.
- Removed the /Transfer/ flag on the QWidget parameters of
QBoxLayout.addWidget(), QBoxLayout.insertWidget(),
QGridLayout.addMultiCellWidget(), QGridLayout.addWidget() and
- QObject.className() now works with Python classes that sub-class from
QObject derived classes.
- pyuic now generates double quoted strings rather than single quoted strings
(to help Qt Linguist).
- Moved the Canvas module classes to the new qtcanvas module.
- Moved the Network module classes to the new qtnetwork module.
- Moved the Table module classes to the new qttable module.
- Moved the XML module classes to the new qtxml module.
- configure now handles Qt-mt.
- Upgraded to autoconf-2.52, automake-1.5 and libtool-1.4.1.
v2.5 11th August 2001
Minor configuration changes. Added the missing variants of, QWidget.reparent() and QInputDialog.getText(). Added
the qtgl module and the example script (thanks to Toby J
Sargeant). QObject.sender() will now return an appropriate value.
Fixed QTextView.setText() and QScrollView.addChild(). Fixed the
problems with overloads with different C++ signatures but similar
Python signatures - QCString.setNum(), QLabel.setNum(),
QLCDNumber.checkOverflow(), QString.arg(), QString.number(),
QString.setNum(), QVariant() and Added the missing
QTranslator methods. Added the QTranslatorMessage class. configure
will now look for Qt v2.3.1. QInterlaceStyle is enabled only for Qt
v2.3.1+ as it is broken in 2.3.0 on Windows. Fixed problems with
QLineEdit.event() and QMultiLineEdit.event(). Added post-hooks to
complement the existing pre-hooks. Added the Pizza example from the Qt
Designer manual. Removed the Version keyword for the latest SIP.
Fixed the memory leaks related to sipMapCppToSelf() in handwritten
code. Changed the build system to handle different versions of PyQt
for different versions of Qt. NULL QCanvasItemList, QFileInfoList,
QObjectList, QStrList and QWidgetList pointers are now converted to an
empty Python list rather than None. Added QDataStream and the QDom
classes (thanks to Jim Bublitz). Added the qt_xdisplay(), qt_xscreen()
and qt_xrootwin() functions. Added the QColor.getHsv(),
QPaintDevice.x11Display(), QPaintDevice.x11AppDisplay(),
QPaintDevice.x11SetAppDpiX(), QPaintDevice.x11SetAppDpiY() and
QWidget.customEvent() methods.
v2.4 22nd April 2001
Added the missing QFileDialog.getExistingDirectory(),
QLineEdit.setReadOnly(), QLineEdit.readOnly(),
QMotifStyle.comboButtonFocusRect(), QMotifStyle.comboButtonRect() and
QMotifStyle.drawComboButton() methods. Added the missing
QFileDialog.DirectoryOnly and QPalette.Inactive enum values. Updated
the example. configure now uses the python executable to get
the various Python locations. Added support of Qt v2.3.0, ie.
QApplication.type(), QFontDatabase.isFixedPitch(),
QScrollView.AutoOneFit, QToolBar.styleChange() and QInterlaceStyle.
Added the missing final argument to QMultiLineEdit.insertAt(). Added
the QCustomEvent class. Upgraded to automake v1.4d and libtool v1.3d.
v2.3 4th February 2001
Added the missing QMessage.setTextFormat(), QMessage.textFormat(),
QPushButton.isFlat(), QPushButton.setFlat() and QMenuData.insertItem()
methods. Added the QCustomMenuItem class. pyuic assumes that custom
widgets are in another module and generates code to import them. Other
pyuic bug fixes and changes to keep track with Qt v2.2.4. eric bug
fixes. Added the, and examples.
Updated all the tutorial scripts to match those in Qt v2.x. Removed
the Qt v1.x specific examples. Removed the deprecated behaviour of
repr() for QString, QCString and QByteArray. The Python objects that
correspond to C++ instances that are "owned" by Qt are now kept alive
without the Python program having to keep an explicit reference.
configure now looks for Python 2.1.
v2.2 6th November 2000
Added the %Copying directive. Added the missing %HeaderCode in
qsizepolicy.sip. Added classes QServerSocket, QSocket and
QHostAddress. Added hooks to the QApplication ctors to tell the
debugger when it is safe to create QSocketNotifiers (with UNIX you can
create QSocketNotifiers before you create the QApplication, with
Windows you can't). Other fixes to eric to get it working with
Windows. Implemented __str__ of QByteArray, QCString and QString to
return an empty string for null instances. Changed __repr__ of the
same classes to return a descriptive string for null instances. Added
the missing QPalette.setInactive(). Colour related fixes to pyuic
(thanks to Robert Roy). Added the documentation section on Python
strings, Qt strings and Unicode.
v2.1 18th October 2000
Added support for Qt v2.2.1. Added the example. Added the
eric debugger. Added the missing QCanvasPixmapArray ctor. Added the
missing QMenuData.setItemParameter(), QMenuData.itemParameter(),
QMenuData.activateItemAt(), QWidget.isHidden(), QWidget.isMaximized(),
QMultiLineEdit.getCursorPosition() and QButton.keyReleaseEvent(). Add
the len, [] and in operators to QStringList. Various other bug fixes
(see ChangeLog).
v2.0 14th September 2000
*NOTE* The implementation of enums has changed meaning that your
scripts will be need to be changed. Also repr() of a QString will
return a unicode object (rather than a string) with versions of Python
that support Unicode.
Added /Transfer/ to QObject.insertChild(). Added /TransferBack/ to
QObject.removeChild() and QTabBar.removeTab(). Changes needed by the
latest SIP. Fixed for Qt v2.x (thanks to Joerg
Kollmann). Added /Transfer/ etc. to several places in QScrollView,
QObject, QHeader, QListView and QListViewItem (thanks to Pete Ware).
Updated everything for Qt v2.2.0. Added pyuic. Updated the examples
to handle to new form of enums. Added full support for Windows.
Install in site-packages if it exists. Changes to handwritten code to
support Python 1.6. Integrate QString with Python's Unicode support.
v0.12 18th May 2000
The versions of the examples specific to Qt v1.x now get installed in
RPMs. Added QListBoxItem.selected(), QStringList.append() and
QStringList.prepend(). Added /Transfer/ to QApplication.setStyle(),
QLayout.addItem(), QBoxLayout.addItem() and QGridLayout.addItem().
Added to the examples. Clarified the software license.
Changes needed by the latest SIP.
v0.11.1 1st April 2000
Fixed the documentation for QPixmap::fill(). Code now compiles with
gcc v2.95.2.
v0.11 28th March 2000
Added Qt v2.x classes QCDEStyle, QChar, QColorDialog, QCommonStyle,
QCString, QFontDialog, QGLayoutIterator, QGrid, QHBox, QHButtonGroup,
QHGroupBox, QLayoutItem, QLayoutIterator, QMimeSource,
QMimeSourceFactory, QMotifStyle, QPlatinumStyle, QSessionManager,
QSimpleRichText, QSizeGrip, QSizePolicy, QSpacerItem, QStringList,
QStyle, QStyleSheet, QStyleSheetItem, Qt, QTabWidget, QTextBrowser,
QTextCodec, QTextDecoder, QTextEncoder, QTextIStream, QTextOStream,
QTextStream, QTextView, QTranslator, QUriDrag, QVBox, QVButtonGroup,
QVGroupBox, QWheelEvent, QWidgetItem, QWindowsStyle and QWizard. Many
other smaller changes for Qt v2.x. Added TransferThis where needed.
v0.10.1 21st January 2000
Fixed a bug in the repr() functions for QString and QByteArray by
generating the code using the latest SIP.
v0.10 19th December 1999
The .pyc files are now created by the installation process. Added
qAppName(), QCursor.handle(), QFont.handle(), QPaintDevice.handle(),
QPainter.handle(). Added most of the typedefs. Changed
examples/ so as not to use the obsolete (and
unimplemented) QMessageBox.message(). Fixed bug in QPixmap ctor.
Changed the format of version qualifiers for the latest SIP. Various
small changes to port to Windows. Added ReleaseLock to QDialog.exec().
Fixed a bug in QRect.coords(). Changed QString and QByteArray from
being mapped classes to being regular classes. Changed
examples/, examples/ and examples/ to
explicitly convert from QString where needed.
v0.9 6th September 1999
Separated the Qt and KDE bindings. These are the Qt bindings. Various
changes needed by the latest SIP. Re-introduced SLOT(). Changed the
examples to use SLOT() where possible. Added QObject.disconnect(),
QAccel.disconnectItem(), QMenuData.disconnectItem(),
QMovie.disconnectResize(), QMovie.disconnectStatus(),
QMovie.disconnectUpdate() and QApplication.clipboard(). Added the
QClipboard and QSocketNotifier classes. QEvent is automatically
converted to the correct sub-class. The Qt event loop now cooperates
with Python threads. Tested with Qt v1.44, Python v1.5.2, egcs v1.1.2
and glibc v2.1.
v0.8 29th May 1999
Hopefully fixed the SuSE configuration problems. Fixed the QPointArray
ctor and QPointArray.setPoints() that took a list of points. Removed
the section in the documentation referring to the inability to handle
C++ references. Added lots of const keywords to suppress new warning
messages from the compiler. Changed the handwritten code for mapped
classes to follow the new NULL/None conventions, and for the
introduction of sipParseArgs(). Added Drag-and-Drop support to kmyapp.
Added Matt Gerassimoff's Qt examples. Added the QCursor global
cursors. Added QPainter.boundingRect(), KApplication.addDropZone(),
KApplication.removeDropZone, KApplication.setRootDropZone(). Added
QDragEnterEvent, QDragLeaveEvent, QDragMoveEvent, QDragObject,
QDragResponseEvent, QDropEvent, QDropSite, QHideEvent, QImageDrag,
QPaintDeviceMetrics, QShowEvent, QStoredDrag, QTextDrag, QTimer,
QUrlDrag, QWindow, KDNDDropZone, KDNDIcon, KDNDWidget, KPath, KSpell,
KSpellConfig, KSpellDlg, KTreeList, KTreeListItem. Tested with Qt
v1.44, KDE v1.1.1, Python v1.5.2, egcs v1.1.2 and glibc v2.1.1.
v0.7.1 3rd May 1999
Fixed the detection of -fno-exceptions support. Added the necessary
Py_DECREF(sipArgs) to all handwritten code. Tested with Qt v1.44, KDE
v1.1.1, Python v1.5.2, egcs v1.1.2 and glibc v2.1.
v0.7 16th April 1999
Build with -fno-exceptions if supported. Converted the documentation
to SGML. Replaced QT_VERSION and KDE_VERSION with the proper Qt and
KDE version constants. Fixed a bad bug converting from QStrings to
Python strings. The "connect" convenience function has been removed.
Added the class variables for all supported classes. Removed SLOT()
from all examples. Renamed some static functions in QDate, QTime and
QFile (needed because of the new implementation of static member
functions). Added the ordinary functions related to supported classes.
Added QListView, QListViewItem, QCheckListItem, KButton, KButtonBox,
KContainerLayout, KContainerLayoutItem, KControlApplication,
KControlDialog, KConfigWidget, KDatePicker, KDateTable, KDialog,
KDirectionButton, KGradientSelector, KIntegerLine, KLed, KLedLamp,
KListSpinBox, KNewPanner, KNumericSpinBox, KPanner, KPopupMenu,
KQuickHelp, KQuickHelpWindow, KRestrictedLine, KRuler, KSelector,
KSeparator, KSlider, KSpinBox, KTabBar, KTabButton, KTabCtl,
KToolBoxManager, KWizard, KWizardPage, KXYSelector. Tested with Qt
v1.44, KDE v1.1, Python v1.5.2, egcs v1.1.2 and glibc v2.1.
v0.6 20th February 1999
Removed some handwritten code now that SIP automatically handles mapped
classes and slots. Changed QString to be mapped to/from Python
strings. Added the static member functions for all supported classes.
Added new member functions for KDE v1.1. Added QBoxLayout,
QButtonGroup, QChain, QCheckBox, QChildEvent, QDate, QDateTime,
QDialog, QDir, QFileDialog, QFileIconProvider, QFileInfo,
QFileInfoList, QGManager, QGroupBox, QGridLayout, QHBoxLayout, QHeader,
QIconSet, QLayout, QMainWindow, QMessageBox, QMovie, QMultiLineEdit,
QObjectList, QPrintDialog, QPrinter, QProgressBar, QProgressDialog,
QRadioButton, QScrollView, QSemiModal, QSpinBox, QSplitter, QStatusBar,
QTab, QTabBar, QTabDialog, QTime, QToolBar, QToolButton, QToolTip,
QToolTipGroup, QVBoxLayout, QWhatsThis, QWidgetList, QWidgetStack.
Added DlgLocation, KColorButton, KColorCombo, KColorDialog,
KColorGroup, KDirDialog, KDirEntry, KEdit, KFM, KFileBaseDialog,
KFileBookmark, KFileDialog, KFileInfo, KFileInfoContents,
KFileInfoList, KFontDialog, KHTMLView, KIconLoaderButton,
KIconLoaderDialog, KMsgBox, KPixmap, KProgress, KRadioGroup,
KSimpleConfig, KURL. Tested with Qt v1.42, KDE v1.1, egcs v1.1.1 and
glibc v2.1.
v0.5 21st January 1999
The bindings are now packaged with autoconf configure scripts. The
enum in QFrame is now unnamed as it is in Qt. All the examples changed
to use the new form of enums. Added support for qApp, the global
QColors, kapp, i18n(), Icon() and ICON(). Same test environment as
v0.4 9th January 1999
Enough Qt and KDE classes to implement the 14 Qt tutorials and KMyApp,
but still not that many that implement user interface widgets. Tested
with Qt v1.42, KDE v1.0 and gcc v2.8.1.
v0.3 9th December 1998
Many more Qt classes, but still not many that implement user interface
widgets. Those classes that are implemented are almost all fully
implemented. Tested with Qt v1.42.
v0.2 5th December 1999
Added the definitions of protected and virtual member functions.
v0.1 1st November 1998
First release (with a very small set of classes implemented) to give
people a flavour. Tested with Qt v1.41.

@ -0,0 +1,64 @@
PyQt - Python Bindings for the Qt Toolkit
These are the Python bindings for Qt. You must also have the SIP Python
bindings generator installed.
The homepage is
The homepage of SIP is
If you have the Commercial version of PyQt then you should also have a
license file that you downloaded separately. The license file must be copied
to the "sip" directory before starting to build PyQt.
Check for any other README files in this directory that relate to your
particular platform. Feel free to contribute a README for your platform or to
provide updates to any existing documentation.
The first step is to configure PyQt by running the following command.
This assumes that the correct Python interpreter is on your path. Something
like the following may be appropriate on Windows.
If you have multiple versions of Python installed then make sure you use the
interpreter for which you wish to generate bindings for.
The script takes many options. Use the "-h" command line option
to display a full list of the available options.
The next step is to build PyQt using your platform's make command.
The final step is to install PyQt by running the following command. (Depending
on your system you may require root or administrator privileges.)
make install
The "examples2" and "examples3" directories contain some examples (for Qt v2.x
and Qt v3.x respectively) of Python scripts, including versions of the standard
Qt tutorials and examples.
The "doc" directory contains SGML and HTML documentation for the bindings.
This documentation includes a section describing the differences visible to
the Python programmer between this and the previous version - please read it.
Phil Thompson

@ -0,0 +1,68 @@
This file describes some things to be aware of when building SIP (and PyQt)
under AIX.
I had success building SIP V3/V4 (and PyQt) on AIX 4.3.3 and on AIX 5.1 with
VisualAge C++ and with gcc.
VisualAge C++ was version 6.0 but it should also work with version 5.x.
The GNU compiler was version 3.3.2 downloaded as a binary from
The Qt-Version was 3.2.3 but it should also work with previous versions.
If you are using Python version 2.3.3 or higher, SIP (and PyQt) should build
out of the box without any changes.
If you are using a Python version before 2.3.3, you have to patch Python,
because until this version, Python uses the system calls load() and
loadbind() to load and bind shared objects. These system calls cannot load
and bind C++ shared objects properly (constructors and destructors for static
classes are not called with these system calls). Since AIX version 4.2 the
system calls dlopen() and dlsym() are available and should be used in
The following patch changes the configure script of Python to use dlopen()
and dlsym() if they are available. It also fixes a bug with the definition of
diff -uNr Python-2.3.2.orig/configure Python-2.3.2/configure
--- Python-2.3.2.orig/configure 2003-09-27 10:58:55.000000000 +0200
+++ Python-2.3.2/configure 2003-10-28 11:33:58.000000000 +0100
@@ -1452,6 +1452,11 @@
# but used in struct sockaddr.sa_family. Reported by Tim Rice.
+ # On AIX 4, mbstate_t is defined only when _XOPEN_SOURCE == 500 but used in
+ # wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined or
+ # has another value. By not (re)defining it, the defaults come in place.
+ AIX/4)
+ define_xopen_source=no;;
if test $define_xopen_source = yes
@@ -12965,7 +12970,12 @@
if test -z "$DYNLOADFILE"
case $ac_sys_system/$ac_sys_release in
- AIX*) DYNLOADFILE="dynload_aix.o";;
+ AIX*) # Use dynload_shlib.c and dlopen() if we have it.
+ if test "$ac_cv_func_dlopen" = yes
+ then DYNLOADFILE="dynload_shlib.o"
+ else DYNLOADFILE="dynload_aix.o"
+ fi
+ ;;
BeOS*) DYNLOADFILE="dynload_beos.o";;
hp*|HP*) DYNLOADFILE="dynload_hpux.o";;
Darwin/*) DYNLOADFILE="dynload_next.o";;
Note: I did not mix the compilers when building Qt, Python, SIP and PyQt. At
least Qt, SIP and PyQt must be built with the same compiler because of
different name mangling schemes.
If you have any problems or questions on building SIP or PyQt on AIX, either
send an email to or use the PyKDE mailing list.
Ulrich Berning

@ -0,0 +1,44 @@
o Compiler Error: CC -DHAVE_CONFIG_H -I. -I. -I..
-I/users/toollib/include/python2.0 -I/users/pyqt/install/sip-3.2.1/include
-I/users/pyqt/install/qt-x11-commercial-3.0.4/include -I/usr/openwin/include
-c qtcmodule.cpp -KPIC -DPIC -o qtcmodule.o
"sipqtProxyqt.h", line 113: Error: Multiple declaration for
"qtcmodule.cpp", line 5393: Error: sipProxyqt::proxySlot(int) already had a
body defined.
This occurs because the Sun Workshop C++ 4.2 compiler (and the Sun Forte
C++ 6.x compiler with -compat) can not distinguish between 'bool' and 'int'
types in overloaded method signatures and issues a compiler error.
In this case bool is declared in qt/include/qglobal.h as
'typedef int bool;'. To workaround this '#if 0' out the the declaration
and body of 'proxySlot(bool)' in PyQt/qt/sipqtProxyqt.h and
PyQt/qt/qtcmodule.cpp. This resolves the compiler error but breaks
any 'sig(bool)' type signals. To workaround this, save the
PyQt/qt/sipqtProxyqt.moc generated after fixing the compiler error and
add the following bits of code:
static const QUParameter param_slot_42[] = {
{ 0, &static_QUType_bool, 0, QUParameter::In }
static const QUMethod slot_42 = {"proxySlot", 1, param_slot_42 };
static const QMetaData slot_tbl[] = {
{ "proxySlot(bool)", &slot_42, QMetaData::Public }
metaObj = QMetaObject::new_metaobject(
"sipProxyqt", parentObject,
slot_tbl, 43,
case 42: proxySlot(static_QUType_bool.get(_o+1)); break;
You will need to comment out the line in PyQt/qt/Makefile that re-generates
PyQt/qt/sipqtProxyqt.moc with moc to avoid the above changes from being
In order to test that everything has been done correctly, create a
toggle button and connect it's 'toggled(bool)' signal to a python slot,
if it works, your done!

@ -0,0 +1,35 @@
Torsten Marek
For going through the Qt classes and adding applicable operators to
Detlev Offenbach
For picking up and enhancing eric.
Hans-Peter Jansen
For the ports of the table and SQL based example scripts and for the
qtui module.
Dimitri Papadopoulos-Orfanos
For all the help with the MacOS X port.
Jim Bublitz
For QDataStream and the QDom classes, and picking up PyKDE.
Pete Ware
For lots of patches for Qt v2.1+.
Boudewijn Rempt
For evangelising and providing so much support to other users. Oh, and
writing a book about it all.
Toby J Sargeant
For QSocketNotifier and getting Python threads working with Qt.
Matt Gerassimoff
For his Python versions of many of the Qt example programs.
Matt Gerassimoff, John Filo, Boudewijn Rempt
For testing and excellent bug reports.
Rupert Thurner
For pointing out what env is for.

@ -0,0 +1,730 @@
# Copyright (c) 2007
# Riverbank Computing Limited <>
# This file is part of PyQt.
# This copy of PyQt is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2, or (at your option) any later
# version.
# PyQt is supplied in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
# You should have received a copy of the GNU General Public License along with
# PyQt; see the file LICENSE. If not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# This is the build script for PyQt. It should be run in the top level
# directory of the source distribution and by the Python interpreter for which
# it is being built. It uses either qmake or tmake to do the hard work of
# generating the platform specific Makefiles.
import sys
import os
import glob
import tempfile
import shutil
import py_compile
import compileall
import string
# Get the SIP configuration.
import sipconfig
print "Unable to import the sipconfig module. Please make sure you have"
print "SIP v3.9 or later installed."
config = sipconfig.SIPConfig("PyQt 3.18.1")
# Initialise the globals.
sipMajorVersion = config.sip_version >> 16
sciIncDir = config.qt_inc_dir
sciLibDir = config.qt_lib_dir
sciLib = None
sciVersion = None
binDir = config.default_bin_dir
modDir = config.default_mod_dir
sipDir = config.default_sip_dir
buildModules = ["qt"]
tempBuildDir = None
catCppFiles = 0
catSplit = 1
qpeTag = None
trace = 0
releaseGIL = 0
def usage(rcode = 2):
"""Display a usage message and exit.
rcode is the return code passed back to the calling process.
print "Usage:"
print " %s [-h] [-a version] [-b dir] [-c] [-d dir] [-g] [-j #] [-n dir] [-o dir] [-r] [-v dir]" % sipconfig.script()
print "where:"
print " -h display this help message"
print " -a tag explicitly enable the qtpe module"
print " -b dir where pyuic and pylupdate will be installed [default %s]" % config.default_bin_dir
print " -c concatenate each module's C++ source files"
print " -d dir where the PyQt modules will be installed [default %s]" % config.default_mod_dir
print " -g always release the GIL (SIP v3.x behaviour)"
print " -j # split the concatenated C++ source files into # pieces [default 1]"
print " -n dir the directory containing the QScintilla header files [default %s]" % config.qt_inc_dir
print " -o dir the directory containing the QScintilla library [default %s]" % config.qt_lib_dir
print " -r generate code with tracing enabled [default disabled]"
print " -v dir where the PyQt .sip files will be installed [default %s]" % config.default_sip_dir
def mkTempBuildDir(olddir=None):
"""Create a temporary build directory for a console application called
qttest, complete with patched Makefile. The global tempBuildDir is set to
the name of the directory. The temporary directory becomes the current
olddir is None if the directory should be created, otherwise it is deleted.
Returns the name of the previous current directory.
global tempBuildDir
if olddir is None:
tempBuildDir = tempfile.mktemp()
sipconfig.error("Unable to create temporary directory.")
prevdir = sipconfig.push_dir(tempBuildDir)
"""TEMPLATE = app
TARGET = qttest
CONFIG += console warn_off @TEST_OPENGL@ @BLX_CONFIG_APP@
SOURCES = qttest.cpp
# Disable OpenGL, qui and QScintilla support by default.
config.patches["@TEST_OPENGL@"] = ""
config.patches["@TEST_QUI_LIB@"] = ""
config.patches["@TEST_QSCINTILLA_INC@"] = ""
config.patches["@TEST_QSCINTILLA_LIB@"] = ""
# Create a dummy source file to suppress a qmake warning.
sipconfig.copy_to_file("qttest.cpp", "")
prevdir = None
shutil.rmtree(tempBuildDir, 1)
return prevdir
def tryModule(maindir, mname, incfile, ctor):
"""See if a PyQt module should be built and update the buildModules list
maindir is the directory containing this script.
mname is the name of the PyQt module.
incfile is the C++ header file that defines the class being used for the
ctor is the constructor of the class being used for the test.
# Check for the existence of the module .sip file.
msip = os.path.join(maindir, "sip", mname, mname + "mod.sip")
if not os.access(msip, os.F_OK):
"""#include <%s>
int main(int argc,char **argv)
new %s;
""" % (incfile, ctor))
if sipconfig.run_make(None,0) == 0:
sipconfig.inform("The %s module will be built." % mname)
sipconfig.inform("The %s module will not be built." % mname)
def checkQScintilla():
"""See if QScintilla can be found and what its version is.
# Find the QScintilla header files.
sciglobal = os.path.join(sciIncDir, "qextscintillaglobal.h")
if os.access(sciglobal,os.F_OK):
config.patches["@PYQT_QSCINTILLA_INC@"] = sciIncDir
sipconfig.inform("%s contains qextscintillaglobal.h." % (sciIncDir))
# Get the QScintilla version number.
global sciVersion
sciVersion, sciversstr = sipconfig.read_version(sciglobal, "QScintilla", "QSCINTILLA_VERSION", "QSCINTILLA_VERSION_STR")
sipconfig.inform("QScintilla %s is being used." % (sciversstr))
# If we find a snapshot then set the version number to 0 as a special
# case.
if sciversstr[:8] == "snapshot":
sciVersion = 0
# Find the QScintilla library.
if sys.platform == "win32":
lpatt = "qscintilla.lib"
lpatt = "libqscintilla.*"
if len(glob.glob(os.path.join(sciLibDir, lpatt))):
sipconfig.inform("%s contains the QScintilla library." % sciLibDir)
global sciLib
if sys.platform == "win32":
sciLib = sipconfig.escape(os.path.join(sciLibDir, "qscintilla.lib"))
sciLib = sipconfig.escape("-L" + sciLibDir) + " -lqscintilla"
config.patches["@PYQT_QSCINTILLA_LIB@"] = sciLib
sipconfig.inform("The QScintilla library could not be found in %s and so the qtext module will not be built. If QScintilla is installed then use the -o argument to explicitly specify the correct directory." % (sciLibDir))
sciVersion = -1
sipconfig.inform("qextscintillaglobal.h could not be found in %s and so the qtext module will not be built. If QScintilla is installed then use the -n argument to explicitly specify the correct directory." % sciIncDir)
sciVersion = -1
def moduleChecks(maindir):
"""See which PyQt modules to build.
sipconfig.inform("Checking which additional PyQt modules to build.");
tryModule(maindir,"qtcanvas", "qcanvas.h", "QCanvas()")
tryModule(maindir,"qtnetwork", "qsocket.h", "QSocket()")
tryModule(maindir,"qttable", "qtable.h", "QTable()")
tryModule(maindir,"qtxml", "qdom.h", "QDomImplementation()")
if config.qt_version >= 0x030000:
tryModule(maindir,"qtsql", "qsql.h", "QSql()")
# We need a different Makefile for the qtgl module.
config.patches["@TEST_OPENGL@"] = "opengl"
tryModule(maindir,"qtgl", "qgl.h", "QGLWidget()")
# Put things back.
config.patches["@TEST_OPENGL@"] = ""
# Check for the qui library.
if config.qt_version >= 0x030000:
if sys.platform == "win32":
quilib = r"$(QTDIR)\lib\qui.lib"
quilib = "-lqui"
config.patches["@PYQT_QUI_LIB@"] = quilib
config.patches["@TEST_QUI_LIB@"] = quilib
tryModule(maindir,"qtui", "qwidgetfactory.h", "QWidgetFactory()")
# Put things back.
config.patches["@TEST_QUI_LIB@"] = ""
# Check for the QScintilla library.
if sciVersion >= 0:
config.patches["@TEST_QSCINTILLA_INC@"] = sciIncDir
config.patches["@TEST_QSCINTILLA_LIB@"] = sciLib
tryModule(maindir,"qtext", "qextscintillabase.h", "QextScintillaBase()")
# Put things back.
config.patches["@TEST_QSCINTILLA_INC@"] = ""
config.patches["@TEST_QSCINTILLA_LIB@"] = ""
def generateFeatures(featfile):
"""Generate the header file describing the Qt features that are enabled if
it doesn't already exist. (If it already exists then we are probably cross
compiling and generated the file through other means.)
featfile is the name of the features file.
if os.access(featfile,os.F_OK):
sipconfig.inform("Using existing features file.")
sipconfig.inform("Generating the features file.")
# The features that a given Qt configuration may or may not support. Note
# that STYLE_WINDOWSXP requires special handling.
# Generate the program which will generate the features file.
f = open("qttest.cpp","w")
# Escape the backslashes so that the name can be embedded in a C++ string.
ffstr = string.replace(featfile, "\\", "\\\\")
"""#include <stdio.h>
#include <qglobal.h>
#include <qapplication.h>
int main(int argc,char **argv)
FILE *fp;
QApplication app(argc,argv,0);
if ((fp = fopen("%s","w")) == NULL)
printf("Unable to create '%s'\\n");
return 1;
#if !defined(QT_THREAD_SUPPORT)
fprintf(fp,"-x Qt_THREAD_SUPPORT\\n");
#if (defined(Q_OS_WIN32) || defined(Q_OS_WIN64)) && QT_VERSION >= 0x030000
if (qWinVersion() != Qt::WV_XP)
fprintf(fp,"-x Qt_STYLE_WINDOWSXP\\n");
""" % (ffstr, ffstr))
for feat in flist:
#if defined(QT_NO_%s)
fprintf(fp,"-x Qt_%s\\n");
""" % (feat, feat))
return 0;
sipconfig.run_program(os.path.join(os.getcwd(), "qttest"))
sipconfig.inform("Generated the features file.")
def generateSource(mname, plattag, qttag, xtrtag):
"""Generate the C++ source code for a particular PyQt module.
mname is the name of the module.
plattag is the SIP tag for the platform.
qttag is the SIP tag for the Qt version.
xtrtag is an optional extra SIP tag.
sipconfig.inform("Generating the C++ source for the %s module." % mname)
sipconfig.error("Unable to create the %s directory." % mname)
pro = mname + ".pro"
argv = ["-t", plattag,
"-t", qttag,
"-z", "features",
"-I", "sip",
"-m", mname + "/" + pro + ".in",
"-c", mname,
"sip/" + mname + "/" + mname + "mod.sip"]
if xtrtag:
if trace:
if releaseGIL:
sipconfig.run_program(config.sip_bin, argv)
# Generate the Makefile.
sipconfig.inform("Generating the Makefile for the %s module." % mname)
olddir = sipconfig.push_dir(mname)
if catCppFiles:
sipconfig.cat_source_files(mname, catSplit)
config.create_makefile(pro, mname)
icmds = []
if sipMajorVersion == 3:
icmds.append(("copy", mname + ".py", modDir))
icmds.append(("copy", mname + ".pyc", modDir))
if sipMajorVersion == 3:
# Compile the Python part of the module.
pyname = mname + ".py"
sipconfig.inform("Compiling %s." % (pyname))
def versionToTag(vers, tags, desc):
"""Convert a version number to a tag.
vers is the version number.
tags is the dictionary of tags keyed by version number.
desc is the descriptive name of the package.
Returns the corresponding tag.
tag = None
vl = tags.keys()
# For a snapshot use the latest tag.
if vers == 0:
tag = tags[vl[-1]]
for v in vl:
if vers < v:
tag = tags[v]
if tag is None:
sipconfig.error("Invalid %s version: 0x%06x." % (desc, vers))
return tag
def main(argv):
"""The main function of the script.
argv is the list of command line arguments.
import getopt
# Parse the command line.
optlist, args = getopt.getopt(argv[1:],"ha:b:cd:gj:n:o:rv:")
except getopt.GetoptError:
for opt, arg in optlist:
if opt == "-h":
elif opt == "-a":
global qpeTag
qpeTag = arg
elif opt == "-b":
global binDir
binDir = arg
elif opt == "-c":
global catCppFiles
catCppFiles = 1
elif opt == "-d":
global modDir
modDir = arg
elif opt == "-g":
global releaseGIL
releaseGIL = 1
elif opt == "-j":
global catSplit
catSplit = int(arg)
catSplit = 0
if catSplit < 1:
elif opt == "