diff options
| author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
|---|---|---|
| committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
| commit | 90825e2392b2d70e43c7a25b8a3752299a933894 (patch) | |
| tree | e33aa27f02b74604afbfd0ea4f1cfca8833d882a /python/pyqt | |
| download | tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.tar.gz tdebindings-90825e2392b2d70e43c7a25b8a3752299a933894.zip | |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'python/pyqt')
483 files changed, 107080 insertions, 0 deletions
diff --git a/python/pyqt/ChangeLog b/python/pyqt/ChangeLog new file mode 100644 index 00000000..e9933799 --- /dev/null +++ b/python/pyqt/ChangeLog @@ -0,0 +1,3223 @@ +2007/04/25 12:25:19 phil +Released as v3.17.2. + + +2007/04/21 14:13:36 phil +Backed out the recent change to remove the /ReleaseGIL/ from +QApplication.postEvent() as it turns out it avoids a potential deadlock. + + +2007/04/10 16:13:51 phil +Released as v3.17.1. + + +2007/04/02 15:27:03 phil +Updated the NEWS file. +SIP v4.6 is now required. +The QLayoutItem sub-class code no longer handles QLayout and leaves it to the +QObject sub-class code to deal with. + + +2007/02/20 10:58:40 phil +Removed the unneeded /ReleaseGIL/ from QApplication::postEvent(). +Removed the GIL manipulation in QCustomEvent (in particular in the traverse +code). + + +2007/01/27 16:02:18 phil +Removed knowledge of the optional parts of the Qt support API so that it is no +longer necessary to update PyQt when new optional parts are added. + + +2007/01/27 15:37:47 phil +Updated the Qt support API for the latest SIP. + + +2007/01/21 16:29:15 phil +Implemented sipQtFindConnection() so that lambda slots can be handled by the +cyclic garbage collector. + + +2007/01/17 16:58:32 phil +Updated the copyright notices. + + +2006/11/30 20:58:48 phil +Fixed bug in QApplication ctor handwritten code that caused a crash if a +QApplication was created a second time with no arguments. + + +2006/11/04 22:08:33 phil +Released as v3.17. + + +2006/10/27 17:13:44 phil +Updated the news file. + + +2006/10/21 14:10:23 phil +Switched the internal build system to Qt v3.3.7. + + +2006/10/06 17:44:27 phil +Synched with the latest QScintilla1 API. + + +2006/09/09 17:59:52 phil +Added QextScintilla.setFont(). +The internal build system now uses -j2. + + +2006/09/02 13:35:03 phil +Removed the use of -c in the internal build systems invocation of configure.py +as it causes problems for GCC v4. + + +2006/08/17 9:36:39 phil +Added the missing QListView.setSelectionAnchor(). + + +2006/07/30 17:16:35 phil +Updated for the latest QScintilla v1 snapshot. + + +2006/07/19 23:30:28 phil +Some tweaks for Windows64 support based on patches from Gerard. + + +2006/07/16 12:38:36 phil +Adapted the handwritten code for Python v2.5. + + +2006/07/08 19:25:44 phil +Added QextScintilla.isCallTipActive(). + + +2006/07/03 19:40:22 phil +Added pyqt_config_args to pyqtconfig.py. +Fixed QTextEdit.setAutoFormatting(). + + +2006/07/02 14:28:05 phil +Added setWrapVisualFlags(), WrapMode::WrapCharacter, WrapVisualFlag to +QextScintilla. + + +2006/07/01 18:57:30 phil +Added cancelList(), firstVisibleLine(), isListActive(), showUserList(), +textHeight() and userListActivated() to QextScintilla. + + +2006/06/28 22:12:57 phil +QextScintilla.foldAll() can now optionally fold all child fold points. +Added autoCompleteFromAll() and setAutoCompletionStartCharacters() to +QextScintilla. +Added AcsAll as an auto-completion source. + + +2006/06/25 21:52:03 phil +Added defaultColor() and setDefaultColor() to QextScintillaLexer. +Added color() and setColor() to QextScintilla. +Renamed eraseColor() and setEraseColor() to paper() and setPaper() in +QextScintilla. + + +2006/06/25 16:21:32 phil +Added defaultPaper() and setDefaultPaper() to QextScintillaLexer. +Added eraseColor() and setEraseColor() to QextScintilla. + + +2006/06/22 19:29:38 phil +The mkfeatures helper is now always built without debugging. +configure.py now states that the -u flag on Windows needs a debug version of +Python. + + +2006/06/20 15:57:55 phil +Latest QScintilla updates. + + +2006/06/19 21:00:47 phil +Synced with the latest QScintilla snapshot - including the significantly +changed Ruby lexer. + + +2006/06/19 15:55:42 phil +Solaris warnings fixes from Ulli. + + +2006/06/18 23:51:34 phil +Sync with the latest QScintilla changes: highlighted identifiers and decorators +in the Python lexer. + + +2006/06/18 16:40:31 phil +Updated for the latest QScintilla snapshot. + + +2006/05/17 8:39:39 phil +Removed some inaccessable methods from QCString. + + +2006/05/11 19:04:27 phil +Another fix for Qt v3.1 in qnamespace.sip. + + +2006/04/28 20:47:46 phil +Replaced long long with PY_LONG_LONG for MSVC 6. + + +2006/04/07 23:29:54 phil +Tidy ups to the internal build system. + + +2006/04/06 12:26:09 phil +Fixed Qt::MacintoshVersion for Qt v3.0.x and v3.1.x. + + +2006/04/05 12:11:43 phil +Removed all functions that were hidden by overloads with the same Python +signature (ie. both of them). + + +2006/03/30 8:09:58 phil +Added QStringList::operator+=(const QString &). + + +2006/03/29 11:38:21 phil +Added the missing QImage.bitBlt() function. + + +2006/03/24 23:54:13 phil +Released as v3.16. + + +2006/03/23 21:34:09 phil +Added a missing /Transfer/ from QGLWidget(). + + +2006/03/20 21:00:58 phil +Removed the "Filter" functions from the documentation. + + +2006/03/20 20:59:23 phil +Removed the "Filter" versions of the QFileDialog static methods as they aren't +necessary after all (just not obvious how to use them properly). + + +2006/03/14 22:45:09 phil +pyuic now specifies the Latin1 encoding when the -embed flag is used. + + +2006/03/13 11:55:09 phil +Build system changes so that PyQt builds on MacOS properly. + + +2006/03/11 19:16:56 phil +Removed some leftovers from when PyQt3 and 4 shared a single config.py. PyQt3 +no longer searches PATH for the Qt bin directory. + + +2006/03/11 15:15:15 phil +Fixed build problem with Qt v1.x. + + +2006/03/10 22:37:30 phil +Updates for Qt v3.3.6. + + +2006/03/04 16:06:40 phil +Documentation updates. +Applied the same transfer rule to QPopupMenu.exec() as is applied to +QDialog.exec(). +Added getOpenFileNameFilter(), getSaveFileNameFilter() and +getOpenFileNamesFilter() to QFileDialog that return a tuple of the selected +files and the current filter. + + +2006/02/26 13:56:28 phil +Added support for signed char to the Qt API. + + +2006/02/21 15:22:08 phil +Changed the signal/slot handling so that unsigned int and unsigned short are +implemented as long objects rather than integer objects. + + +2006/02/19 16:43:48 phil +Updates to the internal Qt API. + + +2006/02/18 21:05:56 phil +Added new stubs in the Qt support API (not used by PyQt3). + + +2006/02/14 19:16:05 phil +The destroyed() signal can now be received by a Python slot. + + +2006/02/13 20:02:22 phil +Fixed a typo in configure.py. + + +2006/02/13 0:24:55 phil +Updated the handwritten code to use the current SIP API. + + +2006/02/12 1:14:11 phil +Removed all calls sipForceConvertTo*(). +Removed all uses of newly deprecated calls. + + +2006/01/26 16:40:38 phil +Changed the signal/slot support required by the latest SIP changes. + + +2006/01/16 18:58:26 phil +Removed PYQT_BUILD. + + +2006/01/10 19:13:07 phil +Fixed a typo in the last change. + + +2006/01/10 18:20:02 phil +Fixed the sipForceConvertToTransfer_*() calls. + + +2005/12/30 14:30:08 phil +More changes to handwritten code that should be handling sipSelfWasArg. + + +2005/12/28 19:35:10 phil +Updated all handwritten convertor code for the latest SIP changes. + + +2005/12/24 17:02:31 phil +Changes required by the introduction of sipSelfWasArg in the SIP snapshot. + + +2005/12/22 16:22:48 phil +Really fixed the QApplication argc bug this time. + + +2005/12/19 17:43:42 phil +Changes to the build system for the latest SIP snapshot. + + +2005/12/18 11:00:06 phil +Stripped the Qt4 specific stuff from configure.py. + + +2005/12/18 10:06:25 phil +Updated the internal build system not to include the .svn directory in +packages. + + +2005/12/17 19:43:36 phil +Changes to the internal build system for the CVS to SVN transfer. + + +2005/12/07 00:54:04 phil +Added a missing #include from qstring.sip in PyQt3. + + +2005/12/04 18:41:31 phil +Fixed the handling of horizontal and vertical stretch in QSizePolicy. + + +2005/11/29 13:06:37 phil +Fixed a long standing bug with QApplication ctors that only showed itself with +Qt4. + + +2005/11/24 17:45:09 phil +Added the missing /ReleaseGIL/ to QThread.exit(). + + +2005/11/24 17:22:31 phil +Changes required for the modified mapped type template syntax. + + +2005/11/20 18:41:02 phil +The HTML documentation is now maintained manually rather than being +auto-generated. + + +2005/11/17 18:24:48 phil +Fixed bug in pyuic related to QKeySequence. + + +2005/11/12 10:29:13 phil +Added the missing ctor to QApplication. + + +2005/11/10 21:10:46 phil +Removed the /TransferThis/ annotations from the QTableItem (and sub-classes) +ctors. The Qt documentation is wrong. + + +2005/11/09 18:00:47 phil +Fixed the GIL bug in qInstallMsgHandler(). + + +2005/11/01 22:08:32 phil +Implemented the PyQt3 changes for the new Qt support API. + + +2005/10/26 14:34:57 phil +Modified the QString buffer interface to be reentrant and to try and use the +default Python codec. + + +2005/10/23 16:02:47 phil +QObject.sender() now supports Python signals. + + +2005/10/22 22:38:54 phil +Implemented the buffer interface for QString. + + +2005/10/19 13:38:24 phil +Improved the fix to QClipboard.setData(). + + +2005/10/16 16:09:29 phil +Used mapped type templates in PyQt3 where possible. + + +2005/10/13 18:52:02 phil +Fixed the handling of QClipboard.setMimeType() and a related memory leak. + + +2005/10/12 21:11:15 phil +Fixed bug in configure.py when the Qt bin directory isn't on the path. +Fixed compilation problem with QAxBase handwritten code and MinGW. +Added the * and *= operators to QString. +Removed some QString methods that were passing or returning arrays. + + +2005/10/11 21:13:48 phil +Added /Numeric/ to the QString + operator. The improved behaviour (being able +to write s = "foo" + QString("bar")) should now work in both PyQt3 and 4. + + +2005/10/07 18:15:37 phil +Changed the PyQt3 QString behaviour with long and ulong to match PyQt4. + + +2005/09/22 20:18:39 phil +Updated the build system now that all Qt specific configuration data has been +removed from sipconfig. + + +2005/09/10 21:33:59 phil +Fixed bug in configure.py when reporting an incorrect SIP version. + + +2005/09/08 20:16:33 phil +Updated the universal slot support to fit with the latest SIP snapshot. +Changed the way universal slots are implemented so they get destroyed when the +corresponding transmitter gets destroyed. + + +2005/09/07 20:53:52 phil +Removed support for SIP v3 in configure.py. +Minor pyuic fix taken from uic v3.3.5. +Added the missing MacintoshVersion enum. +Added the -f flag to configure to use any existing features file (by default it +is recreated). + + +2005/09/06 20:33:43 phil +Removed support for SIP v3 from configure.py. +Added the new Qt support code taken out of SIP. + + +2005/08/30 17:31:05 phil +Released as v3.15. + + +2005/08/17 22:30:17 phil +Replaced all the (now deprecated) sipTransfer() calls in handwritten code. + + +2005/08/10 22:10:29 phil +Synced with the latest QScintilla. +Updated the documentation. + + +2005/07/26 11:08:23 phil +Synced with the current QScintilla. + + +2005/07/25 18:24:29 phil +Added the sipTransfer() to QDialog.exec_loop(). + + +2005/07/24 20:16:51 phil +Synced with the latest QScintilla. +Added the registerWeakActiveObject() and revokeActiveObject() utility +functions to QAxBase. + + +2005/07/10 09:46:49 phil +Added %ConvertSubClassCode to QLayoutItem. + + +2005/07/09 17:55:30 phil +Sync'ed with the latest QScintilla changes. + + +2005/07/06 18:20:26 phil +Fixed the bug in QObject's type conversion graph. +Added the QextScintillaLexerPOV class. +Fixed configure.py so that it properly enables support for the latest +QScintilla. + + +2005/07/05 21:04:26 phil +Added the extra flag to QextScintilla.findFirst(). + + +2005/07/04 19:17:38 phil +Synced with the latest version of QScintilla. + + +2005/07/03 16:58:21 phil +Added support for QAxBase now that SIP has better support for abstract +classes. + + +2005/06/30 15:38:41 phil +Reimplemented all the %ConvertToSubClassCode for QObjects so that it returns +the most specific type that it can, even if it doesn't recognise the exact +type. + + +2005/06/19 13:49:51 phil +Hopefully fixed QImage() for colours with unsigned 32 bit values. + + +2005/06/10 16:45:00 phil +Fixed the return value of QMenuData.insertSeparator(). + + +2005/05/20 17:25:45 phil +Fixed a problem where the readBlock() and readLine() methods of QIODevice were +wrongly expecting a tuple result from a Python reimplementation. + + +2005/05/04 18:41:49 phil +Fixed pyuic bug where a required QIconSet ctor wasn't being generated. + + +2005/04/17 09:04:01 phil +Documented the limitations with super. +Fixed the qdir.py example bugs tiggered by SIP doing some more rigourous +checks. + + +2005/04/15 13:31:55 phil +Added missing Py_DECREF() from QObject.queryList() %MethodCode. + + +2005/04/14 18:17:58 phil +Implemented the QString '+' operator. + + +2005/04/09 15:35:48 phil +When None is passed as a QString (or QByteArray or QCString) then it is now +converted to NULL rather than a null QString. + + +2005/04/04 15:59:27 phil +Fixed a problem with the internal build system caused by the new SIP garbage +collector directives. + + +2005/04/02 23:10:46 phil +Fixed the QCustomEvent %GCClear code. + + +2005/04/02 22:28:50 phil +Added the new %GCTraverseCode and %GCClearCode to QCustomEvent. +Now requires SIP v4.3. + + +2005/04/02 09:53:27 phil +Replaced the new /NoConvertor/ annotation with /Constrained/. + + +2005/03/25 20:18:32 phil +Accel and AccelOverride should now result in QKeyEvent instances rather than +QEvent instances. +Added missing private dtors. + + +2005/03/25 14:24:45 phil +Fixed bug in configure.py when reporting incorrect SIP versions. + + +2005/03/11 19:18:46 phil +Fixed qInstallMsgHandler() for SIP v3. + + +2005/03/10 18:55:52 phil +Fixed QPixmapCache.insert(). + + +2005/03/06 10:09:06 phil +Released as v3.14.1. + + +2005/02/26 11:22:18 phil +Fixed problem with relative path arguments to configure.py. + + +2005/02/25 17:46:51 phil +Added the missing /ReleaseGIL/ annotations from the static QFileDialog methods. +Fixed QObject.queryList() (for SIP v4 only). + + +2005/02/19 15:23:42 phil +Added the QextScintillaLexerLua class. +Released as 3.14. + + +2005/02/18 19:01:46 phil +Fixed the dirview.py example so that it drags local filenames properly and the +folderSelected() signal works the same way as the C++ version. +Added the qdir.py example from Hans-Peter Jansen. +Updated the QAxObject and QAxWidget documentation. +Added qInstallMsgHandler(). +Added the missing classes from the qtext subclass convertor code. + + +2005/02/13 10:47:50 phil +Updated the documentation on QFilePreview. +Fixed a bug in pyuic related to QDataBrowser.del(). + + +2005/02/11 22:54:02 phil +Updated the NEWS file and the documentation. + + +2005/02/11 17:19:19 phil +Fixed broken QObject.inherits() and QObject.isA() (for SIP v4 only). +Changes in version numbers for Qt v2.3.10. +Removed the "Extracting ..." message from pyuic as it isn't always true. + + +2005/02/06 14:39:57 phil +Release the GIL on calling QApplication.enter_loop(). + + +2005/01/29 10:15:48 phil +Synced pyuic with Qt v3.3.4. + + +2005/01/22 18:13:35 phil +PyQt now requires SIP v4.2 or later. + + +2005/01/22 11:54:13 phil +Fixed bug in pyuic where it wasn't importing QDataView when it should. + + +2005/01/21 17:29:52 phil +Added a missing /Transfer/ from QScrollView.setCornerWidget(). +Synced with the current QScintilla snapshot. + + +2005/01/17 13:04:46 phil +Fixed a bug in the internal build system. + + +2005/01/16 13:06:16 phil +Fixed bugs related to most implementations of readBlock() and readLine(). + + +2005/01/14 23:30:27 phil +Removed the out of date README.Linux file. + + +2005/01/14 17:36:52 phil +Backed out the changes to QListBox now that SIP (again) has strict enum +checking. +Fixed enum related bugs in the widgets.py example. +Updated the copyright notices. +Added support for Ulli's VendorID package. +Updated the documentation on application deployment. +Added support for debug builds to the internal build system. + + +2005/01/09 14:02:11 phil +Fixed QListBox so that setRowMode() and setColumnMode() work properly with the +newly relaxed enum type checking in SIP 4. + + +2004/12/29 18:54:44 phil +Added missing const to QDataTable.setDateFormat(). + + +2004/12/26 12:32:59 phil +Added support for the QextScintillaLexerRuby class. + + +2004/12/24 17:54:25 phil +Removed the -g flag from the configure.py help as the corresponding sip flag is +now deprecated. +Hopefully fixed conversions from Python unicode objects to QStrings where +Python uses longs to represent a character. +Allow for spaces in the path to the SIP binary. + + +2004/12/23 22:44:18 phil +Updated the documentation regarding application deployment. + + +2004/12/19 19:29:04 phil +Added the option to build static modules to the internal build system. + + +2004/12/10 19:03:18 phil +Fixed a pyuic bug triggered by the new enum handling in SIP v4.2. + + +2004/12/10 18:07:52 phil +Fixed debug builds on Windows. + + +2004/12/05 14:53:42 phil +Fixed pyuic bug (introduced in 3.13) that broke support for QAxWidget based +instances. + + +2004/12/03 19:00:06 phil +Added a missing /TransferThis/ to QSyntaxHighlighter. + + +2004/10/31 16:33:07 phil +Sync'd to the current QScintilla snapshot. + + +2004/10/17 19:27:08 phil +Minor change to the documentation. + + +2004/10/02 11:51:27 phil +A couple of bug fixes for the webbrowser.py example. + + +2004/10/01 23:09:30 phil +Changed the SIP tag of the educational version. +Added the webbrowser example to the distribution. +Minor fix for the webbrowser example. + + +2004/09/21 14:17:09 phil +Fixed a bug in pyuic2. +Released as v3.13. + + +2004/09/21 11:14:48 phil +Updated the NEWS file. + + +2004/09/15 12:40:09 phil +Added the QMetaObject and QMetaProperty classes. +Added the QObject.metaObject() method. + + +2004/09/12 11:41:49 phil +Added support for the QextScintillaLexerBash class. + + +2004/09/10 22:38:09 phil +Removed redundant implementations of QSqlRecord.field(). +Replaced whrandom with random in all examples. + + +2004/08/25 15:29:20 phil +Added explicit support for QScintilla to pyuic. + + +2004/08/22 15:51:05 phil +Added support for what will become QScintilla v1.4. + + +2004/08/20 11:07:56 phil +Brought the documentation up to date. +Added support for QUuid. + + +2004/08/19 10:32:31 phil +Pushed out support of QAxObject to SIP v4.2. +Added /ReleaseGIL/ to any QApplication and QThread method that might cause +events to be dispatched. + + +2004/08/15 23:34:28 phil +Updated pyuic from Qt 3.3.3. +pyuic now never uses the SLOT() macro in case the connection is to a method of +a Python custom widget. + + +2004/08/04 18:05:25 phil +Added the comparison operators between QChar and QChar and char. + + +2004/08/04 14:06:41 phil +Implemented all the QDataStream << and >> operators for classes. + + +2004/08/03 22:19:59 phil +Build system fix for when QWindowsXPStyle is a plugin. + + +2004/07/19 18:41:53 phil +Fixed a bug in the fontdisplayer.py example. + + +2004/07/08 08:40:54 phil +Minor internal changes. + + +2004/06/27 08:43:19 phil +Added a missing /TransferThis/ from one of the QPushButton ctors. + + +2004/05/26 22:15:40 phil +Added another missing /ReleaseGIL/ to QApplication. + + +2004/05/25 17:05:27 phil +Fixed bug in QArray for old versions of Qt. +Fixed QAssistantClient bug in configure.py for old versions of Qt. +Fixed QSocket bug for old versions of Qt. +Released as v3.12. + + +2004/05/25 13:55:07 phil +Added missing /ReleaseGIL/ to QThread. + + +2004/05/25 11:26:37 phil +Internal build system changes. + + +2004/05/18 18:33:03 phil +Added the webbrowser.py example (which will have to wait until SIP v4.1 before +it works). +Added missing /ReleaseGIL/ to QWaitCondition, QMutex and QMutexLocker. + + +2004/05/15 14:18:24 phil +Fixed bug that accidentally disabled the qtsql module for the free edition. +Disabled the qtaxcontainer module until SIP v4.1. + + +2004/05/09 11:19:26 phil +Minor pyuic3 changes to support QAxWidget. +Marked the qtaxcontainer classes as experimental. + + +2004/05/04 16:01:57 phil +qwindowdefs.sip for all platforms is now included in the commercial package. +Changed the SIP3 dependency to v3.10.2. +QValueList<QIconDragItem> is now dependent on the Qt_ICONVIEW feature. +pyuic and pylupdate will now build on the Enterprise Edition even if the qtxml +module has been disabled. +Compiler error messages during configuration are suppressed if possible, but +can be seen with the new -w flag. +configure.py now explicitly checks QAssistantClient rather than assume it is +present in the Enterprise Edition. +The qtaxcontainer module now builds on Windows. + + +2004/05/02 00:38:16 phil +Sync with the latest QScintilla snapshot. + + +2004/05/01 17:10:57 phil +Fixed more minor build problems. +The commercial version now has identical code on all platforms. + + +2004/04/30 21:50:33 phil +Fixed an internal build problem. +Implemented QValueList<QVariant> as a mapped type. (Done in the previous +commit but I forgot to mention it.) + + +2004/04/25 22:09:09 phil +Added the qtaxcontainer module - doesn't work yet, but shouldn't break +anything. + + +2004/04/24 08:43:22 phil +Update the documentation to say that Qt v3.3.2 is supported. + + +2004/04/18 15:45:12 phil +Changed the build system to deal with the evaluation version of PyQt. + + +2004/04/13 18:24:04 phil +QAssistantClient is disabled for the Professional Edition because it requires +code from the Enterprise Edition (only seems to affect Windows though). + + +2004/04/12 14:49:33 phil +Added the QextScintillaLexerPerl class to the qtext module. + + +2004/04/04 17:01:11 phil +Minor fixes to the dirview.py example. +Sync'ed with the current QScintilla snapshot. + + +2004/03/30 18:22:25 phil +Fixed a bug where the destruction of QTab instances wasn't noticed. + + +2004/03/28 15:16:50 phil +Updated to the latest QScintilla snapshot. + + +2004/03/27 18:26:02 phil +Updated for the latest changes to QScintilla. + + +2004/03/21 21:09:25 phil +Changed the configure.py message when testing for plugins to be the right +"sense". +Updated the QScintilla support for v1.3. + + +2004/03/11 19:05:38 phil +Changed the SIP v3 dependency to v3.10.1. +Released as v3.11. + + +2004/03/11 01:22:12 phil +Minor changes to the internal build system. + + +2004/03/10 18:29:30 phil +Brought the documentation up to date. +Minor internal build system changes. +The build system now disables style classes built as plugins. +Changed the handwritten code to use the SIP generated feature #defines rather +than the unreliable (in the case of plugins) Qt ones. + + +2004/02/26 18:56:39 phil +Updated the documentation to say that PyQt has been tested against Qt v3.3.1. +Updated the internal build system to exploit distcc. +Fixed bug in the conversion from Python lists to QMemArrays. + + +2004/02/15 22:34:39 phil +Fixed the canvas.py example's handling of multiple views. + + +2004/02/11 19:24:10 phil +Fixed the old build system for Qt v3.3.0. + + +2004/02/07 17:38:52 phil +Fixed a couple of bugs in pyuic3 and added the spacer.ui form to verify it. + + +2004/02/02 22:27:48 phil +Updated pyuic from Qt v3.3.0. + + +2004/02/01 14:38:18 phil +Added the QLocale class from Qt v3.3.0. +Updated all existing classes for Qt v3.3.0. +Added the missing += operators for QString. +Added the missing QSocketDevice class. + + +2004/01/31 23:09:45 phil +Added the missing /Transfer/ from QMimeSourceFactory.setData() and +QMimeSourceFactory.setDefaultFactory(). +Added the missing /TransferBack/ from QMimeSourceFactory.takeDefaultFactory(). +Added the missing /Factory/ from createEditor() in QTableItem and sub-classes. +Added the missing /Factory/ in QTextCodec.makeDecoder(), +QTextCodec.makeEncoder() and QTextEdit.createPopupMenu(). +Added Qt v3.3.0 support to the build system. +PyQt now builds against Qt v3.3.0. + + +2004/01/29 19:19:36 phil +Minor change to the internal build system. +Added README.AIX from Ulli Berning. + + +2004/01/27 08:34:21 phil +Reverted the accidental change to QTextEdit.find(). +Fixed a couple of markup problems in the documentation. +Added the missing QHttp, QFtp and QLocalFs to the appropriate +%ConvertToSubClassCode. + + +2004/01/21 18:34:02 phil +Added some fixes for Qtopia v1.6 from Mickey Lauer. + + +2004/01/16 20:53:09 phil +Released as v3.10. + + +2004/01/15 20:04:11 phil +Changed configure.py to check that SIP was built with Qt support enabled as +early as possible. + + +2004/01/15 19:27:58 phil +Added a check for the SIP version number in configure.py. +Fixed pyuic3 not to use iostream and avoid warning messages with MSVC. + + +2004/01/04 18:52:29 phil +Minor updates to the build system. + + +2004/01/03 23:57:31 phil +Updated the copyright notices. +Changed pyuic3 to only #include zlib.h for Qt versions before 3.1.0. +Documented pyqtconfig. + + +2004/01/02 18:41:01 phil +Minor changes to the build system. +Repaired the completely broken pyqtconfig module. + + +2003/12/26 23:34:47 phil +Changes to the build system based on patches from Ulrich Berning. + + +2003/12/26 19:32:31 phil +Added the missing QFtp class. + + +2003/12/26 19:31:23 phil +Added the missing QHttp, QHttpHeader, QHttpRequestHeader, QHttpResponseHeader, +QLocalFs classes. + + +2003/12/21 17:28:16 phil +Documented sip.voidptr.asstring(). + + +2003/12/21 16:07:00 phil +Fixed a bug when automatically converting to a QKeySequence. + + +2003/12/06 20:21:54 phil +Fixed a bug in the old build system for Windows. +Brought the documentation up to date. +Released as v3.9. + + +2003/12/04 19:35:28 phil +Updated the README for the new build system. + + +2003/12/02 00:00:35 phil +Slight change to handwritten code forced by the change to sipParseResult(). + + +2003/11/23 17:04:10 phil +Removed qInstallPathSysconf() on Windows. + + +2003/11/22 20:54:01 phil +Windows related changes to the new build system. + + +2003/11/22 00:50:23 phil +Portability fixes for Qt v2 and Qtopia. + + +2003/11/21 23:06:14 phil +More changes to the new build system. Tested with SIP v4 and Qt Professional +on Linux and SIP v3 and Python v1.5.2 on Linux. + + +2003/11/21 07:32:01 phil +SCons is now completely removed from the new build system. PyQt will now build +with SIP v3 and SIP v4 on Linux. + + +2003/11/15 11:20:17 phil +More changes to the new build system. + + +2003/11/13 19:41:35 phil +More changes to the new build system. PyQt now builds against the Professional +Edition. + + +2003/11/13 13:12:47 phil +New build system changes. PyQt now builds correctly on Linux for SIP v3 and SIP +v4. + + +2003/11/12 22:22:50 phil +Added more of the new build system. +Fixed a bug in pyuic3 handling of encoded strings (thanks to Joerg Kaercher). +Added the QImageIO class. + + +2003/11/05 20:33:43 phil +Added QListViewItemIterator. +Added the QDockArea << and >> operators. +Started on the new build system. + + +2003/10/27 23:23:07 phil +Removed more handwritten code now that SIP fully supports pointers and +references to base types. +Fixed a GIL problem with the QCanvasItem sub-class conversion code. + + +2003/10/26 22:53:03 phil +Added the missing QSettings.readBoolEntry(). +Removed lots of non-virtual %MethodCode now that SIP automatically handles +returning multiple arguments. + + +2003/10/24 08:34:44 phil +Added /ReleaseGIL/ wherever looked sensible. + + +2003/10/23 18:27:30 phil +Used %Build rather than the deprecated %Makefile. +Used %ModuleHeaderCode and %TypeHeaderCode rather than the deprecated +%HeaderCode. +Used %ModuleCode and %TypeCode rather than the deprecated %C++Code. + + +2003/10/22 18:40:32 phil +Added %ConvertToSubClassCode for QTableItem and QCanvasItem. +Added the missing qtui module documentation. +Refactored the internal and external build systems so that the .sip files are +arranged in a hierarchy and are installed. +Added the -v flag to build.py to specify where the .sip are installed to. + + +2003/10/21 16:40:12 phil +Fix to build.py for the Mac. + + +2003/10/21 13:39:18 phil +Fixed Windows warning message from qmemarray.sip handwritten code. +Fixed internal build.py to generate Mac packages properly. + + +2003/10/20 18:50:07 phil +More MacOS/X related changes. +Compiler warnings are now enabled when building with SIP v4. +PyQt builds with no warnings with SIP v4. + + +2003/10/19 19:47:35 phil +Documentation updates. +Removed the tests for missing functions in early versions of Qt for MacOS/X. +Updates to the build system for MacOS/X. + + +2003/10/16 15:50:38 phil +Replaced the use of __cmp__ in QString because it doesn't work with SIP v4 if +the argument isn't of the same type - it's just the way new-style classes work. +Removed the QString.__cmp__() unit test as the implementation no longer uses +handwritten code. + + +2003/10/15 18:19:07 phil +Added the "-r" flag to build.py to build with tracing enabled. +Rewrote all the unit tests to work with PyQt generated with SIP v4. + + +2003/10/11 21:57:20 phil +Brought the documentation up to date. +Changed handwritten code for the changes to sipCallMethod(), sipParseResult() +and sipBadCatcherResult(). + + +2003/10/08 15:04:46 phil +Fixed the internal build system (again). + + +2003/10/07 19:33:13 phil +Fixed QIODevice handwritten code which looked very broken. +Checked all virtual abstract functions that need handwritten code. +Added /TransferBack/ for function return values where needed. +Added the missing qInstallPath(), qInstallPathDocs(), qInstallPathHeaders(), +qInstallPathLibs(), qInstallPathBins(), qInstallPathPlugins(), +qInstallPathData(), qInstallPathTranslations(), qInstallPathSysconf(). +Made sure all handwritten code uses functions that are part of the SIP v4 API. + + +2003/10/04 16:14:45 phil +Changed how sipClassName() is used now that it returns a new reference. + + +2003/10/04 11:16:21 phil +Migrated the remaining %MemberCode to %MethodCode. +Changed the QApplication dtor code slightly to keep the public SIP API simple. +(It means that disowning a top level widget now adds the extra reference, but +this shouldn't make a difference.) + + +2003/10/02 22:54:43 phil +Documented QLayoutIterator.next(). +Fixed problem with build system that was preventing snapshots being generated +after the addition of %MethodCode. +Fixed QSpinBox.mapTextToValue() to take zero parameters. +Converted most of %MemberCode to %MethodCode (ie. the easy ones). + + +2003/10/01 14:00:15 phil +Converted all ctor %MemberCode to %MethodCode. + + +2003/09/23 19:33:07 phil +Converted all Python special methods and operators from %MemberCode to +%MethodCode. +Fixed bug in build system that disabled thread support. + + +2003/09/19 15:30:09 phil +Changes to the build system for SIP v4's new build system. + + +2003/09/19 00:28:39 phil +Fixed converting Python wide Unicode strings to QString for Qt v2. (Actually +done with an earlier change but I forgot to mention it.) +Updated the documentation on application deployment to reflect the changes to +the build system. +The documentation is now a single HTML file with a TOC. +More changes to the build system. Tested with tmake and Windows. + + +2003/09/18 13:47:07 phil +More changes to the build system after initial testing. + + +2003/09/17 18:28:40 phil +Re-factored build.py to use the sipconfig module. Only tested on Linux with +Qt v3.2.1 Enterprise and Python v2.3. + + +2003/09/06 13:35:02 phil +QWMatrix fixes from Torsten Marek. +Added the undocumented "*" operators to QWMatrix. +Updated the educational version to v3.2.0. +Released as v3.8.1. + + +2003/08/24 18:43:40 phil +Updated the tutorials so that they have a consistent coding style and don't use +"import *". +Updated the documentation to say that Qt v3.2.1 is supported. + + +2003/08/17 12:25:57 phil +Fixed QPrinter.winPageSize() for Qt versions before v3. +Released as v3.8. + + +2003/08/17 10:02:11 phil +Fixed problem with QRect | and & operators. + + +2003/08/16 21:14:09 phil +Fixed the code generated by pyuic3 when the -x and -subimpl flags are both +given. +Brought the documentation up to date. + + +2003/08/13 17:50:14 phil +The == and != operators have been implemented for QBrush, QColor, QDomNode, +QFont, QImage, QKeySequence, QPalette, QPen and QRegExp. +The +, +=, -, -=, *, *=, /, /=, ==, != and __nonzero__() operators have been +implemented for QSize. +The ==, != and QString() operators have been implemented for QUrl. +The &, &=, |, |=, ==, !=, __contains__() and __nonzero__() operators have been +implemented for QRect. +The |, |=, +, +=, &, &=, -, -=, ^, ^=, ==, !=, __contains__() and __nonzero__() +operators have been implemented for QRegion. +The ==, != and *= operators have been added to QWMatrix. +The __len__(), __contains__(), == and != operators have been implemented for +QDir. +The comparison operators and __nonzero__() have been implemented for QDate, +QDateTime and QTime. +Added some consts to the QString operators. +Added the QDate, QDateTime, QDir, QRect, QRegion, QSize and QTime unit tests. +Added the runtests.py master unit test runner. + + +2003/08/12 20:34:29 phil +Fixed memory leak in QStringList * operator. +Added the QPoint operators (thanks to Torsten Marek). +Added the QPoint unit test. + + +2003/08/12 15:31:24 phil +Fixed deprecated use of iostream.h in pyuic3. +Updated the QScintilla support. + + +2003/08/11 18:52:45 phil +Fixed version problem with QToolBox. + + +2003/08/01 09:42:10 phil +Added the missing Qt.ButtonState.MetaButton. +Added support for the [], in, len and comparison operators to QString (thanks +to Torsten Marek). +Added the test_QString.py test script. + + +2003/07/25 23:38:36 phil +Refined the pyuic3 changes - because KWrite is crap. + + +2003/07/25 23:36:11 phil +Added the menus.ui test form. +Some pyuic3 format changes from Detlev. + + +2003/07/25 12:13:44 phil +Updated pyuic for Qt v3.2.0. + + +2003/07/24 17:20:59 phil +Added QSplashScreen, QSqlSelectCursor and QToolBox for Qt v3.2.0. +Fix to build.py error message. + + +2003/07/24 10:52:38 phil +Minor license handling changes. +Fixed memory leak in QStringList[] when using slices. +Added the -k flag to build.py to create static modules. +Updated README.MacOSX from Willard Myers. +Updated all existing classes for Qt v3.2.0. + + +2003/07/05 10:31:55 phil +Fixed problem with include directories when using tmake. +Released as v3.7. + + +2003/07/05 09:59:37 phil +Provisional release of v3.7. + + +2003/07/03 16:17:55 phil +pyuic3 now says what it is extracting on stderr rather than stdout. + + +2003/07/01 14:18:37 phil +Brought the documentation up to date. +Added README.MacOSX (thanks to Bill Myers). +Added lots of new examples from Jorge Arroyo. + + +2003/06/30 09:23:25 phil +Changed all handwritten code to use the new 'L' format character where +appropriate. +Implemented __setitem__(), __delitem__(), __add__(), __iadd__(), __mul__(), +__imul__(), __eq__() and __ne__() for QStringList. +Added the internal QStringList unit tests. + + +2003/06/22 11:26:32 phil +%DtorCode has been renamed %VirtualCode. + + +2003/06/21 11:37:58 phil +Fixed the internal build process to deal with the new %DtorCode. + + +2003/06/19 23:53:49 phil +More changes to QCustomEvent which shouldn't now leak memory under any +circumstances. + + +2003/06/19 16:31:57 phil +QEvent.data() now returns a Python object without increasing it's reference +count. +The QEvent dtor is now virtual so that the Python wrapper object gets garbage +collected when Qt deletes the event when it's passed to +QApplication.postEvent(). + + +2003/06/10 14:51:23 phil +(Hopefully) fixed pyuic3 compile bug under Windows. +Added the progressbar.py example from Jorge Arroyo. + + +2003/06/08 12:25:08 phil +Lots of build tidy ups from Hans-Peter Jansen. + + +2003/06/06 12:59:26 phil +pylupdate now recognises the __tr() and __trUtf8() methods generated by pyuic. +Added some missing /Transfer/ flags from QMenuData. +Updated the menu.py example so that it matches the latest Qt version. + + +2003/05/31 12:19:22 phil +Changed the build system to generate .in files which are then patched so that +the patched files stay around to aid debugging. +Removed unneeded directories from INCLUDEPATH in .pro files. + + +2003/05/30 17:52:06 phil +Don't generate the internal __tr() and __trUtf8() methods if the user passes +their own function name. + + +2003/05/30 17:47:57 phil +Added the listbox.py and listboxcombo.py examples from Jorge Arroyo. +build.py improvement in detecting executable programs. +Changed pyuic3 to generate calls to qApp.translate() rather than self.tr(). +Documented the issues related to translations. + + +2003/05/23 22:03:05 phil +Fixed some bugs and inefficiencies in the canvas.py example so that it no +longer segfaults on exit when a sprite has been created. +Added bits(), scanLine(), jumpTable() and colorTable() to QImage. + + +2003/05/22 21:50:05 phil +Added the QWindowsXPStyle class. (Thanks to Ulrich Berning.) + + +2003/05/20 10:36:10 phil +Added QextScintilla.modificationAttempted(). + + +2003/05/18 20:59:53 phil +Added QextScintillaBase.SCN_MODIFYATTEMPTRO. +Fixed pyuic3's broken handling of the -x flag. +Fixed pyuic3's broken generation of embedded images. +Fixed QImage ctor to use an internal colour table instead of an external one +that was garbage collected too soon. + + +2003/05/13 09:50:54 phil +Added the QSignalMapper class (thanks to Gordon Tyler). + + +2003/05/12 10:00:59 phil +Added toShort(), toUShort(), toInt(), toUInt(), toLong(), toULong(), toFloat() +and toDouble() to QCString and QString. + + +2003/05/11 10:26:44 phil +Added the QextScintillaLexerHTML class. + + +2003/05/07 21:07:04 phil +Changed the handling of version numbers so that we assume the latest SIP tags +if we find a QScintilla snapshot. + + +2003/05/07 16:53:05 phil +Updated the documentation to explicitly mention the problems of using lambda +expressions as slots. +Added the QextScintillaLexerSQL class. +Changed build.py to support QScintilla version control. + + +2003/05/04 09:57:19 phil +Fixed silly typo in build.py. + + +2003/05/03 14:50:03 phil +Removed some dead code from build.py. +The qt module was ignoring the release/debug option and the debug version of +the Python library wasn't being searched for. +Added the unittest tests for pyuic. +Fixed the last pyuic3 bugs related to embedded images. +Added the -test flag to pyuic3 to support fully automated unittest tests. + + +2003/04/26 15:24:45 phil +Released as v3.6. + + +2003/04/26 14:36:12 phil +Fixed tmake related breakages introduced with SIP v4 support in .pro files. + + +2003/04/26 13:58:00 phil +Fixed bug in concatanating source files. + + +2003/04/23 14:53:00 phil +Changed to the C++ style operators where possible. + + +2003/04/22 16:05:10 phil +Adjusted handwritten code for Python slots so that it will be compatible with +SIP v3 and v4. +QStringList.__getitem__ will now handle extended slices. + + +2003/04/18 22:17:26 phil +Tracked the latest QScintilla changes. + + +2003/04/16 11:42:45 phil +Fixed build.py for when SIP v4 is used. +Python v2.3 is now required if SIP v4 is being used. +Changed QCustomEvent.data() to deal with the changed support of SIP_PYOBJECT. + + +2003/04/13 15:42:08 phil +Temporarily made some handrwritten code dependent on SIP v3 while debugging +SIP v4. +Fix to pylupdate from Detlev. +Fix to pyuic3 related to pixmaps. + + +2003/04/07 11:52:33 phil +QCommonStyle is now always included (to fit with Qt v3), but it should still be +configured properly for the Zaurus. + + +2003/04/04 14:24:00 phil +Fixed typo in qpixmap.sip where some Qt v3 methods had been added to the Qt v2 +definition. +Fixed some pyuic3 problems with embedded and external images. + + +2003/04/04 10:32:45 phil +SIP v4 related fixes to %VirtualCode. +Fixed some sipParseArgs() format bugs in qtxml handwritten code. +Added missing /TransferThis/ from QTableItem (and derived classes) ctors. +Added other missing transfer flags from some QTable methods. + + +2003/04/01 20:44:55 phil +Added support for the educational version. +Don't delete the .lib and .exp files as part of the installation on Windows. +Added the -j, -r and -t flags to build.py based on patches from Hans-Peter +Jansen. +Changed all sipNames to the new style. + + +2003/03/31 23:39:02 phil +Made sure Python.h is included before stdio.h for LFS support under Solaris. +Removed all uses of %ExportedHeaderCode for compatibility with SIP v4. +Implemented the %VirtualCode that is to be used with SIP v4. +Fixed some bugs in existing %VirtualCode. +Removed QTextEdit.getFormat() and QTextEdit.getParagraphFormat() as they are +undocumented and marked as "don't use". + + +2003/03/26 22:21:58 phil +Slightly changed the implementation of QObject.sender() to maintain +compatibility with SIP v4. +The build process no longer checks for sipQt.h as it isn't in SIP v4. +Added a missing #include in qnetwork.sip that only showed up with SIP v4. + + +2003/03/25 17:52:22 phil +Work around the problem that qmake doesn't like targets called "qt". (For +SIP v4.) + + +2003/03/21 00:20:19 phil +Reverted the "fix" for libqassistantclient on HP-UX, and wait to see if anybody +complains. +pyuic now includes the PyQt version number in the generated output. +Fixed QPixmap handling bug in pyuic. + + +2003/03/16 16:24:24 phil +Tracked latest QScintilla changes. +Fixed an internal build problem with the documentation. + + +2003/03/15 23:42:55 phil +Tracked the latest QScintilla changes. +Brought the documentation up to date. + + +2003/03/14 19:49:44 phil +Added the missing %ConvertToSubClass code for the qtext module. + + +2003/03/13 12:59:44 phil +Tracked the latest QScintilla changes. + + +2003/03/09 18:37:13 phil +Tracked the latest QScintilla changes. + + +2003/03/06 10:35:32 phil +Tracked latest QScintilla changes. +Fixes for the mdi.py example from Ken Godee. +Further improvements to the build system's parsing of the Python version +number. +Fixes to the Qt class and pyuic to deal with the use of the internal +WState_Polished. + + +2003/03/03 18:03:41 phil +Tracked the latest QScintilla changes. + + +2003/02/27 16:21:33 phil +Updates for Qt v3.2.1. +Build system changes for alpha and beta versions of Python. + + +2003/02/26 23:40:22 phil +Tracked latest QScintilla changes. + + +2003/02/26 19:31:26 phil +Tracked latest QScintilla changes. +Fixed QListBox.eventFilter(). +Added the qtui module. +Added /Factory/ to everywhere it seems to be needed. +Fixed Python 1.5.2 problems in the build system. +Updated the menu.py example for Qt3 (thanks to Selim Tuvi). +Fixed a bug in pyuic3 related to pixmaps in QListViewItems. +Fixed a bug in the canvas.py example. +PYQT_VERSION is now the version encoded as a hexadecimal value. +Added PYQT_VERSION_STR as the ASCII version (unless it is a snapshot). + + +2003/01/25 15:39:58 phil +Fixed bug in QPointArray.putPoints(). +The sub-class convertors are now declared as static as SIP now puts them in the +main module code. +Changed the way that the QAssistantClient library is linked in to work around +problems linking static and shared libraries under HP-UX. +Fixed QSpinBox.eventFilter(). + + +2003/01/20 10:24:19 phil +Applied Lars Heete's patch for QString for when Python is built with wide +Unicode support. +Tracked the latest QScintilla changes. + + +2003/01/14 09:55:52 phil +Added the version number to the %Module directives for SIP v4. + + +2003/01/11 15:15:49 phil +pyuic3 will look in the directory containing the .ui file for any .ui.h file. + + +2003/01/06 09:35:29 phil +pyuic3 now properly extracts embedded slot code that takes arguments. +Improved the layout of the pyuic3 generated code slightly. + + +2003/01/04 19:45:03 phil +Updated the copyright notices for 2003. +SLOT(), SIGNAL(), PYSIGNAL(), QT_TR_NOOP() and QT_TRANSLATE_NOOP() are now +implemented as wrapped functions. +PYQT_BUILD is now a string. + + +2003/01/02 16:00:47 phil +Fixed a bug in the build process for sip v3. + + +2002/12/28 17:34:17 phil +Changed the build system to cope with the changes that will be needed for +SIP v4. + + +2002/12/25 10:48:22 phil +Added the checklists.py and drawlines.py examples from Oleksandr Yakovlyev. +Added support for PEP 263 in the code generated by pyuic3. +Tracked latest QScintilla changes. +Implemented the QTextStream << QMainWindow and QTextStream >> QMainWindow +operators. + + +2002/12/20 18:51:37 phil +Added the biff.py example from Oleksandr Yakovlyev. + + +2002/12/20 18:46:10 phil +QString.startsWith() was introduced in Qt v2.2.0 and not Qt v3.0.0. +Added the updated buttongroups.py example from Oleksandr Yakovlyev. + + +2002/12/17 15:33:12 phil +pyuic3 will now extract Python code (tagged with "Python:") from the comments +in a .ui file and copy it to the generated output. + + +2002/12/17 13:20:37 phil +Tracked the latest QScintilla changes, including the new QextScintillaPrinter +class. + + +2002/12/13 18:27:26 phil +Change the build system to ensure that SIP .h files in the location specified +by the -s flag are used in preference to any others in the standard Python +location. +Added the Qtopia QCopEnvelope class. + + +2002/12/11 13:50:58 phil +Ensure that generated Makefiles have a later timestamp than the project file. +Released as v3.5. + + +2002/12/10 23:12:00 phil +Build change where FORCE wasn't being handled properly now that it is version +dependent. +Brought the NEWS file up to date. + + +2002/12/10 14:21:09 phil +Changes related to Qt v3.1.1. +Made Qtopia v1.5.0 the baseline version. +Added the AppLnk, AppLnkSet, Config, DateFormat, DocLnk, DocLnkSet, +FileManager, FileSelector, FileSelectorItem, FontDatabase, Global, MenuButton, +QDawg, QList<AppLnk>, QList<DocLnk> and Resource Qtopia classes. +Added QArray<int> for Qt 1.x and Qt 2.x. + + +2002/12/09 10:40:54 phil +Minor changes for building under Qt/E. + + +2002/12/08 17:56:27 phil +Worked around the Qt Windows bug in QSemaphore += and -= so that the +semaphore.py example now works properly with affected versions of Qt. + + +2002/12/05 17:28:24 phil +Added the script to create the test database for the SQL examples for +PostgreSQL (thanks to Kenneth Godee). +pyuic3 and pylupdate3 changes so that they compile against the Qt Professional +Edition. +Brought the documentation up to date. +Build system change for Qt v3.0.x and FORCE in Makefiles. + + +2002/11/29 10:59:32 phil +Fixed bugs in pyuic3 related to menus and embedded images. +Implemented QMenuItem.setText(), even though it is an internal class, because +it is used in code generated by pyuic3. + + +2002/11/26 12:50:45 phil +eric is now no longer part of the distribution. +Tracked the latest QScintilla changes. +Removed the automatic test for -fno-exceptions and added the -f flag to the +build system so that it can be explicitly set. +Fixed a pyuic3 indentation bug. + + +2002/11/22 22:43:29 phil +Tracked the latest QScintilla changes. + + +2002/11/22 10:15:46 phil +Fixed a couple of bugs in pyuic3's handling of embedded images. + + +2002/11/21 18:57:34 phil +Tracked the latest QScintilla changes. + + +2002/11/18 19:36:53 phil +The missing Windows QEventLoop methods should be added to Qt v3.1.1. +Fixed generation of QString::null in pyuic3. +Tracked latest QScintilla changes. + + +2002/11/14 22:44:42 phil +Fixed problems compiling against Qt v3.0.x introduced with the support for Qt +v3.1.0. + + +2002/11/14 22:32:14 phil +Minor build changes for Windows. +Removed the QEventLoop methods that seem to be missing under Windows. +QGLColormap was actually introduced in Qt v3.0 rather than Qt v3.1. + + +2002/11/13 20:23:43 phil +Tracked the latest QScintilla changes. + + +2002/11/11 11:59:24 phil +Added the missing QDockWindow.drawFrame() and QGLWidget.reparent() methods. +The build system will now recognise Qt v3.1.0. +Added the QAssistantClient, QEventLoop, QGLColormap, QIconFactory, +QIMComposeEvent, QMutexLocker and QSyntaxHighlighter Qt 3.1.0 classes. +QListView.sort() is now virtual for Qt3. +Fixed a bug in the widgets.py example for both Qt2 and Qt3. +Updated pyuic from Qt 3.1.0. +Added the qCompress and qUncompress Qt 3.1.0 functions. + + +2002/11/06 23:56:57 phil +Fixed QWidgetStack.addWidget(). + + +2002/11/05 15:08:21 phil +Addition of new licenses to the internal build system. + + +2002/11/03 20:15:36 phil +Tracked the latest version of QScintilla, including updating to Scintilla +v1.49. + + +2002/10/25 19:00:47 phil +Updated the canvas.py example. +Tracked the latest QScintilla changes. + + +2002/10/24 08:55:46 phil +Tracked the latest QScintilla changes. + + +2002/10/22 21:28:20 phil +Tracked the latest QScintilla changes. + + +2002/10/21 21:25:52 phil +Tracked the latest QScintilla changes. + + +2002/10/20 22:28:46 phil +Tracked the latest changes to QScintilla. +Added the missing QMainWindow.lineUpDockWindows(). + + +2002/10/19 18:43:13 phil +Tracked the latest changes to QScintilla. + + +2002/10/18 17:30:24 phil +More build system changes to fix directory names containing spaces. +Added the QextScintillaLexerCPP, QextScintillaLexerCSharp, +QextScintillaLexerIDL, QextScintillaLexerJava and QextScintillaLexerJavaScript +classes. +Added support for Qt v3.0.6. + + +2002/10/12 23:45:52 phil +Tracked the latest QScintilla changes. +QStringList.__getitem__() now handles slices and negative indices properly. + + +2002/10/11 14:11:53 phil +Fixed the build system where the Python directory path contains spaces. +Another go at fixing the internal build system so that it generates .sip files +for the GPL version that support both X11 and Qt/E. +Updated the QScintilla bindings. + + +2002/10/06 21:21:05 phil +Fixed a silly internal build system bug preventing the qwindowdefs_qws.sip from +being included in the GPL version. + + +2002/10/06 16:04:31 phil +Tracked the latest changes to QextScintilla including the addition of +QextScintillaLexer and QextScintillaLexerPython. + + +2002/10/05 15:03:01 phil +Fixed the internal build system to make sure Qt/Embedded support isn't stripped +out of the GPL version. + + +2002/10/05 13:36:58 phil +Changed the internal build system so that internal development versions are +marked as such. +The user build system now handles conflicting licenses. +pyuic and pylupdate should now build using the professional edition of Qt3. +Added support for margins and markers to QextScintilla. + + +2002/10/03 10:42:28 phil +Synchronised to the latest QScintilla snapshot. + + +2002/10/01 17:38:18 phil +Fixed the i18n example script. +Changed the qtext module build for QScintilla under Windows. + + +2002/09/30 15:32:53 phil +Added the QextScintillaBase.SendScintilla() overload. + + +2002/09/28 08:57:26 phil +Further separated out the Windows .sip files. +Added QextScintillaBase.Colourise(). +Fixed the problem with QTextEdit.find(). + + +2002/09/22 00:39:05 phil +Added eric's missing ViewManager.py file to CVS. + + +2002/09/22 00:37:14 phil +Fixed the internal build system to copy eric's pixmaps directory properly. + + +2002/09/21 17:58:08 phil +Updated eric to v2.1.4 (plus a later patch). +The internal build system now strips down the .sip files for the non-commercial +version. + + +2002/09/18 08:36:18 phil +Added the qtext module containing support for QScintilla. + + +2002/09/13 07:20:57 phil +Fixed QFontDatabase.families() for Qt3. + + +2002/09/10 12:55:34 phil +Minor documentation changes. +Released as v3.4. + + +2002/09/08 21:38:49 phil +Added the missing lib/LICENSE.nc.short. + + +2002/09/08 21:37:30 phil +Added the wtypes.h file to the definitions of MSG and POINT. + + +2002/09/08 12:20:10 phil +The user now has to explicitly accept any non-GPL license. + + +2002/09/07 20:50:13 phil +Added QApplication.winEventFilter(), QWidget.winEvent(), MSG and POINT under +Windows. + + +2002/09/06 17:48:11 phil +Added the new licenses and changed the internal build process to support them. +Updated the NEWS file. + + +2002/09/02 12:05:21 phil +Added a comment to the Signal/Slot documentation about slot reference counts. +Added the mdi.py example from Sadi Kose. +Added the progress.py example from Hans-Peter Jansen. +More license related hooks. + + +2002/08/27 19:09:22 phil +Added the canvas example from Sadi Kose. +Split qwindowdefs.sip into generic and platform specific variants. +Changed the internal build system to support different platforms. +Added a delay to the build system before running make to avoid potential +timestamp problems. + + +2002/08/17 00:48:22 phil +Added Detlev's i18n example. +Added the latest version of eric from Detlev. +Added Fredrik Juhlin's patch to the build system to support debug builds. + + +2002/08/12 14:06:56 phil +Added helpviewer as a standalone application. + + +2002/08/11 20:41:33 phil +Added QT_TR_NOOP() and QT_TRANSLATE_NOOP(). +Added the pylupdate program from Detlev. + + +2002/08/10 20:01:47 phil +Fixed problems with QObject.tr() and QObject.trUtf8(). +Brought the NEWS file up to date. + + +2002/08/06 19:45:26 phil +Build system fixes for Python 1.5.2. + + +2002/08/05 18:02:08 phil +More eric changes from Detelev. + + +2002/07/29 20:54:56 phil +Another eric update from Detlev, including the help browser. + + +2002/07/29 14:16:11 phil +Added QTextEdit.WrapPolicy.AtWhiteSpace as it isn't clear if this is deprecated +or not. (The header file says one thing, the documentation says the opposite.) + + +2002/07/26 13:54:48 phil +Fix a problem with the build system if OpenGL wasn't installed. + + +2002/07/22 21:40:15 phil +Added @BL_INCLUDEPATH@ to the project files for pyuic2 and pyuic3. +Eric's .py files are now compiled by the build system. + + +2002/07/21 23:14:03 phil +Added Detlev's latest patches for eric, including the new qtunittest. Updated +the documentation and build system accordingly. + + +2002/07/20 18:30:07 phil +Added "opengl" to the qtgl project file template. +Changed the build system so that it uses "opengl" when necessary. + + +2002/07/12 13:04:44 phil +Fixed a problem detecting the Qt version in the build system. +Released as 3.3.2. + + +2002/07/12 10:20:20 phil +More internal build system changes. + + +2002/07/11 23:09:40 phil +Internal build system changes. + + +2002/07/11 12:07:40 phil +Added missing /TransferThis/ to all relevant QListBoxText and QListBoxPixmap +ctors. + + +2002/07/09 22:07:10 phil +Added support for Qt 3.0.5. +Released as 3.3.1. + + +2002/07/07 19:20:54 phil +More eric patches from Detlev. +Windows fixes for the build system. +Released as 3.3. + + +2002/07/06 13:35:41 phil +More eric patches from Detlev. +Updated SQL examples from Hans-Peter. +Fixed a bug in pyuic3 when extracting Python slot code when the slot had an +argument. + + +2002/07/05 21:56:20 phil +Backed out the change in the order of attempts to convert Python objects to +QStrings so it is now Unicode objects before string objects. + + +2002/07/05 17:59:16 phil +Fixed a few indentation issues with the dirview examples. +Fixed the same bug in every mapped type based on the QValueList template. + + +2002/07/05 08:54:46 phil +More eric patches from Detlev. +QSqlRecordInfo is now implemented as a Python list of QSqlFieldInfo instances. +The build system now ignores qmake if present when building for Qt 1.x and 2.x. + + +2002/07/04 10:08:24 phil +Still another attempt at a portable features generator. + + +2002/07/04 10:02:04 phil +Another attempt to make the C++ program that generates the feature flags more +portable. + + +2002/07/03 17:43:43 phil +Build system changes for Windows. +Released as 3.3rc3. + + +2002/07/02 22:13:50 phil +Fix a Python warning in build.py. + + +2002/07/02 18:34:32 phil +Changes to the build system for the qtpe module. + + +2002/07/02 14:55:45 phil +More eric patches from Detlev. +Added the missing QString.compare() and QString.localeAwareCompare() overloads. +Changed the build system in line with the way SIP now handles features. + + +2002/06/30 16:24:16 phil +Minor changes to build system messages. +Removed support for the -r flag in the build system as tmake handles -fno-rtti. +Added the -e flag to the build system to explicitly specify the location of the +SIP header files (usually used when cross compiling). +More eric patches from Detlev. +Fixed QDataBrowser.setSqlCursor(). + + +2002/06/29 18:57:01 phil +The build system now determines the Qt version by parsing qglobal.h rather than +running a program (which is no good when cross compiling). +The sipQtFeatures.h file is only generated by the build system is it doesn't +already exist (again to help cross compiling). +Updated the SQL examples. +Fixed an SQL related bug in pyuic3. +Added %MemberCode to QDataTable.setSqlCursor() to transfer ownership of the +cursor if the autoDelete flag is set. + + +2002/06/29 13:09:51 phil +The build system now installs eric for Qt3. +More eric patches from Detlev. + + +2002/06/28 22:45:22 phil +More build.py fixes. +Changed the build system so that project files are restored to their original +contents. +Added the -c flag to the build system to concatenate a module's C++ files prior +to compilation. Compiling PyQt on my 750MHz PIII now takes 10 minutes. (Thanks +to Jim Bublitz and Ricardo Cardenes.) + + +2002/06/28 12:45:25 phil +Added the missing qtpemod.sip. +Added the missing /TransferThis/ to the obsolete QToolBar ctor. +Added the missing %MemberCode for QStyle.getButtonShift(), +QStyle.scrollBarMetrics() and Qstyle.tabbarMetrics(). +More eric patches from Detlev Offenbach. +Added Hans-Peter Jansen's SQL examples. +Fixed a bug in the build system where the path to tmake was explicitly +specified. +Added the -r flag to the build system to explicitly enable -fno-rtti. +Released as 3.3rc2. + + +2002/06/23 19:44:58 phil +Added support for the evaluation version of Qt to the build system. +Applied more eric patches from Detlev Offenbach. +SQL related fixes for pyuic for Qt3. + + +2002/06/22 14:29:05 phil +Applied a couple of eric patches from Detlev Offenbach. +Released as 3.3rc1. + + +2002/06/22 00:53:57 phil +The documentation is now up to date. +Added notes about the limitations on custom editor widgets to the +QSqlPropertyMap documentation. +The default installation directory for pyuic under UNIX/Linux is now +/usr/local/bin rather than where the Python executable is installed. +Fixed a bug with the build system under Windows. +Fixed a problem with QVariant where a numeric value would be recognised as a +QKeySequence. +Added the -i flag to build.py to allow the directory containing the Qt header +files to be explicitly specified. + + +2002/06/20 21:33:34 phil +Fixed bug in QDataTable that stopped in working properly. + + +2002/06/20 18:52:31 phil +Added the qmag.py example script from Hans-Peter Jansen. +Added Christian Bird's notes about his pyuic patch. +Changes to the build system to support Qt/Embedded. +Changes to the build system to handle the lack of site-packages under Windows +before Python v2.2. + + +2002/06/19 17:43:26 phil +Minor changes to eric so that it seems to work under Qt3. + + +2002/06/19 17:29:06 phil +Applied Christian Bird's patch to pyuic for Qt3 to extract slot code written in +Python. + + +2002/06/19 17:14:00 phil +Added the missing qtsqlmod.sip. + + +2002/06/19 07:56:07 phil +Added the missing /Transfer/ from QCanvasPixmapArray.setImage(), +QDataTable.installEditorFactory(), QDataTable.installPropertyMap() and +QSqlForm.installPropertyMap(). +Added Hans-Peter Jansen's bigtable.py, lineedits.py, smalltable.py and +tablestatistics.py example scripts. +Added the missing qxmlmod.sip. + + +2002/06/16 23:15:17 phil +Minor build system changes as a result of moving SIP to its new build system. + + +2002/06/16 15:17:01 phil +Changes to the new build system so that it works under Windows. +Removed all vestiges of the old build system. + + +2002/06/14 16:35:41 phil +The new build process now works with Python v1.5.x. + + +2002/06/14 08:46:36 phil +Changes needed to the build system to support tmake. +The compiled Python scripts will now be installed properly if qmake is used. + + +2002/06/13 18:05:24 phil +More minor build changes related to process for generating automatic snapshots. + + +2002/06/13 17:48:28 phil +Minor build changes. + + +2002/06/13 16:16:19 phil +Added the missing QFontMetrics.boundingRect() variant and QFontMetrics.size(). +Removed the incorrect /TransferBack/ from QTabBar.removeTab(). +The new build system has been tested on Python v2.2/qmake/Linux. + + +2002/06/04 23:33:33 phil +Remove the last of the BlackAdder related files. +Fixed the .spec file. +More updates related to the new build system. + + +2002/06/04 23:26:00 phil +Lots of tidying up of redundant files for the new build system. +Set the release number to v3.2.4 to align with the last official release. + + +2002/06/04 23:04:40 phil +Initial import of PyQt to the Riverbank Computing repository. + + +2002/06/01 11:08:36 phil +Correction to signature of QDir.rename(). +Added README.SunOS. +QValueList<QPixmap> is now fully implemented as a mapping to a Python list of +QPixmap instances. +Added the missing QDoubleValidator.setBottom(), QDoubleValidator.setDecimals(), +QDoubleValidator.setTop, QIntValidator.setBottom() and QIntValidator.setTop(). + + +2002/05/21 14:40:56 phil +Added the missing /Transfer/ to QClipboard.setData(). +Fixed a pyuic3 bug that generates an extra ')' when using the -subimpl flag. + + +2002/05/17 19:04:33 phil +Minor documentation changes. +Released as v3.2.4. + + +2002/05/16 15:28:17 phil +Removed MacOS X support from the build process - until SIP v4. + + +2002/05/15 17:11:34 phil +Modules are now created as simple .so files, ie. without any release number. +The obsolete QMainWindow.setToolBarsMovable() was replaced with +QMainWindow.setDockWindowsMovable(). + + +2002/05/15 11:31:23 phil +Fixed a bug in QInputDialog.getText() for Qt3. + + +2002/05/11 17:38:20 phil +Documentation changes for the latest release. +Released as v3.2.2. + + +2002/05/09 00:19:11 phil +Fixed QPrinter ctor for Qt3. + + +2002/05/07 21:17:32 phil +Added information about "--without-x" to the MacOS installation notes. +Put the -module flag back in for MacOS. +Fixed a bug in pyuic3 where QPixmaps needed to be explicitly converted to +QIconSets. + + +2002/05/05 13:42:46 phil +Added a version that supports the MacOS evaluation version to the list of +"common" source packages. +Released as v3.2.1. + + +2002/05/03 22:35:24 phil +Added INSTALL.MacX. +Removed -module from LDFLAGS as it seemed to make things worse on MacOS. +Released as v3.2. + + +2002/05/01 22:49:37 phil +Updated the documentation regarding support for void *. + + +2002/04/30 07:52:35 phil +configure will now search fro Qt v3.0.4. +Changes required for Qt v3.0.4. +Another minor bug fix related to X11 support and Qt/E. + + +2002/04/29 18:10:04 phil +Added README.Linux describing the broken Qt packages in Mandrake and Debian. + + +2002/04/29 10:17:47 phil +configure doesn't search for X11 for Qt/E. +Added the QPEMenuBar and QPEToolBar classes. + + +2002/04/27 14:19:22 phil +Removed the bug description at the top of the semaphore.py example now that it +is fixed. +Changed %ConvertToSubClassCode for QObject to conform to the latest SIP. +Replaced calls to sipMapCppToSelf() with sipMapCppToSelfSubClass() where +appropriate. + + +2002/04/22 22:56:31 phil +Changed the Windows installation instructions to put things in site-packages. +Fixed the missing QT_THREAD_SUPPORT when building sip_helper on Windows. +Added -module to all LDFLAGS. + + +2002/04/21 19:08:25 phil +QCustomEvent now expects a PyObject * as its data. + + +2002/04/20 22:43:13 phil +Convert instances of the internal class QTableHeader to QHeader. +Fixed a bug in pyuic for Qt3 relating to the format of slot signatures. + + +2002/04/20 16:02:00 phil +Added missing /Transfer/ to QTable.setCellWidget() and QTable.setItem(). + + +2002/04/18 23:17:07 phil +Disabled QFont.dirty(), QClipboard.ownsClipboard(), QClipboard.ownsSelection() +and qAppName() for MacOS. + + +2002/04/18 12:10:42 phil +Updated the NEWS file regarding MacOS X support. +qt.py now defines PYQT_VERSION as the PyQt release as a string. +configure no longer fails if X11 couldn't be found (for MacOS X). + + +2002/04/17 19:10:15 phil +Added support for MacOS X (untested). + + +2002/04/17 09:00:35 phil +Added the missing /TransferThis/ options from all QCanvasItem ctors. +Fixed QCanvasItem.setCanvas() to handle acquiring and losing a parent canvas. + + +2002/04/16 14:17:44 phil +Removed all the /ReleaseLock/ options. +Added Py_BEGIN_ALLOW_THREADS, Py_END_ALLOW_THREADS, SIP_BLOCK_THREADS and +SIP_UNBLOCK_THREADS to all handwritten code. +Thread support is only enabled if it is also enabled in Python. +Added /CreatesThread/ and /NewThread/ to QThread. + + +2002/04/14 18:07:56 phil +Reinstated PyQtDisownTopLevelWidgets() because it solves the problem where we +can't guarantee that the order in which qApp and the top level widgets will be +destroyed. +Changed -MT to -MD for Windows (thanks to Paul Felix). + + +2002/04/06 17:38:53 phil +Added the %ConvertToSubClassCode for QObject and all its sub-classes. +Added the missing QToolTip.setEnabled() and QToolTip.enabled() methods. +Fixed the build process so that the naming of the Qtopia package is more +consistent with other packages. + + +2002/03/30 00:50:10 phil +Make sure the ChangeLog is distributed and that autom4te.cache isn't. +Merged the different versions of QEvent.Type. +Fixed a bug in QStringList.__getitem__(). + + +2002/03/22 10:52:29 phil +Released as v3.1. +Slight change to the build process so make sure that Windows Makefiles always +use the very latest Qt library. + + +2002/03/22 10:40:21 phil +configure will now use qt-mt in preference to qt if it finds both. +Removed build.py from the distribution until it is finished. +Added /Transfer/ to QThread.postEvent(). +Added /ReleaseLock/ to QThread.postEvent(), which might not be required but +shouldn't do any harm. + + +2002/03/20 15:58:33 phil +configure now handles Qt v3.0.3. +Integration of uic changes in Qt v3.0.3. +Applied Rene Hogendoorn's latest patch for slot signatures for pyuic3. + + +2002/03/19 00:19:32 phil +Removed the rebuild-src and rebuild-doc targets as they are no longer +maintained. +Documentation changes prior to the release of v3.1. + + +2002/03/17 17:37:38 phil +Removed the import of GLUT from the gears.py example. + + +2002/03/12 19:31:13 phil +Added the missing build instructions for the qtgl module in INSTALL.win32. +Upgraded to autoconf-2.53 and automake-1.6. +Fixed a couple of pyuic3 bugs related to SQL forms (thanks to Rene Hogendoom). + + +2002/03/09 18:15:48 phil +Various build changes for Windows. +Fixed a bug in QDomDocument.setContent(). +Fixed the qtxml module so that it doesn't get a DLL load failure on Windows. + + +2002/03/04 17:18:31 phil +A couple of changes to eric to reflect the new module structure. +Fixed QThread for Qt v2. +Fixed QTable.setNumRows() in pyuic for Qt v3. + + +2002/02/25 16:26:19 phil +Some enum definitions have been rationalised now that SIP supports individual +values having different versions. + + +2002/02/24 14:59:43 phil +Went through everything adding /ReleaseLock/ to methods that might block. + + +2002/02/24 01:36:06 phil +configure now searches for Qt v3.0.2. +Added QLineEdit.setPasswordChar() and QLineEdit.passwordChar() for Qt v3.0.2 +but left them commented out at they are marked as incompatible add ons. +Updated pyuic3 from the changes in Qt v3.0.2. +Added thread support, ie. QApplication.lock(), QApplication.unlock(), +QApplication.locked(), QApplication.tryLock() and the QMutex, QSemaphore, +QThread and QWaitCondition classes. +Re-did all of the special methods following the SIP changes. + + +2002/02/15 14:45:33 phil +Added the missing QPixmap.grabWidget(). + + +2002/02/14 14:18:35 phil +Fixed bug in pyuic fro Qt v3 related to "black" and "white". + + +2002/02/08 15:51:02 phil +Updated the documentation for the 3.1 pre-releases. +The tr() methods now honour QT_NO_TRANSLATION. + + +2002/02/08 11:54:11 phil +More work on the new build system. +Fixed a bug in eric for PyQt v3. +Fixed a couple of QTable related bugs in pyuic for Qt v3. +Fixed a QToolBar related bug in pyuic for Qt v3. +Fixed bugs with QSqlCursor. + + +2002/01/28 13:42:24 phil +Fixed bug relating to escaping double quotes in pyuic for Qt v2.x. + + +2002/01/28 11:09:08 phil +Removed the Zaurus README. +Changes to configure now that the sip library is a Python module. +Added the start of an alternative build system driven by Python and using qmake +or tmake. + + +2002/01/09 11:47:32 phil +Put version control into the qtpe module and changed the build system so that +it uses a version compatible with both Qtopia and the Zaurus v1.02 ROMs. +Updated README.Zaurus. +Removed the qtpe module from the documentation until SIP is changed to be +tolerant of missing version information. + + +2002/01/08 20:17:11 phil +Removed PyQtDisownTopLevelWidgets() from the QApplication and QPEApplication +dtors because the Qt widget mapper doesn't delete the widgets in the map. + + +2002/01/05 13:16:45 phil +Added the warning about using flash devices as swap on the Zaurus. +Added the missing QActionGroup.add() and QActionGroup.addSeparator() methods. +Implemented enough additional features for the Large configuration of Qt/E. + + +2002/01/04 23:32:42 phil +Added the dragdrop example from Issac Trotts. + + +2002/01/04 15:41:11 phil +Added the Zaurus information. +Minor updates to READMEs etc. + + +2002/01/03 00:41:26 phil +The build script now copes when tmake and/or sgmltools is missing. +Added support to the build system for QPE. +Added the qtpe module. +Added the QPEApplication class (not yet working). +Changed the build system so that there is only one instance of the helper code +and it is more a part of the build system rather than being so closely tied in +which SIP. +configure now allows the directory where the Python modules are to be installed +to be specified. + + +2001/12/27 12:28:07 phil +Fixed all Qt3 writeBlock() methods. +Changes required by the latest SIP. +Support for Qt/Embedded on the Sharp Zaurus. +Removed the QDragResponseEvent internal class. +Added the missing QImageTextKeyLang class. +Added the missing 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 the QValueList<QImageTextLangKey> mapped type. + + +2001/12/09 11:38:47 phil +configure now looks for Qt v3.0.1. +The build system now handles Qt v3.0.1. +.sip file changes needed by Qt v3.0.1. +Updated pyuic3 from Qt v3.0.1. + + +2001/12/06 11:03:29 phil +Fixed more pyuic3 bugs. +Fixed the ownership bug in all QCheckListItem ctors. + + +2001/12/04 10:40:56 phil +Fixed bugs in QSocket.readLine() and QSocket.readBlock(). + + +2001/12/01 18:37:31 phil +Fixed QWidget.reparent(). +Removed the QDateTimeEditBase internal class. +Bug fixes for pyuic3. +configure now allows the location of zlib to be specified. +Used AC_HELP_STRING throughout acinclude.m4. + + +2001/11/25 18:27:27 phil +Minor fixes for pyuic3. + + +2001/11/17 14:48:19 phil +Added the missing qInitNetworkProtocols() function to the qtnetwork module. +Added the missing QRect.contains() variant. +Changed QByteArray, QCString and QString %ConvertToTypeCode to convert None +objects to empty instances. +Changed QFileInfoList, QKeySequence, QList<QNetworkOperation>, QMemArray<int>, +QObjectList, QPair<int,int>, QPtrList<QNetworkOperation>, +QPtrList<QWindowsMime>, QStrList, QValueList<QUrlInfo>, QValueList<int> and +QWidgetList %ConvertToTypeCode to handle None objects. +Fixes to the .spec file. +Fixed ownership issues with QWidget.reparent(). + + +2001/11/11 19:01:27 phil +configure will search for Qt v2.3.2. +Fixed bugs in pyuic for Qt3 (thanks to Andreas Gerstlauer). +Fixed bug in Windows detection (thanks to Andreas Gerstlauer). +Fixed the Qt3 QSizePolicy ctor. + + +2001/10/28 10:33:03 phil +Generated with the latest SIP. + + +2001/10/26 23:33:45 phil +Fixed the ChangeLog. + + +2001/10/26 23:32:23 phil +Changed the way Python special methods are defined to conform to the latest +SIP. +Added __unicode__ to QString for Python v2.2. +Fixed a couple of bugs in pyuic for Qt3. +Changed QString.__str__() to do the "right thing". + + +2001/10/21 13:51:26 phil +Fixed the new QImage ctor. +Fixed the long standing problem converting a QString to Python using unicode(). +Fixed bugs with QFile.readBlock() and QFile.readLine(). + + +2001/10/19 23:34:04 phil +Applied Alan Eldridge's patch for the .spec file. +Made the second parameter to QObject.tr() and QObject.trUtf8() optional. +Added the missing QImage ctor. +Fixed pyuic for Qt3. + + +2001/10/13 11:20:53 phil +Fixed problem with QMenuData.insertItem() when the QKeySequence argument was +omitted. +Ported the remaining examples. + + +2001/10/12 22:46:59 phil +Minor fixes to get the SQL module to build. +Created a separate examples directory for Qt3. +Changes required for the final release of Qt v3.0.0. + + +2001/10/12 10:19:27 phil +Added the qtsql module. +Added the QDataBrowser, QDataTable, QDataView, QEditorFactory, QGridView, +QLibrary, QObjectCleanupHandler, QProcess, QSql, QSqlCursor, QSqlDatabase, +QSqlDriver, QSqlEditorFactory, QSqlError, QSqlField, QSqlFieldInfo, QSqlForm, +QSqlIndex, QSqlPropertyMap, QSqlQuery, QSqlRecord, QSqlRecordInfo, QSqlResult, +QStyleFactory and QWindowsMime Qt3 classes. +Implemented QPtrList<QWindowsMime>. +Renamed QLineEdit.del() to QLineEdit.delChar(). +Renamed QMultiLineEdit.deleteChar() to QMultiLineEdit.delChar(). +Fixed QLineEdit super class for Qt3. + + +2001/10/07 18:47:03 phil +Updated the .spec file with the new modules. +Fixed a bug in the build process. + + +2001/10/06 18:20:00 phil +Fixed QLayoutIterator.next(). +configure now handles multi-threaded Qt. +Moved Canvas module classes to the new qtcanvas module. +Moved Network module classes to the new qtnetwork module. +Moved Table module classes to the new qttable module. +Moved XML module classes to the new qtxml module. +Added the QSound class. + + +2001/10/04 21:33:48 phil +Added the Qt3 classes QDateEdit, QDateTimeEdit, QTimeEdit, QErrorMessage, +QPixmapCache and QSettings. +Added the Qt2 class QDns. +Added QCustomMenuEvent, QIMEvent and QTabletEvent to the list of new Qt3 +classes in the documentation. +Restructure the top-level SIP files so that the documentation is completely +separate. + + +2001/09/30 10:48:01 phil +Implemented QPair<int,int>. +Bug fixing of revised hand-written code. +Changes to get pyuic to compile against Qt3. + + +2001/09/28 23:13:01 phil +Upgraded to Qt v3.0.0Beta6. +Changes required to handwritten code by the new sipParseArgs(). +Added the missing QObject.connect() variant. +Renamed QDate.isValidDate() to QDate.isValid(). +Renamed QTime.isValidTime() to QTime.isValid(). +Renamed QFile.fileExists() to QFile.exists(). +Renamed QFile.removeFile() to QFile.remove(). + + +2001/09/23 20:04:21 phil +Re-added QInterlaceStyle. +Changes required by Qt v3.0.0 Beta5. +Implemented QMenuItem as an opaque class. +Added the missing QSGIStyle class. +Added the missing QMenuData.findItem(), QMotifPlusStyle.drawMenuBarItem(), +QMotifPlusStyle.drawPopupMenuItem(), QMotifStyle.drawPopupMenuItem(), +QMotifStyle.extraPopupMenuItemWidth(), QMotifStyle.popupMenuItemHeight(), +QPlatinumStyle.drawPopupMenuItem(), QPlatinumStyle.extraPopupMenuItemWidth(), +QPlatinumStyle.popupMenuItemHeight(), QPopupMenu.drawItem(), +QPopupMenu.itemHeight(), QStyle.drawPopupMenuItem(), QStyle.drawMenuBarItem(), +QStyle.extraPopupMenuItemWidth(), QStyle.popupMenuItemHeight(), +QWindowsStyle.drawMenuBarItem(), QWindowsStyle.extraPopupMenuItemWidth(), +QWindowsStyle.popupMenuItemHeight(). +Added the QStyleOption Qt3 class. +Classes converted to Qt3: QGL et al, QCDEStyle, QCommonStyle, QMotifPlusStyle, +QMotifStyle, QPlatinumStyle, QStyle, QWindowsStyle. + + +2001/09/21 17:12:07 phil +The following classes were fully converted to Qt3: QFile, QFileDialog, +QFileInfo, QFontDatabase, QFontDialog, QIconView, QIconViewItem, QInputDialog, +QNetworkProtocol, QPaintDeviceMetrics, QPrintDialog, QPrinter, QProgressBar, +QProgressDialog, QRadioButton, QSemiModal, QServerSocket, QSimpleRichText, +QSizeGrip, QSocket, QSpinBox, QTabDialog, QTextBrowser, QTextStream, QUrl, +QUrlOperator, QWhatsThis, QWidgetStack, QWizard, QWorkspace. +Added the missing QFileIconProvider, QFontDialog, QTextBrowser and QWidgetStack +private copy ctors. +Added the missing QFileDialog.done(), QIconView.dropped(), +QIconViewItem.dropped(), QNetworkProtocol.newChildren(), +QPrintDialog.addButton(), QProgressDialog.forceShow(), +QUrlOperator.newChildren() and QUrlOperator.startNextCopy() methods. +Added the missing QIconDrag and QIconDragItem classes. +Implemented QList<QNetworkOperation>, QPtrList<QNetworkOperation>, +QValueList<QIconDragItem> and QValueList<QUrlInfo>. +Added the missing TransferThis to the QPrintDialog ctor. +Moved the QList<> and QPtrList<> templates to their own files. + + +2001/09/21 00:32:29 phil +Forgot to add the new qmemarray.sip file. + + +2001/09/21 00:31:34 phil +Fully converted the following classes to Qt3: QAction, QActionGroup, +QColorDialog, QDial, QDom et al, QMessageBox, QPopupMenu, QPushButton, +QScrollBar, QScrollView, QSplitter, QStatusBar, QTable, QTableItem, QTabWidget, +QToolButton, QToolTip, QToolTipGroup. +Added the following missing methods: QColorDialog.customColor(), +QColorDialog.customCount(), QColorDialog.getRgba(), +QColorDialog.setCustomColor(), QScrollBar.minValue(), QScrollBar.maxValue(), +QScrollBar.setMinValue(), QScrollBar.setMaxValue(), QScrollBar.lineStep(), +QScrollBar.pageStep(), QScrollBar.setLineStep(), QScrollBar.setPageStep(), +QScrollBar.value(), QScrollBar.setValue(), QToolTip.hide(), +QToolTipGroup.enabled(), QToolTipGroup.setEnabled(). +Added the missing QDir.match() variant. +Removed the handling of QValueList<int> out of QSplitter and made it generic. +Added the following Qt3 classes: QCheckTableItem, QComboItem. +Removed QTabWidget.selected() as it is not part of the official API. + + +2001/09/16 18:12:22 phil +Removed the Transfer flag from the QWidget parameter to QLayout.add(), +QGridLayout.addWidget(), QGridLayout.addMultiCellWidget(), +QBoxLayout.addWidget() and QBoxLayout.insertWidget(). +Fixes to the build process so it works with the latest automake. + + +2001/09/14 16:40:03 phil +Added the missing QLayoutIterator.next() method. + + +2001/09/14 15:17:17 phil +Changes to QObject.tr() and QObject.trUtf8() so that they work as expected with +Qt3. +Put back the separate builds for Qt v2.3.0 and v2.3.1. +Put back QPrinter.PageSize.Custom for Qt v2.3.1. +Added the new /AutoGen/ option where needed. + + +2001/09/09 16:26:16 phil +QGrid, QLCDNumber, QListBox, QListBoxItem, QListBoxPixmap, QListBoxText, +QMenuBar, QMenuData, QRangeControl and QSlider fully converted to Qt3. +A QString or int can now be supplied whenever a QKeySequence is expected. +The missing QListBox.isRubberSelecting(), QMenuBar.activateItemAt(), +QMenuBar.focusInEvent(), QMenuBar.isDefaultUp(), QMenuBar.minimumSize(), +QMenuBar.minimumSizeHint(), QMenuBar.setDefaultUp() methods have been added. + + +2001/09/07 16:15:28 phil +Added the new QKeySequence .sip file and remove the QInterlaceStyle .sip file. + + +2001/09/07 16:13:22 phil +Added the missing QAccel ctor. +Added the missing QHeader.setUpdatesEnabled(), QHeader.showEvent() and +QLineEdit.displayText() methods. +Added the missing QColorDrag class. +Converted all the Qt3 changes to Beta4. +Added the QKeySequence Qt3 class. +Fully converted QComboBox, QDialog, QDragObject, QGridLayout, QHeader, QLayout, +QLineEdit, QUriDrag and QWidgetItem to Qt3. +Removed the QBitArray related methods from QVariant. +Removed the QInterlaceStyle class. +Remove QPrinter.PageSize.Custom so that the v2.3.1 build is the same as v2.3.0. +QObject.className() now works with Python classes. +Upgraded to libtool-1.4.1. + + +2001/09/02 17:13:50 phil +Fully converted the following classes to Qt3: QButton, QButtonGroup, QCanvas et +al, QCheckBox, QCheckListItem, QGroupBox, QLabel, QListView, QListViewItem. +pyuic now generates double quoted strings rather than single quoted strings. +Upgraded to autoconf-2.52 and automake-1.5. + + +2001/08/15 19:18:39 phil +Added the Qt3 classes QRegExpValidator and QTextEdit. +Added the missing QPainter.pos() and QTranslator.messages() methods. +Added all methods that use QDataStream now that it has been implemented. +Removed QTableHeader as it isn't part of the documented API. +Fully converted the QFrame, QHBox, QPainter, QPicture, QPointArray, QRect, +QRegExp, QSessionManager, QStyleSheet, QStyleSheetItem, QTab, QTabBar, +QTextCodec, QTextView, QTranslator, QTranslatorMessage, QVariant, QVBox and +QWMatrix classes to Qt3. + + +2001/08/14 16:10:26 phil +Added the QDesktopWidget, QDockArea and QDockWindow Qt3 widgets. +Fully converted the QApplication, QClipboard, QChar, QColorGroup, QDate, +QDateTime, QFontMetrics, QIconSet, QMainWindow, QMimeSource, +QMimeSourceFactory, QPalette, QString, QTime and QToolBar classes to Qt3. +Added the missing QChar.nbsp, QChar.isLetterOrNumber(), QChar.mirroredChar(), +QImage.inputFormatList(), QImage.outputFormatList(), +QMimeSourceFactory.filePath(), QMimeSourceFactory.addFilePath() and +QPalette.inactive() methods. +Added the missing QString.append() and QString.prepend() variants. +Renamed QTime.IsValidTime() to QTime.isValidTime(). +Made QList<QToolBar> a mapped type now that SIP can handle mapped templates. + + +2001/08/10 18:03:56 phil +Final documentation changes for v2.5. + + +2001/08/10 14:54:29 phil +Fixed typo in the Qt3 versioning. + + +2001/08/08 23:28:38 phil +User events get converted to QCustomEvents rather than QEvents. +Finally decided to implement Display * as void *. +QEvent etc., QFont, QFontInfo, QMultiLineEdit and QTableView converted to Qt3. + + +2001/08/07 22:37:16 phil +QWidget is now converted to Qt3. +Added the missing QWidget.customEvent(). +Changed Display to be a class rather than a struct. +Fix a problem with the normal build process caused by the new Qt3 stuff. +Added the temporary qt3.sip-in file. + + +2001/08/07 19:57:06 phil +Fixed a typo in the clean target. +Added Qt3 support for QColor, QCursor, QObject, QPaintDevice, QPixmap and +QSizePolicy. +Added QColor.getHsv(). +Added the Display opaque structure. +Added qt_xdisplay(), qt_xscreen() and qt_xrootwin(). +Added QPaintDevice.x11Display(), QPaintDevice.x11AppDisplay, +QPaintDevice.x11SetAppDpiX() and QPaintDevice.x11SetAppDpiY(). +Added the missing QPixmap.save() variant. + + +2001/08/06 19:57:09 phil +Build changes for the qtgl module under Windows. +The HTML documentation is no longer put into a compressed tar file. +Fixed a minor bug in the widgets.py example. +Changed the configure test for OpenGL support. + + +2001/08/01 22:15:38 phil +More minor build changes. +Fixed QApplication.winVersion(). +Fixed Windows pyuic Makefiles. + + +2001/07/30 22:55:33 phil +Changed the build process so that the current version doesn't have to be the +latest version. +Changed AMTAR to TAR. +Generate Makefiles that support Qt-NC (untested). + + +2001/07/27 22:18:26 phil +The different types that are mapped to Python lists will now return an empty +list (rather than None) when given a NULL pointer. +Fixed a problem detecting -fno-exceptions. +Added QDataStream. +Added the QDom classes. + + +2001/07/21 15:46:35 phil +Used the new %Timeline and %ImportWithTimeline directives. +Added version control to the qtgl module. + + +2001/07/20 23:19:06 phil +Fixed the memory leaks related to sipMapCppToSelf() in hand-written code. +Changed the build system to handle different versions of PyQt for different +versions of Qt. + + +2001/07/17 07:44:09 phil +Changes needed by the latest SIP - Version and %MappedType. +Fixed QScrollView.addChild(). + + +2001/06/29 16:24:55 phil +Minor changes to the BlackAdder DistUtils setup. + + +2001/06/28 23:34:54 phil +Addedpost-hooks to complement the existing pre-hooks. +Added the Pizza example project. + + +2001/06/24 15:12:44 phil +Minor changes to pyuic for BlackAdder. +Moved the BlackAdder specific stuff to its own directory. + + +2001/06/19 15:54:23 phil +Fixed the problems with QLineEdit.event() and QMultiLineEdit.event(). + + +2001/06/18 10:35:45 phil +Re-enabled QInterlaceStype for Qt v2.3.1+. +configure now looks for Qt v2.3.1. +Added QPrinter.PageSize.Custom. +Updates to pyuic from Qt v2.3.1. + + +2001/06/02 17:02:01 phil +Fixed the QTranslatorMessage documentation. + + +2001/05/31 21:01:16 phil +Added the missing QTranslator methods. +Added the QTranslatorMessage class. + + +2001/05/30 21:22:42 phil +Fixed incorrect definition of QTextView.setText(). +Added the /Constraint/ argument everywhere it was needed. +Removed all methods that could never be called because they had different C++ +signatures, but the same Python signatures. + + +2001/05/22 19:36:24 phil +Added the missing QWidget.reparent() variant. +Added the qtgl module. + + +2001/05/14 20:14:36 phil +Removed the QInterlaceStyle class untill Trolltech fix the Windows port. + + +2001/05/13 17:16:43 phil +Added the missing variant of QInputDialog.getText(). + + +2001/05/07 16:50:14 phil +Added fix to pyuic for escaping single quotes properly. + + +2001/04/29 16:21:20 phil +Minor configuration changes. + + +2001/04/22 15:26:48 phil +Added the missing QFileDialog.getExistingDirectory() method. +Upgraded to automake v1.4d. + + +2001/04/19 22:10:42 phil +Final changes for the release of v2.4. + + +2001/04/15 00:38:40 phil +Added missing methods to QMotifStyle. +Added missing enum value to QPalette. +Updated the themes.py example. + + +2001/04/13 13:52:21 phil +Added QCustomEvent. + + +2001/04/08 13:24:53 phil +Added the missing final parameter to QMultiLineEdit.insertAt(). +Updated the documentation ready for v2.4. + + +2001/03/05 23:13:16 phil +Added the new methods and classes implemented in Qt v2.3.0-beta1. +Updated pyuic from Qt v2.3.0-beta1. + + +2001/03/04 16:22:05 phil +Fixed bugs with argument parsing in some handwritten code. Only came to light +with Python 2.1b1. + + +2001/03/01 19:51:38 phil +The generated configure now uses the Python interpreter to find where Python is +installed. + + +2001/02/16 10:53:21 phil +Added a couple of methods missing from QLineEdit. + + +2001/02/04 14:39:56 phil +Configure now checks for Qt v2.2.4 and Python v2.1. +Release as v2.3. + + +2001/01/23 19:23:06 phil +Added the BlackAdder project files. +Various packaging changes for BlackAdder. + + +2001/01/09 11:45:51 phil +Added some missing QSlider methods. +Added some documentation about multiple inheritance. + + +2000/12/24 18:25:52 phil +Fixed a couple of bugs in the examples. +Updated the documentation ready for v2.3. + + +2000/12/19 14:51:01 phil +Added the pre-hooks just before all calls to the Qt event loop. +Changed the QApplication hook to use the new sipCallHook() function. + + +2000/12/13 20:15:55 phil +Really fixed pyuic this time. +pyuic now tries to do something sensible with custom widgets - it assumes they +are in another module and tries to import them. The module name is the header +file name specified in Qt Designer with any extension removed. + + +2000/12/13 18:00:46 phil +Repaired some damage to pyuic caused when integrating the Qt v2.2.3 changes. + + +2000/12/13 10:42:19 phil +Changed the configuration to look for Qt v2.2.3. +Updated pyuic to track changes to uic in Qt v2.2.3. + + +2000/12/12 17:46:14 phil +Added QCustomMenuItem. +Added the missing QMenuData.insertItem methods. +Changed all the handwritten occurences of sipParseArgs() to use the new version +that supports better error reporting. + + +2000/12/11 12:15:48 phil +Added the addressbook.py, buttongroups.py and menu.py examples. +Removed the deprecated behaviour of repr() for QString, QCString and +QByteArray. + + +2000/12/03 17:44:41 phil +Documented that you can't sub-class QCanvasItem. +repr() of QString et al. now does the same as repr() of any other class. + + +2000/12/01 01:31:48 phil +Slight changes to some of the tutorials so that they will run with Python 1.x. +Updated the application.py example. + + +2000/11/30 15:57:54 phil +Modified the tutorial example scripts to match the C++ ones with Qt v2.x. +Removed the old Qt v1.x example scripts. + + +2000/11/29 09:37:56 phil +Added the missing QMessage.setTextFormat() and QMessage.textFormat(). + + +2000/11/24 12:04:04 phil +Added QPushButton.isFlat() and QPushButton.setFlat(). + + +2000/11/12 21:22:02 phil +pyuic fixed to handle QLabel buddies properly. + + +2000/11/11 14:31:07 phil +Added documentation to QListView and QListViewItem about how to delete child +QListViewItems. +Updated pyuic from Qt v2.2.2 uic. +Updated configure to look for Qt v2.2.2. + + +2000/11/09 10:16:24 phil +Fixed compilation problem with QString with Qt v1.x. + + +2000/11/08 12:43:56 phil +A couple of minor fixes to pyuic. +A couple of more major fixes to the debugger so that it will properly go into +other modules of the same application. + + +2000/11/05 20:59:51 phil +Implemented __str__ for QByteArray, QCString and QString. Changed __repr__ to +not raise an exception on null instances. +Added a section to the documentation covering Python and Qt strings. +Released v2.2. + + +2000/11/02 14:57:18 phil +Added missing %HeaderCode in qsizepolicy.sip. +Added %Copying. +Added __pyQtQAppHook__ +Fixed the debugger for Windows. +Added QSocket, QServerSocket and QHostAddress. + + +2000/10/20 23:30:22 phil +Added the missing QPalette.setInactive(). +Colour related fixes to pyuic (thanks to Robert Roy). + + +2000/10/18 16:24:37 phil +Minor fixes to pyuic. +Final updates for v2.1. + + +2000/10/15 20:30:19 phil +Fixed problem with the debugger code being included. +Changed the documentation for v2.1pre1. + + +2000/10/13 18:58:35 phil +Fixed pyuic bug related to QToolTip. +configure will now look for Qt v2.2.1. + + +2000/10/11 17:21:59 phil +Added the widgets.py example. +Fixed bugs with slot arguments in QMovie. + + +2000/10/11 13:32:25 phil +The QApplication dtor now makes sure that any top-pevel windows don't get +deleted twice. +Changed the Shell banner in eric to be closer to Python 2.0. + + +2000/10/08 16:31:50 phil +Added the debugger code (forgot last time). + + +2000/10/08 16:26:29 phil +Added eric the debugger. + + +2000/10/06 12:55:57 phil +Updated pyuic for Qt v2.2.1. +Fixed problems with QInputDialog.getValue() and QInputDialog.getText(). + + +2000/10/03 16:35:25 phil +Added the missing /Transfer/ to QStatusBar.addWidget(). +Added the missing /TransferBack/ to QStatusBar.removeWidget(). + + +2000/10/02 21:45:56 phil +Added the missing QCanvasPixmapArray ctor. +Added the len, [] and in operators to QStringList. + + +2000/10/01 12:37:31 phil +Backed out the changes to the examples as they are no longer needed now that +SIP allows slots to be called with more arguments than expected. This means +that the breakage described in the previous ChangeLog entry has now been +repaired. + + +2000/10/01 00:50:32 phil +Added the missing QMenuData.setItemParameter(), QMenuData.itemParameter() and +QMenuData.activateItemAt(). +QMenuData.insertItem() and QAccel.connectItem() now expect slots that will take +an argument. THIS WILL BREAK SCRIPTS - but is the correct behaviour because +PyQt doesn't support the Qt feature of a slot consuming fewer arguments than a +signal provides. + + +2000/09/28 23:09:51 phil +Added the missing /TransferThis/ in the QWorkspace ctor. + + +2000/09/28 16:31:19 phil +Added missing QWidget.isHidden(), QWidget.isMaximized() and +QMultiLineEdit.getCursorPosition(). + + +2000/09/28 10:27:39 phil +Added /Transfer/ to QApplication::postEvent(). + + +2000/09/27 17:21:27 phil +Fixed the QDir ctor for Qt v2+. + + +2000/09/25 12:02:15 phil +Fixed QBoxLayout::findWidget() so that it compiles under Qt v2.0.x. + + +2000/09/20 11:03:00 phil +Added the README about building from the CVS. +Minor changes prior to moving the CVS tree to theKompany.com. + + +2000/09/19 08:25:47 phil +Added the automatic ChangeLog. +Added the missing keyReleaseEvent() from QButton. +Added the missing QValidator::State::Intermediate. +pyuic was generating bad code for QWizards. Also improved the standalone +support code. + diff --git a/python/pyqt/LICENSE b/python/pyqt/LICENSE new file mode 100644 index 00000000..c7aea189 --- /dev/null +++ b/python/pyqt/LICENSE @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + 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. + + Preamble + + 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 +rights. + + 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. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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 +circumstances. + +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 +Foundation. + + 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. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/python/pyqt/NEWS b/python/pyqt/NEWS new file mode 100644 index 00000000..a18d29b3 --- /dev/null +++ b/python/pyqt/NEWS @@ -0,0 +1,544 @@ +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 configure.py 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 + class. + - 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 qdir.py 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 configure.py. + +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). + - QLayoutIterator.next() 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 (configure.py) build system has been added which is independent of + tmake and qmake and installs a pyqtconfig module. The old (build.py) 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 build.py to build the PyQt modules as static + libraries. + - 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 + Marek). + - Added the missing Qt.MetaButton. + - Updated all classes for Qt v3.2.0. + - Added the QSplashScreen, QSqlSelectCursor and QToolBox classes for Qt + v3.2.0. + - 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 + interaction. + - 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 + operators. + - pyuic will now extract Python code from the comments section of a .ui file. + - pyuic now supports PEP 263. + - Added the biff.py, checklists.py, drawlines.py and modified buttongroups.py + 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. + - Added PYQT_VERSION_STR. + +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 + classes. + +v3.4 10th September 2002 + - More eric updates from Detlev Offenbach, including pylupdate. + - helpviewer is now installed as a standalone application. + - Added the progress.py example from Hans-Peter Jansen. + - Added the mdi.py and canvas.py examples from Sadi Kose. + - Added QT_TR_NOOP() and QT_TRANSLATE_NOOP(). + - 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 + instances. + - Added the missing QDoubleValidator.setBottom(), + QDoubleValidator.setDecimals(), QDoubleValidator.setTop, + QFontMetrics.boundingRect(), QFontMetrics.size(), + QIntValidator.setBottom(), QIntValidator.setTop(), QString.compare() and + QString.localeAwareCompare(). + - 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 + class. + - 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 semaphore.py 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(), QLayoutIterator.next(), 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.drawPopupMenuItem(), + QPlatinumStyle.extraPopupMenuItemWidth(), + 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 + QLayout.add(). + - 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 + QPixmap.save(), QWidget.reparent() and QInputDialog.getText(). Added + the qtgl module and the gears.py 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 QWMatrix.map(). 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 themes.py 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 addressbook.py, buttongroups.py and menu.py 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 widgets.py 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 QFontInfo.family() 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 themes.py 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/application.py 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/application.py, examples/dclock.py and examples/dirview.py 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. + +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. diff --git a/python/pyqt/README b/python/pyqt/README new file mode 100644 index 00000000..1af7d9f4 --- /dev/null +++ b/python/pyqt/README @@ -0,0 +1,64 @@ + PyQt - Python Bindings for the Qt Toolkit + + +INTRODUCTION + +These are the Python bindings for Qt. You must also have the SIP Python +bindings generator installed. + +The homepage is http://www.riverbankcomputing.co.uk/pyqt/. + +The homepage of SIP is http://www.riverbankcomputing.co.uk/sip/. + + +COMMERCIAL VERSION + +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. + + +INSTALLATION + +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. + + python configure.py + +This assumes that the correct Python interpreter is on your path. Something +like the following may be appropriate on Windows. + + c:\python23\python configure.py + +If you have multiple versions of Python installed then make sure you use the +interpreter for which you wish to generate bindings for. + +The configure.py 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. + + make + +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 REST OF THE DISTRIBUTION + +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 +phil@riverbankcomputing.co.uk diff --git a/python/pyqt/README.AIX b/python/pyqt/README.AIX new file mode 100644 index 00000000..d7db29b1 --- /dev/null +++ b/python/pyqt/README.AIX @@ -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 +http://aixpdslib.seas.ucla.edu/aixpdslib.html + +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 +preference. + +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 +_XOPEN_SOURCE: + +---8<-------------------------------------------------------------------->8--- +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. + SCO_SV/3.2) + define_xopen_source=no;; ++ # 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;; + esac + + if test $define_xopen_source = yes +@@ -12965,7 +12970,12 @@ + if test -z "$DYNLOADFILE" + then + 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";; +---8<-------------------------------------------------------------------->8--- + +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 ulrich.berning@desys.de or use the PyKDE mailing list. + +Ulrich Berning +DESYS GmbH diff --git a/python/pyqt/README.SunOS b/python/pyqt/README.SunOS new file mode 100644 index 00000000..5b176c85 --- /dev/null +++ b/python/pyqt/README.SunOS @@ -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 + sipProxyqt::proxySlot(int). + "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 + overwritten. + + 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! + diff --git a/python/pyqt/THANKS b/python/pyqt/THANKS new file mode 100644 index 00000000..7204f8af --- /dev/null +++ b/python/pyqt/THANKS @@ -0,0 +1,35 @@ +Torsten Marek + For going through the Qt classes and adding applicable operators to + PyQt. + +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. diff --git a/python/pyqt/build.py b/python/pyqt/build.py new file mode 100644 index 00000000..ceaa5a92 --- /dev/null +++ b/python/pyqt/build.py @@ -0,0 +1,730 @@ +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. +try: + import sipconfig +except: + print "Unable to import the sipconfig module. Please make sure you have" + print "SIP v3.9 or later installed." + sys.exit(1) + +config = sipconfig.SIPConfig("PyQt 3.17.2") + + +# 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 + + sys.exit(rcode) + + +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 + directory. + + 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() + + try: + os.mkdir(tempBuildDir) + except: + sipconfig.error("Unable to create temporary directory.") + + prevdir = sipconfig.push_dir(tempBuildDir) + + sipconfig.copy_to_file("qttest.pro.in", +"""TEMPLATE = app +TARGET = qttest +CONFIG += console warn_off @TEST_OPENGL@ @BLX_CONFIG_APP@ +INCLUDEPATH = @BLX_INCLUDEPATH@ @TEST_QSCINTILLA_INC@ +DEFINES = @BLX_DEFINES@ +SOURCES = qttest.cpp +LIBS += @TEST_QUI_LIB@ @TEST_QSCINTILLA_LIB@ +""") + + # 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", "") + + config.create_makefile("qttest.pro") + else: + sipconfig.pop_dir(olddir) + 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 + accordingly. + + 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 + test. + 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): + return + + sipconfig.copy_to_file("qttest.cpp", +"""#include <%s> + +int main(int argc,char **argv) +{ + new %s; +} +""" % (incfile, ctor)) + + if sipconfig.run_make(None,0) == 0: + buildModules.append(mname) + sipconfig.inform("The %s module will be built." % mname) + else: + sipconfig.inform("The %s module will not be built." % mname) + + sipconfig.run_make("clean") + + +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" + else: + 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")) + else: + sciLib = sipconfig.escape("-L" + sciLibDir) + " -lqscintilla" + + config.patches["@PYQT_QSCINTILLA_LIB@"] = sciLib + else: + 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 + else: + 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" + config.create_makefile("qttest.pro") + + tryModule(maindir,"qtgl", "qgl.h", "QGLWidget()") + + # Put things back. + config.patches["@TEST_OPENGL@"] = "" + config.create_makefile("qttest.pro") + + # Check for the qui library. + if config.qt_version >= 0x030000: + if sys.platform == "win32": + quilib = r"$(QTDIR)\lib\qui.lib" + else: + quilib = "-lqui" + + config.patches["@PYQT_QUI_LIB@"] = quilib + + config.patches["@TEST_QUI_LIB@"] = quilib + config.create_makefile("qttest.pro") + + tryModule(maindir,"qtui", "qwidgetfactory.h", "QWidgetFactory()") + + # Put things back. + config.patches["@TEST_QUI_LIB@"] = "" + config.create_makefile("qttest.pro") + + # Check for the QScintilla library. + if sciVersion >= 0: + config.patches["@TEST_QSCINTILLA_INC@"] = sciIncDir + config.patches["@TEST_QSCINTILLA_LIB@"] = sciLib + config.create_makefile("qttest.pro") + + tryModule(maindir,"qtext", "qextscintillabase.h", "QextScintillaBase()") + + # Put things back. + config.patches["@TEST_QSCINTILLA_INC@"] = "" + config.patches["@TEST_QSCINTILLA_LIB@"] = "" + config.create_makefile("qttest.pro") + + +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.") + return + + 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. + flist = ["ACTION", "CLIPBOARD", "CODECS", "COLORDIALOG", "DATASTREAM", + "DIAL", "DNS", "DOM", "DRAGANDDROP", "ICONVIEW", "IMAGE_TEXT", + "INPUTDIALOG", "FILEDIALOG", "FONTDATABASE", "FONTDIALOG", + "MESSAGEBOX", "MIMECLIPBOARD", "NETWORKPROTOCOL", "PICTURE", + "PRINTDIALOG", "PRINTER", "PROGRESSDIALOG", "PROPERTIES", + "SEMIMODAL", "SIZEGRIP", "SOUND", "SPLITTER", "STYLE_CDE", + "STYLE_INTERLACE", "STYLE_MOTIF", "STYLE_MOTIFPLUS", + "STYLE_PLATINUM", "STYLE_SGI", "STYLE_WINDOWS", "TABDIALOG", + "TABLE", "TABLEVIEW", "TRANSFORMATIONS", "TRANSLATION", "WIZARD", + "WORKSPACE"] + + # 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, "\\", "\\\\") + + f.write( +"""#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"); +#endif + +#if (defined(Q_OS_WIN32) || defined(Q_OS_WIN64)) && QT_VERSION >= 0x030000 + if (qWinVersion() != Qt::WV_XP) + fprintf(fp,"-x Qt_STYLE_WINDOWSXP\\n"); +#endif +""" % (ffstr, ffstr)) + + for feat in flist: + f.write( +""" +#if defined(QT_NO_%s) + fprintf(fp,"-x Qt_%s\\n"); +#endif +""" % (feat, feat)) + + f.write( +""" + fclose(fp); + + return 0; +} +""") + + f.close() + + sipconfig.run_make() + sipconfig.run_program(os.path.join(os.getcwd(), "qttest")) + sipconfig.run_make("clean") + + 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) + + try: + shutil.rmtree(mname) + except: + pass + + try: + os.mkdir(mname) + except: + 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: + argv.insert(0,xtrtag) + argv.insert(0,"-t") + + if trace: + argv.insert(0,"-r") + + if releaseGIL: + argv.insert(0,"-g") + + 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)) + + config.add_install_target(icmds) + + if sipMajorVersion == 3: + # Compile the Python part of the module. + pyname = mname + ".py" + + sipconfig.inform("Compiling %s." % (pyname)) + py_compile.compile(pyname) + + sipconfig.pop_dir(olddir) + + +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() + vl.sort() + + # For a snapshot use the latest tag. + if vers == 0: + tag = tags[vl[-1]] + else: + for v in vl: + if vers < v: + tag = tags[v] + break + + 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. + try: + optlist, args = getopt.getopt(argv[1:],"ha:b:cd:gj:n:o:rv:") + except getopt.GetoptError: + usage() + + for opt, arg in optlist: + if opt == "-h": + usage(0) + 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 + + try: + catSplit = int(arg) + except: + catSplit = 0 + + if catSplit < 1: + usage() + elif opt == "-n": + global sciIncDir + sciIncDir = arg + elif opt == "-o": + global sciLibDir + sciLibDir = arg + elif opt == "-r": + global trace + trace = 1 + elif opt == "-v": + global sipDir + sipDir = arg + + # Confirm the license. + sipconfig.confirm_license() + + # If there should be a license file then check it is where it should be. + if config.license_file: + if os.access(os.path.join("sip", config.license_file), os.F_OK): + sipconfig.inform("Found the license file %s.\n" % config.license_file) + else: + sipconfig.error("Please copy the license file %s to the sip directory.\n" % config.license_file) + + # Check the Qt version. + if config.qt_version == 0: + sipconfig.error("SIP has been built with Qt support disabled.\n") + + # Early versions of Qt for the Mac didn't include everything. Rather than + # maintain these in the future we just mandate a later version. + if sys.platform == "darwin" and config.qt_version < 0x030100: + sipconfig.error("PyQt for MacOS/X requires Qt v3.1.0 or later.\n") + + # Check the installation directory is valid and add it as a patch. + if not os.access(modDir,os.F_OK): + sipconfig.error("The %s PyQt destination directory does not seem to exist. Use the -d argument to set the correct directory." % (modDir)) + + config.patches["@PYQT_MODDIR@"] = sipconfig.escape(modDir) + + sipconfig.inform("%s is the PyQt installation directory." % (modDir)) + + # Enable warnings for SIP v4 generated code. + if sipMajorVersion >= 4: + warn = "warn_on" + else: + warn = "warn_off" + + config.patches["@PYQT_WARN@"] = warn + + # Create patches to allow some modules to link against others. + if sipMajorVersion >= 4: + modlink = "" + elif sys.platform == "win32": + modlink = sipconfig.escape(os.path.join(modDir, "libqtc.lib")) + else: + modlink = sipconfig.escape("-L" + modDir) + " -lqtcmodule" + + config.patches["@PYQT_QT_MODULE@"] = modlink + + if sipMajorVersion >= 4: + modlink = "" + elif sys.platform == "win32": + modlink = sipconfig.escape(os.path.join(modDir, "libqttablec.lib")) + " " + sipconfig.escape(os.path.join(modDir, "libqtc.lib")) + else: + modlink = sipconfig.escape("-L" + modDir) + " -lqttablecmodule -lqtcmodule" + + config.patches["@PYQT_QTTABLE_MODULE@"] = modlink + + # The professional edition needs special handling if XML support is needed. + if config.qt_edition == "professional": + rbprof = "rbprof" + else: + rbprof = "" + + config.patches["@PYQT_RBPROF@"] = rbprof + + # Link in the qassistantclient library for Qt v3.1+. + qaclib = "" + + if config.qt_version >= 0x030100: + if sys.platform == "win32": + qaclib = r"$(QTDIR)\lib\qassistantclient.lib" + else: + qaclib = "-lqassistantclient" + + config.patches["@PYQT_QASSISTANTCLIENT_LIB@"] = qaclib + + # Check for QScintilla. + if config.qt_version >= 0x030000: + checkQScintilla() + + # Create a build directory that we can compile test programs. + maindir = mkTempBuildDir() + + # Check what additional modules to build. + if config.qt_version >= 0x020000: + moduleChecks(maindir) + + # Work out the platform and Qt version tags to pass to SIP to generate the + # code we need. + if config.qt_lib == "qte": + plattag = "WS_QWS" + elif sys.platform == "win32": + plattag = "WS_WIN" + elif sys.platform == "darwin": + plattag = "WS_MACX" + else: + plattag = "WS_X11" + + qttags = { + 0x020000: "Qt_1_43", + 0x020100: "Qt_2_00", + 0x020200: "Qt_2_1_0", + 0x020300: "Qt_2_2_0", + 0x020301: "Qt_2_3_0", + 0x030000: "Qt_2_3_1", + 0x030001: "Qt_3_0_0", + 0x030002: "Qt_3_0_1", + 0x030004: "Qt_3_0_2", + 0x030005: "Qt_3_0_4", + 0x030006: "Qt_3_0_5", + 0x030100: "Qt_3_0_6", + 0x030101: "Qt_3_1_0", + 0x030102: "Qt_3_1_1", + 0x030200: "Qt_3_1_2", + 0x030300: "Qt_3_2_0", + 0x040000: "Qt_3_3_0" + } + + qttag = versionToTag(config.qt_version, qttags, "Qt") + + # Work out the QScintilla tag. + if sciVersion >= 0: + scitags = { + 0x010100: "QScintilla_1_0", + 0x010200: "QScintilla_1_1", + 0x020000: "QScintilla_1_2" + } + + scitag = versionToTag(sciVersion, scitags, "QScintilla") + else: + scitag = None + + # Generate the features file. + generateFeatures(os.path.join(maindir, "features")) + + # We don't need the temporary build directory anymore. + mkTempBuildDir(maindir) + + subdirs = [] + for mname in buildModules: + if mname == "qtext": + xtratag = scitag + else: + xtratag = None + + generateSource(mname, plattag, qttag, xtratag) + subdirs.append(mname) + + # We handle the qtpe module explicitly rather than auto-detect. This is + # because it does things a bit differently and I'm too lazy to deal with it + # properly at the moment. + if qpeTag: + generateSource("qtpe", plattag, qttag, qpeTag) + subdirs.append("qtpe") + + # Install the .sip files. + sipconfig.inform("Creating Makefile for .sip files.") + olddir = sipconfig.push_dir("sip") + sipconfig.copy_to_file("Makefile", "all:\n") + + icmds = [] + + for mname in buildModules: + dstdir = os.path.join(sipDir, mname) + + icmds.append(("mkdir", dstdir, None)) + + for sf in os.listdir(os.path.join(olddir, "sip", mname)): + icmds.append(("copy", os.path.join(mname, sf), os.path.join(dstdir, sf))) + + config.add_install_target(icmds) + sipconfig.pop_dir(olddir) + subdirs.append("sip") + + # See which version of pyuic to build. + config.patches["@PYQT_BINDIR@"] = sipconfig.escape(binDir) + + if config.qt_version >= 0x030000: + sipconfig.inform("Creating Makefile for pyuic3.") + subdirs.append("pyuic3") + olddir = sipconfig.push_dir("pyuic3") + elif config.qt_version >= 0x020000: + sipconfig.inform("Creating Makefile for pyuic2.") + subdirs.append("pyuic2") + olddir = sipconfig.push_dir("pyuic2") + + config.create_makefile("pyuic.pro", []) + sipconfig.pop_dir(olddir) + + # Build pylupdate if Qt v3.0 or later. + if config.qt_version >= 0x030000: + sipconfig.inform("Creating Makefile for pylupdate3.") + subdirs.append("pylupdate3") + olddir = sipconfig.push_dir("pylupdate3") + + config.create_makefile("pylupdate.pro", []) + sipconfig.pop_dir(olddir) + + # Generate the top-level Makefile. + sipconfig.inform("Creating top level Makefile.") + sipconfig.copy_to_file("PyQt.pro.in", "TEMPLATE = subdirs\nSUBDIRS = " + string.join(subdirs) + "\n") + config.create_makefile("PyQt.pro") + + # Tell the user what to do next. + msg = "The build of the PyQt source code for your system is now complete. To compile and install PyQt run \"%s\" and \"%s install\" with appropriate user privileges." % (config.make_bin, config.make_bin) + + sipconfig.inform(msg) + + +if __name__ == "__main__": + try: + main(sys.argv) + except SystemExit: + raise + except: + print \ +"""An internal error occured. Please report all the output from the program, +including the following traceback, to support@riverbankcomputing.co.uk. +""" + raise diff --git a/python/pyqt/configure.py b/python/pyqt/configure.py new file mode 100644 index 00000000..491302da --- /dev/null +++ b/python/pyqt/configure.py @@ -0,0 +1,1438 @@ +# This script generates the PyQt configuration and generates the Makefiles. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +import sys +import os +import string +import glob +import getopt +import shutil +import py_compile + +import sipconfig + + +# Initialise the globals. +pyqt_version = 0x031102 +pyqt_version_str = "3.17.2" + +sip_min_version = 0x040600 + + +# Try and find a Qt installation to use as the default. +try: + qt_dir = os.environ["QTDIR"] +except KeyError: + qt_dir = "" + + +qt_version = 0 +qt_edition = "" +qt_incdir = None +qt_libdir = None +qt_threaded = 0 +qt_winconfig = "" + +pyqt = None +pyqt_modules = [] +qt_sip_flags = [] +qtext_sip_flags = [] +qtpe_sip_flags = [] +qsci_version = 0 +disabled_classes = [] + +if sys.platform == "win32": + qsci_define = "QEXTSCINTILLA_DLL" +else: + qsci_define = "" + +# Get the SIP configuration. +sipcfg = sipconfig.Configuration() + +# Command line options. +opt_qtlib = None +opt_qconfigdir = None +opt_pyqtbindir = sipcfg.default_bin_dir +opt_pyqtmoddir = sipcfg.default_mod_dir +opt_pyqtsipdir = sipcfg.default_sip_dir +opt_qtpetag = None +opt_qsciincdir = None +opt_qscilibdir = None +opt_static = 0 +opt_debug = 0 +opt_concat = 0 +opt_split = 1 +opt_tracing = 0 +opt_verbose = 0 +opt_keepfeatures = 0 + +opt_vendorcheck = 0 +opt_vendincdir = sipcfg.py_inc_dir +opt_vendlibdir = sipcfg.py_lib_dir + + +def usage(rcode = 2): + """Display a usage message and exit. + + rcode is the return code passed back to the calling process. + """ + if qt_dir: + def_qt_dir = qt_dir + else: + def_qt_dir = "none" + + print "Usage:" + print " python configure.py [-h] [-a tag] [-b dir] [-c] [-d dir] [-f] [-g dir] [-i] [-j #] [-k] [-l dir] [-m dir] [-n dir] [-o dir] [-q dir] [-r] [-s] [-u] [-v dir] [-w] [-y lib] option=value option+=value ..." + 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]" % opt_pyqtbindir + print " -c concatenate each module's C/C++ source files" + print " -d dir where the PyQt modules will be installed [default %s]" % opt_pyqtmoddir + print " -f keep any existing features file (when cross-compiling) [default remove]" + print " -g dir where the Qt qconfig.h file can be found [default Qt include directory]" + print " -i enable checking of signed interpreters using the VendorID package [default disabled]" + print " -j # split the concatenated C++ source files into # pieces [default 1]" + print " -k build the PyQt modules as static libraries" + print " -l dir the directory containing the VendorID header file [default %s]" % opt_vendincdir + print " -m dir the directory containing the VendorID library [default %s]" % opt_vendlibdir + print " -n dir the directory containing the QScintilla header files [default Qt include directory]" + print " -o dir the directory containing the QScintilla library [default Qt lib directory]" + print " -q dir the root directory of the Qt installation [default %s]" % def_qt_dir + print " -r generate code with tracing enabled [default disabled]" + print " -s QScintilla is a static library and not a DLL (Windows only)" + print " -u build with debugging symbols (requires a debug build of Python on Windows" + print " -v dir where the PyQt .sip files will be installed [default %s]" % opt_pyqtsipdir + print " -w don't suppress compiler output during configuration" + print " -y lib explicitly specify the type of Qt library, either qt, qt-mt, qte, qte-mt or qtmt" + + sys.exit(rcode) + + +class ConfigureBase: + """This is the base class for all PyQt version specific configurer classes. + Anything here is common to all configurers. + """ + def check_modules(self): + """Check which modules should be built and add them to the global list. + + Returns the name of any additional library that needs to be linked with + the main module. + """ + return None + + def sip_flags(self): + """Get the configuration specific SIP flags. + + Returns a list of flags. + """ + return [] + + def qt_version_tags(self): + """Get the versions tags for the configuration. + + Returns a dictionary of versions and corresponding tags. + """ + return {} + + def code(self, extra_include_dirs, extra_lib_dir, extra_libs): + """Generate the code for a configuration. + + extra_include_dirs is a list of directories to add to those supplied by + the SIP configuration. + extra_lib_dir is an optional directory to add to those supplied by the + SIP configuration. + extra_lib_dirs is an optional list of directories to add to those + supplied by the SIP configuration. + """ + pass + + def tools(self): + """Create the Makefiles for any other sub-directories and return a list + of those directories. + + Returns a list of sub-directories with Makefile. + """ + return [] + + def module_dir(self): + """Return the configuration's module directory. + """ + return opt_pyqtmoddir + + def module_installs(self): + """Return a list of files to install in the module directory other than + the modules themselves. + """ + return ["pyqtconfig.py"] + + def sip_dir(self): + """Return the configuration's .sip files directory. + """ + return opt_pyqtsipdir + + +class ConfigurePyQt3(ConfigureBase): + """This class defines the methods to configure PyQt v3. + """ + def check_modules(self): + pyqt_modules.append("qt") + + check_module("qtcanvas", "qcanvas.h", "QCanvas()") + check_module("qtnetwork", "qsocket.h", "QSocket()") + check_module("qttable", "qtable.h", "QTable()") + check_module("qtxml", "qdom.h", "QDomImplementation()") + check_module("qtgl", "qgl.h", "QGLWidget()", opengl=1) + + if qt_version >= 0x030000: + check_module("qtui", "qwidgetfactory.h", "QWidgetFactory()", lib="qui") + + if qt_edition in ("enterprise", "free"): + check_module("qtsql", "qsql.h", "QSql()") + + if sys.platform == "win32" and sipcfg.sip_version >= 0x040200: + check_module("qtaxcontainer", "qaxobject.h", "QAxObject()", lib="qaxcontainer") + + if qsci_version: + check_module("qtext", "qextscintillabase.h", "QextScintillaBase()", define=qsci_define, include_dir=opt_qsciincdir, lib_dir=opt_qscilibdir, lib="qscintilla") + + if opt_qtpetag: + pyqt_modules.append("qtpe") + + qtmod_lib = None + + if qt_version >= 0x030100: + sipconfig.inform("Checking to see if the QAssistantClient class is available...") + + if check_class("qassistantclient.h", "QAssistantClient(\"foo\")", lib="qassistantclient"): + qtmod_lib = "qassistantclient" + else: + disabled_classes.append("QAssistantClient") + + return qtmod_lib + + def sip_flags(self): + return get_feature_flags() + + def qt_version_tags(self): + return { + 0x010403: None, + 0x020000: "Qt_1_43", + 0x020100: "Qt_2_00", + 0x020200: "Qt_2_1_0", + 0x020300: "Qt_2_2_0", + 0x020301: "Qt_2_3_0", + 0x030000: "Qt_2_3_1", + 0x030001: "Qt_3_0_0", + 0x030002: "Qt_3_0_1", + 0x030004: "Qt_3_0_2", + 0x030005: "Qt_3_0_4", + 0x030006: "Qt_3_0_5", + 0x030100: "Qt_3_0_6", + 0x030101: "Qt_3_1_0", + 0x030102: "Qt_3_1_1", + 0x030200: "Qt_3_1_2", + 0x030300: "Qt_3_2_0", + 0x030305: "Qt_3_3_0", + 0x030306: "Qt_3_3_5", + 0x040000: "Qt_3_3_6" + } + + def code(self, extra_include_dirs, extra_lib_dir, extra_libs): + generate_code("qt", extra_include_dirs=extra_include_dirs, extra_lib_dir=extra_lib_dir, extra_libs=extra_libs) + + if "qtext" in pyqt_modules: + generate_code("qtext", extra_define=qsci_define, extra_include_dirs=[opt_qsciincdir], extra_lib_dir=opt_qscilibdir, extra_libs=["qscintilla"], sip_flags=qtext_sip_flags) + + if "qtgl" in pyqt_modules: + generate_code("qtgl", opengl=1) + + if "qtpe" in pyqt_modules: + generate_code("qtpe", extra_libs=["qpe"], sip_flags=qtpe_sip_flags) + + if "qtui" in pyqt_modules: + generate_code("qtui", extra_libs=["qui"]) + + if "qtaxcontainer" in pyqt_modules: + generate_code("qtaxcontainer", extra_libs=["qaxcontainer"]) + + # The rest don't need special handling. + for m in ("qtcanvas", "qtnetwork", "qtsql", "qttable", "qtxml"): + if m in pyqt_modules: + generate_code(m) + + def tools(self): + tool_dirs = [] + + if qt_version >= 0x030000: + # The Professional Edition needs special handling. + prof = (qt_edition == "professional") + + sipconfig.inform("Creating pyuic Makefile...") + + if prof or "qtxml" not in pyqt_modules: + buildfile= "pyuic-prof.sbf" + + for xml in ("qdom.cpp", "qxml.cpp"): + shutil.copyfile(qt_dir + "/src/xml/" + xml, "pyuic3/" + xml) + else: + buildfile= "pyuic.sbf" + + makefile = sipconfig.ProgramMakefile( + configuration=sipcfg, + build_file=buildfile, + dir="pyuic3", + install_dir=opt_pyqtbindir, + console=1, + qt=1, + warnings=1 + ) + + makefile.extra_defines.append("UIC") + makefile.extra_defines.append("QT_INTERNAL_XML") + + if prof or "qtxml" not in pyqt_modules: + makefile.extra_defines.append("QT_MODULE_XML") + + if qt_version < 0x030100: + makefile.extra_include_dirs.append(qt_dir + "/src/3rdparty/zlib") + + makefile.generate() + tool_dirs.append("pyuic3") + + sipconfig.inform("Creating pylupdate Makefile...") + + if prof or "qtxml" not in pyqt_modules: + buildfile= "pylupdate-prof.sbf" + + shutil.copyfile(qt_dir + "/src/xml/qxml.cpp", "pylupdate3/qxml.cpp") + else: + buildfile= "pylupdate.sbf" + + makefile = sipconfig.ProgramMakefile( + configuration=sipcfg, + build_file=buildfile, + dir="pylupdate3", + install_dir=opt_pyqtbindir, + console=1, + qt=1, + warnings=1 + ) + + makefile.extra_defines.append("QT_INTERNAL_XML") + + if prof or "qtxml" not in pyqt_modules: + makefile.extra_defines.append("QT_MODULE_XML") + + makefile.generate() + tool_dirs.append("pylupdate3") + elif qt_version >= 0x020000: + sipconfig.inform("Creating pyuic Makefile...") + + makefile = sipconfig.ProgramMakefile( + configuration=sipcfg, + build_file="pyuic.sbf", + dir="pyuic2", + install_dir=opt_pyqtbindir, + console=1, + qt=1, + warnings=1 + ) + + makefile.extra_defines.append("UIC") + makefile.extra_include_dirs.append(qt_dir + "/src/3rdparty/zlib") + + makefile.generate() + tool_dirs.append("pyuic2") + + return tool_dirs + + +def inform_user(): + """Tell the user the option values that are going to be used. + """ + if qt_edition: + edstr = qt_edition + " edition " + else: + edstr = "" + + sipconfig.inform("Qt v%s %sis being used." % (sipconfig.version_to_string(qt_version), edstr)) + sipconfig.inform("SIP %s is being used." % sipcfg.sip_version_str) + sipconfig.inform("These PyQt modules will be built: %s." % string.join(pyqt_modules)) + + if disabled_classes: + sipconfig.inform("Support for these Qt classes has been disabled: %s." % string.join(disabled_classes)) + + sipconfig.inform("The PyQt modules will be installed in %s." % opt_pyqtmoddir) + sipconfig.inform("The PyQt .sip files will be installed in %s." % opt_pyqtsipdir) + + sipconfig.inform("The Qt header files are in %s." % qt_incdir) + sipconfig.inform("The %s Qt library is in %s." % (opt_qtlib, qt_libdir)) + + if qt_version >= 0x020000: + sipconfig.inform("pyuic will be installed in %s." % opt_pyqtbindir) + + if qt_version >= 0x030000: + sipconfig.inform("pylupdate will be installed in %s." % opt_pyqtbindir) + + if opt_vendorcheck: + sipconfig.inform("PyQt will only be usable with signed interpreters.") + + +def create_config(module, template, macros): + """Create the PyQt configuration module so that it can be imported by build + scripts. + + module is the module file name. + template is the template file name. + macros is the dictionary of platform specific build macros. + """ + sipconfig.inform("Creating %s..." % module) + + content = { + "pyqt_config_args": sys.argv[1:], + "pyqt_version": pyqt_version, + "pyqt_version_str": pyqt_version_str, + "pyqt_bin_dir": opt_pyqtbindir, + "pyqt_mod_dir": opt_pyqtmoddir, + "pyqt_sip_dir": opt_pyqtsipdir, + "pyqt_modules": pyqt_modules, + "pyqt_qt_sip_flags": qt_sip_flags, + "qt_version": qt_version, + "qt_edition": qt_edition, + "qt_winconfig": qt_winconfig, + "qt_framework": 0, + "qt_threaded": qt_threaded, + "qt_dir": qt_dir, + "qt_inc_dir": qt_incdir, + "qt_lib": opt_qtlib, + "qt_lib_dir": qt_libdir + } + + if "qtaxcontainer" in pyqt_modules: + content["pyqt_qtaxcontainer_sip_flags"] = qt_sip_flags + + if "qtcanvas" in pyqt_modules: + content["pyqt_qtcanvas_sip_flags"] = qt_sip_flags + + if "qtext" in pyqt_modules: + content["pyqt_qtext_sip_flags"] = qtext_sip_flags + + # These are internal. + content["_pyqt_qscintilla_defines"] = qsci_define + content["_pyqt_qscintilla_inc_dir"] = opt_qsciincdir + content["_pyqt_qscintilla_lib_dir"] = opt_qscilibdir + + if "qtgl" in pyqt_modules: + content["pyqt_qtgl_sip_flags"] = qt_sip_flags + + if "qtnetwork" in pyqt_modules: + content["pyqt_qtnetwork_sip_flags"] = qt_sip_flags + + if "qtpe" in pyqt_modules: + content["pyqt_qtpe_sip_flags"] = qtpe_sip_flags + + if "qtsql" in pyqt_modules: + content["pyqt_qtsql_sip_flags"] = qt_sip_flags + + if "qttable" in pyqt_modules: + content["pyqt_qttable_sip_flags"] = qt_sip_flags + + if "qtui" in pyqt_modules: + content["pyqt_qtui_sip_flags"] = qt_sip_flags + + if "qtxml" in pyqt_modules: + content["pyqt_qtxml_sip_flags"] = qt_sip_flags + + sipconfig.create_config_module(module, template, content, macros) + + +def compile_qt_program(name, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0, python=0, debug=0): + """Compile a simple Qt application. + + name is the name of the single source file. + define is a name to add to the list of preprocessor defines. + include_dir is the name of a directory to add to the list of include + directories. + lib_dir is the name of a directory to add to the list of library + directories. + lib is the name of a library to add to the list of libraries. + opengl is set if the application uses OpenGL. + python is set if the application #includes Python.h. + debug is set if this is a debug build. + + Returns the name of the executable suitable for running or None if it + wasn't created. + """ + makefile = sipconfig.ProgramMakefile(sipcfg, console=1, qt=1, warnings=0, opengl=opengl, python=python, debug=debug) + + if define: + makefile.extra_defines.append(define) + + if include_dir: + makefile.extra_include_dirs.append(include_dir) + + if lib_dir: + makefile.extra_lib_dirs.append(lib_dir) + + if lib: + makefile.extra_libs.append(lib) + + exe, build = makefile.build_command(name) + + # Make sure the executable file doesn't exist. + try: + os.remove(exe) + except OSError: + pass + + if not opt_verbose and hasattr(os, "popen4"): + fin, fout = os.popen4(build) + + # Read stdout and stderr until there is no more output. + lout = fout.readline() + while lout: + lout = fout.readline() + + fin.close() + fout.close() + + try: + os.wait() + except: + pass + else: + os.system(build) + + if not os.access(exe, os.X_OK): + return None + + if sys.platform != "win32": + exe = "./" + exe + + return exe + + +def check_qscintilla(): + """See if QScintilla can be found and what its version is. + """ + # Set the defaults if they haven't been explicitly specified. + global opt_qsciincdir, opt_qscilibdir + + if opt_qsciincdir is None: + opt_qsciincdir = qt_incdir + + if opt_qscilibdir is None: + opt_qscilibdir = qt_libdir + + # Find the QScintilla header files. + sciglobal = os.path.join(opt_qsciincdir, "qextscintillaglobal.h") + + if os.access(sciglobal, os.F_OK): + # Get the QScintilla version number. + global qsci_version + + qsci_version, sciversstr = sipconfig.read_version(sciglobal, "QScintilla", "QSCINTILLA_VERSION", "QSCINTILLA_VERSION_STR") + + if glob.glob(os.path.join(opt_qscilibdir, "*qscintilla*")): + sipconfig.inform("QScintilla %s is being used." % sciversstr) + + # If we find a snapshot then set a negative version number as a + # special case. + if string.find(sciversstr, "snapshot") >= 0: + qsci_version = -1 + else: + 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." % opt_qscilibdir) + else: + 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." % opt_qsciincdir) + + +def check_vendorid(): + """See if the VendorID library and include file can be found. + """ + global opt_vendorcheck + + if opt_vendorcheck: + if os.access(os.path.join(opt_vendincdir, "vendorid.h"), os.F_OK): + if glob.glob(os.path.join(opt_vendlibdir, "*vendorid*")): + sipconfig.inform("The VendorID package was found.") + else: + opt_vendorcheck = 0 + sipconfig.inform("The VendorID library could not be found in %s and so signed interpreter checking will be disabled. If the VendorID library is installed then use the -m argument to explicitly specify the correct directory." % opt_vendlibdir) + else: + opt_vendorcheck = 0 + sipconfig.inform("vendorid.h could not be found in %s and so signed interpreter checking will be disabled. If the VendorID package is installed then use the -l argument to explicitly specify the correct directory." % opt_vendincdir) + + +def check_module(mname, incfile, ctor, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0): + """See if a module can be built and, if so, add it to the global list of + modules. + + mname is the name of the module. + incfile is the name of the include file needed for the test. + ctor is the C++ constructor of the class being used for the test. + define is a name to add to the list of preprocessor defines. + include_dir is the name of a directory to add to the list of include + directories. + lib_dir is the name of a directory to add to the list of library + directories. + lib is the name of a library to add to the list of libraries. + opengl is set if the application uses OpenGL. + """ + # Check the module's main .sip file exists. + if os.access(os.path.join("sip", mname, mname + "mod.sip"), os.F_OK): + sipconfig.inform("Checking to see if the %s module should be built..." % mname) + + if check_class(incfile, ctor, define, include_dir, lib_dir, lib, opengl): + pyqt_modules.append(mname) + + +def check_class(incfile, ctor, define=None, include_dir=None, lib_dir=None, lib=None, opengl=0): + """Return non-zero if a class is available. + + incfile is the name of the include file needed for the test. + ctor is the C++ constructor of the class. + define is a name to add to the list of preprocessor defines. + include_dir is the name of a directory to add to the list of include + directories. + lib_dir is the name of a directory to add to the list of library + directories. + lib is the name of a library to add to the list of libraries. + opengl is set if the application uses OpenGL. + """ + cfgtest = "cfgtest.cpp" + + f = open(cfgtest, "w") + + f.write("""#include <%s> + +int main(int argc, char **argv) +{ + new %s; +} +""" % (incfile, ctor)) + + f.close() + + return compile_qt_program(cfgtest, define, include_dir, lib_dir, lib, opengl) + + +def check_plugin(cname, incfile): + """Return non-zero if a class that might be a plugin is in the main Qt + library. + + cname is the name of the class. + incfile is the name of the include file needed for the test. + """ + sipconfig.inform("Checking to see if the %s class is built in..." % cname) + + return check_class(incfile, cname + "()") + + +def create_features_file(name): + """Create the features file. + + name is the name of the features file in the current directory. + """ + # The features that a given Qt configuration may or may not support. Note + # that STYLE_WINDOWSXP and ASSISTANTCLIENT require special handling. + flist = ["ACTION", "CLIPBOARD", "CODECS", "COLORDIALOG", "DATASTREAM", + "DIAL", "DNS", "DOM", "DRAGANDDROP", "ICONVIEW", "IMAGE_TEXT", + "INPUTDIALOG", "FILEDIALOG", "FONTDATABASE", "FONTDIALOG", + "MESSAGEBOX", "MIMECLIPBOARD", + "NETWORKPROTOCOL", "NETWORKPROTOCOL_FTP", "NETWORKPROTOCOL_HTTP", + "PICTURE", "PRINTDIALOG", "PRINTER", "PROGRESSDIALOG", + "PROPERTIES", + "SEMIMODAL", "SIZEGRIP", "SOUND", "SPLITTER", "STYLE_CDE", + "STYLE_INTERLACE", "STYLE_MOTIF", "STYLE_MOTIFPLUS", + "STYLE_PLATINUM", "STYLE_SGI", "STYLE_WINDOWS", + "TABDIALOG", "TABLE", "TABLEVIEW", "TRANSFORMATIONS", + "TRANSLATION", "WIZARD", "WORKSPACE"] + + # Generate the program which will generate the features file. + f = open("mkfeatures.cpp", "w") + + f.write( +"""#include <Python.h> +#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(WITH_THREAD) || !defined(QT_THREAD_SUPPORT) + fprintf(fp,"-x Qt_THREAD_SUPPORT\\n"); +#endif + +#if !defined(Q_WS_WIN) || QT_VERSION < 0x030000 || defined(QT_NO_STYLE_WINDOWSXP) + fprintf(fp,"-x Qt_STYLE_WINDOWSXP\\n"); +#endif + +#if defined(Q_OS_WIN64) + fprintf(fp,"-x Qt_Q_LONG_IS_long\\n"); +#endif +""" % (name, name)) + + for feat in flist: + f.write( +""" +#if defined(QT_NO_%s) + fprintf(fp,"-x Qt_%s\\n"); +#endif +""" % (feat, feat)) + + # Disable QAssistantClient for the Professional Edition. + if "QAssistantClient" in disabled_classes: + f.write( +""" + fprintf(fp,"-x Qt_ASSISTANTCLIENT\\n"); +""") + + f.write( +""" + fclose(fp); + + return 0; +} +""") + + f.close() + + # Build the program. + exe = compile_qt_program("mkfeatures.cpp", include_dir=sipcfg.py_inc_dir, python=1) + if not exe: + sipconfig.error("Unable to build mkfeatures utility.") + + os.system(exe) + + # Check the file was created. + if not os.access(name, os.F_OK): + sipconfig.error("There was an error creating the features file.") + + # Check what features have been implemented as plugins and disable them. + plugins = [("STYLE_CDE", "qcdestyle.h", "QCDEStyle"), + ("STYLE_INTERLACE", "qinterlacestyle.h", "QInterlaceStyle"), + ("STYLE_MOTIF", "qmotifstyle.h", "QMotifStyle"), + ("STYLE_MOTIFPLUS", "qmotifplusstyle.h", "QMotifPlusStyle"), + ("STYLE_PLATINUM", "qplatinumstyle.h", "QPlatinumStyle"), + ("STYLE_SGI", "qsgistyle.h", "QSGIStyle"), + ("STYLE_WINDOWSXP", "qwindowsxpstyle.h", "QWindowsXPStyle"), + ("STYLE_WINDOWS", "qwindowsstyle.h", "QWindowsStyle")] + + f = open(name, "a") + + for (feat, incfile, cname) in plugins: + if not check_plugin(cname, incfile): + f.write("-x Qt_%s\n" % feat) + disabled_classes.append(cname) + + f.close() + + +def get_feature_flags(): + """Return the list of SIP flags that exclude unsupported Qt features. + """ + featfile = "features" + + # Create the features file if it doesn't exist and we are not keeping it. + if opt_keepfeatures and os.access(featfile,os.F_OK): + sipconfig.inform("Using existing features file.") + else: + sipconfig.inform("Creating features file...") + create_features_file(featfile) + + # Parse the features file. + ff = open(featfile, "r") + + flags = [] + + line = ff.readline() + while line: + flags.extend(string.split(line)) + line = ff.readline() + + return flags + + +def set_sip_flags(): + """Set the SIP platform, version and feature flags. + """ + qt_sip_flags.extend(pyqt.sip_flags()) + + # If we don't check for signed interpreters, we exclude the 'VendorID' + # feature + if not opt_vendorcheck: + qt_sip_flags.append("-x") + qt_sip_flags.append("VendorID") + + # Handle the platform tag. + if opt_qtpetag: + plattag = "WS_QWS" + elif sys.platform == "win32": + plattag = "WS_WIN" + elif sys.platform == "darwin": + if "__DARWIN_X11__" in sipcfg.build_macros()["DEFINES"]: + plattag = "WS_X11" + else: + plattag = "WS_MACX" + else: + plattag = "WS_X11" + + qt_sip_flags.append("-t") + qt_sip_flags.append(plattag) + + # Handle the Qt version tag. + verstag = sipconfig.version_to_sip_tag(qt_version, pyqt.qt_version_tags(), "Qt") + + if verstag: + qt_sip_flags.append("-t") + qt_sip_flags.append(verstag) + + # The flags so far are common. + for f in qt_sip_flags: + qtext_sip_flags.append(f) + qtpe_sip_flags.append(f) + + # Handle the QScintilla version tag. + if qsci_version: + qscitags = { + 0x010100: None, + 0x010200: "QScintilla_1_1", + 0x010300: "QScintilla_1_2", + 0x010400: "QScintilla_1_3", + 0x010500: "QScintilla_1_4", + 0x010600: "QScintilla_1_5", + 0x010700: "QScintilla_1_6", + 0x020000: "QScintilla_1_7" + } + + verstag = sipconfig.version_to_sip_tag(qsci_version, qscitags, "QScintilla") + + if verstag: + qtext_sip_flags.append("-t") + qtext_sip_flags.append(verstag) + + # Handle the Qtopia tag. + if opt_qtpetag: + qtpe_sip_flags.append("-t") + qtpe_sip_flags.append(opt_qtpetag) + + +def generate_code(mname, extra_cflags=None, extra_cxxflags=None, extra_define=None, extra_include_dirs=None, extra_lflags=None, extra_lib_dir=None, extra_libs=None, opengl=0, sip_flags=None): + """Generate the code for a module. + + mname is the name of the module. + extra_cflags is a string containing additional C compiler flags. + extra_cxxflags is a string containing additional C++ compiler flags. + extra_define is a name to add to the list of preprocessor defines. + extra_include_dirs is a list of directories to add to the list of include + directories. + extra_lflags is a string containing additional linker flags. + extra_lib_dir is the name of a directory to add to the list of library + directories. + extra_libs is a list of the names of extra libraries to add to the list of + libraries. + opengl is set if the module needs OpenGL support. + sip_flags is the list of sip flags to use instead of the defaults. + """ + sipconfig.inform("Generating the C++ source for the %s module..." % mname) + + try: + shutil.rmtree(mname) + except: + pass + + try: + os.mkdir(mname) + except: + sipconfig.error("Unable to create the %s directory." % mname) + + # Build the SIP command line. + argv = ['"' + sipcfg.sip_bin + '"'] + + if sip_flags is None: + sip_flags = qt_sip_flags + + argv.extend(sip_flags) + + if opt_concat: + argv.append("-j") + argv.append(str(opt_split)) + + if opt_tracing: + argv.append("-r") + + argv.append("-c") + argv.append(mname) + + buildfile = os.path.join(mname, mname + ".sbf") + argv.append("-b") + argv.append(buildfile) + + argv.append("-I") + argv.append("sip") + + # SIP assumes POSIX style path separators. + argv.append(string.join(["sip", mname, mname + "mod.sip"], "/")) + + os.system(string.join(argv)) + + # Check the result. + if not os.access(buildfile, os.F_OK): + sipconfig.error("Unable to create the C++ code.") + + # Generate the Makefile. + sipconfig.inform("Creating the Makefile for the %s module..." % mname) + + installs = [] + sipfiles = [] + + for s in glob.glob("sip/" + mname + "/*.sip"): + sipfiles.append(os.path.join("..", "sip", mname, os.path.basename(s))) + + installs.append([sipfiles, os.path.join(pyqt.sip_dir(), mname)]) + + makefile = sipconfig.SIPModuleMakefile( + configuration=sipcfg, + build_file=mname + ".sbf", + dir=mname, + install_dir=pyqt.module_dir(), + installs=installs, + qt=1, + opengl=opengl, + warnings=1, + static=opt_static, + debug=opt_debug + ) + + if extra_cflags: + makefile.extra_cflags.append(extra_cflags) + + if extra_cxxflags: + makefile.extra_cxxflags.append(extra_cxxflags) + + if extra_define: + makefile.extra_defines.append(extra_define) + + if extra_include_dirs: + makefile.extra_include_dirs.extend(extra_include_dirs) + + if extra_lflags: + makefile.extra_lflags.append(extra_lflags) + + if extra_lib_dir: + makefile.extra_lib_dirs.append(extra_lib_dir) + + if extra_libs: + makefile.extra_libs.extend(extra_libs) + + makefile.generate() + + +def check_license(): + """Handle the validation of the PyQt license. + """ + try: + import license + ltype = license.LicenseType + lname = license.LicenseName + + try: + lfile = license.LicenseFile + except AttributeError: + lfile = None + except ImportError: + ltype = None + + if ltype is None: + ltype = "GPL" + lname = "GNU General Public License" + lfile = None + + sipconfig.inform("This is the %s version of PyQt %s (licensed under the %s) for Python %s on %s." % (ltype, pyqt_version_str, lname, string.split(sys.version)[0], sys.platform)) + + # Common checks. + if ltype == "GPL" and sys.platform == "win32": + error("You cannot use the GPL version of PyQt under Windows.") + + try: + qted = qt_edition + except AttributeError: + qted = None + + if qted and ltype != "internal": + if (qted == "free" and ltype != "GPL") or (qted != "free" and ltype == "GPL"): + sipconfig.error("This version of PyQt and the %s edition of Qt have incompatible licenses." % qted) + + # Confirm the license. + print + print "Type 'L' to view the license." + print "Type 'yes' to accept the terms of the license." + print "Type 'no' to decline the terms of the license." + print + + while 1: + try: + resp = raw_input("Do you accept the terms of the license? ") + except: + resp = "" + + resp = string.lower(string.strip(resp)) + + if resp == "yes": + break + + if resp == "no": + sys.exit(0) + + if resp == "l": + os.system("more LICENSE") + + # If there should be a license file then check it is where it should be. + if lfile: + if os.access(os.path.join("sip", lfile), os.F_OK): + sipconfig.inform("Found the license file %s." % lfile) + else: + sipconfig.error("Please copy the license file %s to the sip directory." % lfile) + + +def get_build_macros(overrides): + """Return the dictionary of platform specific build macros from the Qt + installation. Return None if any of the overrides was invalid. + + overrides is a list of macros overrides from the user. + """ + # Get the name of the qmake configuration file to take the macros from. + if "QMAKESPEC" in os.environ.keys(): + fname = os.path.join(qt_dir, "mkspecs", os.environ["QMAKESPEC"], "qmake.conf") + else: + fname = os.path.join(qt_dir, "mkspecs", "default", "qmake.conf") + + if not os.access(fname, os.F_OK): + sipconfig.error("Unable to find the default configuration file %s. You can use the QMAKESPEC environment variable to specify the correct platform instead of \"default\"." % fname) + + # Add the Qt specific macros to the default. + names = sipcfg.build_macros().keys() + names.append("INCDIR_QT") + names.append("LIBDIR_QT") + names.append("MOC") + + # Make sure $QTDIR reflects any directory passed on the command line. + os.environ["QTDIR"] = qt_dir + + properties = { + "QT_INSTALL_BINS": os.path.join(qt_dir, "bin"), + "QT_INSTALL_HEADERS": os.path.join(qt_dir, "include"), + "QT_INSTALL_LIBS": os.path.join(qt_dir, "lib") + } + + return sipconfig.parse_build_macros(fname, names, overrides, properties) + + +def check_qt_installation(macros): + """Check the Qt installation and get the version number and edition. + + macros is the dictionary of build macros. + """ + # Get the Makefile generator. + generator = macros["MAKEFILE_GENERATOR"] + + # Set the Qt include and lib directories. + global qt_incdir, qt_libdir + + qt_incdir = macros["INCDIR_QT"] + + if not qt_incdir: + qt_incdir = os.path.join(qt_dir, "include") + macros["INCDIR_QT"] = qt_incdir + + qt_libdir = macros["LIBDIR_QT"] + + if not qt_libdir: + qt_libdir = os.path.join(qt_dir, "lib") + macros["LIBDIR_QT"] = qt_libdir + + # Check the Qt header files have been installed. Quietly check for Qt v4. + qt4_d = os.path.join(qt_incdir, "QtCore") + + qglobal = os.path.join(qt4_d, "qglobal.h") + + if not os.access(qglobal, os.F_OK): + qglobal = os.path.join(qt_incdir, "qglobal.h") + + if not os.access(qglobal, os.F_OK): + sipconfig.error("qglobal.h could not be found in %s." % qt_incdir) + + # Get the Qt version number. + global qt_version + + qt_version, ignore = sipconfig.read_version(qglobal, "Qt", "QT_VERSION") + + # Early versions of Qt for the Mac didn't include everything. Rather than + # maintain these in the future we just mandate a later version. + if sys.platform == "darwin" and qt_version < 0x030100: + sipconfig.error("PyQt for MacOS/X requires Qt v3.1.0 or later.") + + # The way SIP v4.2 and later handle connections between signals and Python + # slots only works with Qt v3 and later. Therefore Qt v2 and earlier needs + # SIP v3. + if qt_version < 0x030000: + sipconfig.error("Qt v2.x and earlier require SIP v3.x.") + + if qt_version >= 0x040000: + sipconfig.error("Qt v4.x requires PyQt v4.x.") + + # Try and work out which edition it is. + global qt_edition + + if qt_version >= 0x030000: + if opt_qconfigdir: + qconfigdir = opt_qconfigdir + else: + qconfigdir = qt_incdir + + qconfig = os.path.join(qconfigdir, "qconfig.h") + + if not os.access(qconfig,os.F_OK): + sipconfig.error("qconfig.h could not be found in %s." % qconfigdir) + + f = open(qconfig) + l = f.readline() + + while l: + wl = string.split(l) + if len(wl) == 3 and wl[0] == "#define" and wl[1] == "QT_PRODUCT_LICENSE": + qt_edition = wl[2][4:-1] + break + + l = f.readline() + + f.close() + + if not qt_edition: + sipconfig.error("The Qt edition could not be determined by parsing %s." % qconfig) + elif qt_version == 0x020300 and sys.platform == "win32": + # See if we have the Qt v2 non-commercial version. + if os.access(os.path.join(qt_libdir, "qt-mt230nc.lib"), os.F_OK): + qt_edition = "non-commercial" + + if sys.platform == "win32": + # Work out how Qt was built on Windows. + + global qt_winconfig + + try: + f = open(os.path.join(qt_dir, ".qtwinconfig"), "r") + except IOError: + f = None + + if f: + cfg = f.readline() + f.close() + + val = string.find(cfg, "=") + + if val >= 0: + qt_winconfig = string.strip(cfg[val + 1:]) + else: + # Assume it was built as a DLL. + qt_winconfig = "shared" + + # Determine the Qt library to link against and if it has thread support. + global qt_threaded + + resolve_qt3_library(generator) + + if opt_qtlib in ("qt-mt", "qt-mtedu", "qt-mteval", "qte-mt", "qtmt", "qtmtedu", "qtmteval"): + qt_threaded = 1 + + global pyqt + + pyqt = ConfigurePyQt3() + + # We haven't yet factored out sipconfig's knowledge of how to build Qt + # binaries and it is expecting to find these in the configuration when it + # generates the Makefiles. + sipcfg.qt_version = qt_version + sipcfg.qt_edition = qt_edition + sipcfg.qt_winconfig = qt_winconfig + sipcfg.qt_framework = 0 + sipcfg.qt_threaded = qt_threaded + sipcfg.qt_dir = qt_dir + sipcfg.qt_lib = opt_qtlib + sipcfg.qt_lib_dir = qt_libdir + + +def resolve_qt3_library(generator): + """See which version of the Qt v3 library can be found. (We can't trust + the configuration files.) + + generator is the name of the Makefile generator. + """ + global opt_qtlib + + if opt_qtlib: + if not is_qt_library(generator, opt_qtlib): + sipconfig.error("The %s Qt library could not be found in %s." % (opt_qtlib, qt_libdir)) + else: + stlib = is_qt_library(generator, "qt") + mtlib = is_qt_library(generator, "qt-mt") + edlib = is_qt_library(generator, "qt-mtedu") + evlib = is_qt_library(generator, "qt-mteval") + emlib = is_qt_library(generator, "qte") + etlib = is_qt_library(generator, "qte-mt") + + # Borland likes to be a little different. + bmtlib = is_qt_library(generator, "qtmt") + bedlib = is_qt_library(generator, "qtmtedu") + bevlib = is_qt_library(generator, "qtmteval") + + names = [] + + if stlib: + opt_qtlib = "qt" + names.append(opt_qtlib) + + if mtlib: + opt_qtlib = "qt-mt" + names.append(opt_qtlib) + + if edlib: + opt_qtlib = "qt-mtedu" + names.append(opt_qtlib) + + if evlib: + opt_qtlib = "qt-mteval" + names.append(opt_qtlib) + + if emlib: + opt_qtlib = "qte" + names.append(opt_qtlib) + + if etlib: + opt_qtlib = "qte-mt" + names.append(opt_qtlib) + + if bmtlib: + opt_qtlib = "qtmt" + names.append(opt_qtlib) + + if bedlib: + opt_qtlib = "qtmtedu" + names.append(opt_qtlib) + + if bevlib: + opt_qtlib = "qtmteval" + names.append(opt_qtlib) + + if not names: + sipconfig.error("No Qt libraries could be found in %s." % qt_libdir) + + if len(names) > 1: + sipconfig.error("These Qt libraries were found: %s. Use the -y argument to explicitly specify which you want to use." % string.join(names)) + + +def is_qt_library(generator, lib): + """See if a particular Qt library is installed. + + generator is the name of the Makefile generator. + lib is the name of the library. + """ + if generator in ("MSVC", "MSVC.NET", "BMAKE"): + lpatts = [lib + "[0-9]*.lib", lib + ".lib"] + else: + lpatts = ["lib" + lib + ".*"] + + for lpatt in lpatts: + lmatch = glob.glob(os.path.join(qt_libdir, lpatt)) + + if lmatch: + return lmatch + + return [] + + +def main(argv): + """Create the configuration module module. + + argv is the list of command line arguments. + """ + # Check SIP is new enough. + if sipcfg.sip_version_str[:8] != "snapshot": + if sipcfg.sip_version < sip_min_version: + sipconfig.error("This version of PyQt requires SIP v%s or later" % sipconfig.version_to_string(sip_min_version)) + + # Parse the command line. + try: + optlist, args = getopt.getopt(argv[1:], "ha:b:cd:fg:ij:kl:m:n:o:q:rsuv:wy:") + except getopt.GetoptError: + usage() + + global qt_dir, opt_qtlib, opt_qconfigdir + global opt_pyqtbindir, opt_pyqtmoddir, opt_pyqtsipdir + global opt_qtpetag, opt_static, opt_debug, opt_concat + global opt_split, opt_tracing, opt_verbose, opt_keepfeatures + global opt_qsciincdir, opt_qscilibdir, qsci_define + global opt_vendorcheck, opt_vendincdir, opt_vendlibdir + + for opt, arg in optlist: + if opt == "-h": + usage(0) + elif opt == "-a": + opt_qtpetag = arg + elif opt == "-b": + opt_pyqtbindir = os.path.abspath(arg) + elif opt == "-c": + opt_concat = 1 + elif opt == "-d": + opt_pyqtmoddir = os.path.abspath(arg) + elif opt == "-f": + opt_keepfeatures = 1 + elif opt == "-g": + opt_qconfigdir = os.path.abspath(arg) + elif opt == "-i": + opt_vendorcheck = 1 + elif opt == "-j": + try: + opt_split = int(arg) + except: + usage() + elif opt == "-k": + opt_static = 1 + elif opt == "-l": + opt_vendincdir = arg + elif opt == "-m": + opt_vendlibdir = arg + elif opt == "-n": + opt_qsciincdir = arg + elif opt == "-o": + opt_qscilibdir = arg + elif opt == "-q": + qt_dir = os.path.abspath(arg) + elif opt == "-r": + opt_tracing = 1 + elif opt == "-s": + qsci_define = "" + elif opt == "-u": + opt_debug = 1 + elif opt == "-v": + opt_pyqtsipdir = os.path.abspath(arg) + elif opt == "-w": + opt_verbose = 1 + elif opt == "-y": + if arg in ("qt", "qt-mt", "qt-mtedu", "qt-mteval", "qte", "qte-mt", "qtmt", "qtmtedu"): + opt_qtlib = arg + else: + usage() + + # Check that we know the name of the Qt root directory. + if not qt_dir: + sipconfig.error("A Qt installation could not be found. Use use the -q argument or the QTDIR environment variable to explicitly specify the correct directory.") + + # When building static libraries, signed interpreter checking makes no + # sense. + if opt_vendorcheck and opt_static: + sipconfig.error("Using the VendorID package when building static libraries makes no sense.") + + # Replace the existing build macros with the ones from the Qt installation. + macros = get_build_macros(args) + + if macros is None: + usage() + + sipcfg.set_build_macros(macros) + + # Check Qt is what we need. + check_qt_installation(macros) + + # Check the licenses are compatible. + check_license() + + # Check for QScintilla. + check_qscintilla() + + # Check which modules to build. + qtmod_lib = pyqt.check_modules() + + # Check for the VendorID package. + check_vendorid() + + # Set the SIP platform, version and feature flags. + set_sip_flags() + + # Tell the user what's been found. + inform_user() + + # Generate the code. + + extra_include_dirs = [] + extra_libs = [] + + if qtmod_lib: + extra_libs.append(qtmod_lib) + + if opt_vendorcheck: + extra_include_dirs.append(opt_vendincdir) + extra_lib_dir = opt_vendlibdir + extra_libs.append("vendorid") + else: + extra_lib_dir = None + + pyqt.code(extra_include_dirs, extra_lib_dir, extra_libs) + + # Create the additional Makefiles. + sipconfig.inform("Creating top level Makefile...") + + sipconfig.ParentMakefile( + configuration=sipcfg, + subdirs=pyqt_modules + pyqt.tools(), + installs=(pyqt.module_installs(), pyqt.module_dir()) + ).generate() + + # Install the configuration module. + create_config("pyqtconfig.py", "pyqtconfig.py.in", macros) + + +############################################################################### +# The script starts here. +############################################################################### + +if __name__ == "__main__": + try: + main(sys.argv) + except SystemExit: + raise + except: + print \ +"""An internal error occured. Please report all the output from the program, +including the following traceback, to support@riverbankcomputing.co.uk. +""" + raise diff --git a/python/pyqt/doc/PyQt.html b/python/pyqt/doc/PyQt.html new file mode 100644 index 00000000..c2768f33 --- /dev/null +++ b/python/pyqt/doc/PyQt.html @@ -0,0 +1,12845 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<HTML +><HEAD +><TITLE +>Python Bindings for Qt (3.17.2)</TITLE +><META +NAME="GENERATOR" +CONTENT="Modular DocBook HTML Stylesheet Version 1.79"></HEAD +><BODY +CLASS="ARTICLE" +><DIV +CLASS="ARTICLE" +><DIV +CLASS="TITLEPAGE" +><H1 +CLASS="TITLE" +><A +NAME="AEN2" +>Python Bindings for Qt (3.17.2)</A +></H1 +><H3 +CLASS="AUTHOR" +><A +NAME="AEN4" +>Phil Thompson</A +></H3 +><DIV +><DIV +CLASS="ABSTRACT" +><P +></P +><A +NAME="AEN7" +></A +><P +> This document describes a set of Python bindings for the Qt widget set. + Contact the author at <CODE +CLASS="EMAIL" +><<A +HREF="mailto:phil@riverbankcomputing.co.uk" +>phil@riverbankcomputing.co.uk</A +>></CODE +>. + </P +><P +></P +></DIV +></DIV +><HR></DIV +><DIV +CLASS="SECT1" +><H2 +CLASS="SECT1" +><A +NAME="AEN10" +>Introduction</A +></H2 +><P +>PyQt is a set of Python bindings for the Qt toolkit and available for all +platforms supported by Qt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against Qt versions 1.43 to 3.3.7, Qt Non-commercial, Qtopia 1.5.0, and Python +versions 1.5 to 2.5. Qt/Embedded v3 is not supported. Qt v4 is supported +by PyQt v4.</P +><P +>PyQt is available under the GPL license for use with the GPL version of Qt, a +a commercial license for use with the commercial version of Qt, a +non-commercial license for use with the non-commercial version of Qt v2, and an +educational license for use with the educational version of Qt.</P +><P +>PyQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyQt.</P +><P +>PyQt for MacOS/X requires Qt v3.1.0 or later and Python v2.3 or later.</P +><P +>The bindings are implemented as a number of Python modules</P +><P +></P +><UL +><LI +><P +><TT +CLASS="LITERAL" +>qt</TT +> is the main module and contains the core classes and most +user interface widgets.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtaxcontainer</TT +> contains a sub-set of the classes implemented +in Qt's QAxContainer module, part of Qt's ActiveQt framework.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtcanvas</TT +> contains the classes implemented in Qt's Canvas +module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtgl</TT +> contains the classes implemented in Qt's OpenGL module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtnetwork</TT +> contains the classes implemented in Qt's Network +module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtpe</TT +> contains the classes implemented in Qtopia (originally +called the Qt Palmtop Environment). It is only supported with Qt/Embedded.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtsql</TT +> contains the classes implemented in Qt's SQL module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qttable</TT +> contains the classes implemented in Qt's Table +module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtui</TT +> contains the classes implemented in Qt's qui library. +These allow GUIs to be created directly from Qt Designer's +<TT +CLASS="LITERAL" +>.ui</TT +> files.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtxml</TT +> contains the classes implemented in Qt's XML module.</P +></LI +><LI +><P +><TT +CLASS="LITERAL" +>qtext</TT +> contains useful third-party classes that are not part +of Qt. At the moment it contains bindings for QScintilla, the port to Qt of +the Scintilla programmer's editor class.</P +></LI +></UL +><P +>PyQt also includes the <TT +CLASS="LITERAL" +>pyuic</TT +> and +<TT +CLASS="LITERAL" +>pylupdate</TT +> utilities which correspond to the Qt +<TT +CLASS="LITERAL" +>uic</TT +> and <TT +CLASS="LITERAL" +>lupdate</TT +> utilities. +<TT +CLASS="LITERAL" +>pyuic</TT +> converts the GUI designs created with Qt Designer to +executable Python code. <TT +CLASS="LITERAL" +>pylupdate</TT +> scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by Qt Linguist.</P +> +</DIV> +<DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN95" +>Other PyQt Goodies</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN97" +>Using Qt Designer</A +></H3 +><P +>Qt Designer is a GPL'ed GUI design editor provided by Trolltech as part of Qt. +It generates an XML description of a GUI design. Qt includes +<TT +CLASS="LITERAL" +>uic</TT +> which generates C++ code from that XML.</P +><P +>PyQt includes <TT +CLASS="LITERAL" +>pyuic</TT +> which generates Python code from the +same XML. The Python code is self contained and can be executed immediately.</P +><P +>It is sometimes useful to be able to include some specific Python code in the +output generated by <TT +CLASS="LITERAL" +>pyuic</TT +>. For example, if you are using +custom widgets, <TT +CLASS="LITERAL" +>pyuic</TT +> has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +<TT +CLASS="LITERAL" +>import</TT +> statement. To help get around this, +<TT +CLASS="LITERAL" +>pyuic</TT +> will extract any lines entered in the +<TT +CLASS="LITERAL" +>Comment</TT +> field of Qt Designer's +<TT +CLASS="LITERAL" +>Form Settings</TT +> dialog that begin with +<TT +CLASS="LITERAL" +>Python:</TT +> and copies them to the generated output.</P +><P +>Here's a simple example showing the contents of the <TT +CLASS="LITERAL" +>Comment</TT +> +field.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>This comment will be ignored by pyuic. +Python: +Python:# Import our custom widget. +Python:from foo import bar</PRE +></TD +></TR +></TABLE +><P +>Here's the corresponding output from <TT +CLASS="LITERAL" +>pyuic</TT +>.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>from qt import * + +# Import our custom widget. +from foo import bar</PRE +></TD +></TR +></TABLE +><P +>Thanks to Christian Bird, <TT +CLASS="LITERAL" +>pyuic</TT +> will extract Python code +entered using Qt Designer to implement slots. In Qt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation.</P +><P +>Make sure that the <TT +CLASS="LITERAL" +>ui.h</TT +> file is in the same directory as the +<TT +CLASS="LITERAL" +>.ui</TT +> file when using <TT +CLASS="LITERAL" +>pyuic</TT +>. The +<TT +CLASS="LITERAL" +>.ui</TT +> file implies the name of the <TT +CLASS="LITERAL" +>.ui.h</TT +> +file so there is no need to specify it on the command line.</P +><P +>Here's an example of a simple slot. </P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>void DebMainWindowFrm::browsePushButtonClicked() +{ +if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +}</PRE +></TD +></TR +></TABLE +><P +>Here is the resulting code when <TT +CLASS="LITERAL" +>pyuic</TT +> is run.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>class DebMainWindowFrm(QMainWindow): + ...stuff... + def browsePushButtonClicked(self): + if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!")</PRE +></TD +></TR +></TABLE +><P +>Note that indenting is as normal and that <TT +CLASS="LITERAL" +>self</TT +> and all other +parameters passed to the slot are available.</P +><P +>If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN133" +>Using Qt Linguist</A +></H3 +><P +>Qt includes the <TT +CLASS="LITERAL" +>lupdate</TT +> program which parses C++ source +files converting calls to the <TT +CLASS="LITERAL" +>QT_TR_NOOP()</TT +> and +<TT +CLASS="LITERAL" +>QT_TRANSLATE_NOOP()</TT +> macros to <TT +CLASS="LITERAL" +>.ts</TT +> +language source files. The <TT +CLASS="LITERAL" +>lrelease</TT +> program is then used to +generate <TT +CLASS="LITERAL" +>.qm</TT +> binary language files that are distributed with +your application.</P +><P +>Thanks to Detlev Offenbach, PyQt includes the <TT +CLASS="LITERAL" +>pylupdate</TT +> +program. This generates the same <TT +CLASS="LITERAL" +>.ts</TT +> language source files +from your PyQt source files.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN145" +>Deploying Commercial PyQt Applications</A +></H2 +><P +>When deploying commercial PyQt applications it is necessary to discourage users +from accessing the underlying PyQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial Qt and +PyQt licenses.</P +><P +>One solution to this problem is the +<A +HREF="http://www.riverbankcomputing.co.uk/vendorid/" +TARGET="_top" +>VendorID</A +> +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module.</P +><P +>In order to build PyQt with support for the VendorID package, pass the +<TT +CLASS="LITERAL" +>-i</TT +> command line flag to <TT +CLASS="LITERAL" +>configure.py</TT +>.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN153" +><TT +CLASS="LITERAL" +>pyqtconfig</TT +> and Build System Support</A +></H2 +><P +>The SIP build system (ie. the <TT +CLASS="LITERAL" +>sipconfig</TT +> module) is described +in the SIP documentation. PyQt includes the <TT +CLASS="LITERAL" +>pyqtconfig</TT +> +module that can be used by configuration scripts of other bindings that are +built on top of PyQt.</P +><P +>The <TT +CLASS="LITERAL" +>pyqtconfig</TT +> module contains the following classes:</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>Configuration(sipconfig.Configuration)</TT +></DT +><DD +><P +>This class encapsulates additional configuration values, specific to PyQt, that +can be accessed as instance variables.</P +><P +>The following configuration values are provided (in addition to those provided +by the <TT +CLASS="LITERAL" +>sipconfig.Configuration</TT +> class):</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>pyqt_bin_dir</TT +></DT +><DD +><P +>The name of the directory containing the <TT +CLASS="LITERAL" +>pyuic</TT +> and +<TT +CLASS="LITERAL" +>pylupdate</TT +> executables.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_mod_dir</TT +></DT +><DD +><P +>The name of the directory containing the PyQt modules.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_modules</TT +></DT +><DD +><P +>A string containing the names of the PyQt modules that were installed.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qt_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qt</TT +> module and which should be added to those needed by any +module that imports the <TT +CLASS="LITERAL" +>qt</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtaxcontainer_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtaxcontainer</TT +> module and which should be added to those +needed by any module that imports the <TT +CLASS="LITERAL" +>qtaxcontainer</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtcanvas_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtcanvas</TT +> module and which should be added to those needed by +any module that imports the <TT +CLASS="LITERAL" +>qtcanvas</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtext_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtext</TT +> module and which should be added to those needed by +any module that imports the <TT +CLASS="LITERAL" +>qtext</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtgl_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtgl</TT +> module and which should be added to those needed by any +module that imports the <TT +CLASS="LITERAL" +>qtgl</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtnetwork_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtnetwork</TT +> module and which should be added to those needed +by any module that imports the <TT +CLASS="LITERAL" +>qtnetwork</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtsql_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtsql</TT +> module and which should be added to those needed by +any module that imports the <TT +CLASS="LITERAL" +>qtsql</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qttable_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qttable</TT +> module and which should be added to those needed by +any module that imports the <TT +CLASS="LITERAL" +>qttable</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtui_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtui</TT +> module and which should be added to those needed by any +module that imports the <TT +CLASS="LITERAL" +>qtui</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_qtxml_sip_flags</TT +></DT +><DD +><P +>A string of the SIP flags used to generate the code for the +<TT +CLASS="LITERAL" +>qtxml</TT +> module and which should be added to those needed by +any module that imports the <TT +CLASS="LITERAL" +>qtxml</TT +> module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_sip_dir</TT +></DT +><DD +><P +>The name of the base directory where the <TT +CLASS="LITERAL" +>.sip</TT +> files for each +of the PyQt modules is installed. A sub-directory exists with the same name as +the module.</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_version</TT +></DT +><DD +><P +>The PyQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +<TT +CLASS="LITERAL" +>0x030a00</TT +>).</P +><P +></P +><P +></P +></DD +><DT +><TT +CLASS="LITERAL" +>pyqt_version_str</TT +></DT +><DD +><P +>The PyQt version as a string. For development snapshots it will start with +<TT +CLASS="LITERAL" +>snapshot-</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtModuleMakefile(sipconfig.SIPModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qt</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtAxContainerModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtaxcontainer</TT +> +module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtCanvasModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtcanvas</TT +> +module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtExtModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtext</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtGLModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtgl</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtNetworkModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtnetwork</TT +> +module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtTableModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qttable</TT +> +module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtSQLModuleMakefile(QtTableModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtsql</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtUIModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtui</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +><DT +><TT +CLASS="LITERAL" +>QtXMLModuleMakefile(QtModuleMakefile)</TT +></DT +><DD +><P +>The Makefile class for modules that import the <TT +CLASS="LITERAL" +>qtxml</TT +> module.</P +><P +></P +><DIV +CLASS="VARIABLELIST" +><DL +><DT +><TT +CLASS="LITERAL" +>finalise(self)</TT +></DT +><DD +><P +>This is a reimplementation of <TT +CLASS="LITERAL" +>sipconfig.Makefile.finalise()</TT +>.</P +><P +></P +><P +></P +></DD +></DL +></DIV +></DD +></DL +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN457" +>Things to be Aware Of</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN459" +>super and Wrapped Classes</A +></H3 +><P +>Internally PyQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyQt.</P +><P +>In most circumstances this technique is transparent to an application. The +exception is when <TT +CLASS="LITERAL" +>super</TT +> is used with a PyQt class. The way +that <TT +CLASS="LITERAL" +>super</TT +> is currently implemented means that the lazy +lookup is bypassed resulting in <TT +CLASS="LITERAL" +>AttributeError</TT +> exceptions +unless the attribute has been previously referenced.</P +><P +>Note that this restriction applies to any class wrapped by SIP and not just +PyQt.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN467" +>Python Strings, Qt Strings and Unicode</A +></H3 +><P +>Unicode support was added to Qt in v2.0 and to Python in v1.6. In Qt, Unicode +support is implemented using the <TT +CLASS="LITERAL" +>QString</TT +> class. It is +important to understand that <TT +CLASS="LITERAL" +>QString</TT +>s, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in many cases and easy to achieve manually when needed.</P +><P +>Whenever PyQt expects a <TT +CLASS="LITERAL" +>QString</TT +> as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyQt will do the necessary conversion automatically.</P +><P +>You may also manually convert Python string and Unicode objects to +<TT +CLASS="LITERAL" +>QString</TT +>s by using the <TT +CLASS="LITERAL" +>QString</TT +> constructor +as demonstrated in the following code fragment.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>qs1 = QString('Converted Python string object') +qs2 = QString(u'Converted Python Unicode object')</PRE +></TD +></TR +></TABLE +><P +>In order to convert a <TT +CLASS="LITERAL" +>QString</TT +> to a Python string object use +the Python <TT +CLASS="LITERAL" +>str()</TT +> function. Applying +<TT +CLASS="LITERAL" +>str()</TT +> to a null <TT +CLASS="LITERAL" +>QString</TT +> and an empty +<TT +CLASS="LITERAL" +>QString</TT +> both result in an empty Python string object.</P +><P +>In order to convert a <TT +CLASS="LITERAL" +>QString</TT +> to a Python Unicode object use +the Python <TT +CLASS="LITERAL" +>unicode()</TT +> function. Applying +<TT +CLASS="LITERAL" +>unicode()</TT +> to a null <TT +CLASS="LITERAL" +>QString</TT +> and an empty +<TT +CLASS="LITERAL" +>QString</TT +> both result in an empty Python Unicode object.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN490" +>Access to Protected Member Functions</A +></H3 +><P +>When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN493" +><TT +CLASS="LITERAL" +>None</TT +> and <TT +CLASS="LITERAL" +>NULL</TT +></A +></H3 +><P +>Throughout the bindings, the <TT +CLASS="LITERAL" +>None</TT +> value can be specified +wherever <TT +CLASS="LITERAL" +>NULL</TT +> is acceptable to the underlying C++ code.</P +><P +>Equally, <TT +CLASS="LITERAL" +>NULL</TT +> is converted to <TT +CLASS="LITERAL" +>None</TT +> +whenever it is returned by the underlying C++ code.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN503" +>Support for C++ <TT +CLASS="LITERAL" +>void *</TT +> Data Types</A +></H3 +><P +>PyQt represents <TT +CLASS="LITERAL" +>void *</TT +> values as objects of type +<TT +CLASS="LITERAL" +>sip.voidptr</TT +>. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a <TT +CLASS="LITERAL" +>sip.voidptr</TT +> is expected.</P +><P +>A <TT +CLASS="LITERAL" +>sip.voidptr</TT +> may be converted to a Python integer by using +the <TT +CLASS="LITERAL" +>int()</TT +> builtin function.</P +><P +>A <TT +CLASS="LITERAL" +>sip.voidptr</TT +> may be converted to a Python string by using +its <TT +CLASS="LITERAL" +>asstring()</TT +> method. The <TT +CLASS="LITERAL" +>asstring()</TT +> +method takes an integer argument which is the length of the data in bytes.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN517" +>Support for Threads</A +></H3 +><P +>PyQt implements the full set of Qt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyQt does not impose any additional restrictions. +(Read the relevant part of the Qt documentation to understand the restrictions +imposed by the Qt API.)</P +><P +>If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules.</P +><P +></P +><UL +><LI +><P +>If you use the Qt API then the very first <TT +CLASS="LITERAL" +>import</TT +> of one of +the PyQt modules must be done from the main thread.</P +></LI +><LI +><P +>If you use the Python API then all calls to PyQt (including any +<TT +CLASS="LITERAL" +>import</TT +>s) must be done from one thread only. Therefore, if +you want to make calls to PyQt from several threads then you must use the Qt +API.</P +></LI +><LI +><P +>If you want to use both APIs in the same application then all calls to PyQt +must be done from threads created using the Qt API.</P +></LI +></UL +><P +>The above comments actually apply to any SIP generated module, not just PyQt.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN531" +>Garbage Collection</A +></H3 +><P +>C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>c = new QColor(); +c = new QColor();</PRE +></TD +></TR +></TABLE +><P +>In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to <TT +CLASS="LITERAL" +>c</TT +>:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>c = QColor() +c = QColor()</PRE +></TD +></TR +></TABLE +><P +>In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>self.c1 = QColor() +self.c2 = QColor()</PRE +></TD +></TR +></TABLE +><P +>Sometimes a Qt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a <TT +CLASS="LITERAL" +>QObject</TT +> (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects.</P +><P +>So, in the following Python fragment, the first <TT +CLASS="LITERAL" +>QLabel</TT +> is +not destroyed when the second is assigned to <TT +CLASS="LITERAL" +>l</TT +> because the +parent <TT +CLASS="LITERAL" +>QWidget</TT +> still has a reference to it.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>p = QWidget() +l = QLabel('First label',p) +l = QLabel('Second label',p)</PRE +></TD +></TR +></TABLE +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN547" +>C++ Variables</A +></H3 +><P +>Access to C++ variables is supported. They are accessed as Python instance +variables. For example:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>tab = QTab() +tab.label = "First Tab" +tab.r = QRect(10,10,75,30)</PRE +></TD +></TR +></TABLE +><P +>Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future.</P +><P +>Access to protected C++ class variables is not supported. This may change in +the future.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN553" +>Multiple Inheritance</A +></H3 +><P +>It is not possible to define a new Python class that sub-classes from more than +one Qt class.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN556" +>i18n Support</A +></H3 +><P +>Qt implements i18n support through the Qt Linguist application, the +<TT +CLASS="LITERAL" +>QTranslator</TT +> class, and the +<TT +CLASS="LITERAL" +>QApplication::translate()</TT +>, <TT +CLASS="LITERAL" +>QObject::tr()</TT +> +and <TT +CLASS="LITERAL" +>QObject::trUtf8()</TT +> methods. Usually the +<TT +CLASS="LITERAL" +>tr()</TT +> method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. <TT +CLASS="LITERAL" +>tr()</TT +> is actually +generated by <TT +CLASS="LITERAL" +>moc</TT +> and uses the hardcoded class name as the +context. On the other hand, <TT +CLASS="LITERAL" +>QApplication::translate()</TT +> +allows to context to be explicitly stated.</P +><P +>Unfortunately, because of the way Qt implents <TT +CLASS="LITERAL" +>tr()</TT +> (and +<TT +CLASS="LITERAL" +>trUtf8()</TT +>) it is not possible for PyQt to exactly reproduce +its behavour. The PyQt implementation of <TT +CLASS="LITERAL" +>tr()</TT +> (and +<TT +CLASS="LITERAL" +>trUtf8()</TT +>) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyQt, but is hardcoded in Qt. In other +words, the context of a translation may change depending on an instance's class +hierarchy.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return self.tr("Hello") + +class B(A): + def __init__(self): + A.__init__(self) + +a = A() +a.hello() + +b = B() +b.hello()</PRE +></TD +></TR +></TABLE +><P +>In the above the message is translated by <TT +CLASS="LITERAL" +>a.hello()</TT +> using a +context of <TT +CLASS="LITERAL" +>A</TT +>, and by <TT +CLASS="LITERAL" +>b.hello()</TT +> using a +context of <TT +CLASS="LITERAL" +>B</TT +>. In the equivalent C++ version the context +would be <TT +CLASS="LITERAL" +>A</TT +> in both cases.</P +><P +>The PyQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that <TT +CLASS="LITERAL" +>QApplication.translate()</TT +> be used in +preference to <TT +CLASS="LITERAL" +>tr()</TT +> (and <TT +CLASS="LITERAL" +>trUtf8()</TT +>). This +is guaranteed to work with current and future versions of PyQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of <TT +CLASS="LITERAL" +>A</TT +> that uses +<TT +CLASS="LITERAL" +>QApplication.translate()</TT +>.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return qApp.translate("A","Hello")</PRE +></TD +></TR +></TABLE +><P +>Note that the code generated by <TT +CLASS="LITERAL" +>pyuic</TT +> uses +<TT +CLASS="LITERAL" +>QApplication.translate()</TT +>.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN589" +>Signal and Slot Support</A +></H2 +><P +>A signal may be either a Qt signal (specified using +<TT +CLASS="LITERAL" +>SIGNAL()</TT +>) or a Python signal (specified using +<TT +CLASS="LITERAL" +>PYSIGNAL()</TT +>).</P +><P +>A slot can be either a Python callable object, a Qt signal (specified using +<TT +CLASS="LITERAL" +>SIGNAL()</TT +>), a Python signal (specified using +<TT +CLASS="LITERAL" +>PYSIGNAL()</TT +>), or a Qt slot (specified using +<TT +CLASS="LITERAL" +>SLOT()</TT +>).</P +><P +>You connect signals to slots (and other signals) as you would from C++. For +example:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>QObject.connect(a,SIGNAL("QtSig()"),pyFunction) +QObject.connect(a,SIGNAL("QtSig()"),pyClass.pyMethod) +QObject.connect(a,SIGNAL("QtSig()"),PYSIGNAL("PySig")) +QObject.connect(a,SIGNAL("QtSig()"),SLOT("QtSlot()")) +QObject.connect(a,PYSIGNAL("PySig"),pyFunction) +QObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +QObject.connect(a,PYSIGNAL("PySig"),SIGNAL("QtSig()")) +QObject.connect(a,PYSIGNAL("PySig"),SLOT("QtSlot()"))</PRE +></TD +></TR +></TABLE +><P +>When a slot is a Python method that corresponds to a Qt slot then a signal can +be connected to either the Python method or the Qt slot. The following +connections achieve the same effect.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>sbar = QScrollBar() +lcd = QLCDNumber() + +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))</PRE +></TD +></TR +></TABLE +><P +>The difference is that the second connection is made at the C++ level and is +more efficient.</P +><P +>Disconnecting signals works in exactly the same way.</P +><P +>Any instance of a class that is derived from the <TT +CLASS="LITERAL" +>QObject</TT +> +class can emit a signal using the <TT +CLASS="LITERAL" +>emit</TT +> method. This takes +two arguments. The first is the Python or Qt signal, the second is a Python +tuple which are the arguments to the signal. For example:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>a.emit(SIGNAL("clicked()"),()) +a.emit(PYSIGNAL("pySig"),("Hello","World"))</PRE +></TD +></TR +></TABLE +><P +>Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected.</P +><P +>Qt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way. </P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN610" +>Static Member Functions</A +></H2 +><P +>Static member functions are implemented as Python class functions. +For example the C++ static member function +<TT +CLASS="LITERAL" +>QObject::connect()</TT +> is called from Python as +<TT +CLASS="LITERAL" +>QObject.connect()</TT +> or <TT +CLASS="LITERAL" +>self.connect()</TT +> if +called from a sub-class of <TT +CLASS="LITERAL" +>QObject</TT +>.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN617" +>Enumerated Types</A +></H2 +><P +>Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values.</P +><P +>When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example:</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>Qt.SolidPattern +QWidget.TabFocus +QFrame.TabFocus</PRE +></TD +></TR +></TABLE +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN622" +>Module Reference Documentation</A +></H2 +><P +>The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here.</P +><P +>In these sections, <SPAN +CLASS="emphasis" +><I +CLASS="EMPHASIS" +>Not yet implemented</I +></SPAN +> +implies that the feature can be easily implemented if needed. <SPAN +CLASS="emphasis" +><I +CLASS="EMPHASIS" +>Not +implemented</I +></SPAN +> implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate.</P +><P +>If a class is described as being <SPAN +CLASS="emphasis" +><I +CLASS="EMPHASIS" +>fully implemented</I +></SPAN +> then +all non-private member functions and all public class variables have been +implemented.</P +><P +>If an operator has been implemented then it is stated explicitly.</P +><P +>Classes that are not mentioned have not yet been implemented.</P +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN632" +><TT +CLASS="LITERAL" +>qt</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN635" +>Qt Constants</A +></H3 +><P +>All constant values defined by Qt have equivalent constants defined to Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN638" +>Qt (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>Qt</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN642" +>QAccel</A +></H3 +><P +><TT +CLASS="LITERAL" +>QAccel</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN646" +>QAction (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QAction</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN650" +>QActionGroup (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QActionGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN654" +>QApplication</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN656" +></A +><CODE +CLASS="FUNCDEF" +>QApplication</CODE +>(int &argc, char **argv);<P +></P +></DIV +><P +>This takes one parameter which is a list of argument strings. Arguments +used by Qt are removed from the list.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN664" +></A +><CODE +CLASS="FUNCDEF" +>QApplication</CODE +>(int &argc, char **argv, bool GUIenabled);<P +></P +></DIV +><P +>This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN674" +></A +><CODE +CLASS="FUNCDEF" +>QApplication</CODE +>(int &argc, char **argv, Type type);<P +></P +></DIV +><P +>This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. (Qt v2.2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN684" +></A +><CODE +CLASS="FUNCDEF" +>int exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN690" +>QAssistantClient (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QAssistantClient</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN694" +>QBitmap</A +></H3 +><P +><TT +CLASS="LITERAL" +>QBitmap</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN698" +>QBrush</A +></H3 +><P +><TT +CLASS="LITERAL" +>QBrush</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN704" +>QButton</A +></H3 +><P +><TT +CLASS="LITERAL" +>QButton</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN708" +>QButtonGroup</A +></H3 +><P +><TT +CLASS="LITERAL" +>QButtonGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN712" +>QByteArray</A +></H3 +><P +>A Python string can be used whenever a <TT +CLASS="LITERAL" +>QByteArray</TT +> can be +used. A <TT +CLASS="LITERAL" +>QByteArray</TT +> can be converted to a Python string +using the Python <TT +CLASS="LITERAL" +>str()</TT +> function.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN718" +></A +><CODE +CLASS="FUNCDEF" +>QByteArray &assign</CODE +>(const char *data, uint size);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN726" +></A +><CODE +CLASS="FUNCDEF" +>char &at</CODE +>(uint i);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN732" +></A +><CODE +CLASS="FUNCDEF" +>int contains</CODE +>(const char &d);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN738" +></A +><CODE +CLASS="FUNCDEF" +>bool fill</CODE +>(const char &d, int size = -1);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN746" +></A +><CODE +CLASS="FUNCDEF" +>int find</CODE +>(const char &d, uint i = 0);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN754" +></A +><CODE +CLASS="FUNCDEF" +>void resetRawData</CODE +>(const char *data, uintsize);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN762" +></A +><CODE +CLASS="FUNCDEF" +>QByteArray &setRawData</CODE +>(const char *data, uintsize);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN770" +>QCDEStyle (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCDEStyle</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN774" +>QCheckBox</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCheckBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN778" +>QClipboard</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN780" +></A +><CODE +CLASS="FUNCDEF" +>void *data const</CODE +>(const char *format);<P +></P +></DIV +><P +>Not yet implemented (Qt v1.x).</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN786" +></A +><CODE +CLASS="FUNCDEF" +>void setData</CODE +>(const char *format, void *);<P +></P +></DIV +><P +>Not yet implemented (Qt v1.x).</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN794" +>QColor</A +></H3 +><P +>The Python <TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators are +supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN799" +></A +><CODE +CLASS="FUNCDEF" +>void getHsv</CODE +>(int *h, int *s, int *v);<P +></P +></DIV +><P +>This takes no parameters and returns the <TT +CLASS="LITERAL" +>h</TT +>, +<TT +CLASS="LITERAL" +>s</TT +> and <TT +CLASS="LITERAL" +>v</TT +> values as a tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN812" +></A +><CODE +CLASS="FUNCDEF" +>void getRgb</CODE +>(int *r, int *g, int *b);<P +></P +></DIV +><P +>This takes no parameters and returns the <TT +CLASS="LITERAL" +>r</TT +>, +<TT +CLASS="LITERAL" +>g</TT +> and <TT +CLASS="LITERAL" +>b</TT +> values as a tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN825" +></A +><CODE +CLASS="FUNCDEF" +>void hsv</CODE +>(int *h, int *s, int *v);<P +></P +></DIV +><P +>This takes no parameters and returns the <TT +CLASS="LITERAL" +>h</TT +>, +<TT +CLASS="LITERAL" +>s</TT +> and <TT +CLASS="LITERAL" +>v</TT +> values as a tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN838" +></A +><CODE +CLASS="FUNCDEF" +>void rgb</CODE +>(int *r, int *g, int *b);<P +></P +></DIV +><P +>This takes no parameters and returns the <TT +CLASS="LITERAL" +>r</TT +>, +<TT +CLASS="LITERAL" +>g</TT +> and <TT +CLASS="LITERAL" +>b</TT +> values as a tuple.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN851" +>QColorDialog (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN853" +></A +><CODE +CLASS="FUNCDEF" +>static QRgb getRgba</CODE +>(QRgb initial, bool *ok, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>initial</TT +>, <TT +CLASS="LITERAL" +>parent</TT +> and +<TT +CLASS="LITERAL" +>name</TT +> parameters and returns a tuple containing the +<TT +CLASS="LITERAL" +>QRgb</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN870" +>QColorGroup</A +></H3 +><P +><TT +CLASS="LITERAL" +>QColorGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN874" +>QComboBox</A +></H3 +><P +><TT +CLASS="LITERAL" +>QComboBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN878" +>QCommonStyle (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN880" +></A +><CODE +CLASS="FUNCDEF" +>virtual void getButtonShift</CODE +>(int &x, int &y);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>x</TT +> and +<TT +CLASS="LITERAL" +>y</TT +> values. (Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN890" +></A +><CODE +CLASS="FUNCDEF" +>virtual void tabbarMetrics</CODE +>(const QTabBar *t, int &hframe, int &vframe, int &overlap);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>t</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>hframe</TT +>, <TT +CLASS="LITERAL" +>vframe</TT +> and +<TT +CLASS="LITERAL" +>overlap</TT +> values. (Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN906" +>QCString (Qt v2+)</A +></H3 +><P +>A Python string can be used whenever a <TT +CLASS="LITERAL" +>QCString</TT +> can be used. +A <TT +CLASS="LITERAL" +>QCString</TT +> can be converted to a Python string using the +Python <TT +CLASS="LITERAL" +>str()</TT +> function.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN912" +></A +><CODE +CLASS="FUNCDEF" +>QCString &sprintf</CODE +>(const char *format, ...);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN919" +></A +><CODE +CLASS="FUNCDEF" +>short toShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>short</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN927" +></A +><CODE +CLASS="FUNCDEF" +>ushort toUShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ushort</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN935" +></A +><CODE +CLASS="FUNCDEF" +>int toInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN943" +></A +><CODE +CLASS="FUNCDEF" +>uint toUInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>uint</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN951" +></A +><CODE +CLASS="FUNCDEF" +>long toLong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>long</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN959" +></A +><CODE +CLASS="FUNCDEF" +>ulong toULong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ulong</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN967" +></A +><CODE +CLASS="FUNCDEF" +>float toFloat</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>float</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN975" +></A +><CODE +CLASS="FUNCDEF" +>double toDouble</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>double</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN983" +>QCursor</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCursor</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN987" +>QDataStream</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN989" +></A +><CODE +CLASS="FUNCDEF" +>QDataStream &readBytes</CODE +>(const char *&s, uint &l);<P +></P +></DIV +><P +>This takes no parameters. The <TT +CLASS="LITERAL" +>QDataStream</TT +> result and the +data read are returned as a tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN998" +></A +><CODE +CLASS="FUNCDEF" +>QDataStream &readRawBytes</CODE +>(const char *s, uint l);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>l</TT +> parameter. The +<TT +CLASS="LITERAL" +>QDataStream</TT +> result and the data read are returned as a +tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1008" +></A +><CODE +CLASS="FUNCDEF" +>QDataStream &writeBytes</CODE +>(const char *s, uint len);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>s</TT +> and not passed as a +parameter.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1018" +></A +><CODE +CLASS="FUNCDEF" +>QDataStream &writeRawBytes</CODE +>(const char *s, uint len);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>s</TT +> and not passed as a +parameter.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1028" +>QDate</A +></H3 +><P +>The Python +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, +<TT +CLASS="LITERAL" +><</TT +>, <TT +CLASS="LITERAL" +><=</TT +>, +<TT +CLASS="LITERAL" +>></TT +>, <TT +CLASS="LITERAL" +>>=</TT +> +and <TT +CLASS="LITERAL" +>__nonzero__</TT +> +operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1038" +></A +><CODE +CLASS="FUNCDEF" +>int weekNumber</CODE +>(int *yearNum = 0);<P +></P +></DIV +><P +>This takes no parameters and returns the week number and the year number as a +tuple. (Qt v3.1+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1044" +>QDateTime</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDateTime</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, +<TT +CLASS="LITERAL" +><</TT +>, <TT +CLASS="LITERAL" +><=</TT +>, +<TT +CLASS="LITERAL" +>></TT +>, <TT +CLASS="LITERAL" +>>=</TT +> +and <TT +CLASS="LITERAL" +>__nonzero__</TT +> +operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1055" +>QTime</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTime</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, +<TT +CLASS="LITERAL" +><</TT +>, <TT +CLASS="LITERAL" +><=</TT +>, +<TT +CLASS="LITERAL" +>></TT +>, <TT +CLASS="LITERAL" +>>=</TT +> +and <TT +CLASS="LITERAL" +>__nonzero__</TT +> +operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1066" +>QDateEdit (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDateEdit</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1070" +>QTimeEdit (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTimeEdit</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1074" +>QDateTimeEdit (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDateTimeEdit</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1078" +>QDesktopWidget (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDesktopWidget</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1082" +>QDial (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDial</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1086" +>QDialog</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1088" +></A +><CODE +CLASS="FUNCDEF" +>int exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +><P +>This method also causes ownership of the underlying C++ dialog to be +transfered to Python. This means that the C++ dialog will be deleted when the +Python wrapper is garbage collected. Although this is a little inconsistent, +it ensures that the dialog is deleted without having to explicity code it +using <TT +CLASS="LITERAL" +>QObject.deleteLater()</TT +> or other techniques.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1096" +>QDir</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDir</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>len</TT +>, <TT +CLASS="LITERAL" +>[]</TT +> (for reading slices and +individual elements), <TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +> and +<TT +CLASS="LITERAL" +>in</TT +> operators</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1105" +>QFileInfoList</A +></H3 +><P +>This class isn't implemented. Whenever a <TT +CLASS="LITERAL" +>QFileInfoList</TT +> is +the return type of a function or the type of an argument, a Python list of +<TT +CLASS="LITERAL" +>QFileInfo</TT +> instances is used instead.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1110" +>QDockArea (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1112" +></A +><CODE +CLASS="FUNCDEF" +>bool hasDockWindow const</CODE +>(QDockWindow *w, int *index = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>w</TT +> parameter and returns the index of the +QDockWIndow or -1 if the QDockArea does not contain the QDockWindow.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1121" +>QDockWindow (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDockWindow</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1125" +>QColorDrag (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QColorDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1129" +>QDragObject</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDragObject</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1133" +>QImageDrag</A +></H3 +><P +><TT +CLASS="LITERAL" +>QImageDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1137" +>QStoredDrag</A +></H3 +><P +><TT +CLASS="LITERAL" +>QStoredDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1141" +>QTextDrag</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTextDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1145" +>QUriDrag (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QUriDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1149" +>QUrlDrag (Qt v1.x)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QUrlDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1153" +>QDropSite</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDropSite</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1157" +>QErrorMessage (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QErrorMessage</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1161" +>QEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QEvent</TT +> is fully implemented.</P +><P +>Instances of <TT +CLASS="LITERAL" +>QEvent</TT +>s are automatically converted to the +correct sub-class.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1167" +>QChildEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QChildEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1171" +>QCloseEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCloseEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1175" +>QIconDragEvent (Qt v3.3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconDragEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1179" +>QContextMenuEvent (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QContextMenuEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1183" +>QCustomEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCustomEvent</TT +> is fully implemented. Any Python object can be +passed as the event data and its reference count is increased.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1187" +>QDragEnterEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDragEnterEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1191" +>QDragLeaveEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDragLeaveEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1195" +>QDragMoveEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDragMoveEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1199" +>QDropEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDropEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1203" +>QFocusEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFocusEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1207" +>QHideEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHideEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1211" +>QIMComposeEvent (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIMComposeEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1215" +>QIMEvent (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIMEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1219" +>QKeyEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QKeyEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1223" +>QMouseEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMouseEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1227" +>QMoveEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMoveEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1231" +>QPaintEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPaintEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1235" +>QResizeEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QResizeEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1239" +>QShowEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QShowEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1243" +>QTabletEvent (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTabletEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1247" +>QTimerEvent</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTimerEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1251" +>QWheelEvent (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWheelEvent</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1255" +>QEventLoop (Qt v3.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1257" +></A +><CODE +CLASS="FUNCDEF" +>virtual int exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1263" +>QFile</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1265" +></A +><CODE +CLASS="FUNCDEF" +>bool open</CODE +>(int m, FILE *f);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1273" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readBlock</CODE +>(char *data, Q_ULONG len);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>len</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>None</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1284" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readLine</CODE +>(char *data, Q_ULONG maxlen);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>maxlen</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>None</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1295" +></A +><CODE +CLASS="FUNCDEF" +>static void setDecodingFunction</CODE +>(EncoderFn f);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1301" +></A +><CODE +CLASS="FUNCDEF" +>static void setEncodingFunction</CODE +>(EncoderFn f);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1307" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG writeBlock</CODE +>(const char *data, Q_ULONG len);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>data</TT +> and not passed +as a parameter.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1317" +>QFileDialog</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFileDialog</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1321" +>QFileIconProvider</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFileIconProvider</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1325" +>QFilePreview</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFilePreview</TT +> is fully implemented. However it cannot be +used from Python in the same way as it is used from C++ because PyQt does not +support multiple inheritance involving more than one wrapped class. A trick +that seems to work is to use composition rather than inheritance as in the +following code fragment.</P +><TABLE +BORDER="0" +BGCOLOR="#E0E0E0" +WIDTH="100%" +><TR +><TD +><PRE +CLASS="PROGRAMLISTING" +>class FilePreview(QFilePreview): + pass + +class Preview(QLabel): + def __init__(self, parent=None): + QLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl</PRE +></TD +></TR +></TABLE +><P +>Note that QFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1331" +>QFileInfo</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFileInfo</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1335" +>QFont</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFont</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1341" +>QFontDatabase (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFontDatabase</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1345" +>QFontDialog (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1347" +></A +><CODE +CLASS="FUNCDEF" +>static QFont getFont</CODE +>(bool *ok, const QFont &def, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>def</TT +>, <TT +CLASS="LITERAL" +>parent</TT +> and +<TT +CLASS="LITERAL" +>name</TT +> parameters and returns a tuple containing the +<TT +CLASS="LITERAL" +>QFont</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1364" +></A +><CODE +CLASS="FUNCDEF" +>static QFont getFont</CODE +>(bool *ok, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>parent</TT +> and <TT +CLASS="LITERAL" +>name</TT +> parameters +and returns a tuple containing the <TT +CLASS="LITERAL" +>QFont</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1378" +>QFontInfo</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFontInfo</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1382" +>QFontMetrics</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1384" +></A +><CODE +CLASS="FUNCDEF" +>QRect boundingRect</CODE +>(int x, int y, int w, int h, int flags, const QString &str, int len = -1, int tabstops = 0, int *tabarray = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>tabarray</TT +> parameter is a Python list of integers.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1407" +></A +><CODE +CLASS="FUNCDEF" +>QSize size</CODE +>(int flags, const QString &str, int len = -1, int tabstops = 0, int *tabarray = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>tabarray</TT +> parameter is a Python list of integers.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1422" +>QFrame</A +></H3 +><P +><TT +CLASS="LITERAL" +>QFrame</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1426" +>QGManager (Qt v1.x)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGManager</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1430" +>QChain (Qt v1.x)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QChain</TT +> is implemented as an opaque class.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1434" +>QGrid (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGrid</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1438" +>QGridView (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGridView</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1442" +>QGroupBox</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGroupBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1446" +>QHBox (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1450" +>QHButtonGroup (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHButtonGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1454" +>QHeader</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHeader</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1458" +>QHGroupBox (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHGroupBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1462" +>QIconSet</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconSet</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1466" +>QIconFactory (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconFactory</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1470" +>QIconView (Qt v2.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1472" +></A +><CODE +CLASS="FUNCDEF" +>QIconViewItem *makeRowLayout</CODE +>(QIconViewItem *begin, int &y);<P +></P +></DIV +><P +>Not yet implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1480" +>QIconViewItem (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconViewItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1484" +>QIconDrag (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconDrag</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1488" +>QIconDragItem (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIconDragItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1492" +>QImage</A +></H3 +><P +>The Python <TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators are +supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1497" +></A +><CODE +CLASS="FUNCDEF" +>QImage</CODE +>(const char *xpm[]);<P +></P +></DIV +><P +>This takes a list of strings as its parameter.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1503" +></A +><CODE +CLASS="FUNCDEF" +>QImage</CODE +>(uchar *data, int w, int h, int depth, QRgb *colorTable, int numColors, Endian bitOrder);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>colorTable</TT +> parameter is a list of QRgb instances or +None. (Qt v2.1+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1522" +></A +><CODE +CLASS="FUNCDEF" +>uchar *bits</CODE +>();<P +></P +></DIV +><P +>The return value is a <TT +CLASS="LITERAL" +>sip.voidptr</TT +> object which is only +useful if passed to another Python module.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1528" +></A +><CODE +CLASS="FUNCDEF" +>QRgb *colorTable</CODE +>();<P +></P +></DIV +><P +>The return value is a <TT +CLASS="LITERAL" +>sip.voidptr</TT +> object which is only +useful if passed to another Python module.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1534" +></A +><CODE +CLASS="FUNCDEF" +>QImage convertDepthWithPalette</CODE +>(int, QRgb *p, int pc, int cf = 0);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1545" +></A +><CODE +CLASS="FUNCDEF" +>uchar **jumpTable</CODE +>();<P +></P +></DIV +><P +>The return value is a <TT +CLASS="LITERAL" +>sip.voidptr</TT +> object which is only +useful if passed to another Python module.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1551" +></A +><CODE +CLASS="FUNCDEF" +>bool loadFromData</CODE +>(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>buf</TT +> and not passed as +a parameter.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1565" +></A +><CODE +CLASS="FUNCDEF" +>uchar *scanLine</CODE +>(int i);<P +></P +></DIV +><P +>The return value is a <TT +CLASS="LITERAL" +>sip.voidptr</TT +> object which is only +useful if passed to another Python module.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1572" +>QImageIO</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1574" +></A +><CODE +CLASS="FUNCDEF" +>static void defineIOHandler</CODE +>(const char *format, const char *header, const char *flags, image_io_handler read_image, image_io_handler write_image);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1588" +>QImageTextKeyLang</A +></H3 +><P +><TT +CLASS="LITERAL" +>QImageTextKeyLang</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1592" +>QInputDialog (Qt v2.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1594" +></A +><CODE +CLASS="FUNCDEF" +>static QString getText</CODE +>(const QString &caption, const QString &label, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QString</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag. +(Qt v2.1 - v2.3.1)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1613" +></A +><CODE +CLASS="FUNCDEF" +>static QString getText</CODE +>(const QString &caption, const QString &label, QLineEdit::EchoModeecho, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QString</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag. +(Qt v2.2 - v2.3.1)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1634" +></A +><CODE +CLASS="FUNCDEF" +>static QString getText</CODE +>(const QString &caption, const QString &label, QLineEdit::EchoModeecho = QLineEdit::Normal, const QString &text = QString::null, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QString</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag. +(Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1655" +></A +><CODE +CLASS="FUNCDEF" +>static int getInteger</CODE +>(const QString &caption, const QString &label, int num = 0, int from = -2147483647, int to = 2147483647, int step = 1, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>int</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1680" +></A +><CODE +CLASS="FUNCDEF" +>static double getDouble</CODE +>(const QString &caption, const QString &label, double num = 0, double from = -2147483647, double to = 2147483647, int step = 1, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>double</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1705" +></A +><CODE +CLASS="FUNCDEF" +>static QString getItem</CODE +>(const QString &caption, const QString &label, const QStringList &list, int current = 0, bool editable = TRUE, bool *ok = 0, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QString</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1728" +>QInterlaceStyle (Qt v2.3.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1730" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1749" +>QIODevice</A +></H3 +><P +><TT +CLASS="LITERAL" +>QIODevice</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1753" +>QKeySequence (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QKeySequence</TT +> is fully implemented including the operators +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, <TT +CLASS="LITERAL" +>QString()</TT +> and +<TT +CLASS="LITERAL" +>int()</TT +>. A <TT +CLASS="LITERAL" +>QString</TT +> instance or a Python +integer may be used whenever a <TT +CLASS="LITERAL" +>QKeySequence</TT +> can be used.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1763" +>QLabel</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLabel</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1767" +>QLayout</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLayout</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1771" +>QBoxLayout</A +></H3 +><P +><TT +CLASS="LITERAL" +>QBoxLayout</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1775" +>QGLayoutIterator (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGLayoutIterator</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1779" +>QGridLayout</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1781" +></A +><CODE +CLASS="FUNCDEF" +>bool findWidget</CODE +>(QWidget *w, int *row, int *col);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>w</TT +> parameter and returns a tuple containing +the <TT +CLASS="LITERAL" +>bool</TT +> result, <TT +CLASS="LITERAL" +>row</TT +> and +<TT +CLASS="LITERAL" +>col</TT +>. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1795" +>QHBoxLayout</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHBoxLayout</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1799" +>QLayoutItem (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLayoutItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1803" +>QLayoutIterator (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1805" +></A +><CODE +CLASS="FUNCDEF" +>QLayoutItem *next</CODE +>();<P +></P +></DIV +><P +>This is a wrapper around the <TT +CLASS="LITERAL" +>QLayoutIterator</TT +> +<TT +CLASS="LITERAL" +>++</TT +> operator.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1812" +>QSpacerItem (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSpacerItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1816" +>QVBoxLayout</A +></H3 +><P +><TT +CLASS="LITERAL" +>QVBoxLayout</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1820" +>QWidgetItem (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWidgetItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1824" +>QLCDNumber</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLCDNumber</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1828" +>QLibrary (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLibrary</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1832" +>QLineEdit</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1834" +></A +><CODE +CLASS="FUNCDEF" +>int characterAt</CODE +>(int xpos, QChar *chr);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>xpos</TT +> parameter and returns the int +result and the <TT +CLASS="LITERAL" +>chr</TT +> value as a tuple. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1844" +></A +><CODE +CLASS="FUNCDEF" +>void del</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delChar</TT +> in Python. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1850" +></A +><CODE +CLASS="FUNCDEF" +>bool getSelection</CODE +>(int *start, int *end);<P +></P +></DIV +><P +>This takes no parameters and returns the bool result and the +<TT +CLASS="LITERAL" +>start</TT +> and <TT +CLASS="LITERAL" +>end</TT +> values as a tuple. +(Qt v3+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1860" +>QList<type> (Qt v2)</A +></H3 +><P +>Types based on the <TT +CLASS="LITERAL" +>QList</TT +> template are automatically +converted to and from Python lists of the type.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1864" +>QListBox</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1866" +></A +><CODE +CLASS="FUNCDEF" +>bool itemYPos</CODE +>(int index, int *yPos);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>index</TT +> parameter and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and <TT +CLASS="LITERAL" +>yPos</TT +>. +(Qt v1.x)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1877" +>QListBoxItem</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListBoxItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1881" +>QListBoxPixmap</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListBoxPixmap</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1885" +>QListBoxText</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListBoxText</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1889" +>QListView</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListView</TT +> is fully implemented.</P +><P +>Note that to remove a child <TT +CLASS="LITERAL" +>QListViewItem</TT +> you must first +call <TT +CLASS="LITERAL" +>takeItem()</TT +> and then <TT +CLASS="LITERAL" +>del()</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1897" +>QListViewItem</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListViewItem</TT +> is fully implemented.</P +><P +>Note that to remove a child <TT +CLASS="LITERAL" +>QListViewItem</TT +> you must first +call <TT +CLASS="LITERAL" +>takeItem()</TT +> and then <TT +CLASS="LITERAL" +>del()</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1905" +>QCheckListItem</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCheckListItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1909" +>QListViewItemIterator (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QListViewItemIterator</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1913" +>QLocale (Qt v3.3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1915" +></A +><CODE +CLASS="FUNCDEF" +>short toShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>short</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1923" +></A +><CODE +CLASS="FUNCDEF" +>ushort toUShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ushort</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1931" +></A +><CODE +CLASS="FUNCDEF" +>int toInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1939" +></A +><CODE +CLASS="FUNCDEF" +>uint toUInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>uint</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1947" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG toLong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>long</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1955" +></A +><CODE +CLASS="FUNCDEF" +>Q_ULONG toULong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ulong</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1963" +></A +><CODE +CLASS="FUNCDEF" +>float toFloat</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>float</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1971" +></A +><CODE +CLASS="FUNCDEF" +>double toDouble</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>double</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN1979" +>QMainWindow</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1981" +></A +><CODE +CLASS="FUNCDEF" +>QTextStream &operator<<</CODE +>(QTextStream &, const QMainWindow &);<P +></P +></DIV +><P +>This operator is fully implemented. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1989" +></A +><CODE +CLASS="FUNCDEF" +>QTextStream &operator>></CODE +>(QTextStream &, QMainWindow &);<P +></P +></DIV +><P +>This operator is fully implemented. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN1997" +></A +><CODE +CLASS="FUNCDEF" +>bool getLocation</CODE +>(QToolBar *tb, ToolBarDock &dock, int &index, bool &nl, int &extraOffset);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>tb</TT +> parameter and returns a tuple of the +result, <TT +CLASS="LITERAL" +>dock</TT +>, <TT +CLASS="LITERAL" +>index</TT +>, +<TT +CLASS="LITERAL" +>nl</TT +> and <TT +CLASS="LITERAL" +>extraOffset</TT +> values. (Qt v2.1.0+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2016" +></A +><CODE +CLASS="FUNCDEF" +>QList<QToolBar> toolBars</CODE +>(ToolBarDock dock);<P +></P +></DIV +><P +>This returns a list of <TT +CLASS="LITERAL" +>QToolBar</TT +> instances. (Qt v2.1.0+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2023" +>QMemArray<type> (Qt v3+)</A +></H3 +><P +>Types based on the <TT +CLASS="LITERAL" +>QMemArray</TT +> template are automatically +converted to and from Python lists of the type.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2027" +>QMenuBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMenuBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2031" +>QMenuData</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2033" +></A +><CODE +CLASS="FUNCDEF" +>QMenuItem *findItem</CODE +>(int id, QMenuData **parent);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2041" +>QCustomMenuItem (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCustomMenuItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2045" +>QMenuItem</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMenuItem</TT +> is an internal Qt class.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2049" +>QMessageBox</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMessageBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2053" +>QMetaObject</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2055" +></A +><CODE +CLASS="FUNCDEF" +>int numClassInfo const</CODE +>(bool super = FALSE);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2061" +></A +><CODE +CLASS="FUNCDEF" +>const QClassInfo *classInfo const</CODE +>(bool super = FALSE);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2067" +>QMetaProperty</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMetaProperty</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2071" +>QMimeSource (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMimeSource</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2075" +>QMimeSourceFactory (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMimeSourceFactory</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2079" +>QWindowsMime (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWindowsMime</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2083" +>QMotifPlusStyle (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2085" +></A +><CODE +CLASS="FUNCDEF" +>void getButtonShift</CODE +>(int &x, int &y);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>x</TT +> and +<TT +CLASS="LITERAL" +>y</TT +> values. (Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2095" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2114" +>QMotifStyle (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2116" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2135" +></A +><CODE +CLASS="FUNCDEF" +>void tabbarMetrics</CODE +>(const QTabBar *t, int &hframe, int &vframe, int &overlap);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>t</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>hframe</TT +>, <TT +CLASS="LITERAL" +>vframe</TT +> and +<TT +CLASS="LITERAL" +>overlap</TT +> values. (Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2151" +>QMovie</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2153" +></A +><CODE +CLASS="FUNCDEF" +>QMovie</CODE +>(QDataSource *src, int bufsize = 1024);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2161" +></A +><CODE +CLASS="FUNCDEF" +>void pushData</CODE +>(const uchar *data, int length);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>length</TT +> is derived from <TT +CLASS="LITERAL" +>data</TT +> and not +passed as a parameter. (Qt v2.2.0+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2171" +>QMultiLineEdit</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2173" +></A +><CODE +CLASS="FUNCDEF" +>void cursorPosition const</CODE +>(int *line, int *col);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>line</TT +> and +<TT +CLASS="LITERAL" +>col</TT +> values. (Qt v1.x, Qt v2.x)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2183" +></A +><CODE +CLASS="FUNCDEF" +>virtual void del</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delChar</TT +> in Python. (Qt v1.x, Qt v2.x)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2189" +></A +><CODE +CLASS="FUNCDEF" +>void getCursorPosition const</CODE +>(int *line, int *col);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>line</TT +> and +<TT +CLASS="LITERAL" +>col</TT +> values. (Qt v1.x, Qt v2.x)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2199" +></A +><CODE +CLASS="FUNCDEF" +>bool getMarkedRegion</CODE +>(int *line1, int *col1, int *line2, int *col2);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the bool result and the +<TT +CLASS="LITERAL" +>line1</TT +>, <TT +CLASS="LITERAL" +>col1</TT +>, <TT +CLASS="LITERAL" +>line2</TT +> and +<TT +CLASS="LITERAL" +>col2</TT +> values.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2215" +>QMutex (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMutex</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2219" +>QMutexLocker (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QMutexLocker</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2223" +>QNetworkOperation (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QNetworkOperation</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2227" +>QNetworkProtocol (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QNetworkProtocol</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2231" +>QNetworkProtocolFactoryBase (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QNetworkProtocolFactoryBase</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2235" +>QObject</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2237" +></A +><CODE +CLASS="FUNCDEF" +>bool disconnect</CODE +>(const QObject *receiver, const char *member = 0);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2245" +></A +><CODE +CLASS="FUNCDEF" +>bool disconnect</CODE +>(const char *signal = 0, const QObject *receiver = 0, const char *member = 0);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2255" +></A +><CODE +CLASS="FUNCDEF" +>static bool disconnect</CODE +>(const QObject *sender, const char *signal, const QObject *receiver, const char *member);<P +></P +></DIV +><P +>At the moment PyQt does not support the full behaviour of the corresponding Qt +method. In particular, specifying None (ie. 0 in C++) for the +<TT +CLASS="LITERAL" +>signal</TT +> and <TT +CLASS="LITERAL" +>receiver</TT +> parameters is not yet +supported.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2269" +>QObjectCleanupHandler (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QObjectCleanupHandler</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2273" +>QObjectList</A +></H3 +><P +>This class isn't implemented. Whenever a <TT +CLASS="LITERAL" +>QObjectList</TT +> is the +return type of a function or the type of an argument, a Python list of +<TT +CLASS="LITERAL" +>QObject</TT +> instances is used instead.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2278" +>QPaintDeviceMetrics</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPaintDeviceMetrics</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2282" +>QPaintDevice</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2284" +></A +><CODE +CLASS="FUNCDEF" +>virtual bool cmd</CODE +>(int, QPainter *, QPDevCmdParam *);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2291" +>QPainter</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2293" +></A +><CODE +CLASS="FUNCDEF" +>QRect boundingRect</CODE +>(int x, int y, int w, int h, int flags, const char *str, int len = -1, char **intern = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>intern</TT +> parameter is not supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2314" +></A +><CODE +CLASS="FUNCDEF" +>QRect boundingRect</CODE +>(const QRect&, int flags, const char *str, int len = -1, char **intern = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>intern</TT +> parameter is not supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2328" +></A +><CODE +CLASS="FUNCDEF" +>void drawText</CODE +>(int x, int y, int w, int h, int flags, const char *str, int len = -1, QRect *br = 0, char **intern = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>intern</TT +> parameter is not supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2351" +></A +><CODE +CLASS="FUNCDEF" +>void drawText</CODE +>(const QRect&, int flags, const char *str, int len = -1, QRect *br = 0, char **intern = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>intern</TT +> parameter is not supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2367" +></A +><CODE +CLASS="FUNCDEF" +>void setTabArray</CODE +>(int *ta);<P +></P +></DIV +><P +>This takes a single parameter which is a list of tab stops.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2373" +></A +><CODE +CLASS="FUNCDEF" +>int *tabArray</CODE +>();<P +></P +></DIV +><P +>This returns a list of tab stops.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2378" +>QPalette</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPalette</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2384" +>QPixmap</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2386" +></A +><CODE +CLASS="FUNCDEF" +>QPixmap</CODE +>(const char *xpm[]);<P +></P +></DIV +><P +>This takes a list of strings as its parameter.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2392" +></A +><CODE +CLASS="FUNCDEF" +>bool loadFromData</CODE +>(const uchar *buf, uint len, const char *format = 0, ColorMode mode = Auto);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>buf</TT +> and not passed as +a parameter.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2406" +></A +><CODE +CLASS="FUNCDEF" +>bool loadFromData</CODE +>(const uchar *buf, uint len, const char *format, int conversion_flags);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2418" +>QPixmapCache (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPixmapCache</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2422" +>QPair<type,type> (Qt v3+)</A +></H3 +><P +>Types based on the <TT +CLASS="LITERAL" +>QPair</TT +> template are automatically +converted to and from Python tuples of two elements.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2426" +>QPen</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPen</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2432" +>QPicture</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2434" +></A +><CODE +CLASS="FUNCDEF" +>const char *data</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2439" +></A +><CODE +CLASS="FUNCDEF" +>void setData</CODE +>(const char *data, uint size);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>size</TT +> is derived from <TT +CLASS="LITERAL" +>data</TT +> and not passed +as a parameter.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2449" +>QPlatinumStyle (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2451" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2470" +>QPoint</A +></H3 +><P +>The Python +<TT +CLASS="LITERAL" +>+</TT +>, <TT +CLASS="LITERAL" +>+=</TT +>, +<TT +CLASS="LITERAL" +>-</TT +>, <TT +CLASS="LITERAL" +>-=</TT +>, unary <TT +CLASS="LITERAL" +>-</TT +>, +<TT +CLASS="LITERAL" +>*</TT +>, <TT +CLASS="LITERAL" +>*=</TT +>, +<TT +CLASS="LITERAL" +>/</TT +>, <TT +CLASS="LITERAL" +>/=</TT +>, +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +> and <TT +CLASS="LITERAL" +>__nonzero__</TT +> +operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2485" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rx</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2490" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &ry</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2495" +>QPointArray</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2497" +></A +><CODE +CLASS="FUNCDEF" +>QPointArray</CODE +>(int nPoints, const QCOORD *points);<P +></P +></DIV +><P +>This takes a single parameter which is a list of points.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2505" +></A +><CODE +CLASS="FUNCDEF" +>void point</CODE +>(uint i, int *x, int *y);<P +></P +></DIV +><P +>This takes the single parameter <TT +CLASS="LITERAL" +>i</TT +> and returns the +<TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> values as a tuple.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2518" +></A +><CODE +CLASS="FUNCDEF" +>bool putPoints</CODE +>(int index, int nPoints, const QCOORD *points);<P +></P +></DIV +><P +>This takes two parameters, <TT +CLASS="LITERAL" +>index</TT +> and a list of points.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2529" +></A +><CODE +CLASS="FUNCDEF" +>bool putPoints</CODE +>(int index, int nPoints, int firstx, int firsty, ...);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2542" +></A +><CODE +CLASS="FUNCDEF" +>bool setPoints</CODE +>(int nPoints, const QCOORD *points);<P +></P +></DIV +><P +>This takes a single parameter which is a list of points.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2550" +></A +><CODE +CLASS="FUNCDEF" +>bool setPoints</CODE +>(int nPoints, int firstx, int firsty, ...);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2561" +>QPopupMenu</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2563" +></A +><CODE +CLASS="FUNCDEF" +>int exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2569" +></A +><CODE +CLASS="FUNCDEF" +>int exec</CODE +>(const QPoint &pos, int indexAtPoint = 0);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2578" +>QPrintDialog (X11)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPrintDialog</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2582" +>QPrinter</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPrinter</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2586" +>QProcess (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QProcess</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2590" +>QProgressBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QProgressBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2594" +>QProgressDialog</A +></H3 +><P +><TT +CLASS="LITERAL" +>QProgressDialog</TT +> is fully implemented. +value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2598" +>QPtrList<type> (Qt v3+)</A +></H3 +><P +>Types based on the <TT +CLASS="LITERAL" +>QPtrList</TT +> template are automatically +converted to and from Python lists of the type.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2602" +>QPushButton</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPushButton</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2606" +>QRadioButton</A +></H3 +><P +><TT +CLASS="LITERAL" +>QRadioButton</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2610" +>QRangeControl</A +></H3 +><P +><TT +CLASS="LITERAL" +>QRangeControl</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2614" +>QRect</A +></H3 +><P +>The Python +<TT +CLASS="LITERAL" +>&</TT +>, <TT +CLASS="LITERAL" +>&=</TT +>, +<TT +CLASS="LITERAL" +>|</TT +>, <TT +CLASS="LITERAL" +>|=</TT +>, +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, <TT +CLASS="LITERAL" +>in</TT +> and +<TT +CLASS="LITERAL" +>__nonzero__</TT +> operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2625" +></A +><CODE +CLASS="FUNCDEF" +>void coords</CODE +>(int *x1, int *y1, int *x2, int *y2);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple containing the four values.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2637" +></A +><CODE +CLASS="FUNCDEF" +>void rect</CODE +>(int *x, int *y, int *w, int *h);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple containing the four values.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2649" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rBottom</CODE +>();<P +></P +></DIV +><P +>Not implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2654" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rLeft</CODE +>();<P +></P +></DIV +><P +>Not implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2659" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rRight</CODE +>();<P +></P +></DIV +><P +>Not implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2664" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rTop</CODE +>();<P +></P +></DIV +><P +>Not implemented. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2669" +>QRegExp</A +></H3 +><P +>The Python <TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators are +supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2674" +></A +><CODE +CLASS="FUNCDEF" +>int match</CODE +>(const char *str, int index = 0, int *len = 0);<P +></P +></DIV +><P +>This takes <TT +CLASS="LITERAL" +>str</TT +> and <TT +CLASS="LITERAL" +>index</TT +> parameters and +returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the +<TT +CLASS="LITERAL" +>len</TT +> value. (Qt v1.x)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2688" +></A +><CODE +CLASS="FUNCDEF" +>int match</CODE +>(const QString &str, int index = 0, int *len = 0);<P +></P +></DIV +><P +>This takes <TT +CLASS="LITERAL" +>str</TT +> and <TT +CLASS="LITERAL" +>index</TT +> parameters and +returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the +<TT +CLASS="LITERAL" +>len</TT +> value. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2702" +>QRegion</A +></H3 +><P +>The Python +<TT +CLASS="LITERAL" +>|</TT +>, <TT +CLASS="LITERAL" +>|=</TT +>, +<TT +CLASS="LITERAL" +>+</TT +>, <TT +CLASS="LITERAL" +>+=</TT +>, +<TT +CLASS="LITERAL" +>&</TT +>, <TT +CLASS="LITERAL" +>&=</TT +>, +<TT +CLASS="LITERAL" +>-</TT +>, <TT +CLASS="LITERAL" +>-=</TT +>, +<TT +CLASS="LITERAL" +>^</TT +>, <TT +CLASS="LITERAL" +>^=</TT +>, +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +>, <TT +CLASS="LITERAL" +>in</TT +> and +<TT +CLASS="LITERAL" +>__nonzero__</TT +> operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2719" +></A +><CODE +CLASS="FUNCDEF" +>QArray<QRect> rects</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2724" +></A +><CODE +CLASS="FUNCDEF" +>void setRects</CODE +>(QRect *rects, int num);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2.2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2732" +>QScrollBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QScrollBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2736" +>QScrollView</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2738" +></A +><CODE +CLASS="FUNCDEF" +>void contentsToViewport</CODE +>(int x, int y, int &vx, int &vy);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> parameters and +returns a tuple containing the <TT +CLASS="LITERAL" +>vx</TT +> and <TT +CLASS="LITERAL" +>vy</TT +> +values. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2754" +></A +><CODE +CLASS="FUNCDEF" +>void viewportToContents</CODE +>(int vx, int vy, int &x, int &y);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>vx</TT +> and <TT +CLASS="LITERAL" +>vy</TT +> parameters and +returns a tuple containing the <TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> +values. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2770" +>QSemaphore (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSemaphore</TT +> is fully implemented. The <TT +CLASS="LITERAL" +>+=</TT +> +and <TT +CLASS="LITERAL" +>-=</TT +> operators have also been implemented, but require +Python v2.0 or later.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2776" +>QSemiModal (Qt v1, v2)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSemiModal</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2780" +>QSessionManager (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSessionManager</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2784" +>QSettings (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2786" +></A +><CODE +CLASS="FUNCDEF" +>bool readBoolEntry</CODE +>(const QString &key, bool def = 0, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>bool</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2799" +></A +><CODE +CLASS="FUNCDEF" +>double readDoubleEntry</CODE +>(const QString &key, double def = 0, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>double</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2812" +></A +><CODE +CLASS="FUNCDEF" +>QString readEntry</CODE +>(const QString &key, const QString &def = QString::null, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QString</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2825" +></A +><CODE +CLASS="FUNCDEF" +>QStringList readListEntry</CODE +>(const QString &key, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QStringList</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2836" +></A +><CODE +CLASS="FUNCDEF" +>QStringList readListEntry</CODE +>(const QString &key, const QChar &separator, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>QStringList</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2849" +></A +><CODE +CLASS="FUNCDEF" +>int readNumEntry</CODE +>(const QString &key, int def = 0, bool *ok = 0);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>ok</TT +> is not passed and the returned value is a tuple of +the <TT +CLASS="LITERAL" +>int</TT +> result and the <TT +CLASS="LITERAL" +>ok</TT +> flag.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2862" +></A +><CODE +CLASS="FUNCDEF" +>bool writeEntry</CODE +>(const QString &key, bool value);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2870" +>QSGIStyle (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2872" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QScrollBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2891" +>QSignalMapper</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSignalMapper</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2895" +>QSimpleRichText (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSimpleRichText</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2899" +>QSize</A +></H3 +><P +>The Python +<TT +CLASS="LITERAL" +>+</TT +>, <TT +CLASS="LITERAL" +>+=</TT +>, +<TT +CLASS="LITERAL" +>-</TT +>, <TT +CLASS="LITERAL" +>-=</TT +>, +<TT +CLASS="LITERAL" +>*</TT +>, <TT +CLASS="LITERAL" +>*=</TT +>, +<TT +CLASS="LITERAL" +>/</TT +>, <TT +CLASS="LITERAL" +>/=</TT +>, +<TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +> and <TT +CLASS="LITERAL" +>__nonzero__</TT +> +operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2913" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rheight</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2918" +></A +><CODE +CLASS="FUNCDEF" +>QCOORD &rwidth</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2923" +>QSizeGrip (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSizeGrip</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2927" +>QSizePolicy (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSizePolicy</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2931" +>QSlider</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSlider</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2935" +>QSocketNotifier</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSocketNotifier</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2939" +>QSound (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSound</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2943" +>QSpinBox</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2945" +></A +><CODE +CLASS="FUNCDEF" +>virtual int mapTextToValue</CODE +>(bool *ok);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the modified +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2953" +>QSplashScreen (Qt v3.2.0+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSplashScreen</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2957" +>QSplitter</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2959" +></A +><CODE +CLASS="FUNCDEF" +>void getRange</CODE +>(int id, int *min, int *max);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>id</TT +> parameter and returns the +<TT +CLASS="LITERAL" +>min</TT +> and <TT +CLASS="LITERAL" +>max</TT +> values as a tuple. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2972" +>QStatusBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QStatusBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2976" +>QChar (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2978" +></A +><CODE +CLASS="FUNCDEF" +>uchar &cell const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN2983" +></A +><CODE +CLASS="FUNCDEF" +>uchar &row const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN2988" +>QString</A +></H3 +><P +>A Python string object (or Unicode object) can be used whenever a +<TT +CLASS="LITERAL" +>QString</TT +> can be used. A <TT +CLASS="LITERAL" +>QString</TT +> can be +converted to a Python string object using the Python <TT +CLASS="LITERAL" +>str()</TT +> +function, and to a Python Unicode object using the Python +<TT +CLASS="LITERAL" +>unicode()</TT +> function.</P +><P +>The Python <TT +CLASS="LITERAL" +>+=</TT +>, <TT +CLASS="LITERAL" +>len</TT +>, <TT +CLASS="LITERAL" +>[]</TT +> +(for reading slices and individual characters), <TT +CLASS="LITERAL" +>in</TT +> and +comparison operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3000" +></A +><CODE +CLASS="FUNCDEF" +>QCharRef at</CODE +>(uint i);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3006" +></A +><CODE +CLASS="FUNCDEF" +>QChar constref const</CODE +>(uint i);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3012" +></A +><CODE +CLASS="FUNCDEF" +>QChar &ref</CODE +>(uint i);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3018" +></A +><CODE +CLASS="FUNCDEF" +>QString &setUnicodeCodes</CODE +>(const ushort *unicode_as_shorts, uint len);<P +></P +></DIV +><P +>Not yet implemented. (Qt v2.1+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3026" +></A +><CODE +CLASS="FUNCDEF" +>QString &sprintf</CODE +>(const char *format, ...);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3033" +></A +><CODE +CLASS="FUNCDEF" +>short toShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>short</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3041" +></A +><CODE +CLASS="FUNCDEF" +>ushort toUShort</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ushort</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3049" +></A +><CODE +CLASS="FUNCDEF" +>int toInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>int</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3057" +></A +><CODE +CLASS="FUNCDEF" +>uint toUInt</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>uint</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3065" +></A +><CODE +CLASS="FUNCDEF" +>long toLong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>long</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3073" +></A +><CODE +CLASS="FUNCDEF" +>ulong toULong</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>ulong</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3081" +></A +><CODE +CLASS="FUNCDEF" +>float toFloat</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>float</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3089" +></A +><CODE +CLASS="FUNCDEF" +>double toDouble</CODE +>(bool *ok = 0);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>double</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3097" +>QStringList (Qt v2+)</A +></H3 +><P +>The Python <TT +CLASS="LITERAL" +>len</TT +>, <TT +CLASS="LITERAL" +>[]</TT +> (for both reading and +writing slices and individual elements), <TT +CLASS="LITERAL" +>del</TT +> (for deleting +slices and individual elements), <TT +CLASS="LITERAL" +>+</TT +>, <TT +CLASS="LITERAL" +>+=</TT +>, +<TT +CLASS="LITERAL" +>*</TT +>, <TT +CLASS="LITERAL" +>*=</TT +>, <TT +CLASS="LITERAL" +>==</TT +>, +<TT +CLASS="LITERAL" +>!=</TT +> and <TT +CLASS="LITERAL" +>in</TT +> operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3110" +></A +><CODE +CLASS="FUNCDEF" +>Iterator append</CODE +>(const QString &x);<P +></P +></DIV +><P +>This does not return a value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3116" +></A +><CODE +CLASS="FUNCDEF" +>Iterator prepend</CODE +>(const QString &x);<P +></P +></DIV +><P +>This does not return a value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3122" +>QStrList</A +></H3 +><P +>This class isn't implemented. Whenever a <TT +CLASS="LITERAL" +>QStrList</TT +> is the +return type of a function or the type of an argument, a Python list of strings +is used instead.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3126" +>QStyle (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3128" +></A +><CODE +CLASS="FUNCDEF" +>virtual void getButtonShift</CODE +>(int &x, int &y);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>x</TT +> and +<TT +CLASS="LITERAL" +>y</TT +> values. (Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3138" +></A +><CODE +CLASS="FUNCDEF" +>virtual void scrollBarMetrics</CODE +>(const QScrollBar *b, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>Thus takes only the <TT +CLASS="LITERAL" +>b</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3157" +></A +><CODE +CLASS="FUNCDEF" +>virtual void tabbarMetrics</CODE +>(const QTabBar *t, int &hframe, int &vframe, int &overlap);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>t</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>hframe</TT +>, <TT +CLASS="LITERAL" +>vframe</TT +> and +<TT +CLASS="LITERAL" +>overlap</TT +> values. (Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3173" +>QStyleOption (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QStyleOption</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3177" +>QStyleSheet (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QStyleSheet</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3181" +>QStyleSheetItem (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QStyleSheetItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3185" +>QSyntaxHighlighter (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSyntaxHighlighter</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3189" +>QTab</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTab</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3193" +>QTabBar</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3195" +></A +><CODE +CLASS="FUNCDEF" +>QList<QTab> tabList</CODE +>();<P +></P +></DIV +><P +>This returns a list of <TT +CLASS="LITERAL" +>QTab</TT +> instances.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3201" +>QTabDialog</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTabDialog</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3205" +>QTableView (Qt 1.x, Qt 2.x)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3207" +></A +><CODE +CLASS="FUNCDEF" +>bool colXPos</CODE +>(int col, int *xPos);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>col</TT +> parameter and returns a tuple containing +the <TT +CLASS="LITERAL" +>bool</TT +> result and <TT +CLASS="LITERAL" +>xPos</TT +>.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3218" +></A +><CODE +CLASS="FUNCDEF" +>bool rowYPos</CODE +>(int row, int *yPos);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>row</TT +> parameter and returns a tuple containing +the <TT +CLASS="LITERAL" +>bool</TT +> result and <TT +CLASS="LITERAL" +>yPos</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3229" +>QTabWidget (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTabWidget</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3233" +>QTextBrowser (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTextBrowser</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3237" +>QTextCodec (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3239" +></A +><CODE +CLASS="FUNCDEF" +>virtual QCString fromUnicode</CODE +>(const QString &uc, int &lenInOut);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>QCString</TT +> result and the +updated <TT +CLASS="LITERAL" +>lenInOut</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3249" +>QTextDecoder (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTextDecoder</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3253" +>QTextEncoder (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3255" +></A +><CODE +CLASS="FUNCDEF" +>virtual QCString fromUnicode = 0</CODE +>(const QString &uc, int &lenInOut);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>QCString</TT +> result and the +updated <TT +CLASS="LITERAL" +>lenInOut</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3265" +>QTextEdit (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3267" +></A +><CODE +CLASS="FUNCDEF" +>int charAt</CODE +>(const QPoint &pos, int *para = 0);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>pos</TT +> parameter and returns a tuple of the +value returned via the <TT +CLASS="LITERAL" +>para</TT +> pointer and the int result.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3277" +></A +><CODE +CLASS="FUNCDEF" +>void del</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delChar</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3283" +></A +><CODE +CLASS="FUNCDEF" +>virtual bool find</CODE +>(const QString &expr, bool cs, bool wo, bool forward = TRUE, int *para = 0, int *index = 0);<P +></P +></DIV +><P +>If the <TT +CLASS="LITERAL" +>para</TT +> and <TT +CLASS="LITERAL" +>index</TT +> parameters are +omitted then the bool result is returned. If both are supplied (as integers) +then a tuple of the bool result and the modified values of +<TT +CLASS="LITERAL" +>para</TT +> and <TT +CLASS="LITERAL" +>index</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3303" +></A +><CODE +CLASS="FUNCDEF" +>void getCursorPosition</CODE +>(int *para, int *index);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the values returned via the +<TT +CLASS="LITERAL" +>para</TT +> and <TT +CLASS="LITERAL" +>index</TT +> pointers.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3313" +></A +><CODE +CLASS="FUNCDEF" +>void getSelection</CODE +>(int *paraFrom, int *indexFrom, int *paraTo, int *indexTo, int selNum = 0);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>selNum</TT +> parameter and returns a tuple of +the <TT +CLASS="LITERAL" +>paraFrom</TT +>, <TT +CLASS="LITERAL" +>indexFrom</TT +>, +<TT +CLASS="LITERAL" +>paraTo</TT +> and <TT +CLASS="LITERAL" +>indexTo</TT +> values.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3332" +>QTextStream</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3334" +></A +><CODE +CLASS="FUNCDEF" +>QTextStream</CODE +>(FILE *fp, int mode);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3342" +></A +><CODE +CLASS="FUNCDEF" +>QTextStream &readRawBytes</CODE +>(char *buf, uint len);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3350" +></A +><CODE +CLASS="FUNCDEF" +>QTextStream &writeRawBytes</CODE +>(const char *buf, uint len);<P +></P +></DIV +><P +>Not yet implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3358" +>QTextIStream (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3360" +></A +><CODE +CLASS="FUNCDEF" +>QTextIStream</CODE +>(FILE *fp, int mode);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3368" +>QTextOStream (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3370" +></A +><CODE +CLASS="FUNCDEF" +>QTextOStream</CODE +>(FILE *fp, int mode);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3378" +>QTextView (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTextView</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3382" +>QThread (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QThread</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3386" +>QTimer</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTimer</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3390" +>QToolBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QToolBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3394" +>QToolBox (Qt v3.2.0+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QToolBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3398" +>QToolButton</A +></H3 +><P +><TT +CLASS="LITERAL" +>QToolButton</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3402" +>QToolTip</A +></H3 +><P +><TT +CLASS="LITERAL" +>QToolTip</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3406" +>QToolTipGroup</A +></H3 +><P +><TT +CLASS="LITERAL" +>QToolTipGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3410" +>QTranslator (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTranslator</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3414" +>QTranslatorMessage (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTranslatorMessage</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3418" +>QUrl (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QUrl</TT +> is fully implemented, including the +<TT +CLASS="LITERAL" +>QString()</TT +>, <TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> +operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3425" +>QUrlInfo (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QUrlInfo</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3429" +>QUrlOperator (Qt v2.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3431" +></A +><CODE +CLASS="FUNCDEF" +>virtual bool isDir</CODE +>(bool *ok);<P +></P +></DIV +><P +>This returns a tuple of the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>ok</TT +> value.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3439" +>QUuid (Qt v3.0+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QUuid</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3443" +>QValidator</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3445" +></A +><CODE +CLASS="FUNCDEF" +>virtual State validate</CODE +>(QString& input, int& pos);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>State</TT +> result and the +updated <TT +CLASS="LITERAL" +>pos</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3455" +>QDoubleValidator</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3457" +></A +><CODE +CLASS="FUNCDEF" +>State validate</CODE +>(QString& input, int& pos);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>State</TT +> result and the +updated <TT +CLASS="LITERAL" +>pos</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3467" +>QIntValidator</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3469" +></A +><CODE +CLASS="FUNCDEF" +>State validate</CODE +>(QString& input, int& pos);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>State</TT +> result and the +updated <TT +CLASS="LITERAL" +>pos</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3479" +>QRegExpValidator (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3481" +></A +><CODE +CLASS="FUNCDEF" +>virtual State validate</CODE +>(QString& input, int& pos);<P +></P +></DIV +><P +>The returned value is a tuple of the <TT +CLASS="LITERAL" +>State</TT +> result and the +updated <TT +CLASS="LITERAL" +>pos</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3491" +>QValueList<type> (Qt v2+)</A +></H3 +><P +>Types based on the <TT +CLASS="LITERAL" +>QValueList</TT +> template are automatically +converted to and from Python lists of the type.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3495" +>QVariant (Qt v2.1+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3497" +></A +><CODE +CLASS="FUNCDEF" +>QVariant</CODE +>(const char *val);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3503" +></A +><CODE +CLASS="FUNCDEF" +>QVariant</CODE +>(const QBitArray &val);<P +></P +></DIV +><P +>Not yet implemented. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3509" +></A +><CODE +CLASS="FUNCDEF" +>QVariant</CODE +>(const QValueList<QVariant> &val);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3515" +></A +><CODE +CLASS="FUNCDEF" +>QVariant</CODE +>(const QMap<QString,QVariant> &val);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3521" +></A +><CODE +CLASS="FUNCDEF" +>QBitArray &asBitArray</CODE +>();<P +></P +></DIV +><P +>Not yet implemented. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3526" +></A +><CODE +CLASS="FUNCDEF" +>bool &asBool</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3531" +></A +><CODE +CLASS="FUNCDEF" +>double &asDouble</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3536" +></A +><CODE +CLASS="FUNCDEF" +>int &asInt</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3541" +></A +><CODE +CLASS="FUNCDEF" +>QValueList<QVariant> &asList</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3546" +></A +><CODE +CLASS="FUNCDEF" +>QMap<QString,QVariant> &asMap</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3551" +></A +><CODE +CLASS="FUNCDEF" +>uint &asUInt</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3556" +></A +><CODE +CLASS="FUNCDEF" +>QValueListConstIterator<QVariant>listBegin const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3561" +></A +><CODE +CLASS="FUNCDEF" +>QValueListConstIterator<QVariant>listEnd const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3566" +></A +><CODE +CLASS="FUNCDEF" +>QMapConstIterator<QString,QVariant>mapBegin const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3571" +></A +><CODE +CLASS="FUNCDEF" +>QMapConstIterator<QString,QVariant>mapEnd const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3576" +></A +><CODE +CLASS="FUNCDEF" +>QMapConstIterator<QString,QVariant>mapFind const</CODE +>(const QString &key);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3582" +></A +><CODE +CLASS="FUNCDEF" +>QValueListConstIterator<QString>stringListBegin const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3587" +></A +><CODE +CLASS="FUNCDEF" +>QValueListConstIterator<QString>stringListEnd const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3592" +></A +><CODE +CLASS="FUNCDEF" +>const QBitArray toBitArray const</CODE +>();<P +></P +></DIV +><P +>Not yet implemented. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3597" +></A +><CODE +CLASS="FUNCDEF" +>const QValueList<QVariant>toList const</CODE +>();<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3602" +></A +><CODE +CLASS="FUNCDEF" +>const QMap<QString,QVariant>toMap const</CODE +>();<P +></P +></DIV +><P +>Not yet implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3607" +>QVBox (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QVBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3611" +>QVButtonGroup (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QVButtonGroup</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3615" +>QVGroupBox (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QVGroupBox</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3619" +>QWaitCondition (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWaitCondition</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3623" +>QWhatsThis</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWhatsThis</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3627" +>QWidget</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3629" +></A +><CODE +CLASS="FUNCDEF" +>QWExtra *extraData</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3634" +></A +><CODE +CLASS="FUNCDEF" +>QFocusData *focusData</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3639" +></A +><CODE +CLASS="FUNCDEF" +>void lower</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>lowerW</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3645" +></A +><CODE +CLASS="FUNCDEF" +>void raise</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>raiseW</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3651" +>QWidgetList</A +></H3 +><P +>This class isn't implemented. Whenever a <TT +CLASS="LITERAL" +>QWidgetList</TT +> is the +return type of a function or the type of an argument, a Python list of +instances is used instead.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3655" +>QWidgetStack</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWidgetStack</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3659" +>QWindow</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWindow</TT +> is fully implemented (Qt v1.x).</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3663" +>QWindowsStyle (Qt v2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3665" +></A +><CODE +CLASS="FUNCDEF" +>void getButtonShift</CODE +>(int &x, int &y);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>x</TT +> and +<TT +CLASS="LITERAL" +>y</TT +> values. (Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3675" +></A +><CODE +CLASS="FUNCDEF" +>void scrollBarMetrics</CODE +>(const QTabBar *sb, int &sliderMin, int &sliderMax, int &sliderLength, int &buttonDim);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>sb</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>sliderMin</TT +>, <TT +CLASS="LITERAL" +>sliderMax</TT +>, +<TT +CLASS="LITERAL" +>sliderLength</TT +> and <TT +CLASS="LITERAL" +>buttonDim</TT +> values. +(Qt v2)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3694" +></A +><CODE +CLASS="FUNCDEF" +>void tabbarMetrics</CODE +>(const QTabBar *t, int &hframe, int &vframe, int &overlap);<P +></P +></DIV +><P +>This takes only the <TT +CLASS="LITERAL" +>t</TT +> parameter and returns a tuple of the +<TT +CLASS="LITERAL" +>hframe</TT +>, <TT +CLASS="LITERAL" +>vframe</TT +> and +<TT +CLASS="LITERAL" +>overlap</TT +> values. (Qt v2)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3710" +>QWindowsXPStyle (Qt v3.0.1+, Windows)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWindowsXPStyle</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3714" +>QWizard (Qt v2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWizard</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3718" +>QWMatrix</A +></H3 +><P +>The Python <TT +CLASS="LITERAL" +>==</TT +>, <TT +CLASS="LITERAL" +>!=</TT +> and +<TT +CLASS="LITERAL" +>*=</TT +> operators are supported.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3724" +></A +><CODE +CLASS="FUNCDEF" +>QWMatrix invert const</CODE +>(bool *invertible = 0);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the <TT +CLASS="LITERAL" +>QWMatrix</TT +> +result and the <TT +CLASS="LITERAL" +>invertible</TT +> value.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3732" +></A +><CODE +CLASS="FUNCDEF" +>void map const</CODE +>(int x, int y, int *tx, int *ty);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> parameters and +returns a tuple containing the <TT +CLASS="LITERAL" +>tx</TT +> and <TT +CLASS="LITERAL" +>ty</TT +> +values.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3748" +></A +><CODE +CLASS="FUNCDEF" +>void map const</CODE +>(float x, float y, float *tx, float *ty);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> parameters and +returns a tuple containing the <TT +CLASS="LITERAL" +>tx</TT +> and <TT +CLASS="LITERAL" +>ty</TT +> +values. (Qt v1.x)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3764" +></A +><CODE +CLASS="FUNCDEF" +>void map const</CODE +>(double x, double y, double *tx, double *ty);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>x</TT +> and <TT +CLASS="LITERAL" +>y</TT +> parameters and +returns a tuple containing the <TT +CLASS="LITERAL" +>tx</TT +> and <TT +CLASS="LITERAL" +>ty</TT +> +values. (Qt v2+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3780" +>QWorkspace (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWorkspace</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3784" +><TT +CLASS="LITERAL" +>qtaxcontainer</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN3787" +>QAxBase (Windows, Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3789" +></A +><CODE +CLASS="FUNCDEF" +>QAxObject</CODE +>(IUnknown *iface = 0);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3795" +></A +><CODE +CLASS="FUNCDEF" +>long queryInterface</CODE +>(const QUuid &uuid, void **iface);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3803" +></A +><CODE +CLASS="FUNCDEF" +>PropertyBag propertyBag const</CODE +>();<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3808" +></A +><CODE +CLASS="FUNCDEF" +>void setPropertyBag</CODE +>(const PropertyBag &bag);<P +></P +></DIV +><P +>Not implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3814" +></A +><CODE +CLASS="FUNCDEF" +>unsigned long registerWeakActiveObject</CODE +>(const QString &guid);<P +></P +></DIV +><P +>This is a utility method provided by PyQt to make it easier to use +Mark Hammond's <TT +CLASS="LITERAL" +>win32com</TT +> module to manipulate objects +created by the <TT +CLASS="LITERAL" +>qtaxcontainer</TT +> module.</P +><P +>The <TT +CLASS="LITERAL" +>RegisterActiveObject()</TT +> COM function is called to +register the <TT +CLASS="LITERAL" +>QAxBase</TT +> instance as a weak object with the +<TT +CLASS="LITERAL" +>guid</TT +> GUID. The revoke handle is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3826" +></A +><CODE +CLASS="FUNCDEF" +>static void revokeActiveObject</CODE +>(unsigned long rhandle);<P +></P +></DIV +><P +>This is a wrapper around the <TT +CLASS="LITERAL" +>RevokeActiveObject()</TT +> COM +function and is called to revoke the object registered using +<TT +CLASS="LITERAL" +>registerWeakActiveObject()</TT +>. <TT +CLASS="LITERAL" +>rhandle</TT +> is +the revoke handle returned by <TT +CLASS="LITERAL" +>registerWeakActiveObject()</TT +>.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3836" +>QAxObject (Windows, Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3838" +></A +><CODE +CLASS="FUNCDEF" +>QAxObject</CODE +>(IUnknown *iface, QObject *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3848" +>QAxWidget (Windows, Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3850" +></A +><CODE +CLASS="FUNCDEF" +>QAxWidget</CODE +>(IUnknown *iface, QWidget *parent = 0, const char *name = 0);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3860" +><TT +CLASS="LITERAL" +>qtcanvas</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN3863" +>QCanvas (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvas</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3867" +>QCanvasEllipse (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasEllipse</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3871" +>QCanvasItem (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3875" +>QCanvasItemList (Qt v2.2+)</A +></H3 +><P +>This class isn't implemented. Whenever a <TT +CLASS="LITERAL" +>QCanvasItemList</TT +> is +the return type of a function or the type of an argument, a Python list of +<TT +CLASS="LITERAL" +>QCanvasItem</TT +> instances is used instead.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3880" +>QCanvasLine (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasLine</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3884" +>QCanvasPixmap (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasPixmap</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3888" +>QCanvasPixmapArray (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3890" +></A +><CODE +CLASS="FUNCDEF" +>QPixmapArray</CODE +>(QList<QPixmap> pixmaps, QList<QPoint> hotspots);<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>pixmaps</TT +> argument is a Python list of QPixmap instances, +and the <TT +CLASS="LITERAL" +>hotspots</TT +> argument is a Python list of QPoint +instances. (Qt v2.2.0 - Qt v2.3.1)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3900" +></A +><CODE +CLASS="FUNCDEF" +>QPixmapArray</CODE +>(QValueList<QPixmap> pixmaps, QPointArray hotspots = QPointArray());<P +></P +></DIV +><P +>The <TT +CLASS="LITERAL" +>pixmaps</TT +> argument is a Python list of QPixmap instances. +(Qt v3+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3909" +>QCanvasPolygon (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasPolygon</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3913" +>QCanvasPolygonalItem (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasPolygonalItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3917" +>QCanvasRectangle (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasRectangle</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3921" +>QCanvasSpline (Qt v3.0+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasSpline</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3925" +>QCanvasSprite (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasSprite</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3929" +>QCanvasText (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasText</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3933" +>QCanvasView (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCanvasView</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN3937" +><TT +CLASS="LITERAL" +>qtext</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN3940" +>QextScintilla</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3942" +></A +><CODE +CLASS="FUNCDEF" +>void getCursorPosition</CODE +>(int *line, int *index);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the values returned by the +<TT +CLASS="LITERAL" +>line</TT +> and <TT +CLASS="LITERAL" +>index</TT +> pointers.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN3952" +></A +><CODE +CLASS="FUNCDEF" +>void getSelection</CODE +>(int *lineFrom, int *indexFrom, int *lineTo, int *indexTo);<P +></P +></DIV +><P +>This takes no parameters and returns a tuple of the values returned by the +<TT +CLASS="LITERAL" +>lineFrom</TT +>, <TT +CLASS="LITERAL" +>indexFrom</TT +>, +<TT +CLASS="LITERAL" +>lineTo</TT +> and <TT +CLASS="LITERAL" +>indexTo</TT +> pointers.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3968" +>QextScintillaAPIs</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaAPIs</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3972" +>QextScintillaBase</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaBase</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3976" +>QextScintillaCommand</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaCommand</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3980" +>QextScintillaCommandSet</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaCommandSet</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3984" +>QextScintillaDocument</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaDocument</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3988" +>QextScintillaLexer</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexer</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3992" +>QextScintillaLexerBash (QScintilla v1.4+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerBash</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN3996" +>QextScintillaLexerBatch (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerBatch</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4000" +>QextScintillaLexerCPP</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerCPP</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4004" +>QextScintillaLexerCSharp</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerCSharp</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4008" +>QextScintillaLexerCSS (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerCSS</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4012" +>QextScintillaLexerDiff (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerDiff</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4016" +>QextScintillaLexerHTML (QScintilla v1.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerHTML</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4020" +>QextScintillaLexerIDL</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerIDL</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4024" +>QextScintillaLexerJava</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerJava</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4028" +>QextScintillaLexerJavaScript</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerJavaScript</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4032" +>QextScintillaLexerLua (QScintilla v1.5+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerLua</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4036" +>QextScintillaLexerMakefile (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerMakefile</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4040" +>QextScintillaLexerPerl</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerPerl</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4044" +>QextScintillaLexerPOV (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerPOV</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4048" +>QextScintillaLexerProperties (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerProperties</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4052" +>QextScintillaLexerPython</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerPython</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4056" +>QextScintillaLexerRuby (QScintilla v1.5+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerRuby</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4060" +>QextScintillaLexerSQL (QScintilla v1.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerSQL</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4064" +>QextScintillaLexerTeX (QScintilla v1.6+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaLexerTeX</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4068" +>QextScintillaMacro</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaMacro</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4072" +>QextScintillaPrinter</A +></H3 +><P +><TT +CLASS="LITERAL" +>QextScintillaPrinter</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4076" +><TT +CLASS="LITERAL" +>qtgl</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4079" +>QGL</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGL</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4083" +>QGLContext</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGLContext</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4087" +>QGLFormat</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGLFormat</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4091" +>QGLWidget</A +></H3 +><P +><TT +CLASS="LITERAL" +>QGLWidget</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4095" +>QGLColormap (Qt v3.0+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4097" +></A +><CODE +CLASS="FUNCDEF" +>void setEntries</CODE +>(int count, const QRgb *colors, int base = 0);<P +></P +></DIV +><P +>Not yet implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4107" +><TT +CLASS="LITERAL" +>qtnetwork</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4110" +>QDns (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDns</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4114" +>QFtp (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4116" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readBlock</CODE +>(char *data, Q_ULONG maxlen);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>maxlen</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>None</TT +> is returned.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4127" +>QHostAddress (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4129" +></A +><CODE +CLASS="FUNCDEF" +>QHostAddress</CODE +>(Q_UINT8 *ip6Addr);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4135" +></A +><CODE +CLASS="FUNCDEF" +>QHostAddress</CODE +>(const Q_IPV6ADDR &ip6Addr);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4141" +></A +><CODE +CLASS="FUNCDEF" +>void setAddress</CODE +>(Q_UINT8 *ip6Addr);<P +></P +></DIV +><P +>Not yet implemented.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4147" +></A +><CODE +CLASS="FUNCDEF" +>Q_IPV6ADDR toIPv6Address const</CODE +>();<P +></P +></DIV +><P +>Not yet implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4153" +>QHttp (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4155" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readBlock</CODE +>(char *data, Q_ULONG maxlen);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>maxlen</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>None</TT +> is returned.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4166" +>QHttpHeader (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHttpHeader</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4170" +>QHttpRequestHeader (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHttpRequestHeader</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4174" +>QHttpResponseHeader (Qt v3.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QHttpResponseHeader</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4178" +>QLocalFs (Qt v2.1+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QLocalFs</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4182" +>QServerSocket (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QServerSocket</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4186" +>QSocket (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4188" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readBlock</CODE +>(char *data, Q_ULONG len);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>len</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>Py_None</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4199" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readLine</CODE +>(char *data, Q_ULONG maxlen);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>maxlen</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>Py_None</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4210" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG writeBlock</CODE +>(const char *data, Q_ULONG len);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>data</TT +> and not passed +as a parameter.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4220" +>QSocketDevice (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4222" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG readBlock</CODE +>(char *data, Q_ULONG len);<P +></P +></DIV +><P +>This takes a single <TT +CLASS="LITERAL" +>len</TT +> parameter. The +<TT +CLASS="LITERAL" +>data</TT +> is returned if there was no error, otherwise +<TT +CLASS="LITERAL" +>None</TT +> is returned.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4233" +></A +><CODE +CLASS="FUNCDEF" +>Q_LONG writeBlock</CODE +>(const char *data, Q_ULONG len);<P +></P +></DIV +><P +><TT +CLASS="LITERAL" +>len</TT +> is derived from <TT +CLASS="LITERAL" +>data</TT +> and not passed +as a parameter.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4243" +><TT +CLASS="LITERAL" +>qtpe</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4246" +>QPEApplication</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4248" +></A +><CODE +CLASS="FUNCDEF" +>QApplication</CODE +>(int& argc, char **argv, Type type);<P +></P +></DIV +><P +>This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4258" +></A +><CODE +CLASS="FUNCDEF" +>int exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_loop</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4264" +>AppLnk</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4266" +></A +><CODE +CLASS="FUNCDEF" +>virtual QString exec const</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_property</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4272" +>AppLnkSet</A +></H3 +><P +><TT +CLASS="LITERAL" +>AppLnkSet</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4276" +>Config</A +></H3 +><P +><TT +CLASS="LITERAL" +>Config</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4280" +>DateFormat</A +></H3 +><P +><TT +CLASS="LITERAL" +>DateFormat</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4284" +>DocLnk</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4286" +></A +><CODE +CLASS="FUNCDEF" +>QString exec const</CODE +>();<P +></P +></DIV +><P +>This has been renamed to <TT +CLASS="LITERAL" +>exec_property</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4292" +>DocLnkSet</A +></H3 +><P +><TT +CLASS="LITERAL" +>DocLnkSet</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4296" +>FileManager</A +></H3 +><P +><TT +CLASS="LITERAL" +>FileManager</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4300" +>FileSelector</A +></H3 +><P +><TT +CLASS="LITERAL" +>FileSelector</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4304" +>FileSelectorItem</A +></H3 +><P +><TT +CLASS="LITERAL" +>FileSelectorItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4308" +>FontDatabase</A +></H3 +><P +><TT +CLASS="LITERAL" +>FontDatabase</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4312" +>Global</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4314" +></A +><CODE +CLASS="FUNCDEF" +>static void setBuiltinCommands</CODE +>(Command *);<P +></P +></DIV +><P +>Not implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4319" +>MenuButton</A +></H3 +><P +><TT +CLASS="LITERAL" +>MenuButton</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4323" +>QCopEnvelope</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCopEnvelope</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4327" +>QDawg</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDawg</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4331" +>QPEMenuBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPEMenuBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4335" +>QPEToolBar</A +></H3 +><P +><TT +CLASS="LITERAL" +>QPEToolBar</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4339" +>Resource</A +></H3 +><P +><TT +CLASS="LITERAL" +>Resource</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4343" +><TT +CLASS="LITERAL" +>qtsql</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4346" +>QDataBrowser (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4348" +></A +><CODE +CLASS="FUNCDEF" +>virtual void del</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delOnCursor</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4354" +>QDataTable (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDataTable</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4358" +>QDataView (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDataView</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4362" +>QEditorFactory (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QEditorFactory</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4366" +>QSql (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSql</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4370" +>QSqlCursor (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4372" +></A +><CODE +CLASS="FUNCDEF" +>virtual int del</CODE +>(bool invalidate = TRUE);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delRecords</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4379" +></A +><CODE +CLASS="FUNCDEF" +>virtual int del</CODE +>(const QString &filter, bool invalidate = TRUE);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delRecords</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4388" +></A +><CODE +CLASS="FUNCDEF" +>bool exec</CODE +>(const QString &query);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>execQuery</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4395" +>QSqlDatabase (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4397" +></A +><CODE +CLASS="FUNCDEF" +>QSqlQuery exec</CODE +>(const QString &query = QString::null);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>execStatement</TT +> in Python.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4404" +>QSqlDriver (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlDriver</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4408" +>QSqlEditorFactory (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlEditorFactory</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4412" +>QSqlError (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlError</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4416" +>QSqlField (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlField</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4420" +>QSqlFieldInfo (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlFieldInfo</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4424" +>QSqlForm (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlForm</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4428" +>QSqlIndex (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlIndex</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4432" +>QSqlPropertyMap (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlPropertyMap</TT +> is fully implemented. However, because PyQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. This will +simple be ignored.</P +><P +>This problem may be addressed in a future release of PyQt.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4437" +>QSqlQuery (Qt v3+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4439" +></A +><CODE +CLASS="FUNCDEF" +>QMap<QString,QVariant> boundValues const</CODE +>();<P +></P +></DIV +><P +>Not yet implemented. (Qt v3.2.0+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4444" +></A +><CODE +CLASS="FUNCDEF" +>virtual bool exec</CODE +>(const QString &query);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>execQuery</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4451" +></A +><CODE +CLASS="FUNCDEF" +>bool exec</CODE +>();<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>execQuery</TT +> in Python. (Qt v3.1+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4457" +>QSqlRecord (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlRecord</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4461" +>QSqlRecordInfo (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlRecordInfo</TT +> is implemented as a Python list of +<TT +CLASS="LITERAL" +>QSqlFieldInfo</TT +> instances.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4466" +>QSqlResult (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QSqlResult</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4470" +>QSqlSelectCursor (Qt v3.2.0+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4472" +></A +><CODE +CLASS="FUNCDEF" +>int del</CODE +>(bool invalidate = TRUE);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>delRecords</TT +> in Python.</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4479" +></A +><CODE +CLASS="FUNCDEF" +>bool exec</CODE +>(const QString &query);<P +></P +></DIV +><P +>This has been renamed <TT +CLASS="LITERAL" +>execQuery</TT +> in Python.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4486" +><TT +CLASS="LITERAL" +>qttable</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4489" +>QTable (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTable</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4493" +>QTableItem (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTableItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4497" +>QCheckTableItem (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QCheckTableItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4501" +>QComboTableItem (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QComboTableItem</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4505" +>QTableSelection (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QTableSelection</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4509" +><TT +CLASS="LITERAL" +>qtui</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4512" +>QWidgetFactory (Qt v3+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QWidgetFactory</TT +> is fully implemented.</P +></DIV +></DIV +><DIV +CLASS="SECT1" +><HR><H2 +CLASS="SECT1" +><A +NAME="AEN4516" +><TT +CLASS="LITERAL" +>qtxml</TT +> Module Reference</A +></H2 +><DIV +CLASS="SECT2" +><H3 +CLASS="SECT2" +><A +NAME="AEN4519" +>QDomImplementation (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomImplementation</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4523" +>QDomNode (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomNode</TT +> is fully implemented, including the Python +<TT +CLASS="LITERAL" +>==</TT +> and <TT +CLASS="LITERAL" +>!=</TT +> operators.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4529" +>QDomNodeList (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomNodeList</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4533" +>QDomDocument (Qt v2.2+)</A +></H3 +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4535" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QCString &buffer, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>buffer</TT +> and +<TT +CLASS="LITERAL" +>namespaceProcessing</TT +> parameters and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4555" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QByteArray &buffer, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>buffer</TT +> and +<TT +CLASS="LITERAL" +>namespaceProcessing</TT +> parameters and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4575" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QString &text, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>text</TT +> and +<TT +CLASS="LITERAL" +>namespaceProcessing</TT +> parameters and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4595" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QIODevice *dev, bool namespaceProcessing, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>dev</TT +> and +<TT +CLASS="LITERAL" +>namespaceProcessing</TT +> parameters and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4615" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QCString &buffer, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>buffer</TT +> parameter only and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4632" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QByteArray &buffer, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>buffer</TT +> parameter only and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4649" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QString &text, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>text</TT +> parameter only and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4666" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(const QIODevice *dev, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>This takes the <TT +CLASS="LITERAL" +>dev</TT +> parameter only and returns a tuple +containing the <TT +CLASS="LITERAL" +>bool</TT +> result and the +<TT +CLASS="LITERAL" +>errorMsg</TT +>, <TT +CLASS="LITERAL" +>errorLine</TT +> and +<TT +CLASS="LITERAL" +>errorColumn</TT +> values. (Qt v3+)</P +><DIV +CLASS="FUNCSYNOPSIS" +><P +></P +><A +NAME="AEN4683" +></A +><CODE +CLASS="FUNCDEF" +>bool setContent</CODE +>(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg = 0, int *errorLine = 0, int *errorColumn = 0);<P +></P +></DIV +><P +>Not yet implemented. (Qt v3.2.0+)</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4697" +>QDomDocumentFragment (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomDocumentFragment</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4701" +>QDomDocumentType (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomDocumentType</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4705" +>QDomNamedNodeMap (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomNamedNodeMap</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4709" +>QDomCharacterData (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomCharacterData</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4713" +>QDomAttr (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomAttr</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4717" +>QDomElement (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomElement</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4721" +>QDomText (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomText</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4725" +>QDomComment (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomComment</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4729" +>QDomCDATASection (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomCDATASection</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4733" +>QDomNotation (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomNotation</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4737" +>QDomEntity (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomEntity</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4741" +>QDomEntityReference (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomEntityReference</TT +> is fully implemented.</P +></DIV +><DIV +CLASS="SECT2" +><HR><H3 +CLASS="SECT2" +><A +NAME="AEN4745" +>QDomProcessingInstruction (Qt v2.2+)</A +></H3 +><P +><TT +CLASS="LITERAL" +>QDomProcessingInstruction</TT +> is fully implemented.</P +></DIV +></DIV +></DIV +></BODY +></HTML +> diff --git a/python/pyqt/doc/PyQt.sgml b/python/pyqt/doc/PyQt.sgml new file mode 100644 index 00000000..62916248 --- /dev/null +++ b/python/pyqt/doc/PyQt.sgml @@ -0,0 +1,5807 @@ +<!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> +<Article> +<ArtHeader> + <Title>Python Bindings for Qt (3.17.2)</Title> + <Author> + <FirstName>Phil</FirstName> + <Surname>Thompson</Surname> + </Author> + <Abstract> + <Para> + This document describes a set of Python bindings for the Qt widget set. + Contact the author at <Email>phil@riverbankcomputing.co.uk</Email>. + </Para> + </Abstract> +</ArtHeader> + + +<Sect1><Title>Introduction</Title> +<Para> +PyQt is a set of Python bindings for the Qt toolkit and available for all +platforms supported by Qt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against Qt versions 1.43 to 3.3.6, Qt Non-commercial, Qtopia 1.5.0, and Python +versions 1.5 to 2.4.2. Qt/Embedded v3 is not supported. Qt v4 is supported +by PyQt v4. +</Para> + +<Para> +PyQt is available under the GPL license for use with the GPL version of Qt, a +a commercial license for use with the commercial version of Qt, a +non-commercial license for use with the non-commercial version of Qt v2, and an +educational license for use with the educational version of Qt. +</Para> + +<Para> +There is also an evaluation version of PyQt for Windows. This must be used +with the corresponding evaluation version of Qt. +</Para> + +<Para> +PyQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyQt. +</Para> + +<Para> +PyQt for MacOS/X requires Qt v3.1.0 or later and Python v2.3 or later. +</Para> + +<Para> +The bindings are implemented as a number of Python modules +</Para> + +<ItemizedList> +<ListItem> +<Para> +<Literal>qt</Literal> is the main module and contains the core classes and most +user interface widgets. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtaxcontainer</Literal> contains a sub-set of the classes implemented +in Qt's QAxContainer module, part of Qt's ActiveQt framework. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtcanvas</Literal> contains the classes implemented in Qt's Canvas +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtgl</Literal> contains the classes implemented in Qt's OpenGL module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtnetwork</Literal> contains the classes implemented in Qt's Network +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtpe</Literal> contains the classes implemented in Qtopia (originally +called the Qt Palmtop Environment). It is only supported with Qt/Embedded. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtsql</Literal> contains the classes implemented in Qt's SQL module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qttable</Literal> contains the classes implemented in Qt's Table +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtui</Literal> contains the classes implemented in Qt's qui library. +These allow GUIs to be created directly from Qt Designer's +<Literal>.ui</Literal> files. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtxml</Literal> contains the classes implemented in Qt's XML module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtext</Literal> contains useful third-party classes that are not part +of Qt. At the moment it contains bindings for QScintilla, the port to Qt of +the Scintilla programmer's editor class. +</Para> +</ListItem> +</ItemizedList> + +<Para> +PyQt also includes the <Literal>pyuic</Literal> and +<Literal>pylupdate</Literal> utilities which correspond to the Qt +<Literal>uic</Literal> and <Literal>lupdate</Literal> utilities. +<Literal>pyuic</Literal> converts the GUI designs created with Qt Designer to +executable Python code. <Literal>pylupdate</Literal> scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by Qt Linguist. +</Para> + +<Sect2><Title>Changes</Title> +<Para> +The changes visible to the Python programmer in this release are as follows. +</Para> +<ItemizedList> + +<ListItem> +<Para> +This version requires SIP v4.4 (or later). +</Para> +</ListItem> + +<ListItem> +<Para> +Concatenating Python strings and <Literal>QString</Literal>s is now supported. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QString</Literal> now supports the <Literal>*</Literal> and +<Literal>*=</Literal> operators that behave as they do for Python strings. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QString</Literal> is more interoperable with Python string and unicode +objects. For example they can be passed as arguments to +<Literal>open()</Literal> and to most (but not all) string methods. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QPopupMenu</Literal> (and sub-classes) instances now transfer +ownership of the menu to Python in the call to <Literal>exec_loop()</Literal>. +This means the menu's resources are all released when the Python wrapper is +garbage collected without needing to call +<Literal>QObject.deleteLater()</Literal>. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QObject.sender()</Literal> now handles Python signals. +</Para> +</ListItem> + +<ListItem> +<Para> +The missing <Literal>MacintoshVersion</Literal> enum has been added. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>PYQT_BUILD</Literal> has been removed. +</Para> +</ListItem> + +<ListItem> +<Para> +The convention for converting between a C/C++ null pointer and Python's +<Literal>None</Literal> 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 <Literal>None</Literal>. +</Para> +</ListItem> + +</ItemizedList> +</Sect2> +</Sect1> + + +<Sect1><Title>Other PyQt Goodies</Title> +<Sect2><Title>Using Qt Designer</Title> +<Para> +Qt Designer is a GPL'ed GUI design editor provided by Trolltech as part of Qt. +It generates an XML description of a GUI design. Qt includes +<Literal>uic</Literal> which generates C++ code from that XML. +</Para> + +<Para> +PyQt includes <Literal>pyuic</Literal> which generates Python code from the +same XML. The Python code is self contained and can be executed immediately. +</Para> + +<Para> +It is sometimes useful to be able to include some specific Python code in the +output generated by <Literal>pyuic</Literal>. For example, if you are using +custom widgets, <Literal>pyuic</Literal> has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +<Literal>import</Literal> statement. To help get around this, +<Literal>pyuic</Literal> will extract any lines entered in the +<Literal>Comment</Literal> field of Qt Designer's +<Literal>Form Settings</Literal> dialog that begin with +<Literal>Python:</Literal> and copies them to the generated output. +</Para> + +<Para> +Here's a simple example showing the contents of the <Literal>Comment</Literal> +field. +</Para> + +<ProgramListing> +This comment will be ignored by pyuic. +Python: +Python:# Import our custom widget. +Python:from foo import bar +</ProgramListing> + +<Para> +Here's the corresponding output from <Literal>pyuic</Literal>. +</Para> + +<ProgramListing> +from qt import * + +# Import our custom widget. +from foo import bar +</ProgramListing> + +<Para> +Thanks to Christian Bird, <Literal>pyuic</Literal> will extract Python code +entered using Qt Designer to implement slots. In Qt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation. +</Para> + +<Para> +Make sure that the <Literal>ui.h</Literal> file is in the same directory as the +<Literal>.ui</Literal> file when using <Literal>pyuic</Literal>. The +<Literal>.ui</Literal> file implies the name of the <Literal>.ui.h</Literal> +file so there is no need to specify it on the command line. +</Para> + +<Para> +Here's an example of a simple slot. +</Para> + +<ProgramListing> +void DebMainWindowFrm::browsePushButtonClicked() +{ +if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +} +</ProgramListing> + +<Para> +Here is the resulting code when <Literal>pyuic</Literal> is run. +</Para> + +<ProgramListing> +class DebMainWindowFrm(QMainWindow): + ...stuff... + def browsePushButtonClicked(self): + if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +</ProgramListing> + +<Para> +Note that indenting is as normal and that <Literal>self</Literal> and all other +parameters passed to the slot are available. +</Para> + +<Para> +If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python. +</Para> +</Sect2> + +<Sect2><Title>Using Qt Linguist</Title> +<Para> +Qt includes the <Literal>lupdate</Literal> program which parses C++ source +files converting calls to the <Literal>QT_TR_NOOP()</Literal> and +<Literal>QT_TRANSLATE_NOOP()</Literal> macros to <Literal>.ts</Literal> +language source files. The <Literal>lrelease</Literal> program is then used to +generate <Literal>.qm</Literal> binary language files that are distributed with +your application. +</Para> + +<Para> +Thanks to Detlev Offenbach, PyQt includes the <Literal>pylupdate</Literal> +program. This generates the same <Literal>.ts</Literal> language source files +from your PyQt source files. +</Para> +</Sect2> +</Sect1> + + +<Sect1><Title>Deploying Commercial PyQt Applications</Title> +<Para> +When deploying commercial PyQt applications it is necessary to discourage users +from accessing the underlying PyQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial Qt and +PyQt licenses. +</Para> + +<Para> +One solution to this problem is the +<ULink url="http://www.riverbankcomputing.co.uk/vendorid/">VendorID</ULink> +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module. +</Para> + +<Para> +In order to build PyQt with support for the VendorID package, pass the +<Literal>-i</Literal> command line flag to <Literal>configure.py</Literal>. +</Para> +</Sect1> + +<Sect1><Title><Literal>pyqtconfig</Literal> and Build System Support</Title> +<Para> +The SIP build system (ie. the <Literal>sipconfig</Literal> module) is described +in the SIP documentation. PyQt includes the <Literal>pyqtconfig</Literal> +module that can be used by configuration scripts of other bindings that are +built on top of PyQt. +</Para> + +<Para> +The <Literal>pyqtconfig</Literal> module contains the following classes: +</Para> + +<VariableList> +<VarListEntry> +<Term><Literal>Configuration(sipconfig.Configuration)</Literal></Term> +<ListItem> +<Para> +This class encapsulates additional configuration values, specific to PyQt, that +can be accessed as instance variables. +</Para> + +<Para> +The following configuration values are provided (in addition to those provided +by the <Literal>sipconfig.Configuration</Literal> class): +</Para> +<VariableList> + +<VarListEntry> +<Term><Literal>pyqt_bin_dir</Literal></Term> +<ListItem> +<Para> +The name of the directory containing the <Literal>pyuic</Literal> and +<Literal>pylupdate</Literal> executables. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_config_args</Literal></Term> +<ListItem> +<Para> +The command line passed to <Literal>configure.py</Literal> when PyQt was +configured. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_mod_dir</Literal></Term> +<ListItem> +<Para> +The name of the directory containing the PyQt modules. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_modules</Literal></Term> +<ListItem> +<Para> +A string containing the names of the PyQt modules that were installed. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qt_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qt</Literal> module and which should be added to those needed by any +module that imports the <Literal>qt</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtaxcontainer_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtaxcontainer</Literal> module and which should be added to those +needed by any module that imports the <Literal>qtaxcontainer</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtcanvas_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtcanvas</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtcanvas</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtext_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtext</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtext</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtgl_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtgl</Literal> module and which should be added to those needed by any +module that imports the <Literal>qtgl</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtnetwork_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtnetwork</Literal> module and which should be added to those needed +by any module that imports the <Literal>qtnetwork</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtsql_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtsql</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtsql</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qttable_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qttable</Literal> module and which should be added to those needed by +any module that imports the <Literal>qttable</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtui_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtui</Literal> module and which should be added to those needed by any +module that imports the <Literal>qtui</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtxml_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtxml</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtxml</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_sip_dir</Literal></Term> +<ListItem> +<Para> +The name of the base directory where the <Literal>.sip</Literal> files for each +of the PyQt modules is installed. A sub-directory exists with the same name as +the module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_version</Literal></Term> +<ListItem> +<Para> +The PyQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +<Literal>0x030a00</Literal>). +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_version_str</Literal></Term> +<ListItem> +<Para> +The PyQt version as a string. For development snapshots it will start with +<Literal>snapshot-</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtModuleMakefile(sipconfig.SIPModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qt</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtAxContainerModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtaxcontainer</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtCanvasModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtcanvas</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtExtModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtext</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtGLModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtgl</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtNetworkModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtnetwork</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtTableModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qttable</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtSQLModuleMakefile(QtTableModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtsql</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtUIModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtui</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtXMLModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtxml</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +</VariableList> +</Sect1> +<Sect1><Title>Things to be Aware Of</Title> +<Sect2><Title>super and Wrapped Classes</Title> +<Para> +Internally PyQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyQt. +</Para> + +<Para> +In most circumstances this technique is transparent to an application. The +exception is when <Literal>super</Literal> is used with a PyQt class. The way +that <Literal>super</Literal> is currently implemented means that the lazy +lookup is bypassed resulting in <Literal>AttributeError</Literal> exceptions +unless the attribute has been previously referenced. +</Para> + +<Para> +Note that this restriction applies to any class wrapped by SIP and not just +PyQt. +</Para> +</Sect2> + + +<Sect2><Title>Python Strings, Qt Strings and Unicode</Title> +<Para> +Unicode support was added to Qt in v2.0 and to Python in v1.6. In Qt, Unicode +support is implemented using the <Literal>QString</Literal> class. It is +important to understand that <Literal>QString</Literal>s, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in almost all cases and easy to achieve manually when needed. +</Para> + +<Para> +Whenever PyQt expects a <Literal>QString</Literal> as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyQt will do the necessary conversion automatically. +</Para> + +<Para> +You may also manually convert Python string and Unicode objects to +<Literal>QString</Literal>s by using the <Literal>QString</Literal> constructor +as demonstrated in the following code fragment. +</Para> + +<ProgramListing> +qs1 = QString('Converted Python string object') +qs2 = QString(u'Converted Python Unicode object') +</ProgramListing> + +<Para> +In order to convert a <Literal>QString</Literal> to a Python string object use +the Python <Literal>str()</Literal> function. Applying +<Literal>str()</Literal> to a null <Literal>QString</Literal> and an empty +<Literal>QString</Literal> both result in an empty Python string object. +</Para> + +<Para> +In order to convert a <Literal>QString</Literal> to a Python Unicode object use +the Python <Literal>unicode()</Literal> function. Applying +<Literal>unicode()</Literal> to a null <Literal>QString</Literal> and an empty +<Literal>QString</Literal> both result in an empty Python Unicode object. +</Para> +</Sect2> + +<Sect2><Title>Access to Protected Member Functions</Title> +<Para> +When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called. +</Para> +</Sect2> + +<Sect2><Title><Literal>None</Literal> and <Literal>NULL</Literal></Title> +<Para> +Throughout the bindings, the <Literal>None</Literal> value can be specified +wherever <Literal>NULL</Literal> is acceptable to the underlying C++ code. +</Para> + +<Para> +Equally, <Literal>NULL</Literal> is converted to <Literal>None</Literal> +whenever it is returned by the underlying C++ code. +</Para> +</Sect2> + + +<Sect2><Title>Support for C++ <Literal>void *</Literal> Data Types</Title> +<Para> +PyQt represents <Literal>void *</Literal> values as objects of type +<Literal>sip.voidptr</Literal>. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a <Literal>sip.voidptr</Literal> is expected. +</Para> +<Para> +A <Literal>sip.voidptr</Literal> may be converted to a Python integer by using +the <Literal>int()</Literal> builtin function. +</Para> +<Para> +A <Literal>sip.voidptr</Literal> may be converted to a Python string by using +its <Literal>asstring()</Literal> method. The <Literal>asstring()</Literal> +method takes an integer argument which is the length of the data in bytes. +</Para> +</Sect2> + + +<Sect2><Title>Support for Threads</Title> +<Para> +PyQt implements the full set of Qt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyQt does not impose any additional restrictions. +(Read the relevant part of the Qt documentation to understand the restrictions +imposed by the Qt API.) +</Para> +<Para> +If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules. +</Para> +<ItemizedList> +<ListItem> +<Para> +If you use the Qt API then the very first <Literal>import</Literal> of one of +the PyQt modules must be done from the main thread. +</Para> +</ListItem> +<ListItem> +<Para> +If you use the Python API then all calls to PyQt (including any +<Literal>import</Literal>s) must be done from one thread only. Therefore, if +you want to make calls to PyQt from several threads then you must use the Qt +API. +</Para> +</ListItem> +<ListItem> +<Para> +If you want to use both APIs in the same application then all calls to PyQt +must be done from threads created using the Qt API. +</Para> +</ListItem> +</ItemizedList> +<Para> +The above comments actually apply to any SIP generated module, not just PyQt. +</Para> +</Sect2> + +<Sect2><Title>Garbage Collection</Title> +<Para> +C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program: +</Para> + +<ProgramListing> +c = new QColor(); +c = new QColor(); +</ProgramListing> + +<Para> +In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to <Literal>c</Literal>: +</Para> + +<ProgramListing> +c = QColor() +c = QColor() +</ProgramListing> + +<Para> +In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like: +</Para> + +<ProgramListing> +self.c1 = QColor() +self.c2 = QColor() +</ProgramListing> + +<Para> +Sometimes a Qt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a <Literal>QObject</Literal> (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects. +</Para> + +<Para> +So, in the following Python fragment, the first <Literal>QLabel</Literal> is +not destroyed when the second is assigned to <Literal>l</Literal> because the +parent <Literal>QWidget</Literal> still has a reference to it. +</Para> + +<ProgramListing> +p = QWidget() +l = QLabel('First label',p) +l = QLabel('Second label',p) +</ProgramListing> +</Sect2> + +<Sect2><Title>C++ Variables</Title> +<Para> +Access to C++ variables is supported. They are accessed as Python instance +variables. For example: +</Para> + +<ProgramListing> +tab = QTab() +tab.label = "First Tab" +tab.r = QRect(10,10,75,30) +</ProgramListing> + +<Para> +Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future. +</Para> + +<Para> +Access to protected C++ class variables is not supported. This may change in +the future. +</Para> +</Sect2> + +<Sect2><Title>Multiple Inheritance</Title> +<Para> +It is not possible to define a new Python class that sub-classes from more than +one Qt class. +</Para> +</Sect2> + +<Sect2><Title>i18n Support</Title> +<Para> +Qt implements i18n support through the Qt Linguist application, the +<Literal>QTranslator</Literal> class, and the +<Literal>QApplication::translate()</Literal>, <Literal>QObject::tr()</Literal> +and <Literal>QObject::trUtf8()</Literal> methods. Usually the +<Literal>tr()</Literal> method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. <Literal>tr()</Literal> is actually +generated by <Literal>moc</Literal> and uses the hardcoded class name as the +context. On the other hand, <Literal>QApplication::translate()</Literal> +allows to context to be explicitly stated. +</Para> + +<Para> +Unfortunately, because of the way Qt implents <Literal>tr()</Literal> (and +<Literal>trUtf8()</Literal>) it is not possible for PyQt to exactly reproduce +its behavour. The PyQt implementation of <Literal>tr()</Literal> (and +<Literal>trUtf8()</Literal>) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyQt, but is hardcoded in Qt. In other +words, the context of a translation may change depending on an instance's class +hierarchy. +</Para> + +<ProgramListing> +class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return self.tr("Hello") + +class B(A): + def __init__(self): + A.__init__(self) + +a = A() +a.hello() + +b = B() +b.hello() +</ProgramListing> + +<Para> +In the above the message is translated by <Literal>a.hello()</Literal> using a +context of <Literal>A</Literal>, and by <Literal>b.hello()</Literal> using a +context of <Literal>B</Literal>. In the equivalent C++ version the context +would be <Literal>A</Literal> in both cases. +</Para> + +<Para> +The PyQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that <Literal>QApplication.translate()</Literal> be used in +preference to <Literal>tr()</Literal> (and <Literal>trUtf8()</Literal>). This +is guaranteed to work with current and future versions of PyQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of <Literal>A</Literal> that uses +<Literal>QApplication.translate()</Literal>. +</Para> + +<ProgramListing> +class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return qApp.translate("A","Hello") +</ProgramListing> + +<Para> +Note that the code generated by <Literal>pyuic</Literal> uses +<Literal>QApplication.translate()</Literal>. +</Para> +</Sect2> +</Sect1> + + +<Sect1><Title>Signal and Slot Support</Title> +<Para> +A signal may be either a Qt signal (specified using +<Literal>SIGNAL()</Literal>) or a Python signal (specified using +<Literal>PYSIGNAL()</Literal>). +</Para> + +<Para> +A slot can be either a Python callable object, a Qt signal (specified using +<Literal>SIGNAL()</Literal>), a Python signal (specified using +<Literal>PYSIGNAL()</Literal>), or a Qt slot (specified using +<Literal>SLOT()</Literal>). +</Para> + +<Para> +You connect signals to slots (and other signals) as you would from C++. For +example: +</Para> + +<ProgramListing> +QObject.connect(a,SIGNAL("QtSig()"),pyFunction) +QObject.connect(a,SIGNAL("QtSig()"),pyClass.pyMethod) +QObject.connect(a,SIGNAL("QtSig()"),PYSIGNAL("PySig")) +QObject.connect(a,SIGNAL("QtSig()"),SLOT("QtSlot()")) +QObject.connect(a,PYSIGNAL("PySig"),pyFunction) +QObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +QObject.connect(a,PYSIGNAL("PySig"),SIGNAL("QtSig()")) +QObject.connect(a,PYSIGNAL("PySig"),SLOT("QtSlot()")) +</ProgramListing> + +<Para> +When a slot is a Python method that corresponds to a Qt slot then a signal can +be connected to either the Python method or the Qt slot. The following +connections achieve the same effect. +</Para> + +<ProgramListing> +sbar = QScrollBar() +lcd = QLCDNumber() + +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) +</ProgramListing> + +<Para> +The difference is that the second connection is made at the C++ level and is +more efficient. +</Para> + +<Para> +Disconnecting signals works in exactly the same way. +</Para> + +<Para> +Any instance of a class that is derived from the <Literal>QObject</Literal> +class can emit a signal using the <Literal>emit</Literal> method. This takes +two arguments. The first is the Python or Qt signal, the second is a Python +tuple which are the arguments to the signal. For example: +</Para> + +<ProgramListing> +a.emit(SIGNAL("clicked()"),()) +a.emit(PYSIGNAL("pySig"),("Hello","World")) +</ProgramListing> + +<Para> +Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected. +</Para> + +<Para> +Qt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way. +</Para> +</Sect1> + + +<Sect1><Title>Static Member Functions</Title> +<Para> +Static member functions are implemented as Python class functions. +For example the C++ static member function +<Literal>QObject::connect()</Literal> is called from Python as +<Literal>QObject.connect()</Literal> or <Literal>self.connect()</Literal> if +called from a sub-class of <Literal>QObject</Literal>. +</Para> +</Sect1> + + +<Sect1><Title>Enumerated Types</Title> +<Para> +Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values. +</Para> + +<Para> +When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example: +</Para> + +<ProgramListing> +Qt.SolidPattern +QWidget.TabFocus +QFrame.TabFocus +</ProgramListing> +</Sect1> + + +<Sect1><Title>Module Reference Documentation</Title> +<Para> +The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here. +</Para> + +<Para> +In these sections, <Emphasis>Not yet implemented</Emphasis> +implies that the feature can be easily implemented if needed. <Emphasis>Not +implemented</Emphasis> implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate. +</Para> + +<Para> +If a class is described as being <Emphasis>fully implemented</Emphasis> then +all non-private member functions and all public class variables have been +implemented. +</Para> + +<Para> +If an operator has been implemented then it is stated explicitly. +</Para> + +<Para> +Classes that are not mentioned have not yet been implemented. +</Para> +</Sect1> + + +<Sect1><Title><Literal>qt</Literal> Module Reference</Title> +<Sect2><Title>Qt Constants</Title> +<Para> +All constant values defined by Qt have equivalent constants defined to Python. +</Para> +</Sect2> +<Sect2><Title>Qt (Qt v2+)</Title> +<Para> +<Literal>Qt</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QAccel</Title> +<Para> +<Literal>QAccel</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QAction (Qt v2.2+)</Title> +<Para> +<Literal>QAction</Literal> is fully implemented. +</Para> + +</Sect2> +<Sect2><Title>QActionGroup (Qt v2.2+)</Title> +<Para> +<Literal>QActionGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QApplication</Title> +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes one parameter which is a list of argument strings. Arguments +used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>bool <Parameter>GUIenabled</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>Type <Parameter>type</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. (Qt v2.2+) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QAssistantClient (Qt v3.1+)</Title> +<Para> +<Literal>QAssistantClient</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QBitmap</Title> +<Para> +<Literal>QBitmap</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QBrush</Title> +<Para> +<Literal>QBrush</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +<Sect2><Title>QButton</Title> +<Para> +<Literal>QButton</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QButtonGroup</Title> +<Para> +<Literal>QButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QByteArray</Title> +<Para> +A Python string can be used whenever a <Literal>QByteArray</Literal> can be +used. A <Literal>QByteArray</Literal> can be converted to a Python string +using the Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>QByteArray &<Function>assign</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>char &<Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>contains</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>fill</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>int <Parameter>size</Parameter> = -1</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>find</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>uint <Parameter>i</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>resetRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QByteArray &<Function>setRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QCDEStyle (Qt v2+)</Title> +<Para> +<Literal>QCDEStyle</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QCheckBox</Title> +<Para> +<Literal>QCheckBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QClipboard</Title> +<FuncSynopsis> + <FuncDef>void *<Function>data</Function> const</FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (Qt v1.x). +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>void *<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (Qt v1.x). +</Para> +</Sect2> +<Sect2><Title>QColor</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getHsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getRgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>hsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> +</Sect2> +<Sect2><Title>QColorDialog (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>static QRgb <Function>getRgba</Function></FuncDef> + <ParamDef>QRgb <Parameter>initial</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>initial</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>QRgb</Literal> result and the <Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QColorGroup</Title> +<Para> +<Literal>QColorGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QComboBox</Title> +<Para> +<Literal>QComboBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QCommonStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +<Sect2><Title>QCString (Qt v2+)</Title> +<Para> +A Python string can be used whenever a <Literal>QCString</Literal> can be used. +A <Literal>QCString</Literal> can be converted to a Python string using the +Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>QCString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QCursor</Title> +<Para> +<Literal>QCursor</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDataStream</Title> +<FuncSynopsis> + <FuncDef>QDataStream &<Function>readBytes</Function></FuncDef> + <ParamDef>const char *&<Parameter>s</Parameter></ParamDef> + <ParamDef>uint &<Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters. The <Literal>QDataStream</Literal> result and the +data read are returned as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>l</Literal> parameter. The +<Literal>QDataStream</Literal> result and the data read are returned as a +tuple. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>writeBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> +</Sect2> +<Sect2><Title>QDate</Title> +<Para> +The Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>weekNumber</Function></FuncDef> + <ParamDef>int *<Parameter>yearNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the week number and the year number as a +tuple. (Qt v3.1+) +</Para> +</Sect2> + +<Sect2><Title>QDateTime</Title> +<Para> +<Literal>QDateTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> + +<Sect2><Title>QTime</Title> +<Para> +<Literal>QTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> +<Sect2><Title>QDateEdit (Qt v3+)</Title> +<Para> +<Literal>QDateEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTimeEdit (Qt v3+)</Title> +<Para> +<Literal>QTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDateTimeEdit (Qt v3+)</Title> +<Para> +<Literal>QDateTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDesktopWidget (Qt v3+)</Title> +<Para> +<Literal>QDesktopWidget</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDial (Qt v2.2+)</Title> +<Para> +<Literal>QDial</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDialog</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ dialog to be transfered +to Python. This means that the C++ dialog will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the dialog is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +<Sect2><Title>QDir</Title> +<Para> +<Literal>QDir</Literal> is fully implemented, including the Python +<Literal>len</Literal>, <Literal>[]</Literal> (for reading slices and +individual elements), <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>in</Literal> operators +</Para> +</Sect2> + +<Sect2><Title>QFileInfoList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QFileInfoList</Literal> is +the return type of a function or the type of an argument, a Python list of +<Literal>QFileInfo</Literal> instances is used instead. +</Para> +</Sect2> +<Sect2><Title>QDockArea (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>hasDockWindow</Function> const</FuncDef> + <ParamDef>QDockWindow *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns the index of the +QDockWIndow or -1 if the QDockArea does not contain the QDockWindow. +</Para> +</Sect2> +<Sect2><Title>QDockWindow (Qt v3+)</Title> +<Para> +<Literal>QDockWindow</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QColorDrag (Qt v2.1+)</Title> +<Para> +<Literal>QColorDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragObject</Title> +<Para> +<Literal>QDragObject</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QImageDrag</Title> +<Para> +<Literal>QImageDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QStoredDrag</Title> +<Para> +<Literal>QStoredDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextDrag</Title> +<Para> +<Literal>QTextDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QUriDrag (Qt v2+)</Title> +<Para> +<Literal>QUriDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QUrlDrag (Qt v1.x)</Title> +<Para> +<Literal>QUrlDrag</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDropSite</Title> +<Para> +<Literal>QDropSite</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QErrorMessage (Qt v3+)</Title> +<Para> +<Literal>QErrorMessage</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QEvent</Title> +<Para> +<Literal>QEvent</Literal> is fully implemented. +</Para> +<Para> +Instances of <Literal>QEvent</Literal>s are automatically converted to the +correct sub-class. +</Para> +</Sect2> + +<Sect2><Title>QChildEvent</Title> +<Para> +<Literal>QChildEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCloseEvent</Title> +<Para> +<Literal>QCloseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDragEvent (Qt v3.3+)</Title> +<Para> +<Literal>QIconDragEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QContextMenuEvent (Qt v3+)</Title> +<Para> +<Literal>QContextMenuEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCustomEvent</Title> +<Para> +<Literal>QCustomEvent</Literal> is fully implemented. Any Python object can be +passed as the event data and its reference count is increased. +</Para> +</Sect2> + +<Sect2><Title>QDragEnterEvent</Title> +<Para> +<Literal>QDragEnterEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragLeaveEvent</Title> +<Para> +<Literal>QDragLeaveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragMoveEvent</Title> +<Para> +<Literal>QDragMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDropEvent</Title> +<Para> +<Literal>QDropEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFocusEvent</Title> +<Para> +<Literal>QFocusEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHideEvent</Title> +<Para> +<Literal>QHideEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIMComposeEvent (Qt v3.1+)</Title> +<Para> +<Literal>QIMComposeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIMEvent (Qt v3+)</Title> +<Para> +<Literal>QIMEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QKeyEvent</Title> +<Para> +<Literal>QKeyEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMouseEvent</Title> +<Para> +<Literal>QMouseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMoveEvent</Title> +<Para> +<Literal>QMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPaintEvent</Title> +<Para> +<Literal>QPaintEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QResizeEvent</Title> +<Para> +<Literal>QResizeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QShowEvent</Title> +<Para> +<Literal>QShowEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTabletEvent (Qt v3+)</Title> +<Para> +<Literal>QTabletEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTimerEvent</Title> +<Para> +<Literal>QTimerEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWheelEvent (Qt v2+)</Title> +<Para> +<Literal>QWheelEvent</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QEventLoop (Qt v3.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QFile</Title> +<FuncSynopsis> + <FuncDef>bool <Function>open</Function></FuncDef> + <ParamDef>int <Parameter>m</Parameter></ParamDef> + <ParamDef>FILE *<Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readLine</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setDecodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setEncodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +<Sect2><Title>QFileDialog</Title> +<Para> +<Literal>QFileDialog</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFileIconProvider</Title> +<Para> +<Literal>QFileIconProvider</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFilePreview</Title> +<Para> +<Literal>QFilePreview</Literal> is fully implemented. However it cannot be +used from Python in the same way as it is used from C++ because PyQt does not +support multiple inheritance involving more than one wrapped class. A trick +that seems to work is to use composition rather than inheritance as in the +following code fragment. +</Para> +<ProgramListing> +class FilePreview(QFilePreview): + pass + +class Preview(QLabel): + def __init__(self, parent=None): + QLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl +</ProgramListing> +<Para> +Note that QFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick. +</Para> +</Sect2> +<Sect2><Title>QFileInfo</Title> +<Para> +<Literal>QFileInfo</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QFont</Title> +<Para> +<Literal>QFont</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +<Sect2><Title>QFontDatabase (Qt v2.1+)</Title> +<Para> +<Literal>QFontDatabase</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QFontDialog (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>static QFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>const QFont &<Parameter>def</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>def</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>QFont</Literal> result and the <Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>static QFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>parent</Literal> and <Literal>name</Literal> parameters +and returns a tuple containing the <Literal>QFont</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QFontInfo</Title> +<Para> +<Literal>QFontInfo</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QFontMetrics</Title> +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> + +<FuncSynopsis> + <FuncDef>QSize <Function>size</Function></FuncDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> +</Sect2> +<Sect2><Title>QFrame</Title> +<Para> +<Literal>QFrame</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QGManager (Qt v1.x)</Title> +<Para> +<Literal>QGManager</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QChain (Qt v1.x)</Title> +<Para> +<Literal>QChain</Literal> is implemented as an opaque class. +</Para> +</Sect2> +<Sect2><Title>QGrid (Qt v2+)</Title> +<Para> +<Literal>QGrid</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QGridView (Qt v3+)</Title> +<Para> +<Literal>QGridView</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QGroupBox</Title> +<Para> +<Literal>QGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QHBox (Qt v2+)</Title> +<Para> +<Literal>QHBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QHButtonGroup (Qt v2+)</Title> +<Para> +<Literal>QHButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QHeader</Title> +<Para> +<Literal>QHeader</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QHGroupBox (Qt v2+)</Title> +<Para> +<Literal>QHGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QIconSet</Title> +<Para> +<Literal>QIconSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconFactory (Qt v3.1+)</Title> +<Para> +<Literal>QIconFactory</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QIconView (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>QIconViewItem *<Function>makeRowLayout</Function></FuncDef> + <ParamDef>QIconViewItem *<Parameter>begin</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconViewItem (Qt v2.1+)</Title> +<Para> +<Literal>QIconViewItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDrag (Qt v2.1+)</Title> +<Para> +<Literal>QIconDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDragItem (Qt v2.1+)</Title> +<Para> +<Literal>QIconDragItem</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QImage</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QImage</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QImage</Function></FuncDef> + <ParamDef>uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>depth</Parameter></ParamDef> + <ParamDef>QRgb *<Parameter>colorTable</Parameter></ParamDef> + <ParamDef>int <Parameter>numColors</Parameter></ParamDef> + <ParamDef>Endian <Parameter>bitOrder</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The <Literal>colorTable</Literal> parameter is a list of QRgb instances or +None. (Qt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>bits</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>QRgb *<Function>colorTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>QImage <Function>convertDepthWithPalette</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>QRgb *<Parameter>p</Parameter></ParamDef> + <ParamDef>int <Parameter>pc</Parameter></ParamDef> + <ParamDef>int <Parameter>cf</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar **<Function>jumpTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>scanLine</Function></FuncDef> + <ParamDef>int <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> +</Sect2> + +<Sect2><Title>QImageIO</Title> +<FuncSynopsis> + <FuncDef>static void <Function>defineIOHandler</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>const char *<Parameter>header</Parameter></ParamDef> + <ParamDef>const char *<Parameter>flags</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>read_image</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>write_image</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QImageTextKeyLang</Title> +<Para> +<Literal>QImageTextKeyLang</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QInputDialog (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v2.1 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>QLineEdit::EchoMode<Parameter>echo</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v2.2 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>QLineEdit::EchoMode<Parameter>echo</Parameter> = QLineEdit::Normal</ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>static int <Function>getInteger</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>int <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>int <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static double <Function>getDouble</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>double <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>double <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>double <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getItem</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const QStringList &<Parameter>list</Parameter></ParamDef> + <ParamDef>int <Parameter>current</Parameter> = 0</ParamDef> + <ParamDef>bool <Parameter>editable</Parameter> = TRUE</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +</Para> +</Sect2> +<Sect2><Title>QInterlaceStyle (Qt v2.3.1+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +</Para> +</Sect2> +<Sect2><Title>QIODevice</Title> +<Para> +<Literal>QIODevice</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QKeySequence (Qt v3+)</Title> +<Para> +<Literal>QKeySequence</Literal> is fully implemented including the operators +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>QString()</Literal> and +<Literal>int()</Literal>. A <Literal>QString</Literal> instance or a Python +integer may be used whenever a <Literal>QKeySequence</Literal> can be used. +</Para> +</Sect2> +<Sect2><Title>QLabel</Title> +<Para> +<Literal>QLabel</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLayout</Title> +<Para> +<Literal>QLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QBoxLayout</Title> +<Para> +<Literal>QBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLayoutIterator (Qt v2+)</Title> +<Para> +<Literal>QGLayoutIterator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGridLayout</Title> +<FuncSynopsis> + <FuncDef>bool <Function>findWidget</Function></FuncDef> + <ParamDef>QWidget *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>row</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result, <Literal>row</Literal> and +<Literal>col</Literal>. (Qt v2+) +</Para> +</Sect2> + +<Sect2><Title>QHBoxLayout</Title> +<Para> +<Literal>QHBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QLayoutItem (Qt v2+)</Title> +<Para> +<Literal>QLayoutItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QLayoutIterator (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>QLayoutItem *<Function>next</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This is a wrapper around the <Literal>QLayoutIterator</Literal> +<Literal>++</Literal> operator. +</Para> +</Sect2> + +<Sect2><Title>QSpacerItem (Qt v2+)</Title> +<Para> +<Literal>QSpacerItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QVBoxLayout</Title> +<Para> +<Literal>QVBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWidgetItem (Qt v2+)</Title> +<Para> +<Literal>QWidgetItem</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLCDNumber</Title> +<Para> +<Literal>QLCDNumber</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLibrary (Qt v3+)</Title> +<Para> +<Literal>QLibrary</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLineEdit</Title> +<FuncSynopsis> + <FuncDef>int <Function>characterAt</Function></FuncDef> + <ParamDef>int <Parameter>xpos</Parameter></ParamDef> + <ParamDef>QChar *<Parameter>chr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>xpos</Literal> parameter and returns the int +result and the <Literal>chr</Literal> value as a tuple. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>start</Parameter></ParamDef> + <ParamDef>int *<Parameter>end</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the bool result and the +<Literal>start</Literal> and <Literal>end</Literal> values as a tuple. +(Qt v3+) +</Para> +</Sect2> +<Sect2><Title>QList<type> (Qt v2)</Title> +<Para> +Types based on the <Literal>QList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +<Sect2><Title>QListBox</Title> +<FuncSynopsis> + <FuncDef>bool <Function>itemYPos</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int *<Parameter>yPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>index</Literal> parameter and returns a tuple +containing the <Literal>bool</Literal> result and <Literal>yPos</Literal>. +(Qt v1.x) +</Para> +</Sect2> + +<Sect2><Title>QListBoxItem</Title> +<Para> +<Literal>QListBoxItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListBoxPixmap</Title> +<Para> +<Literal>QListBoxPixmap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListBoxText</Title> +<Para> +<Literal>QListBoxText</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QListView</Title> +<Para> +<Literal>QListView</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>QListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QListViewItem</Title> +<Para> +<Literal>QListViewItem</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>QListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QCheckListItem</Title> +<Para> +<Literal>QCheckListItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListViewItemIterator (Qt v2+)</Title> +<Para> +<Literal>QListViewItemIterator</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLocale (Qt v3.3+)</Title> +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>Q_ULONG <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QMainWindow</Title> +<FuncSynopsis> + <FuncDef>QTextStream &<Function>operator<<</Function></FuncDef> + <ParamDef>QTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>const QMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>operator>></Function></FuncDef> + <ParamDef>QTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>QMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getLocation</Function></FuncDef> + <ParamDef>QToolBar *<Parameter>tb</Parameter></ParamDef> + <ParamDef>ToolBarDock &<Parameter>dock</Parameter></ParamDef> + <ParamDef>int &<Parameter>index</Parameter></ParamDef> + <ParamDef>bool &<Parameter>nl</Parameter></ParamDef> + <ParamDef>int &<Parameter>extraOffset</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>tb</Literal> parameter and returns a tuple of the +result, <Literal>dock</Literal>, <Literal>index</Literal>, +<Literal>nl</Literal> and <Literal>extraOffset</Literal> values. (Qt v2.1.0+) +</Para> + +<FuncSynopsis> + <FuncDef>QList<QToolBar> <Function>toolBars</Function></FuncDef> + <ParamDef>ToolBarDock <Parameter>dock</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>QToolBar</Literal> instances. (Qt v2.1.0+) +</Para> +</Sect2> +<Sect2><Title>QMemArray<type> (Qt v3+)</Title> +<Para> +Types based on the <Literal>QMemArray</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +<Sect2><Title>QMenuBar</Title> +<Para> +<Literal>QMenuBar</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QMenuData</Title> +<FuncSynopsis> + <FuncDef>QMenuItem *<Function>findItem</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>QMenuData **<Parameter>parent</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QCustomMenuItem (Qt v2.1+)</Title> +<Para> +<Literal>QCustomMenuItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMenuItem</Title> +<Para> +<Literal>QMenuItem</Literal> is an internal Qt class. +</Para> +</Sect2> +<Sect2><Title>QMessageBox</Title> +<Para> +<Literal>QMessageBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QMetaObject</Title> +<FuncSynopsis> + <FuncDef>int <Function>numClassInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QClassInfo *<Function>classInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QMetaProperty</Title> +<Para> +<Literal>QMetaProperty</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QMimeSource (Qt v2+)</Title> +<Para> +<Literal>QMimeSource</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMimeSourceFactory (Qt v2+)</Title> +<Para> +<Literal>QMimeSourceFactory</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWindowsMime (Qt v3+)</Title> +<Para> +<Literal>QWindowsMime</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QMotifPlusStyle (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +<Sect2><Title>QMotifStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +<Sect2><Title>QMovie</Title> +<FuncSynopsis> + <FuncDef><Function>QMovie</Function></FuncDef> + <ParamDef>QDataSource *<Parameter>src</Parameter></ParamDef> + <ParamDef>int <Parameter>bufsize</Parameter> = 1024</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>pushData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>length</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>length</Literal> is derived from <Literal>data</Literal> and not +passed as a parameter. (Qt v2.2.0+) +</Para> +</Sect2> +<Sect2><Title>QMultiLineEdit</Title> +<FuncSynopsis> + <FuncDef>void <Function>cursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getCursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getMarkedRegion</Function></FuncDef> + <ParamDef>int *<Parameter>line1</Parameter></ParamDef> + <ParamDef>int *<Parameter>col1</Parameter></ParamDef> + <ParamDef>int *<Parameter>line2</Parameter></ParamDef> + <ParamDef>int *<Parameter>col2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the bool result and the +<Literal>line1</Literal>, <Literal>col1</Literal>, <Literal>line2</Literal> and +<Literal>col2</Literal> values. +</Para> +</Sect2> +<Sect2><Title>QMutex (Qt v2.2+)</Title> +<Para> +<Literal>QMutex</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMutexLocker (Qt v3.1+)</Title> +<Para> +<Literal>QMutexLocker</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QNetworkOperation (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkOperation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QNetworkProtocol (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkProtocol</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QNetworkProtocolFactoryBase (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkProtocolFactoryBase</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QObject</Title> +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const char *<Parameter>signal</Parameter> = 0</ParamDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>static bool <Function>disconnect</Function></FuncDef> + <ParamDef>const QObject *<Parameter>sender</Parameter></ParamDef> + <ParamDef>const char *<Parameter>signal</Parameter></ParamDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter></ParamDef> +</FuncSynopsis> +<Para> +At the moment PyQt does not support the full behaviour of the corresponding Qt +method. In particular, specifying None (ie. 0 in C++) for the +<Literal>signal</Literal> and <Literal>receiver</Literal> parameters is not yet +supported. +</Para> +</Sect2> +<Sect2><Title>QObjectCleanupHandler (Qt v3+)</Title> +<Para> +<Literal>QObjectCleanupHandler</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QObjectList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QObjectList</Literal> is the +return type of a function or the type of an argument, a Python list of +<Literal>QObject</Literal> instances is used instead. +</Para> +</Sect2> +<Sect2><Title>QPaintDeviceMetrics</Title> +<Para> +<Literal>QPaintDeviceMetrics</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QPaintDevice</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>cmd</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>QPainter *</ParamDef> + <ParamDef>QPDevCmdParam *</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QPainter</Title> +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>const QRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>QRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>const QRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>QRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setTabArray</Function></FuncDef> + <ParamDef>int *<Parameter>ta</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of tab stops. +</Para> + +<FuncSynopsis> + <FuncDef>int *<Function>tabArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of tab stops. +</Para> +</Sect2> +<Sect2><Title>QPalette</Title> +<Para> +<Literal>QPalette</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +<Sect2><Title>QPixmap</Title> +<FuncSynopsis> + <FuncDef><Function>QPixmap</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>int <Parameter>conversion_flags</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QPixmapCache (Qt v3+)</Title> +<Para> +<Literal>QPixmapCache</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QPair<type,type> (Qt v3+)</Title> +<Para> +Types based on the <Literal>QPair</Literal> template are automatically +converted to and from Python tuples of two elements. +</Para> +</Sect2> +<Sect2><Title>QPen</Title> +<Para> +<Literal>QPen</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +<Sect2><Title>QPicture</Title> +<FuncSynopsis> + <FuncDef>const char *<Function>data</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>size</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +<Sect2><Title>QPlatinumStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +<Sect2><Title>QPoint</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, unary <Literal>-</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rx</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>ry</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QPointArray</Title> +<FuncSynopsis> + <FuncDef><Function>QPointArray</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>point</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the single parameter <Literal>i</Literal> and returns the +<Literal>x</Literal> and <Literal>y</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, <Literal>index</Literal> and a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QPopupMenu</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef>const QPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int <Parameter>indexAtPoint</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +<Sect2><Title>QPrintDialog (X11)</Title> +<Para> +<Literal>QPrintDialog</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QPrinter</Title> +<Para> +<Literal>QPrinter</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QProcess (Qt v3+)</Title> +<Para> +<Literal>QProcess</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QProgressBar</Title> +<Para> +<Literal>QProgressBar</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QProgressDialog</Title> +<Para> +<Literal>QProgressDialog</Literal> is fully implemented. +value. +</Para> +</Sect2> +<Sect2><Title>QPtrList<type> (Qt v2+)</Title> +<Para> +Types based on the <Literal>QPtrList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +<Sect2><Title>QPushButton</Title> +<Para> +<Literal>QPushButton</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QRadioButton</Title> +<Para> +<Literal>QRadioButton</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QRangeControl</Title> +<Para> +<Literal>QRangeControl</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QRect</Title> +<Para> +The Python +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>coords</Function></FuncDef> + <ParamDef>int *<Parameter>x1</Parameter></ParamDef> + <ParamDef>int *<Parameter>y1</Parameter></ParamDef> + <ParamDef>int *<Parameter>x2</Parameter></ParamDef> + <ParamDef>int *<Parameter>y2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rect</Function></FuncDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rBottom</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rLeft</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rRight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rTop</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> +</Sect2> +<Sect2><Title>QRegExp</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (Qt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (Qt v2+) +</Para> +</Sect2> +<Sect2><Title>QRegion</Title> +<Para> +The Python +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>^</Literal>, <Literal>^=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QArray<QRect> <Function>rects</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setRects</Function></FuncDef> + <ParamDef>QRect *<Parameter>rects</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2.2+) +</Para> +</Sect2> +<Sect2><Title>QScrollBar</Title> +<Para> +<Literal>QScrollBar</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QScrollView</Title> +<FuncSynopsis> + <FuncDef>void <Function>contentsToViewport</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int &<Parameter>vx</Parameter></ParamDef> + <ParamDef>int &<Parameter>vy</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>vx</Literal> and <Literal>vy</Literal> +values. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>viewportToContents</Function></FuncDef> + <ParamDef>int <Parameter>vx</Parameter></ParamDef> + <ParamDef>int <Parameter>vy</Parameter></ParamDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>vx</Literal> and <Literal>vy</Literal> parameters and +returns a tuple containing the <Literal>x</Literal> and <Literal>y</Literal> +values. (Qt v2+) +</Para> +</Sect2> +<Sect2><Title>QSemaphore (Qt v2.2+)</Title> +<Para> +<Literal>QSemaphore</Literal> is fully implemented. The <Literal>+=</Literal> +and <Literal>-=</Literal> operators have also been implemented, but require +Python v2.0 or later. +</Para> +</Sect2> +<Sect2><Title>QSemiModal (Qt v1, v2)</Title> +<Para> +<Literal>QSemiModal</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSessionManager (Qt v2+)</Title> +<Para> +<Literal>QSessionManager</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSettings (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>readBoolEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>bool</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>double <Function>readDoubleEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>double <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QString <Function>readEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>def</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const QChar &<Parameter>separator</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>int <Function>readNumEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>int <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>writeEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>value</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QSGIStyle (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +<Sect2><Title>QSignalMapper</Title> +<Para> +<Literal>QSignalMapper</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSimpleRichText (Qt v2+)</Title> +<Para> +<Literal>QSimpleRichText</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSize</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rheight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rwidth</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QSizeGrip (Qt v2+)</Title> +<Para> +<Literal>QSizeGrip</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSizePolicy (Qt v2+)</Title> +<Para> +<Literal>QSizePolicy</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSlider</Title> +<Para> +<Literal>QSlider</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSocketNotifier</Title> +<Para> +<Literal>QSocketNotifier</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSound (Qt v2.2+)</Title> +<Para> +<Literal>QSound</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSpinBox</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>mapTextToValue</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the modified +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QSplashScreen (Qt v3.2.0+)</Title> +<Para> +<Literal>QSplashScreen</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSplitter</Title> +<FuncSynopsis> + <FuncDef>void <Function>getRange</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>int *<Parameter>min</Parameter></ParamDef> + <ParamDef>int *<Parameter>max</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>id</Literal> parameter and returns the +<Literal>min</Literal> and <Literal>max</Literal> values as a tuple. (Qt v2+) +</Para> +</Sect2> +<Sect2><Title>QStatusBar</Title> +<Para> +<Literal>QStatusBar</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QChar (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>uchar &<Function>cell</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar &<Function>row</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QString</Title> +<Para> +A Python string object (or Unicode object) can be used whenever a +<Literal>QString</Literal> can be used. A <Literal>QString</Literal> can be +converted to a Python string object using the Python <Literal>str()</Literal> +function, and to a Python Unicode object using the Python +<Literal>unicode()</Literal> function. +</Para> + +<Para> +The Python <Literal>+</Literal>, <Literal>+=</Literal>, <Literal>*</Literal>, +<Literal>*=</Literal>, <Literal>len</Literal>, <Literal>[]</Literal> +(for reading slices and individual characters), <Literal>in</Literal> and +comparison operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCharRef <Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QChar <Function>constref</Function> const</FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QChar &<Function>ref</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QString &<Function>setUnicodeCodes</Function></FuncDef> + <ParamDef>const ushort *<Parameter>unicode_as_shorts</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>QString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QStringList (Qt v2+)</Title> +<Para> +The Python <Literal>len</Literal>, <Literal>[]</Literal> (for both reading and +writing slices and individual elements), <Literal>del</Literal> (for deleting +slices and individual elements), <Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, <Literal>==</Literal>, +<Literal>!=</Literal> and <Literal>in</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>append</Function></FuncDef> + <ParamDef>const QString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>prepend</Function></FuncDef> + <ParamDef>const QString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> +</Sect2> +<Sect2><Title>QStrList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QStrList</Literal> is the +return type of a function or the type of an argument, a Python list of strings +is used instead. +</Para> +</Sect2> +<Sect2><Title>QStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>b</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Thus takes only the <Literal>b</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> + +<Sect2><Title>QStyleOption (Qt v3+)</Title> +<Para> +<Literal>QStyleOption</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QStyleSheet (Qt v2+)</Title> +<Para> +<Literal>QStyleSheet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QStyleSheetItem (Qt v2+)</Title> +<Para> +<Literal>QStyleSheetItem</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSyntaxHighlighter (Qt v3.1+)</Title> +<Para> +<Literal>QSyntaxHighlighter</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTab</Title> +<Para> +<Literal>QTab</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTabBar</Title> +<FuncSynopsis> + <FuncDef>QList<QTab> <Function>tabList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>QTab</Literal> instances. +</Para> +</Sect2> +<Sect2><Title>QTabDialog</Title> +<Para> +<Literal>QTabDialog</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTableView (Qt 1.x, Qt 2.x)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>colXPos</Function></FuncDef> + <ParamDef>int <Parameter>col</Parameter></ParamDef> + <ParamDef>int *<Parameter>xPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>col</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result and <Literal>xPos</Literal>. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>rowYPos</Function></FuncDef> + <ParamDef>int <Parameter>row</Parameter></ParamDef> + <ParamDef>int *<Parameter>yPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>row</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result and <Literal>yPos</Literal>. +</Para> +</Sect2> +<Sect2><Title>QTabWidget (Qt v2+)</Title> +<Para> +<Literal>QTabWidget</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTextBrowser (Qt v2+)</Title> +<Para> +<Literal>QTextBrowser</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTextCodec (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual QCString <Function>fromUnicode</Function></FuncDef> + <ParamDef>const QString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>QCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QTextDecoder (Qt v2+)</Title> +<Para> +<Literal>QTextDecoder</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextEncoder (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual QCString <Function>fromUnicode</Function> = 0</FuncDef> + <ParamDef>const QString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>QCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> +<Sect2><Title>QTextEdit (Qt v3+)</Title> +<FuncSynopsis> +<FuncDef>int <Function>charAt</Function></FuncDef> + <ParamDef>const QPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>pos</Literal> parameter and returns a tuple of the +value returned via the <Literal>para</Literal> pointer and the int result. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. +</Para> + +<FuncSynopsis> +<FuncDef>virtual bool <Function>find</Function></FuncDef> + <ParamDef>const QString &<Parameter>expr</Parameter></ParamDef> + <ParamDef>bool <Parameter>cs</Parameter></ParamDef> + <ParamDef>bool <Parameter>wo</Parameter></ParamDef> + <ParamDef>bool <Parameter>forward</Parameter> = TRUE</ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +If the <Literal>para</Literal> and <Literal>index</Literal> parameters are +omitted then the bool result is returned. If both are supplied (as integers) +then a tuple of the bool result and the modified values of +<Literal>para</Literal> and <Literal>index</Literal> is returned. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getCursorPosition</Function></FuncDef> + <ParamDef>int *<Parameter>para</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned via the +<Literal>para</Literal> and <Literal>index</Literal> pointers. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>paraFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>paraTo</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexTo</Parameter></ParamDef> + <ParamDef>int <Parameter>selNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>selNum</Literal> parameter and returns a tuple of +the <Literal>paraFrom</Literal>, <Literal>indexFrom</Literal>, +<Literal>paraTo</Literal> and <Literal>indexTo</Literal> values. +</Para> +</Sect2> +<Sect2><Title>QTextStream</Title> +<FuncSynopsis> + <FuncDef><Function>QTextStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextIStream (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QTextIStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextOStream (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QTextOStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QTextView (Qt v2+)</Title> +<Para> +<Literal>QTextView</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QThread (Qt v2.2+)</Title> +<Para> +<Literal>QThread</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTimer</Title> +<Para> +<Literal>QTimer</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QToolBar</Title> +<Para> +<Literal>QToolBar</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QToolBox (Qt v3.2.0+)</Title> +<Para> +<Literal>QToolBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QToolButton</Title> +<Para> +<Literal>QToolButton</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QToolTip</Title> +<Para> +<Literal>QToolTip</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QToolTipGroup</Title> +<Para> +<Literal>QToolTipGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QTranslator (Qt v2+)</Title> +<Para> +<Literal>QTranslator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTranslatorMessage (Qt v2.2+)</Title> +<Para> +<Literal>QTranslatorMessage</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QUrl (Qt v2.1+)</Title> +<Para> +<Literal>QUrl</Literal> is fully implemented, including the +<Literal>QString()</Literal>, <Literal>==</Literal> and <Literal>!=</Literal> +operators. +</Para> +</Sect2> +<Sect2><Title>QUrlInfo (Qt v2.1+)</Title> +<Para> +<Literal>QUrlInfo</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QUrlOperator (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>isDir</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>bool</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +<Sect2><Title>QUuid (Qt v3.0+)</Title> +<Para> +<Literal>QUuid</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QValidator</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QDoubleValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QIntValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QRegExpValidator (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> +<Sect2><Title>QValueList<type> (Qt v2+)</Title> +<Para> +Types based on the <Literal>QValueList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +<Sect2><Title>QVariant (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const char *<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QBitArray &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QValueList<QVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QMap<QString,QVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QBitArray &<Function>asBitArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool &<Function>asBool</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>double &<Function>asDouble</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int &<Function>asInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueList<QVariant> &<Function>asList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMap<QString,QVariant> &<Function>asMap</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uint &<Function>asUInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QVariant><Function>listBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QVariant><Function>listEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapFind</Function> const</FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QString><Function>stringListBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QString><Function>stringListEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QBitArray <Function>toBitArray</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>const QValueList<QVariant><Function>toList</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QMap<QString,QVariant><Function>toMap</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +<Sect2><Title>QVBox (Qt v2+)</Title> +<Para> +<Literal>QVBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QVButtonGroup (Qt v2+)</Title> +<Para> +<Literal>QVButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QVGroupBox (Qt v2+)</Title> +<Para> +<Literal>QVGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWaitCondition (Qt v2.2+)</Title> +<Para> +<Literal>QWaitCondition</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWhatsThis</Title> +<Para> +<Literal>QWhatsThis</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWidget</Title> +<FuncSynopsis> + <FuncDef>QWExtra *<Function>extraData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QFocusData *<Function>focusData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>lower</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>lowerW</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>raise</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>raiseW</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QWidgetList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QWidgetList</Literal> is the +return type of a function or the type of an argument, a Python list of +instances is used instead. +</Para> +</Sect2> +<Sect2><Title>QWidgetStack</Title> +<Para> +<Literal>QWidgetStack</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWindow</Title> +<Para> +<Literal>QWindow</Literal> is fully implemented (Qt v1.x). +</Para> +</Sect2> +<Sect2><Title>QWindowsStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +<Sect2><Title>QWindowsXPStyle (Qt v3.0.1+, Windows)</Title> +<Para> +<Literal>QWindowsXPStyle</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWizard (Qt v2+)</Title> +<Para> +<Literal>QWizard</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QWMatrix</Title> +<Para> +The Python <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>*=</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QWMatrix <Function>invert</Function> const</FuncDef> + <ParamDef>bool *<Parameter>invertible</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>QWMatrix</Literal> +result and the <Literal>invertible</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>tx</Parameter></ParamDef> + <ParamDef>int *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>float <Parameter>x</Parameter></ParamDef> + <ParamDef>float <Parameter>y</Parameter></ParamDef> + <ParamDef>float *<Parameter>tx</Parameter></ParamDef> + <ParamDef>float *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (Qt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>double <Parameter>x</Parameter></ParamDef> + <ParamDef>double <Parameter>y</Parameter></ParamDef> + <ParamDef>double *<Parameter>tx</Parameter></ParamDef> + <ParamDef>double *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (Qt v2+) +</Para> +</Sect2> +<Sect2><Title>QWorkspace (Qt v2.1+)</Title> +<Para> +<Literal>QWorkspace</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtaxcontainer</Literal> Module Reference</Title> +<Sect2><Title>QAxBase (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxObject</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>queryInterface</Function></FuncDef> + <ParamDef>const QUuid &<Parameter>uuid</Parameter></ParamDef> + <ParamDef>void **<Parameter>iface</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>PropertyBag <Function>propertyBag</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setPropertyBag</Function></FuncDef> + <ParamDef>const PropertyBag &<Parameter>bag</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>unsigned long <Function>registerWeakActiveObject</Function></FuncDef> + <ParamDef>const QString &<Parameter>guid</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This is a utility method provided by PyQt to make it easier to use +Mark Hammond's <Literal>win32com</Literal> module to manipulate objects +created by the <Literal>qtaxcontainer</Literal> module. +</Para> +<Para> +The <Literal>RegisterActiveObject()</Literal> COM function is called to +register the <Literal>QAxBase</Literal> instance as a weak object with the +<Literal>guid</Literal> GUID. The revoke handle is returned. +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>revokeActiveObject</Function></FuncDef> + <ParamDef>unsigned long <Parameter>rhandle</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This is a wrapper around the <Literal>RevokeActiveObject()</Literal> COM +function and is called to revoke the object registered using +<Literal>registerWeakActiveObject()</Literal>. <Literal>rhandle</Literal> is +the revoke handle returned by <Literal>registerWeakActiveObject()</Literal>. +</Para> +</Sect2> +<Sect2><Title>QAxObject (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxObject</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter></ParamDef> + <ParamDef>QObject *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +<Sect2><Title>QAxWidget (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxWidget</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtcanvas</Literal> Module Reference</Title> +<Sect2><Title>QCanvas (Qt v2.2+)</Title> +<Para> +<Literal>QCanvas</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasEllipse (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasEllipse</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasItem (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasItemList (Qt v2.2+)</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QCanvasItemList</Literal> is +the return type of a function or the type of an argument, a Python list of +<Literal>QCanvasItem</Literal> instances is used instead. +</Para> +</Sect2> + +<Sect2><Title>QCanvasLine (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasLine</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPixmap (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPixmap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPixmapArray (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QPixmapArray</Function></FuncDef> + <ParamDef>QList<QPixmap> <Parameter>pixmaps</Parameter></ParamDef> + <ParamDef>QList<QPoint> <Parameter>hotspots</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The <Literal>pixmaps</Literal> argument is a Python list of QPixmap instances, +and the <Literal>hotspots</Literal> argument is a Python list of QPoint +instances. (Qt v2.2.0 - Qt v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef><Function>QPixmapArray</Function></FuncDef> + <ParamDef>QValueList<QPixmap> <Parameter>pixmaps</Parameter></ParamDef> + <ParamDef>QPointArray <Parameter>hotspots</Parameter> = QPointArray()</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>pixmaps</Literal> argument is a Python list of QPixmap instances. +(Qt v3+) +</Para> +</Sect2> + +<Sect2><Title>QCanvasPolygon (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPolygon</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPolygonalItem (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPolygonalItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasRectangle (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasRectangle</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasSpline (Qt v3.0+)</Title> +<Para> +<Literal>QCanvasSpline</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasSprite (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasSprite</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasText (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasText</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasView (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasView</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtext</Literal> Module Reference</Title> + +<Sect2><Title>QextScintilla</Title> +<FuncSynopsis> + <FuncDef>void <Function>getCursorPosition</Function></FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned by the +<Literal>line</Literal> and <Literal>index</Literal> pointers. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>lineFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>lineTo</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexTo</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned by the +<Literal>lineFrom</Literal>, <Literal>indexFrom</Literal>, +<Literal>lineTo</Literal> and <Literal>indexTo</Literal> pointers. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaAPIs</Title> +<Para> +<Literal>QextScintillaAPIs</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaBase</Title> +<Para> +<Literal>QextScintillaBase</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaCommand</Title> +<Para> +<Literal>QextScintillaCommand</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaCommandSet</Title> +<Para> +<Literal>QextScintillaCommandSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaDocument</Title> +<Para> +<Literal>QextScintillaDocument</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexer</Title> +<Para> +<Literal>QextScintillaLexer</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerBash (QScintilla v1.4+)</Title> +<Para> +<Literal>QextScintillaLexerBash</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerBatch (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerBatch</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCPP</Title> +<Para> +<Literal>QextScintillaLexerCPP</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCSharp</Title> +<Para> +<Literal>QextScintillaLexerCSharp</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCSS (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerCSS</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerDiff (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerDiff</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerHTML (QScintilla v1.1+)</Title> +<Para> +<Literal>QextScintillaLexerHTML</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerIDL</Title> +<Para> +<Literal>QextScintillaLexerIDL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerJava</Title> +<Para> +<Literal>QextScintillaLexerJava</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerJavaScript</Title> +<Para> +<Literal>QextScintillaLexerJavaScript</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerLua (QScintilla v1.5+)</Title> +<Para> +<Literal>QextScintillaLexerLua</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerMakefile (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerMakefile</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPerl</Title> +<Para> +<Literal>QextScintillaLexerPerl</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPOV (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerPOV</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerProperties (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerProperties</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPython</Title> +<Para> +<Literal>QextScintillaLexerPython</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerRuby (QScintilla v1.5+)</Title> +<Para> +<Literal>QextScintillaLexerRuby</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerSQL (QScintilla v1.1+)</Title> +<Para> +<Literal>QextScintillaLexerSQL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerTeX (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerTeX</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaMacro</Title> +<Para> +<Literal>QextScintillaMacro</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaPrinter</Title> +<Para> +<Literal>QextScintillaPrinter</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtgl</Literal> Module Reference</Title> +<Sect2><Title>QGL</Title> +<Para> +<Literal>QGL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLContext</Title> +<Para> +<Literal>QGLContext</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLFormat</Title> +<Para> +<Literal>QGLFormat</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLWidget</Title> +<Para> +<Literal>QGLWidget</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QGLColormap (Qt v3.0+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>setEntries</Function></FuncDef> + <ParamDef>int <Parameter>count</Parameter></ParamDef> + <ParamDef>const QRgb *<Parameter>colors</Parameter></ParamDef> + <ParamDef>int <Parameter>base</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtnetwork</Literal> Module Reference</Title> +<Sect2><Title>QDns (Qt v2.2+)</Title> +<Para> +<Literal>QDns</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QFtp (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> +</Sect2> +<Sect2><Title>QHostAddress (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QHostAddress</Function></FuncDef> + <ParamDef>Q_UINT8 *<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QHostAddress</Function></FuncDef> + <ParamDef>const Q_IPV6ADDR &<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setAddress</Function></FuncDef> + <ParamDef>Q_UINT8 *<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>Q_IPV6ADDR <Function>toIPv6Address</Function> const</FuncDef> + <ParamDef><Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +<Sect2><Title>QHttp (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> +</Sect2> + +<Sect2><Title>QHttpHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpHeader</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHttpRequestHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpRequestHeader</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHttpResponseHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpResponseHeader</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QLocalFs (Qt v2.1+)</Title> +<Para> +<Literal>QLocalFs</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QServerSocket (Qt v2.2+)</Title> +<Para> +<Literal>QServerSocket</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSocket (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>Py_None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readLine</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>Py_None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +<Sect2><Title>QSocketDevice (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtpe</Literal> Module Reference</Title> + +<Sect2><Title>QPEApplication</Title> +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int& <Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>Type <Parameter>type</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>AppLnk</Title> +<FuncSynopsis> + <FuncDef>virtual QString <Function>exec</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_property</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>AppLnkSet</Title> +<Para> +<Literal>AppLnkSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Config</Title> +<Para> +<Literal>Config</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>DateFormat</Title> +<Para> +<Literal>DateFormat</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>DocLnk</Title> +<FuncSynopsis> + <FuncDef>QString <Function>exec</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_property</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>DocLnkSet</Title> +<Para> +<Literal>DocLnkSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileManager</Title> +<Para> +<Literal>FileManager</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileSelector</Title> +<Para> +<Literal>FileSelector</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileSelectorItem</Title> +<Para> +<Literal>FileSelectorItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FontDatabase</Title> +<Para> +<Literal>FontDatabase</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Global</Title> +<FuncSynopsis> + <FuncDef>static void <Function>setBuiltinCommands</Function></FuncDef> + <ParamDef>Command *</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>MenuButton</Title> +<Para> +<Literal>MenuButton</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCopEnvelope</Title> +<Para> +<Literal>QCopEnvelope</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDawg</Title> +<Para> +<Literal>QDawg</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPEMenuBar</Title> +<Para> +<Literal>QPEMenuBar</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPEToolBar</Title> +<Para> +<Literal>QPEToolBar</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Resource</Title> +<Para> +<Literal>Resource</Literal> is fully implemented. +</Para> +</Sect2> + +</Sect1> +<Sect1><Title><Literal>qtsql</Literal> Module Reference</Title> +<Sect2><Title>QDataBrowser (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delOnCursor</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QDataTable (Qt v3+)</Title> +<Para> +<Literal>QDataTable</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QDataView (Qt v3+)</Title> +<Para> +<Literal>QDataView</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSql (Qt v3+)</Title> +<Para> +<Literal>QSql</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlCursor (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>const QString &<Parameter>filter</Parameter></ParamDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QSqlDatabase (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QSqlQuery <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter> = QString::null</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execStatement</Literal> in Python. +</Para> +</Sect2> +<Sect2><Title>QSqlDriver (Qt v3+)</Title> +<Para> +<Literal>QSqlDriver</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QSqlEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlError (Qt v3+)</Title> +<Para> +<Literal>QSqlError</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlField (Qt v3+)</Title> +<Para> +<Literal>QSqlField</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlFieldInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlFieldInfo</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlForm (Qt v3+)</Title> +<Para> +<Literal>QSqlForm</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlIndex (Qt v3+)</Title> +<Para> +<Literal>QSqlIndex</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlPropertyMap (Qt v3+)</Title> +<Para> +<Literal>QSqlPropertyMap</Literal> is fully implemented. However, because PyQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. These will +simply be ignored. +</Para> + +<Para> +This problem may be addressed in a future release of PyQt. +</Para> +</Sect2> +<Sect2><Title>QSqlQuery (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QMap<QString,QVariant> <Function>boundValues</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3.2.0+) +</Para> + +<FuncSynopsis> + <FuncDef>virtual bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. (Qt v3.1+) +</Para> +</Sect2> +<Sect2><Title>QSqlRecord (Qt v3+)</Title> +<Para> +<Literal>QSqlRecord</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlRecordInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlRecordInfo</Literal> is implemented as a Python list of +<Literal>QSqlFieldInfo</Literal> instances. +</Para> +</Sect2> +<Sect2><Title>QSqlResult (Qt v3+)</Title> +<Para> +<Literal>QSqlResult</Literal> is fully implemented. +</Para> +</Sect2> +<Sect2><Title>QSqlSelectCursor (Qt v3.2.0+)</Title> +<FuncSynopsis> + <FuncDef>int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qttable</Literal> Module Reference</Title> +<Sect2><Title>QTable (Qt v2.2+)</Title> +<Para> +<Literal>QTable</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTableItem (Qt v2.2+)</Title> +<Para> +<Literal>QTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCheckTableItem (Qt v3+)</Title> +<Para> +<Literal>QCheckTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QComboTableItem (Qt v3+)</Title> +<Para> +<Literal>QComboTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTableSelection (Qt v2.2+)</Title> +<Para> +<Literal>QTableSelection</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtui</Literal> Module Reference</Title> +<Sect2><Title>QWidgetFactory (Qt v3+)</Title> +<Para> +<Literal>QWidgetFactory</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +<Sect1><Title><Literal>qtxml</Literal> Module Reference</Title> +<Sect2><Title>QDomImplementation (Qt v2.2+)</Title> +<Para> +<Literal>QDomImplementation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNode (Qt v2.2+)</Title> +<Para> +<Literal>QDomNode</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> + +<Sect2><Title>QDomNodeList (Qt v2.2+)</Title> +<Para> +<Literal>QDomNodeList</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomDocument (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QCString &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QByteArray &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QString &<Parameter>text</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>text</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QIODevice *<Parameter>dev</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>dev</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QCString &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QByteArray &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QString &<Parameter>text</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>text</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QIODevice *<Parameter>dev</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>dev</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>QXmlInputSource *<Parameter>source</Parameter></ParamDef> + <ParamDef>QXmlReader *<Parameter>reader</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3.2.0+) +</Para> +</Sect2> + +<Sect2><Title>QDomDocumentFragment (Qt v2.2+)</Title> +<Para> +<Literal>QDomDocumentFragment</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomDocumentType (Qt v2.2+)</Title> +<Para> +<Literal>QDomDocumentType</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNamedNodeMap (Qt v2.2+)</Title> +<Para> +<Literal>QDomNamedNodeMap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomCharacterData (Qt v2.2+)</Title> +<Para> +<Literal>QDomCharacterData</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomAttr (Qt v2.2+)</Title> +<Para> +<Literal>QDomAttr</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomElement (Qt v2.2+)</Title> +<Para> +<Literal>QDomElement</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomText (Qt v2.2+)</Title> +<Para> +<Literal>QDomText</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomComment (Qt v2.2+)</Title> +<Para> +<Literal>QDomComment</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomCDATASection (Qt v2.2+)</Title> +<Para> +<Literal>QDomCDATASection</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNotation (Qt v2.2+)</Title> +<Para> +<Literal>QDomNotation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomEntity (Qt v2.2+)</Title> +<Para> +<Literal>QDomEntity</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomEntityReference (Qt v2.2+)</Title> +<Para> +<Literal>QDomEntityReference</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomProcessingInstruction (Qt v2.2+)</Title> +<Para> +<Literal>QDomProcessingInstruction</Literal> is fully implemented. +</Para> +</Sect2> +</Sect1> +</Article> diff --git a/python/pyqt/doc/qtdocs.sip b/python/pyqt/doc/qtdocs.sip new file mode 100644 index 00000000..070a4fb4 --- /dev/null +++ b/python/pyqt/doc/qtdocs.sip @@ -0,0 +1,1920 @@ +// This is the SIP file for organising the PyQt documentation. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module Dummy + + +%Include qt/versions.sip + + +%Doc +<!DOCTYPE Article PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> +<Article> +<ArtHeader> + <Title>Python Bindings for Qt (3.17.2)</Title> + <Author> + <FirstName>Phil</FirstName> + <Surname>Thompson</Surname> + </Author> + <Abstract> + <Para> + This document describes a set of Python bindings for the Qt widget set. + Contact the author at <Email>phil@riverbankcomputing.co.uk</Email>. + </Para> + </Abstract> +</ArtHeader> + + +<Sect1><Title>Introduction</Title> +<Para> +PyQt is a set of Python bindings for the Qt toolkit and available for all +platforms supported by Qt, including Windows, Linux, UNIX, MacOS/X and embedded +systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested +against Qt versions 1.43 to 3.3.6, Qt Non-commercial, Qtopia 1.5.0, and Python +versions 1.5 to 2.4.2. Qt/Embedded v3 is not supported. Qt v4 is supported +by PyQt v4. +</Para> + +<Para> +PyQt is available under the GPL license for use with the GPL version of Qt, a +a commercial license for use with the commercial version of Qt, a +non-commercial license for use with the non-commercial version of Qt v2, and an +educational license for use with the educational version of Qt. +</Para> + +<Para> +There is also an evaluation version of PyQt for Windows. This must be used +with the corresponding evaluation version of Qt. +</Para> + +<Para> +PyQt is built using SIP (a tool for generating Python extension modules for +C++ class libraries). SIP v4.6 or later must be installed in order to build +and run this version of PyQt. +</Para> + +<Para> +PyQt for MacOS/X requires Qt v3.1.0 or later and Python v2.3 or later. +</Para> + +<Para> +The bindings are implemented as a number of Python modules +</Para> + +<ItemizedList> +<ListItem> +<Para> +<Literal>qt</Literal> is the main module and contains the core classes and most +user interface widgets. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtaxcontainer</Literal> contains a sub-set of the classes implemented +in Qt's QAxContainer module, part of Qt's ActiveQt framework. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtcanvas</Literal> contains the classes implemented in Qt's Canvas +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtgl</Literal> contains the classes implemented in Qt's OpenGL module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtnetwork</Literal> contains the classes implemented in Qt's Network +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtpe</Literal> contains the classes implemented in Qtopia (originally +called the Qt Palmtop Environment). It is only supported with Qt/Embedded. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtsql</Literal> contains the classes implemented in Qt's SQL module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qttable</Literal> contains the classes implemented in Qt's Table +module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtui</Literal> contains the classes implemented in Qt's qui library. +These allow GUIs to be created directly from Qt Designer's +<Literal>.ui</Literal> files. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtxml</Literal> contains the classes implemented in Qt's XML module. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>qtext</Literal> contains useful third-party classes that are not part +of Qt. At the moment it contains bindings for QScintilla, the port to Qt of +the Scintilla programmer's editor class. +</Para> +</ListItem> +</ItemizedList> + +<Para> +PyQt also includes the <Literal>pyuic</Literal> and +<Literal>pylupdate</Literal> utilities which correspond to the Qt +<Literal>uic</Literal> and <Literal>lupdate</Literal> utilities. +<Literal>pyuic</Literal> converts the GUI designs created with Qt Designer to +executable Python code. <Literal>pylupdate</Literal> scans Python code, +extracts all strings that are candidates for internationalisation, and creates +an XML file for use by Qt Linguist. +</Para> + +<Sect2><Title>Changes</Title> +<Para> +The changes visible to the Python programmer in this release are as follows. +</Para> +<ItemizedList> + +<ListItem> +<Para> +This version requires SIP v4.4 (or later). +</Para> +</ListItem> + +<ListItem> +<Para> +Concatenating Python strings and <Literal>QString</Literal>s is now supported. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QString</Literal> now supports the <Literal>*</Literal> and +<Literal>*=</Literal> operators that behave as they do for Python strings. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QString</Literal> is more interoperable with Python string and unicode +objects. For example they can be passed as arguments to +<Literal>open()</Literal> and to most (but not all) string methods. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QPopupMenu</Literal> (and sub-classes) instances now transfer +ownership of the menu to Python in the call to <Literal>exec_loop()</Literal>. +This means the menu's resources are all released when the Python wrapper is +garbage collected without needing to call +<Literal>QObject.deleteLater()</Literal>. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>QObject.sender()</Literal> now handles Python signals. +</Para> +</ListItem> + +<ListItem> +<Para> +The missing <Literal>MacintoshVersion</Literal> enum has been added. +</Para> +</ListItem> + +<ListItem> +<Para> +<Literal>PYQT_BUILD</Literal> has been removed. +</Para> +</ListItem> + +<ListItem> +<Para> +The convention for converting between a C/C++ null pointer and Python's +<Literal>None</Literal> 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 <Literal>None</Literal>. +</Para> +</ListItem> + +</ItemizedList> +</Sect2> +</Sect1> + + +<Sect1><Title>Other PyQt Goodies</Title> +<Sect2><Title>Using Qt Designer</Title> +<Para> +Qt Designer is a GPL'ed GUI design editor provided by Trolltech as part of Qt. +It generates an XML description of a GUI design. Qt includes +<Literal>uic</Literal> which generates C++ code from that XML. +</Para> + +<Para> +PyQt includes <Literal>pyuic</Literal> which generates Python code from the +same XML. The Python code is self contained and can be executed immediately. +</Para> + +<Para> +It is sometimes useful to be able to include some specific Python code in the +output generated by <Literal>pyuic</Literal>. For example, if you are using +custom widgets, <Literal>pyuic</Literal> has no way of knowing the name of the +Python module containing the widget and so cannot generate the required +<Literal>import</Literal> statement. To help get around this, +<Literal>pyuic</Literal> will extract any lines entered in the +<Literal>Comment</Literal> field of Qt Designer's +<Literal>Form Settings</Literal> dialog that begin with +<Literal>Python:</Literal> and copies them to the generated output. +</Para> + +<Para> +Here's a simple example showing the contents of the <Literal>Comment</Literal> +field. +</Para> + +<ProgramListing> +This comment will be ignored by pyuic. +Python: +Python:# Import our custom widget. +Python:from foo import bar +</ProgramListing> + +<Para> +Here's the corresponding output from <Literal>pyuic</Literal>. +</Para> + +<ProgramListing> +from qt import * + +# Import our custom widget. +from foo import bar +</ProgramListing> + +<Para> +Thanks to Christian Bird, <Literal>pyuic</Literal> will extract Python code +entered using Qt Designer to implement slots. In Qt Designer, when you need to +edit a slot and the source editor appears, enter Python code between the curly +braces. Don't worry about the correct starting indent level, each line is +prepended with a correct indentation. +</Para> + +<Para> +Make sure that the <Literal>ui.h</Literal> file is in the same directory as the +<Literal>.ui</Literal> file when using <Literal>pyuic</Literal>. The +<Literal>.ui</Literal> file implies the name of the <Literal>.ui.h</Literal> +file so there is no need to specify it on the command line. +</Para> + +<Para> +Here's an example of a simple slot. +</Para> + +<ProgramListing> +void DebMainWindowFrm::browsePushButtonClicked() +{ +if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +} +</ProgramListing> + +<Para> +Here is the resulting code when <Literal>pyuic</Literal> is run. +</Para> + +<ProgramListing> +class DebMainWindowFrm(QMainWindow): + ...stuff... + def browsePushButtonClicked(self): + if self.debugging: + QMessageBox.critical(self, "Event", "browse pushbutton was clicked!") +</ProgramListing> + +<Para> +Note that indenting is as normal and that <Literal>self</Literal> and all other +parameters passed to the slot are available. +</Para> + +<Para> +If you use this, you will need to turn off all of the fancy options for the C++ +editor in Designer as it tries to force C++ syntax and that's naturally +annoying when trying to code in Python. +</Para> +</Sect2> + +<Sect2><Title>Using Qt Linguist</Title> +<Para> +Qt includes the <Literal>lupdate</Literal> program which parses C++ source +files converting calls to the <Literal>QT_TR_NOOP()</Literal> and +<Literal>QT_TRANSLATE_NOOP()</Literal> macros to <Literal>.ts</Literal> +language source files. The <Literal>lrelease</Literal> program is then used to +generate <Literal>.qm</Literal> binary language files that are distributed with +your application. +</Para> + +<Para> +Thanks to Detlev Offenbach, PyQt includes the <Literal>pylupdate</Literal> +program. This generates the same <Literal>.ts</Literal> language source files +from your PyQt source files. +</Para> +</Sect2> +</Sect1> + + +<Sect1><Title>Deploying Commercial PyQt Applications</Title> +<Para> +When deploying commercial PyQt applications it is necessary to discourage users +from accessing the underlying PyQt modules for themselves. A user that used +the modules shipped with your application to develop new applications would +themselves be considered a developer and would need their own commercial Qt and +PyQt licenses. +</Para> + +<Para> +One solution to this problem is the +<ULink url="http://www.riverbankcomputing.co.uk/vendorid/">VendorID</ULink> +package. This allows you to build Python extension modules that can only be +imported by a digitally signed custom interpreter. The package enables you to +create such an interpreter with your application embedded within it. The +result is an interpreter that can only run your application, and PyQt modules +that can only be imported by that interpreter. You can use the package to +similarly restrict access to any extension module. +</Para> + +<Para> +In order to build PyQt with support for the VendorID package, pass the +<Literal>-i</Literal> command line flag to <Literal>configure.py</Literal>. +</Para> +</Sect1> + +<Sect1><Title><Literal>pyqtconfig</Literal> and Build System Support</Title> +<Para> +The SIP build system (ie. the <Literal>sipconfig</Literal> module) is described +in the SIP documentation. PyQt includes the <Literal>pyqtconfig</Literal> +module that can be used by configuration scripts of other bindings that are +built on top of PyQt. +</Para> + +<Para> +The <Literal>pyqtconfig</Literal> module contains the following classes: +</Para> + +<VariableList> +<VarListEntry> +<Term><Literal>Configuration(sipconfig.Configuration)</Literal></Term> +<ListItem> +<Para> +This class encapsulates additional configuration values, specific to PyQt, that +can be accessed as instance variables. +</Para> + +<Para> +The following configuration values are provided (in addition to those provided +by the <Literal>sipconfig.Configuration</Literal> class): +</Para> +<VariableList> + +<VarListEntry> +<Term><Literal>pyqt_bin_dir</Literal></Term> +<ListItem> +<Para> +The name of the directory containing the <Literal>pyuic</Literal> and +<Literal>pylupdate</Literal> executables. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_config_args</Literal></Term> +<ListItem> +<Para> +The command line passed to <Literal>configure.py</Literal> when PyQt was +configured. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_mod_dir</Literal></Term> +<ListItem> +<Para> +The name of the directory containing the PyQt modules. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_modules</Literal></Term> +<ListItem> +<Para> +A string containing the names of the PyQt modules that were installed. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qt_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qt</Literal> module and which should be added to those needed by any +module that imports the <Literal>qt</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtaxcontainer_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtaxcontainer</Literal> module and which should be added to those +needed by any module that imports the <Literal>qtaxcontainer</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtcanvas_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtcanvas</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtcanvas</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtext_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtext</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtext</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtgl_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtgl</Literal> module and which should be added to those needed by any +module that imports the <Literal>qtgl</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtnetwork_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtnetwork</Literal> module and which should be added to those needed +by any module that imports the <Literal>qtnetwork</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtsql_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtsql</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtsql</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qttable_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qttable</Literal> module and which should be added to those needed by +any module that imports the <Literal>qttable</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtui_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtui</Literal> module and which should be added to those needed by any +module that imports the <Literal>qtui</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_qtxml_sip_flags</Literal></Term> +<ListItem> +<Para> +A string of the SIP flags used to generate the code for the +<Literal>qtxml</Literal> module and which should be added to those needed by +any module that imports the <Literal>qtxml</Literal> module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_sip_dir</Literal></Term> +<ListItem> +<Para> +The name of the base directory where the <Literal>.sip</Literal> files for each +of the PyQt modules is installed. A sub-directory exists with the same name as +the module. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_version</Literal></Term> +<ListItem> +<Para> +The PyQt version as a 3 part hexadecimal number (eg. v3.10 is represented as +<Literal>0x030a00</Literal>). +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>pyqt_version_str</Literal></Term> +<ListItem> +<Para> +The PyQt version as a string. For development snapshots it will start with +<Literal>snapshot-</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> + +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtModuleMakefile(sipconfig.SIPModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qt</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtAxContainerModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtaxcontainer</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtCanvasModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtcanvas</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtExtModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtext</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtGLModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtgl</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtNetworkModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtnetwork</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtTableModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qttable</Literal> +module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtSQLModuleMakefile(QtTableModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtsql</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtUIModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtui</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +<VarListEntry> +<Term><Literal>QtXMLModuleMakefile(QtModuleMakefile)</Literal></Term> +<ListItem> +<Para> +The Makefile class for modules that import the <Literal>qtxml</Literal> module. +</Para> +<VariableList> +<VarListEntry> +<Term><Literal>finalise(self)</Literal></Term> +<ListItem> +<Para> +This is a reimplementation of <Literal>sipconfig.Makefile.finalise()</Literal>. +</Para> +<Para></Para><Para></Para> +</ListItem> +</VarListEntry> +</VariableList> +</ListItem> +</VarListEntry> + +</VariableList> +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title>Things to be Aware Of</Title> +<Sect2><Title>super and Wrapped Classes</Title> +<Para> +Internally PyQt implements a lazy technique for attribute lookup where +attributes are only placed in type and instance dictionaries when they are +first referenced. This technique is needed to reduce the time taken to import +large modules such as PyQt. +</Para> + +<Para> +In most circumstances this technique is transparent to an application. The +exception is when <Literal>super</Literal> is used with a PyQt class. The way +that <Literal>super</Literal> is currently implemented means that the lazy +lookup is bypassed resulting in <Literal>AttributeError</Literal> exceptions +unless the attribute has been previously referenced. +</Para> + +<Para> +Note that this restriction applies to any class wrapped by SIP and not just +PyQt. +</Para> +</Sect2> + + +<Sect2><Title>Python Strings, Qt Strings and Unicode</Title> +<Para> +Unicode support was added to Qt in v2.0 and to Python in v1.6. In Qt, Unicode +support is implemented using the <Literal>QString</Literal> class. It is +important to understand that <Literal>QString</Literal>s, Python string objects +and Python Unicode objects are all different but conversions between them are +automatic in almost all cases and easy to achieve manually when needed. +</Para> + +<Para> +Whenever PyQt expects a <Literal>QString</Literal> as a function argument, a +Python string object or a Python Unicode object can be provided instead, and +PyQt will do the necessary conversion automatically. +</Para> + +<Para> +You may also manually convert Python string and Unicode objects to +<Literal>QString</Literal>s by using the <Literal>QString</Literal> constructor +as demonstrated in the following code fragment. +</Para> + +<ProgramListing> +qs1 = QString('Converted Python string object') +qs2 = QString(u'Converted Python Unicode object') +</ProgramListing> + +<Para> +In order to convert a <Literal>QString</Literal> to a Python string object use +the Python <Literal>str()</Literal> function. Applying +<Literal>str()</Literal> to a null <Literal>QString</Literal> and an empty +<Literal>QString</Literal> both result in an empty Python string object. +</Para> + +<Para> +In order to convert a <Literal>QString</Literal> to a Python Unicode object use +the Python <Literal>unicode()</Literal> function. Applying +<Literal>unicode()</Literal> to a null <Literal>QString</Literal> and an empty +<Literal>QString</Literal> both result in an empty Python Unicode object. +</Para> +</Sect2> + +<Sect2><Title>Access to Protected Member Functions</Title> +<Para> +When an instance of a C++ class is not created from Python it is not possible +to access the protected member functions, or emit the signals, of that +instance. Attempts to do so will raise a Python exception. Also, any Python +methods corresponding to the instance's virtual member functions will never be +called. +</Para> +</Sect2> + +<Sect2><Title><Literal>None</Literal> and <Literal>NULL</Literal></Title> +<Para> +Throughout the bindings, the <Literal>None</Literal> value can be specified +wherever <Literal>NULL</Literal> is acceptable to the underlying C++ code. +</Para> + +<Para> +Equally, <Literal>NULL</Literal> is converted to <Literal>None</Literal> +whenever it is returned by the underlying C++ code. +</Para> +</Sect2> + + +<Sect2><Title>Support for C++ <Literal>void *</Literal> Data Types</Title> +<Para> +PyQt represents <Literal>void *</Literal> values as objects of type +<Literal>sip.voidptr</Literal>. Such values are often used to pass the +addresses of external objects between different Python modules. To make this +easier, a Python integer (or anything that Python can convert to an integer) +can be used whenever a <Literal>sip.voidptr</Literal> is expected. +</Para> +<Para> +A <Literal>sip.voidptr</Literal> may be converted to a Python integer by using +the <Literal>int()</Literal> builtin function. +</Para> +<Para> +A <Literal>sip.voidptr</Literal> may be converted to a Python string by using +its <Literal>asstring()</Literal> method. The <Literal>asstring()</Literal> +method takes an integer argument which is the length of the data in bytes. +</Para> +</Sect2> + + +<Sect2><Title>Support for Threads</Title> +<Para> +PyQt implements the full set of Qt's thread classes. Python, of course, also +has its own thread extension modules. If you are using SIP v4 (or later) and +Python v2.3.5 (or later) then PyQt does not impose any additional restrictions. +(Read the relevant part of the Qt documentation to understand the restrictions +imposed by the Qt API.) +</Para> +<Para> +If you are using earlier versions of either SIP or Python then it is possible +to use either of the APIs so long as you follow some simple rules. +</Para> +<ItemizedList> +<ListItem> +<Para> +If you use the Qt API then the very first <Literal>import</Literal> of one of +the PyQt modules must be done from the main thread. +</Para> +</ListItem> +<ListItem> +<Para> +If you use the Python API then all calls to PyQt (including any +<Literal>import</Literal>s) must be done from one thread only. Therefore, if +you want to make calls to PyQt from several threads then you must use the Qt +API. +</Para> +</ListItem> +<ListItem> +<Para> +If you want to use both APIs in the same application then all calls to PyQt +must be done from threads created using the Qt API. +</Para> +</ListItem> +</ItemizedList> +<Para> +The above comments actually apply to any SIP generated module, not just PyQt. +</Para> +</Sect2> + +<Sect2><Title>Garbage Collection</Title> +<Para> +C++ does not garbage collect unreferenced class instances, whereas Python does. +In the following C++ fragment both colours exist even though the first can no +longer be referenced from within the program: +</Para> + +<ProgramListing> +c = new QColor(); +c = new QColor(); +</ProgramListing> + +<Para> +In the corresponding Python fragment, the first colour is destroyed when +the second is assigned to <Literal>c</Literal>: +</Para> + +<ProgramListing> +c = QColor() +c = QColor() +</ProgramListing> + +<Para> +In Python, each colour must be assigned to different names. Typically this +is done within class definitions, so the code fragment would be something like: +</Para> + +<ProgramListing> +self.c1 = QColor() +self.c2 = QColor() +</ProgramListing> + +<Para> +Sometimes a Qt class instance will maintain a pointer to another instance and +will eventually call the destructor of that second instance. The most common +example is that a <Literal>QObject</Literal> (and any of its sub-classes) keeps +pointers to its children and will automatically call their destructors. In +these cases, the corresponding Python object will also keep a reference to the +corresponding child objects. +</Para> + +<Para> +So, in the following Python fragment, the first <Literal>QLabel</Literal> is +not destroyed when the second is assigned to <Literal>l</Literal> because the +parent <Literal>QWidget</Literal> still has a reference to it. +</Para> + +<ProgramListing> +p = QWidget() +l = QLabel('First label',p) +l = QLabel('Second label',p) +</ProgramListing> +</Sect2> + +<Sect2><Title>C++ Variables</Title> +<Para> +Access to C++ variables is supported. They are accessed as Python instance +variables. For example: +</Para> + +<ProgramListing> +tab = QTab() +tab.label = "First Tab" +tab.r = QRect(10,10,75,30) +</ProgramListing> + +<Para> +Global variables and static class variables are effectively read-only. They +can be assigned to, but the underlying C++ variable will not be changed. This +may change in the future. +</Para> + +<Para> +Access to protected C++ class variables is not supported. This may change in +the future. +</Para> +</Sect2> + +<Sect2><Title>Multiple Inheritance</Title> +<Para> +It is not possible to define a new Python class that sub-classes from more than +one Qt class. +</Para> +</Sect2> + +<Sect2><Title>i18n Support</Title> +<Para> +Qt implements i18n support through the Qt Linguist application, the +<Literal>QTranslator</Literal> class, and the +<Literal>QApplication::translate()</Literal>, <Literal>QObject::tr()</Literal> +and <Literal>QObject::trUtf8()</Literal> methods. Usually the +<Literal>tr()</Literal> method is used to obtain the correct translation of a +message. The translation process uses a message context to allow the same +message to be translated differently. <Literal>tr()</Literal> is actually +generated by <Literal>moc</Literal> and uses the hardcoded class name as the +context. On the other hand, <Literal>QApplication::translate()</Literal> +allows to context to be explicitly stated. +</Para> + +<Para> +Unfortunately, because of the way Qt implents <Literal>tr()</Literal> (and +<Literal>trUtf8()</Literal>) it is not possible for PyQt to exactly reproduce +its behavour. The PyQt implementation of <Literal>tr()</Literal> (and +<Literal>trUtf8()</Literal>) uses the class name of the instance as the +context. The key difference, and the source of potential problems, is that the +context is determined dynamically in PyQt, but is hardcoded in Qt. In other +words, the context of a translation may change depending on an instance's class +hierarchy. +</Para> + +<ProgramListing> +class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return self.tr("Hello") + +class B(A): + def __init__(self): + A.__init__(self) + +a = A() +a.hello() + +b = B() +b.hello() +</ProgramListing> + +<Para> +In the above the message is translated by <Literal>a.hello()</Literal> using a +context of <Literal>A</Literal>, and by <Literal>b.hello()</Literal> using a +context of <Literal>B</Literal>. In the equivalent C++ version the context +would be <Literal>A</Literal> in both cases. +</Para> + +<Para> +The PyQt behaviour is unsatisfactory and may be changed in the future. It is +recommended that <Literal>QApplication.translate()</Literal> be used in +preference to <Literal>tr()</Literal> (and <Literal>trUtf8()</Literal>). This +is guaranteed to work with current and future versions of PyQt and makes it +much easier to share message files between Python and C++ code. Below is the +alternative implementation of <Literal>A</Literal> that uses +<Literal>QApplication.translate()</Literal>. +</Para> + +<ProgramListing> +class A(QObject): + def __init__(self): + QObject.__init__(self) + + def hello(self): + return qApp.translate("A","Hello") +</ProgramListing> + +<Para> +Note that the code generated by <Literal>pyuic</Literal> uses +<Literal>QApplication.translate()</Literal>. +</Para> +</Sect2> +</Sect1> + + +<Sect1><Title>Signal and Slot Support</Title> +<Para> +A signal may be either a Qt signal (specified using +<Literal>SIGNAL()</Literal>) or a Python signal (specified using +<Literal>PYSIGNAL()</Literal>). +</Para> + +<Para> +A slot can be either a Python callable object, a Qt signal (specified using +<Literal>SIGNAL()</Literal>), a Python signal (specified using +<Literal>PYSIGNAL()</Literal>), or a Qt slot (specified using +<Literal>SLOT()</Literal>). +</Para> + +<Para> +You connect signals to slots (and other signals) as you would from C++. For +example: +</Para> + +<ProgramListing> +QObject.connect(a,SIGNAL("QtSig()"),pyFunction) +QObject.connect(a,SIGNAL("QtSig()"),pyClass.pyMethod) +QObject.connect(a,SIGNAL("QtSig()"),PYSIGNAL("PySig")) +QObject.connect(a,SIGNAL("QtSig()"),SLOT("QtSlot()")) +QObject.connect(a,PYSIGNAL("PySig"),pyFunction) +QObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +QObject.connect(a,PYSIGNAL("PySig"),SIGNAL("QtSig()")) +QObject.connect(a,PYSIGNAL("PySig"),SLOT("QtSlot()")) +</ProgramListing> + +<Para> +When a slot is a Python method that corresponds to a Qt slot then a signal can +be connected to either the Python method or the Qt slot. The following +connections achieve the same effect. +</Para> + +<ProgramListing> +sbar = QScrollBar() +lcd = QLCDNumber() + +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display) +QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) +</ProgramListing> + +<Para> +The difference is that the second connection is made at the C++ level and is +more efficient. +</Para> + +<Para> +Disconnecting signals works in exactly the same way. +</Para> + +<Para> +Any instance of a class that is derived from the <Literal>QObject</Literal> +class can emit a signal using the <Literal>emit</Literal> method. This takes +two arguments. The first is the Python or Qt signal, the second is a Python +tuple which are the arguments to the signal. For example: +</Para> + +<ProgramListing> +a.emit(SIGNAL("clicked()"),()) +a.emit(PYSIGNAL("pySig"),("Hello","World")) +</ProgramListing> + +<Para> +Note that when a slot is a Python callable object its reference count is not +increased. This means that a class instance can be deleted without having to +explicitly disconnect any signals connected to its methods. However, it also +means that using lambda expressions as slots will not work unless you keep a +separate reference to the expression to prevent it from being immediately +garbage collected. +</Para> + +<Para> +Qt allows a signal to be connected to a slot that requires fewer arguments than +the signal passes. The extra arguments are quietly discarded. Python slots +can be used in the same way. +</Para> +</Sect1> + + +<Sect1><Title>Static Member Functions</Title> +<Para> +Static member functions are implemented as Python class functions. +For example the C++ static member function +<Literal>QObject::connect()</Literal> is called from Python as +<Literal>QObject.connect()</Literal> or <Literal>self.connect()</Literal> if +called from a sub-class of <Literal>QObject</Literal>. +</Para> +</Sect1> + + +<Sect1><Title>Enumerated Types</Title> +<Para> +Enumerated types are implemented as a set of simple variables corresponding to +the separate enumerated values. +</Para> + +<Para> +When using an enumerated value the name of the class (or a sub-class) in which +the enumerated type was defined in must be included. For example: +</Para> + +<ProgramListing> +Qt.SolidPattern +QWidget.TabFocus +QFrame.TabFocus +</ProgramListing> +</Sect1> + + +<Sect1><Title>Module Reference Documentation</Title> +<Para> +The following sections should be used in conjunction with the normal class +documentation - only the differences specific to the Python bindings are +documented here. +</Para> + +<Para> +In these sections, <Emphasis>Not yet implemented</Emphasis> +implies that the feature can be easily implemented if needed. <Emphasis>Not +implemented</Emphasis> implies that the feature will not be implemented, either +because it cannot be or because it is not appropriate. +</Para> + +<Para> +If a class is described as being <Emphasis>fully implemented</Emphasis> then +all non-private member functions and all public class variables have been +implemented. +</Para> + +<Para> +If an operator has been implemented then it is stated explicitly. +</Para> + +<Para> +Classes that are not mentioned have not yet been implemented. +</Para> +</Sect1> + + +<Sect1><Title><Literal>qt</Literal> Module Reference</Title> +%End + +%Include qt/qglobal.sip +%Include qt/qwindowdefs.sip +%Include qt/qnamespace.sip + +%Include qt/qaccel.sip +%Include qt/qaction.sip +%Include qt/qapplication.sip +%Include qt/qassistantclient.sip +%Include qt/qbitmap.sip +%Include qt/qbrush.sip +%Include qt/qbutton.sip +%Include qt/qbuttongroup.sip +%Include qt/qbytearray.sip +%Include qt/qcdestyle.sip +%Include qt/qcheckbox.sip +%Include qt/qclipboard.sip +%Include qt/qcolor.sip +%Include qt/qcolordialog.sip +%Include qt/qcolorgroup.sip +%Include qt/qcombobox.sip +%Include qt/qcommonstyle.sip +%Include qt/qcstring.sip +%Include qt/qcursor.sip +%Include qt/qdatastream.sip +%Include qt/qdatetime.sip +%Include qt/qdatetimeedit.sip +%Include qt/qdesktopwidget.sip +%Include qt/qdial.sip +%Include qt/qdialog.sip +%Include qt/qdir.sip +%Include qt/qdockarea.sip +%Include qt/qdockwindow.sip +%Include qt/qdragobject.sip +%Include qt/qdrawutil.sip +%Include qt/qdropsite.sip +%Include qt/qerrormessage.sip +%Include qt/qevent.sip +%Include qt/qeventloop.sip +%Include qt/qfile.sip +%Include qt/qfiledialog.sip +%Include qt/qfileinfo.sip +%Include qt/qfont.sip +%Include qt/qfontdatabase.sip +%Include qt/qfontdialog.sip +%Include qt/qfontinfo.sip +%Include qt/qfontmetrics.sip +%Include qt/qframe.sip +%Include qt/qgmanager.sip +%Include qt/qgrid.sip +%Include qt/qgridview.sip +%Include qt/qgroupbox.sip +%Include qt/qhbox.sip +%Include qt/qhbuttongroup.sip +%Include qt/qheader.sip +%Include qt/qhgroupbox.sip +%Include qt/qiconset.sip +%Include qt/qiconview.sip +%Include qt/qimage.sip +%Include qt/qinputdialog.sip +%Include qt/qinterlacestyle.sip +%Include qt/qiodevice.sip +%Include qt/qkeycode.sip +%Include qt/qkeysequence.sip +%Include qt/qlabel.sip +%Include qt/qlayout.sip +%Include qt/qlcdnumber.sip +%Include qt/qlibrary.sip +%Include qt/qlineedit.sip +%Include qt/qlist.sip +%Include qt/qlistbox.sip +%Include qt/qlistview.sip +%Include qt/qlocale.sip +%Include qt/qmainwindow.sip +%Include qt/qmemarray.sip +%Include qt/qmenubar.sip +%Include qt/qmenudata.sip +%Include qt/qmessagebox.sip +%Include qt/qmetaobject.sip +%Include qt/qmime.sip +%Include qt/qmotifplusstyle.sip +%Include qt/qmotifstyle.sip +%Include qt/qmovie.sip +%Include qt/qmultilinedit.sip +%Include qt/qmutex.sip +%Include qt/qnetworkprotocol.sip +%Include qt/qobject.sip +%Include qt/qobjectcleanuphandler.sip +%Include qt/qobjectlist.sip +%Include qt/qpaintdevicemetrics.sip +%Include qt/qpaintdevice.sip +%Include qt/qpainter.sip +%Include qt/qpalette.sip +%Include qt/qpixmap.sip +%Include qt/qpixmapcache.sip +%Include qt/qpair.sip +%Include qt/qpen.sip +%Include qt/qpicture.sip +%Include qt/qplatinumstyle.sip +%Include qt/qpoint.sip +%Include qt/qpointarray.sip +%Include qt/qpopupmenu.sip +%Include qt/qprintdialog.sip +%Include qt/qprinter.sip +%Include qt/qprocess.sip +%Include qt/qprogressbar.sip +%Include qt/qprogressdialog.sip +%Include qt/qptrlist.sip +%Include qt/qpushbutton.sip +%Include qt/qradiobutton.sip +%Include qt/qrangecontrol.sip +%Include qt/qrect.sip +%Include qt/qregexp.sip +%Include qt/qregion.sip +%Include qt/qscrollbar.sip +%Include qt/qscrollview.sip +%Include qt/qsemaphore.sip +%Include qt/qsemimodal.sip +%Include qt/qsessionmanager.sip +%Include qt/qsettings.sip +%Include qt/qsgistyle.sip +%Include qt/qsignalmapper.sip +%Include qt/qsimplerichtext.sip +%Include qt/qsize.sip +%Include qt/qsizegrip.sip +%Include qt/qsizepolicy.sip +%Include qt/qslider.sip +%Include qt/qsocketnotifier.sip +%Include qt/qsound.sip +%Include qt/qspinbox.sip +%Include qt/qsplashscreen.sip +%Include qt/qsplitter.sip +%Include qt/qstatusbar.sip +%Include qt/qstring.sip +%Include qt/qstringlist.sip +%Include qt/qstrlist.sip +%Include qt/qstyle.sip +%Include qt/qstylesheet.sip +%Include qt/qsyntaxhighlighter.sip +%Include qt/qtabbar.sip +%Include qt/qtabdialog.sip +%Include qt/qtableview.sip +%Include qt/qtabwidget.sip +%Include qt/qtextbrowser.sip +%Include qt/qtextcodec.sip +%Include qt/qtextedit.sip +%Include qt/qtextstream.sip +%Include qt/qtextview.sip +%Include qt/qthread.sip +%Include qt/qtimer.sip +%Include qt/qtoolbar.sip +%Include qt/qtoolbox.sip +%Include qt/qtoolbutton.sip +%Include qt/qtooltip.sip +%Include qt/qtranslator.sip +%Include qt/qurl.sip +%Include qt/qurlinfo.sip +%Include qt/qurloperator.sip +%Include qt/quuid.sip +%Include qt/qvalidator.sip +%Include qt/qvaluelist.sip +%Include qt/qvariant.sip +%Include qt/qvbox.sip +%Include qt/qvbuttongroup.sip +%Include qt/qvgroupbox.sip +%Include qt/qwaitcondition.sip +%Include qt/qwhatsthis.sip +%Include qt/qwidget.sip +%Include qt/qwidgetlist.sip +%Include qt/qwidgetstack.sip +%Include qt/qwindow.sip +%Include qt/qwindowsstyle.sip +%Include qt/qwindowsxpstyle.sip +%Include qt/qwizard.sip +%Include qt/qwmatrix.sip +%Include qt/qworkspace.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtaxcontainer</Literal> Module Reference</Title> +%End + +%Include qtaxcontainer/qaxbase.sip +%Include qtaxcontainer/qaxobject.sip +%Include qtaxcontainer/qaxwidget.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtcanvas</Literal> Module Reference</Title> +%End + +%Include qtcanvas/qcanvas.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtext</Literal> Module Reference</Title> + +<Sect2><Title>QextScintilla</Title> +<FuncSynopsis> + <FuncDef>void <Function>getCursorPosition</Function></FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned by the +<Literal>line</Literal> and <Literal>index</Literal> pointers. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>lineFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>lineTo</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexTo</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned by the +<Literal>lineFrom</Literal>, <Literal>indexFrom</Literal>, +<Literal>lineTo</Literal> and <Literal>indexTo</Literal> pointers. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaAPIs</Title> +<Para> +<Literal>QextScintillaAPIs</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaBase</Title> +<Para> +<Literal>QextScintillaBase</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaCommand</Title> +<Para> +<Literal>QextScintillaCommand</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaCommandSet</Title> +<Para> +<Literal>QextScintillaCommandSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaDocument</Title> +<Para> +<Literal>QextScintillaDocument</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexer</Title> +<Para> +<Literal>QextScintillaLexer</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerBash (QScintilla v1.4+)</Title> +<Para> +<Literal>QextScintillaLexerBash</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerBatch (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerBatch</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCPP</Title> +<Para> +<Literal>QextScintillaLexerCPP</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCSharp</Title> +<Para> +<Literal>QextScintillaLexerCSharp</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerCSS (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerCSS</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerDiff (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerDiff</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerHTML (QScintilla v1.1+)</Title> +<Para> +<Literal>QextScintillaLexerHTML</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerIDL</Title> +<Para> +<Literal>QextScintillaLexerIDL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerJava</Title> +<Para> +<Literal>QextScintillaLexerJava</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerJavaScript</Title> +<Para> +<Literal>QextScintillaLexerJavaScript</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerLua (QScintilla v1.5+)</Title> +<Para> +<Literal>QextScintillaLexerLua</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerMakefile (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerMakefile</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPerl</Title> +<Para> +<Literal>QextScintillaLexerPerl</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPOV (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerPOV</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerProperties (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerProperties</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerPython</Title> +<Para> +<Literal>QextScintillaLexerPython</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerRuby (QScintilla v1.5+)</Title> +<Para> +<Literal>QextScintillaLexerRuby</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerSQL (QScintilla v1.1+)</Title> +<Para> +<Literal>QextScintillaLexerSQL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaLexerTeX (QScintilla v1.6+)</Title> +<Para> +<Literal>QextScintillaLexerTeX</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaMacro</Title> +<Para> +<Literal>QextScintillaMacro</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QextScintillaPrinter</Title> +<Para> +<Literal>QextScintillaPrinter</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtgl</Literal> Module Reference</Title> +%End + +%Include qtgl/qgl.sip +%Include qtgl/qglcolormap.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtnetwork</Literal> Module Reference</Title> +%End + +%Include qtnetwork/qdns.sip +%Include qtnetwork/qftp.sip +%Include qtnetwork/qhostaddress.sip +%Include qtnetwork/qhttp.sip +%Include qtnetwork/qlocalfs.sip +%Include qtnetwork/qnetwork.sip +%Include qtnetwork/qserversocket.sip +%Include qtnetwork/qsocket.sip +%Include qtnetwork/qsocketdevice.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtpe</Literal> Module Reference</Title> + +<Sect2><Title>QPEApplication</Title> +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int& <Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>Type <Parameter>type</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>AppLnk</Title> +<FuncSynopsis> + <FuncDef>virtual QString <Function>exec</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_property</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>AppLnkSet</Title> +<Para> +<Literal>AppLnkSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Config</Title> +<Para> +<Literal>Config</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>DateFormat</Title> +<Para> +<Literal>DateFormat</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>DocLnk</Title> +<FuncSynopsis> + <FuncDef>QString <Function>exec</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_property</Literal> in Python. +</Para> +</Sect2> + +<Sect2><Title>DocLnkSet</Title> +<Para> +<Literal>DocLnkSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileManager</Title> +<Para> +<Literal>FileManager</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileSelector</Title> +<Para> +<Literal>FileSelector</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FileSelectorItem</Title> +<Para> +<Literal>FileSelectorItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>FontDatabase</Title> +<Para> +<Literal>FontDatabase</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Global</Title> +<FuncSynopsis> + <FuncDef>static void <Function>setBuiltinCommands</Function></FuncDef> + <ParamDef>Command *</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>MenuButton</Title> +<Para> +<Literal>MenuButton</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCopEnvelope</Title> +<Para> +<Literal>QCopEnvelope</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDawg</Title> +<Para> +<Literal>QDawg</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPEMenuBar</Title> +<Para> +<Literal>QPEMenuBar</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPEToolBar</Title> +<Para> +<Literal>QPEToolBar</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>Resource</Title> +<Para> +<Literal>Resource</Literal> is fully implemented. +</Para> +</Sect2> + +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtsql</Literal> Module Reference</Title> +%End + +%Include qtsql/qdatabrowser.sip +%Include qtsql/qdatatable.sip +%Include qtsql/qdataview.sip +%Include qtsql/qeditorfactory.sip +%Include qtsql/qsql.sip +%Include qtsql/qsqlcursor.sip +%Include qtsql/qsqldatabase.sip +%Include qtsql/qsqldriver.sip +%Include qtsql/qsqleditorfactory.sip +%Include qtsql/qsqlerror.sip +%Include qtsql/qsqlfield.sip +%Include qtsql/qsqlform.sip +%Include qtsql/qsqlindex.sip +%Include qtsql/qsqlpropertymap.sip +%Include qtsql/qsqlquery.sip +%Include qtsql/qsqlrecord.sip +%Include qtsql/qsqlresult.sip +%Include qtsql/qsqlselectcursor.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qttable</Literal> Module Reference</Title> +%End + +%Include qttable/qtable.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtui</Literal> Module Reference</Title> +%End + +%Include qtui/qwidgetfactory.sip + +%ExportedDoc +</Sect1> +%End + + +%ExportedDoc +<Sect1><Title><Literal>qtxml</Literal> Module Reference</Title> +%End + +%Include qtxml/qdom.sip + +%ExportedDoc +</Sect1> +%End + + +%Doc +</Article> +%End diff --git a/python/pyqt/examples2/README b/python/pyqt/examples2/README new file mode 100644 index 00000000..1c1938f1 --- /dev/null +++ b/python/pyqt/examples2/README @@ -0,0 +1,11 @@ +To run these examples, make sure you have your PYTHONPATH environment variable +set if needed and explicitly set the path to python at the top of each script +if you don't have /usr/bin/env. + +The examples are written for Qt v2.x. + +A much better source of information about using PyQt is Boudewijn Rempt's +book at http://stage.linuxports.com/projects/pyqt/. + +Phil Thompson +phil@riverbankcomputing.co.uk diff --git a/python/pyqt/examples2/aclock.py b/python/pyqt/examples2/aclock.py new file mode 100755 index 00000000..38ed36c9 --- /dev/null +++ b/python/pyqt/examples2/aclock.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +import sys +from qt import * + +def QMIN(x, y): + if y > x: return y + return x +class AnalogClock(QWidget): + def __init__(self, *args): + apply(QWidget.__init__,(self,) + args) + self.time = QTime.currentTime() + internalTimer = QTimer(self) + self.connect(internalTimer, SIGNAL("timeout()"), self.timeout) + internalTimer.start(5000) + + def timeout(self): + new_time = QTime.currentTime() + if new_time.minute() != self.time.minute(): + self.update() + + def paintEvent(self, qe): + if not self.isVisible(): + return + self.time = QTime.currentTime() + + pts = QPointArray() + paint = QPainter(self) + paint.setBrush(self.foregroundColor()) + + cp = QPoint(self.rect().center()) + d = QMIN(self.width(), self.height()) + matrix = QWMatrix() + matrix.translate(cp.x(), cp.y()) + matrix.scale(d/1000.0, d/1000.0) + + h_angle = 30*(self.time.hour()%12 - 3) + self.time.minute()/2 + matrix.rotate(h_angle) + paint.setWorldMatrix(matrix) + pts.setPoints([-20,0,0,-20,300,0,0,20]) + paint.drawPolygon(pts) + matrix.rotate(-h_angle) + + m_angle = (self.time.minute()-15)*6 + matrix.rotate(m_angle) + paint.setWorldMatrix(matrix) + pts.setPoints([-10,0,0,-10,400,0,0,10]) + paint.drawPolygon(pts) + matrix.rotate(-m_angle) + + for i in range(0,12): + paint.setWorldMatrix(matrix) + paint.drawLine(450,0, 500,0) + matrix.rotate(30) + +a = QApplication(sys.argv) +clock = AnalogClock() +clock.resize(100,100) +a.setMainWidget(clock) +clock.show() +a.exec_loop() diff --git a/python/pyqt/examples2/addressbook.py b/python/pyqt/examples2/addressbook.py new file mode 100755 index 00000000..d7316e33 --- /dev/null +++ b/python/pyqt/examples2/addressbook.py @@ -0,0 +1,457 @@ +#!/usr/bin/env python + +# A port to PyQt of the application example from Qt v2.x. + + +import sys, string +from qt import * + +TRUE = 1 +FALSE = 0 +fileopen = [ +' 16 13 5 1', +'. c #040404', +'# c #808304', +'a c None', +'b c #f3f704', +'c c #f3f7f3', +'aaaaaaaaa...aaaa', +'aaaaaaaa.aaa.a.a', +'aaaaaaaaaaaaa..a', +'a...aaaaaaaa...a', +'.bcb.......aaaaa', +'.cbcbcbcbc.aaaaa', +'.bcbcbcbcb.aaaaa', +'.cbcb...........', +'.bcb.#########.a', +'.cb.#########.aa', +'.b.#########.aaa', +'..#########.aaaa', +'...........aaaaa' +] + +filesave = [ +' 14 14 4 1', +'. c #040404', +'# c #808304', +'a c #bfc2bf', +'b c None', +'..............', +'.#.aaaaaaaa.a.', +'.#.aaaaaaaa...', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.##........##.', +'.############.', +'.##.........#.', +'.##......aa.#.', +'.##......aa.#.', +'.##......aa.#.', +'b.............' +] + +fileprint = [ +' 16 14 6 1', +'. c #000000', +'# c #848284', +'a c #c6c3c6', +'b c #ffff00', +'c c #ffffff', +'d c None', +'ddddd.........dd', +'dddd.cccccccc.dd', +'dddd.c.....c.ddd', +'ddd.cccccccc.ddd', +'ddd.c.....c....d', +'dd.cccccccc.a.a.', +'d..........a.a..', +'.aaaaaaaaaa.a.a.', +'.............aa.', +'.aaaaaa###aa.a.d', +'.aaaaaabbbaa...d', +'.............a.d', +'d.aaaaaaaaa.a.dd', +'dd...........ddd' +] + +class ABCentralWidget( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self, ) + args ) + self.mainGrid = QGridLayout( self, 2, 1, 5, 5 ) + + self.setupTabWidget() + self.setupListView() + + self.mainGrid.setRowStretch( 0, 0 ) + self.mainGrid.setRowStretch( 1, 1 ) + + def save( self, filename ): + if not self.listView.firstChild(): + return + + f = QFile( filename ) + if not f.open( IO_WriteOnly ): + return + + t = QTextStream( f ) + + #it = QListViewItemIterator( self.listView ) + + while not t.eof(): + item = QListViewItem( self.listView ) + for i in range (0, 4): + t << item.text( i ) << '\n' + #for it in it.current(): + #for i in range (0, 4): + #t << it.current().text[ i ] << "\n" + + f.close() + + + def load( self, filename ): + self.listView.clear() + + f = QFile( filename ) + if not f.open( IO_ReadOnly ): + return + + t = QTextStream( f ) + + while not t.eof(): + item = QListViewItem( self.listView ) + for i in range (0, 4): + item.setText( i, t.readLine() ) + + f.close(); + + + def setupTabWidget( self ): + self.tabWidget = QTabWidget( self ) + + self.input = QWidget( self.tabWidget ) + self.grid1 = QGridLayout( self.input, 2, 5, 5, 5 ) + + self.liFirstName = QLabel( 'First &Name', self.input ) + self.liFirstName.resize( self.liFirstName.sizeHint() ) + self.grid1.addWidget( self.liFirstName, 0, 0 ) + + self.liLastName = QLabel( '&Last Name', self.input ) + self.liLastName.resize( self.liLastName.sizeHint() ) + self.grid1.addWidget( self.liLastName, 0, 1 ) + + self.liAddress = QLabel( '&Address', self.input ) + self.liAddress.resize( self.liAddress.sizeHint() ) + self.grid1.addWidget( self.liAddress, 0, 2 ) + + self.liEMail = QLabel( '&E-Mail', self.input ) + self.liEMail.resize( self.liEMail.sizeHint() ) + self.grid1.addWidget( self.liEMail, 0, 3 ) + + self.add = QPushButton( '&Add', self.input ) + self.add.resize( self.add.sizeHint() ) + self.grid1.addWidget( self.add, 0, 4 ) + self.connect( self.add, SIGNAL( 'clicked()' ), self.addEntry ) + + self.iFirstName = QLineEdit( self.input ) + self.iFirstName.resize( self.iFirstName.sizeHint() ) + self.grid1.addWidget( self.iFirstName, 1, 0 ) + self.liFirstName.setBuddy( self.iFirstName ) + + self.iLastName = QLineEdit( self.input ) + self.iLastName.resize( self.iLastName.sizeHint() ) + self.grid1.addWidget( self.iLastName, 1, 1 ) + self.liLastName.setBuddy( self.iLastName ) + + self.iAddress = QLineEdit( self.input ) + self.iAddress.resize( self.iAddress.sizeHint() ) + self.grid1.addWidget( self.iAddress, 1, 2 ) + self.liAddress.setBuddy( self.iAddress ) + + self.iEMail = QLineEdit( self.input ) + self.iEMail.resize( self.iEMail.sizeHint() ) + self.grid1.addWidget( self.iEMail, 1, 3 ) + self.liEMail.setBuddy( self.iEMail ) + + self.change = QPushButton( '&Change', self.input ) + self.change.resize( self.change.sizeHint() ) + self.grid1.addWidget( self.change, 1, 4 ) + self.connect( self.change, SIGNAL( 'clicked()' ), self.changeEntry ) + + self.tabWidget.addTab( self.input, '&Add/Change Entry' ) + + # -------------------------------------- + + self.search = QWidget( self ) + self.grid2 = QGridLayout( self.search, 2, 5, 5, 5 ) + + self.cFirstName = QCheckBox( 'First &Name', self.search ) + self.cFirstName.resize( self.cFirstName.sizeHint() ) + self.grid2.addWidget( self.cFirstName, 0, 0 ) + self.connect( self.cFirstName, SIGNAL( 'clicked()' ), self.toggleFirstName ) + + self.cLastName = QCheckBox( '&Last Name', self.search ) + self.cLastName.resize( self.cLastName.sizeHint() ) + self.grid2.addWidget( self.cLastName, 0, 1 ) + self.connect( self.cLastName, SIGNAL( 'clicked()' ), self.toggleLastName ) + + self.cAddress = QCheckBox( '&Address', self.search ) + self.cAddress.resize( self.cAddress.sizeHint() ) + self.grid2.addWidget( self.cAddress, 0, 2 ) + self.connect( self.cAddress, SIGNAL( 'clicked()' ), self.toggleAddress ) + + self.cEMail = QCheckBox( '&E-Mail', self.search ) + self.cEMail.resize( self.cEMail.sizeHint() ) + self.grid2.addWidget( self.cEMail, 0, 3 ) + self.connect( self.cEMail, SIGNAL( 'clicked()' ), self.toggleEMail ) + + self.sFirstName = QLineEdit( self.search ) + self.sFirstName.resize( self.sFirstName.sizeHint() ) + self.grid2.addWidget( self.sFirstName, 1, 0 ) + + self.sLastName = QLineEdit( self.search ) + self.sLastName.resize( self.sLastName.sizeHint() ) + self.grid2.addWidget( self.sLastName, 1, 1 ) + + self.sAddress = QLineEdit( self.search ) + self.sAddress.resize( self.sAddress.sizeHint() ) + self.grid2.addWidget( self.sAddress, 1, 2 ) + + self.sEMail = QLineEdit( self.search ) + self.sEMail.resize( self.sEMail.sizeHint() ) + self.grid2.addWidget( self.sEMail, 1, 3 ) + + self.find = QPushButton( '&Find', self.search ) + self.find.resize( self.find.sizeHint() ) + self.grid2.addWidget( self.find, 1, 4 ) + self.connect( self.find, SIGNAL( 'clicked()' ), self.findEntries ) + + self.cFirstName.setChecked( TRUE ) + self.sFirstName.setEnabled( TRUE ) + self.sLastName.setEnabled( FALSE ) + self.sAddress.setEnabled( FALSE ) + self.sEMail.setEnabled( FALSE ) + + self.tabWidget.addTab( self.search, "&Search" ) + + self.mainGrid.addWidget( self.tabWidget, 0, 0 ) + + def setupListView( self ): + self.listView = QListView( self ) + self.listView.addColumn( 'First Name' ) + self.listView.addColumn( 'Last Name' ) + self.listView.addColumn( 'Address' ) + self.listView.addColumn( 'E-Mail' ) + + self.listView.setSelectionMode( QListView.Extended ) + + self.connect( self.listView, SIGNAL( 'clicked( QListViewItem* )' ), self.itemSelected ) + + self.mainGrid.addWidget( self.listView, 1, 0 ) + self.listView.setAllColumnsShowFocus( TRUE ) + + + def addEntry( self ): + if not self.iFirstName.text().isEmpty() or not self.iLastName.text().isEmpty() or \ + not self.iAddress.text().isEmpty() or not self.iEMail.text().isEmpty() : + self.item = QListViewItem( self.listView ) + self.item.setText( 0, self.iFirstName.text() ) + self.item.setText( 1, self.iLastName.text() ) + self.item.setText( 2, self.iAddress.text() ) + self.item.setText( 3, self.iEMail.text() ) + + self.iFirstName.setText( '' ) + self.iLastName.setText( '' ) + self.iAddress.setText( '' ) + self.iEMail.setText( '' ) + + def changeEntry( self ): + self.item = self.listView.currentItem() + if self.item and ( not self.iFirstName.text().isEmpty() or not self.iLastName.text().isEmpty() or \ + not self.iAddress.text().isEmpty() or not self.iEMail.text().isEmpty() ) : + self.item.setText( 0, self.iFirstName.text() ) + self.item.setText( 1, self.iLastName.text() ) + self.item.setText( 2, self.iAddress.text() ) + self.item.setText( 3, self.iEMail.text() ) + + def selectionChanged( self ): + self.iFirstName.setText( '' ) + self.iLastName.setText( '' ) + self.iAddress.setText( '' ) + self.iEMail.setText( '' ) + + def itemSelected( self, item ): + self.item.setSelected( TRUE ) + self.item.repaint() + + self.iFirstName.setText( item.text( 0 ) ) + self.iLastName.setText( item.text( 1 ) ) + self.iAddress.setText( item.text( 2 ) ) + self.iEMail.setText( item.text( 3 ) ) + + def toggleFirstName( self ): + self.sFirstName.setText( '' ) + if self.cFirstName.isChecked(): + self.sFirstName.setEnabled( TRUE ) + self.sFirstName.setFocus() + else: + self.sFirstName.setEnabled( FALSE ) + + def toggleLastName( self ): + self.sLastName.setText( '' ) + if self.cLastName.isChecked(): + self.sLastName.setEnabled( TRUE ) + self.sLastName.setFocus() + else: + self.sLastName.setEnabled( FALSE ) + + + def toggleAddress( self ): + self.sAddress.setText( '' ) + if self.cAddress.isChecked(): + self.sAddress.setEnabled( TRUE ) + self.sAddress.setFocus() + else: + self.sAddress.setEnabled( FALSE ) + + + def toggleEMail( self ): + self.sEMail.setText( '' ) + if self.cEMail.isChecked(): + self.sEMail.setEnabled( TRUE ) + self.sEMail.setFocus() + + else: + self.sEMail.setEnabled( FALSE ) + + + def findEntries( self ): + if not self.cFirstName.isChecked() and not self.cLastName.isChecked() and \ + not self.cAddress.isChecked() and not self.cEMail.isChecked(): + self.listView.clearSelection() + return + + it = QListViewItemIterator( self.listView ) + + for it in it.current() : + select = TRUE + + if self.cFirstName.isChecked(): + if select and it.current().text( 0 ).contains( self.sFirstName.text() ): + select = TRUE + else: + select = FALSE + + if self.cLastName.isChecked(): + if select and it.current().text( 1 ).contains( self.sLastName.text() ): + select = TRUE + else: + select = FALSE + + if self.cAddress.isChecked(): + if select and it.current().text( 2 ).contains( self.sAddress.text() ): + select = TRUE + else: + select = FALSE + + if self.cEMail.isChecked(): + if select and it.current().text( 3 ).contains( self.sEMail.text() ): + select = TRUE + else: + select = FALSE + + + if select: + it.current().setSelected( TRUE ) + else: + it.current().setSelected( FALSE ) + it.current().repaint() + + +class ABMainWindow(QMainWindow): + def __init__( self ): + QMainWindow.__init__( self, None, 'example addressbook application' ) + + self.filename = QString.null + self.setupMenuBar() + self.setupFileTools() + self.setupStatusBar() + self.setupCentralWidget() + + def setupMenuBar( self ): + self.file = QPopupMenu( self ) + self.menuBar().insertItem( '&File', self.file ) + + openIcon = QIconSet( QPixmap( fileopen ) ) + self.file.insertItem( 'New', self.fileNew, Qt.CTRL + Qt.Key_N ) + self.file.insertItem( openIcon, 'Open', self.fileOpen, Qt.CTRL + Qt.Key_O ) + self.file.insertSeparator() + saveIcon = QIconSet( QPixmap( filesave ) ) + self.file.insertItem( saveIcon, 'Save', self.fileSave, Qt.CTRL + Qt.Key_S ) + self.file.insertItem( 'Save As...', self.fileSaveAs ) + self.file.insertSeparator() + printIcon = QIconSet( QPixmap( fileprint ) ) + self.file.insertItem( printIcon, 'Print...', self.filePrint, Qt.CTRL + Qt.Key_P ) + self.file.insertSeparator() + #self.file.insertItem( 'Close', self.closeWindow, Qt.CTRL + Qt.Key_W ) + self.file.insertItem('Close', self, SLOT('close()'), Qt.CTRL+Qt.Key_W) + self.file.insertItem( 'Quit', qApp, SLOT( 'quit()' ), Qt.CTRL + Qt.Key_Q ) + + def setupFileTools( self ): + pass + #self.fileTools = QToolBar( self, 'file operations' ) + + def setupStatusBar( self ): + self.statusBar().message( "Ready", 2000 ) + + def setupCentralWidget( self ): + self.view = ABCentralWidget( self ) + #self.view.show() + self.setCentralWidget( self.view ) + + def closeWindow( self ): + close() + + + def fileNew( self ): + pass + + def fileOpen( self ): + fn = QFileDialog.getOpenFileName( QString.null, QString.null, self ) + if not fn.isEmpty(): + self.filename = fn + self.view.load( self.filename ) + + def fileSave( self ): + if self.filename.isEmpty(): + self.fileSaveAs() + return + + self.view.save( self.filename ) + + def fileSaveAs( self ): + fn = QFileDialog.getSaveFileName( QString.null, QString.null, self ) + if not fn.isEmpty(): + self.filename = fn + self.fileSave + + def filePrint( self ): + pass + + +a = QApplication( sys.argv ) + +mw = ABMainWindow() +#mw.setupMenuBar() +#mw.setupFileTools +#mw.setupStatusBar +#mw.setupCentralWidget +#view = ABCentralWidget() +#mw.setCentralWidget( view ) +mw.setCaption( 'Addressbook 1' ) +a.setMainWidget( mw ) +mw.show() + +a.connect( a, SIGNAL( 'lastWindowClosed()' ), a, SLOT( 'quit()' ) ) +a.exec_loop() diff --git a/python/pyqt/examples2/application.py b/python/pyqt/examples2/application.py new file mode 100755 index 00000000..294c6cb4 --- /dev/null +++ b/python/pyqt/examples2/application.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python + +# A simple application. + + +import sys, string +from qt import * + + +fileopen = [ + '16 13 5 1', + '. c #040404', + '# c #808304', + 'a c None', + 'b c #f3f704', + 'c c #f3f7f3', + 'aaaaaaaaa...aaaa', + 'aaaaaaaa.aaa.a.a', + 'aaaaaaaaaaaaa..a', + 'a...aaaaaaaa...a', + '.bcb.......aaaaa', + '.cbcbcbcbc.aaaaa', + '.bcbcbcbcb.aaaaa', + '.cbcb...........', + '.bcb.#########.a', + '.cb.#########.aa', + '.b.#########.aaa', + '..#########.aaaa', + '...........aaaaa' +] + +filesave = [ + '14 14 4 1', + '. c #040404', + '# c #808304', + 'a c #bfc2bf', + 'b c None', + '..............', + '.#.aaaaaaaa.a.', + '.#.aaaaaaaa...', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.##........##.', + '.############.', + '.##.........#.', + '.##......aa.#.', + '.##......aa.#.', + '.##......aa.#.', + 'b.............' +] + +fileprint = [ + '16 14 6 1', + '. c #000000', + '# c #848284', + 'a c #c6c3c6', + 'b c #ffff00', + 'c c #ffffff', + 'd c None', + 'ddddd.........dd', + 'dddd.cccccccc.dd', + 'dddd.c.....c.ddd', + 'ddd.cccccccc.ddd', + 'ddd.c.....c....d', + 'dd.cccccccc.a.a.', + 'd..........a.a..', + '.aaaaaaaaaa.a.a.', + '.............aa.', + '.aaaaaa###aa.a.d', + '.aaaaaabbbaa...d', + '.............a.d', + 'd.aaaaaaaaa.a.dd', + 'dd...........ddd' +] + + +fileOpenText = \ +'''<img source="fileopen"> +Click this button to open a <em>new file</em>.<br><br> +You can also select the <b>Open</b> command from the <b>File</b> menu.''' + +fileSaveText = \ +'''Click this button to save the file you are editing.<br><br> +You will be prompted for a filename.<br><br> +You can also select the <b>Save</b> command from the <b>File</b> menu.''' + +filePrintText = \ +'''Click this button to print the file you are editing.<br><br> +You can also select the <b>Print</b> command from the <b>File</b> menu.''' + + +editorList = [] + + +class ApplicationWindow(QMainWindow): + def __init__(self): + QMainWindow.__init__(self,None,'example application main window',Qt.WDestructiveClose) + + self.filename = QString.null + self.printer = QPrinter() + + self.fileTools = QToolBar(self,'file operations') + + openIcon = QPixmap(fileopen) + self.fileOpen = QToolButton(openIcon,'Open File',QString.null,self.load,self.fileTools,'open file') + + saveIcon = QPixmap(filesave) + self.fileSave = QToolButton(saveIcon,'Save File',QString.null,self.save,self.fileTools,'save file') + + printIcon = QPixmap(fileprint) + self.filePrint = QToolButton(printIcon,'Print File',QString.null,self.printDoc,self.fileTools,'print file') + + QWhatsThis.whatsThisButton(self.fileTools) + + QWhatsThis.add(self.fileOpen,fileOpenText) + QMimeSourceFactory.defaultFactory().setPixmap('fileopen',openIcon) + QWhatsThis.add(self.fileSave,fileSaveText) + QWhatsThis.add(self.filePrint,filePrintText) + + self.file = QPopupMenu(self) + self.menuBar().insertItem('&File',self.file) + + self.file.insertItem('&New',self.newDoc,Qt.CTRL + Qt.Key_N) + + id = self.file.insertItem(QIconSet(openIcon),'&Open',self.load,Qt.CTRL + Qt.Key_O) + self.file.setWhatsThis(id,fileOpenText) + + id = self.file.insertItem(QIconSet(saveIcon),'&Save',self.save,Qt.CTRL + Qt.Key_S) + self.file.setWhatsThis(id,fileSaveText) + + id = self.file.insertItem('Save &as',self.saveAs) + self.file.setWhatsThis(id,fileSaveText) + + self.file.insertSeparator() + + id = self.file.insertItem(QIconSet(printIcon),'&Print',self.printDoc,Qt.CTRL + Qt.Key_P) + self.file.setWhatsThis(id,filePrintText) + + self.file.insertSeparator() + + self.file.insertItem('&Close',self,SLOT('close()'),Qt.CTRL + Qt.Key_W) + self.file.insertItem('&Quit',qApp,SLOT('closeAllWindows()'),Qt.CTRL + Qt.Key_Q) + + self.help = QPopupMenu(self) + self.menuBar().insertSeparator() + self.menuBar().insertItem('&Help',self.help) + + self.help.insertItem('&About',self.about,Qt.Key_F1) + self.help.insertItem('About &Qt',self.aboutQt) + + self.e = QMultiLineEdit(self,'editor') + self.e.setFocus() + self.setCentralWidget(self.e) + + self.statusBar().message('Ready',2000) + self.resize(450,600) + + def newDoc(self): + ed = ApplicationWindow() + ed.show() + editorList.append(ed) + + def load(self): + fn = QFileDialog.getOpenFileName(QString.null,QString.null,self) + if fn.isEmpty(): + self.statusBar().message('Loading aborted',2000) + return + + fileName = str(fn) + + self.e.setAutoUpdate(0) + self.e.clear() + + try: + f = open(fileName,'r') + except: + return + + for l in f.readlines(): + self.e.append(string.rstrip(l)) + + f.close() + + self.e.setAutoUpdate(1) + self.e.repaint() + self.e.setEdited(0) + self.setCaption(fileName) + self.statusBar().message('Loaded document %s' % (fileName),2000) + + def save(self): + if self.filename.isEmpty(): + self.saveAs() + return + + try: + f = open(str(self.filename),'w+') + except: + self.statusBar().message('Could not write to %s' % (self.filename),2000) + return + + f.write(str(self.e.text())) + f.close() + + self.e.setEdited(0) + self.setCaption(self.filename) + self.statusBar().message('File %s saved' % (self.filename),2000) + + def saveAs(self): + fn = QFileDialog.getSaveFileName(QString.null,QString.null,self) + if not fn.isEmpty(): + self.filename = fn + self.save() + else: + self.statusBar().message('Saving aborted',2000) + + def printDoc(self): + Margin = 10 + pageNo = 1 + + if self.printer.setup(self): + self.statusBar().message('Printing...') + + p = QPainter() + p.begin(self.printer) + p.setFont(self.e.font()) + yPos = 0 + fm = p.fontMetrics() + metrics = QPaintDeviceMetrics(self.printer) + + for i in range(self.e.numLines): + if Margin + yPos > metrics.height() - Margin: + pageNo = pageNo + 1 + self.statusBar().message('Printing (page %d)...' % (pageNo)) + self.printer.newPage() + yPos = 0 + + p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i)) + yPos = yPos + fm.lineSpacing() + + p.end() + self.statusBar().message('Printing completed',2000) + else: + self.statusBar().message('Printing aborted',2000) + + def closeEvent(self,ce): + if not self.e.edited(): + ce.accept() + return + + rc = QMessageBox.information(self,'Qt Application Example', + 'The document has been changed since the last save.', + 'Save Now','Cancel','Leave Anyway',0,1) + + if rc == 0: + self.save() + ce.accept() + elif rc == 2: + ce.accept() + else: + ce.ignore() + + def about(self): + QMessageBox.about(self,'Qt Application Example', + 'This example demonstrates simple use of QMainWindow,\nQMenuBar and QToolBar.') + + def aboutQt(self): + QMessageBox.aboutQt(self,'Qt Application Example') + + +a = QApplication(sys.argv) +mw = ApplicationWindow() +mw.setCaption('Document 1') +mw.show() +a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()')) +a.exec_loop() diff --git a/python/pyqt/examples2/buttongroups.py b/python/pyqt/examples2/buttongroups.py new file mode 100755 index 00000000..a8c94575 --- /dev/null +++ b/python/pyqt/examples2/buttongroups.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python +#/**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +#** +#** This file is part of an example program for Qt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * + +TRUE = 1 +FALSE = 0 + +## +# Creates all child widgets of the ButtonGroups window +## + +class ButtonsGroups( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + + # Create Widgets which allow easy layouting + self.vbox = QVBoxLayout( self ) + self.box1 = QHBoxLayout( self.vbox ) + self.box2 = QHBoxLayout( self.vbox ) + + # ------- first group + + # Create an exclusive button group + self.grp1 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) + self.box1.addWidget( self.grp1 ) + self.grp1.setExclusive( TRUE ) + + # insert 3 radiobuttons + self.rb11 = QRadioButton( "&Radiobutton 1", self.grp1 ) + self.rb11.setChecked( TRUE ) + QRadioButton( "R&adiobutton 2", self.grp1 ) + QRadioButton( "Ra&diobutton 3", self.grp1 ) + + # ------- second group + + # Create a non-exclusive buttongroup + self.grp2 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) + self.box1.addWidget( self.grp2 ) + self.grp2.setExclusive( FALSE ) + + # insert 3 checkboxes + QCheckBox( "&Checkbox 1", self.grp2 ) + self.cb12 = QCheckBox( "C&heckbox 2", self.grp2 ) + self.cb12.setChecked( TRUE ) + self.cb13 = QCheckBox( "Triple &State Button", self.grp2 ) + self.cb13.setTristate( TRUE ) + self.cb13.setChecked( TRUE ) + + # ------------ third group + + # create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons + self.grp3 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) + self.box2.addWidget( self.grp3 ) + self.grp3.setRadioButtonExclusive( TRUE ) + + # insert three radiobuttons + self.rb21 = QRadioButton( "Rad&iobutton 1", self.grp3 ) + self.rb22 = QRadioButton( "Radi&obutton 2", self.grp3 ) + self.rb23 = QRadioButton( "Radio&button 3", self.grp3 ) + self.rb23.setChecked( TRUE ) + + # insert a checkbox... + self.state = QCheckBox( "E&nable Radiobuttons", self.grp3 ) + self.state.setChecked( TRUE ) + # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State() + self.connect( self.state, SIGNAL( "clicked()" ), self.slotChangeGrp3State ) + + # ------------ fourth group + + # create a groupbox which layouts its childs in a columns + self.grp4 = QButtonGroup( 1, QGroupBox.Horizontal, "Groupbox with normal buttons", self ) + self.box2.addWidget( self.grp4 ) + + # insert two pushbuttons... + QPushButton( "&Push Button", self.grp4 ) + self.tb = QPushButton( "&Toggle Button", self.grp4 ) + + # ... and make the second one a toggle button + self.tb.setToggleButton( TRUE ) + self.tb.setOn( TRUE ) + + + # + # SLOT slotChangeGrp3State() + # enables/disables the radiobuttons of the third buttongroup + # + + def slotChangeGrp3State( self ): + self.rb21.setEnabled( self.state.isChecked() ) + self.rb22.setEnabled( self.state.isChecked() ) + self.rb23.setEnabled( self.state.isChecked() ) + + +## main program +a = QApplication( sys.argv ) + +buttonsgroups = ButtonsGroups() +buttonsgroups.resize( 500, 250 ) +buttonsgroups.setCaption( "Examples for Buttons and Groups" ) +a.setMainWidget( buttonsgroups ) +buttonsgroups.show() + +a.exec_loop() diff --git a/python/pyqt/examples2/dclock.py b/python/pyqt/examples2/dclock.py new file mode 100755 index 00000000..5382d4fa --- /dev/null +++ b/python/pyqt/examples2/dclock.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# A port to PyQt of the dclock example from Qt v2.x. + + +import sys, string +from qt import * + + +class DigitalClock(QLCDNumber): + def __init__(self, parent=None, name=None): + QLCDNumber.__init__(self, parent, name) + self.showingColon = 0 + self.setFrameStyle(QFrame.Panel | QFrame.Raised) + self.setLineWidth(2) + self.showTime() + self.normalTimer = self.startTimer(500) + self.showDateTimer = -1 + + def timerEvent(self, e): + if e.timerId() == self.showDateTimer: + self.stopDate() + else: + if self.showDateTimer == -1: + self.showTime() + + def mousePressEvent(self, e): + if e.button() == Qt.LeftButton: + self.showDate() + + def showDate(self): + if self.showDateTimer != -1: + return + d = QDate.currentDate() + self.display('%2d %2d' % (d.month(), d.day())) + self.showDateTimer = self.startTimer(2000) + + def stopDate(self): + self.killTimer(self.showDateTimer) + self.showDateTimer = -1 + self.showTime() + + def showTime(self): + self.showingColon = not self.showingColon + s = list(str(QTime.currentTime().toString())[:5]) #.left(5) + if not self.showingColon: + s[2] = ' ' + if s[0] == '0': + s[0] = ' ' + s = string.join(s,'') + self.display(s) + +a = QApplication(sys.argv) +clock = DigitalClock() +clock.resize(170,80) +a.setMainWidget(clock) +clock.show() +a.exec_loop() diff --git a/python/pyqt/examples2/desktop.py b/python/pyqt/examples2/desktop.py new file mode 100755 index 00000000..a1177f24 --- /dev/null +++ b/python/pyqt/examples2/desktop.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python + +import sys +from qt import * + +seed = 0.353535353535 +KINDA_RAND_MAX = 32767 + +def kindaRand(): + global seed + seed = seed * 147 + seed = seed - int(seed) + return int(seed*(KINDA_RAND_MAX + 1)) + +velmax = 15 +velmin = 4 + +def velocity(i): + if i == 1 or i == 2: + i = (kindaRand()&0x7fff % velmax)/3 + velmin + else: + i = (kindaRand()&0x7fff % velmax) + velmin + +maxpoints = 5 +maxcurves = 8 + +def poly(): + d = QApplication.desktop() + d.setBackgroundColor(white) + xvel = [ 0 ] * 8 + yvel = [ 0 ] * 8 + head = 0 + tail = -maxcurves + 2 + a = QPointArray() * maxcurves + r = d.rect() + for i in range(maxcurves): + a[i].resize(maxpoints) + p = a[0] + for i in range(maxpoints): + p.setPoint(i, (kindaRand()&0x7fff) % r.width(), + (kindaRand()&0x7fff) % r.height() ) + xvel[i] = velocity(i) + yvel[i] = velocity(i) + + paint = QPainter() + paint.begin(d) + + for ntimes in range(2000): + paint.setBrush(QColor(kindaRand()%360,180,255, QColor.Hsv)) + paint.drawPolygon(a[head]) + tail = tail + 1 + if tail >= maxcurves: + tail = 0 + minx = r.left() + maxx = r.right() + miny = r.top() + maxy = r.bottom() + p = a[head] + head = head + 1 + if head >= maxcurves: + head = 0 + for i in range(maxpoints): + x, y = p.point(i) + x = x + xvel[i] + y = y + yvel[i] + if x >= maxx: + x = maxx - (x - maxx + 1) + xvel[i] = -velocity(i) + if x <= minx: + x = minx + (minx - x + 1) + xvel[i] = velocity(i) + if y >= maxy: + y = maxy - (y - maxy + 1) + yvel[i] = -velocity(i) + if y <= miny: + y = miny + (miny - y + 1) + yvel[i] = velocity(i) + a[head].setPoint(i, x, y) + paint.end() + +def rotate(): + w = 64 + h = 64 + image = QImage(w, h, 8, 128) + for i in range(128): + image.setColor(i, qRgb(i,0,0)) + for y in range(h): + for x in range(w): + image.setPixel(x,y,(x+y)%128) + + pm = QPixmap() + pm.convertFromImage(image) + #pm.optimize(1) + + d = QApplication.desktop() + + for i in range(0,361,2): + m = QWMatrix() + m.rotate(i) + rpm = pm.xForm(m) + d.setBackgroundPixmap(rpm) + d.update() + +def generateStone(pm, c1, c2, c3): + p = QPainter() + p1 = QPen(c1, 0) + p2 = QPen(c2, 0) + p3 = QPen(c3, 0) + + p.begin(pm) + for i in range(pm.width()): + for j in range(pm.height()): + r = kindaRand() + if r < KINDA_RAND_MAX / 3: + p.setPen(p1) + elif r < KINDA_RAND_MAX / 3 * 2: + p.setPen(p2) + else: + p.setPen(p3) + p.drawPoint(i, j) + p.end() + +def drawShadeText(p, x, y, text, topColor, bottomColor, sw=2): + if not p.isActive(): + return + + p.setPen(bottomColor) + p.drawText(x+sw, y+sw, text) + p.setPen(topColor) + p.drawText(x, y, text) + +class DesktopWidget(QWidget): + def __init__(self, s, parent=None, name=''): + QWidget.__init__(self, parent, name, WType_Desktop | WPaintDesktop) + self.text = s + self.pm = None + + def paintEvent(self, pe): + c1 = self.backgroundColor() + c2 = c1.light(104) + c3 = c1.dark(106) + if not self.pm: + self.pm = QPixmap(64, 64) + generateStone(self.pm, c1, c2, c3) + self.setBackgroundPixmap(self.pm) + self.update() + br = self.fontMetrics().boundingRect(self.text) + offscreen = QPixmap(br.width(), br.height()) + x = self.width()/2 - br.width()/2 + y = self.height()/2 - br.height()/2 + offscreen.fill(self, x, y) + p = QPainter() + p.begin(offscreen) + drawShadeText(p, -br.x(), -br.y(), self.text, c2, c3, 3) + p.end() + bitBlt(self, x, y, offscreen) + +def desktopWidget(s='Troll Tech'): + t = DesktopWidget(s) + t.update() + qApp.exec_loop() + +def desktopText(s='Troll Tech'): + border = 20 + + c1 = qApp.palette().normal().background() + c2 = c1.light(104) + c3 = c1.dark(106) + + pm = QPixmap(10, 10) + p = QPainter() + p.begin(pm) + r = p.fontMetrics().boundingRect(s) + p.end() + + appWidth = qApp.desktop().width() + appHeight = qApp.desktop().height() + if r.width() > appWidth - border*2: + r.setWidth(appWidth - border*2) + if r.height() > appHeight - border*2: + r.setHeight(appHeight - border*2) + + pm.resize(r.size().width()+border*2,r.size().height()+border*2) + generateStone(pm, c1, c2, c3) + p.begin(pm) + drawShadeText(p, -r.x()+border, -r.y()+border, s, c2, c3) + p.end() + + qApp.desktop().setBackgroundPixmap(pm) + +a = QApplication(sys.argv) +if len(sys.argv) > 1: + f = QFont('charter', 96, QFont.Weight.Black) + f.setStyleHint(QFont.StyleHint.Times) + a.setFont(f) +validOptions = 0 +if len(sys.argv) == 2: + validOptions = 1 + if sys.argv[1] == '-poly': + poly() + elif sys.argv[1] == '-rotate': + rotate() + elif sys.argv[1] == '-troll': + desktopText() + elif sys.argv[1] == '-trollwidget': + desktopWidget() + else: + validOptions = 0 +if len(sys.argv) == 3: + validOptions = 1 + if sys.argv[1] == '-shadetext': + desktopText(sys.argv[2]) + elif sys.argv[1] == '-shadewidget': + desktopWidget(sys.argv[2]) + else: + validOptions = 0 + +if not validOptions: + rotate() diff --git a/python/pyqt/examples2/dirview.py b/python/pyqt/examples2/dirview.py new file mode 100755 index 00000000..ae232e98 --- /dev/null +++ b/python/pyqt/examples2/dirview.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python + +import sys +from qt import * + +class Directory(QListViewItem): + def __init__(self, parent, name=None): + apply(QListViewItem.__init__,(self,parent)) + if isinstance(parent, QListView): + self.p = None + self.f = '/' + else: + self.p = parent + self.f = name + self.c = [] + self.readable = 1 + + def setOpen(self, o): + if o and not self.childCount(): + s = self.fullName() + thisDir = QDir(s) + if not thisDir.isReadable(): + self.readable = 0 + return + + files = thisDir.entryInfoList() + if files: + for f in files: + fileName = str(f.fileName()) + if fileName == '.' or fileName == '..': + continue + elif f.isSymLink(): + d = QListViewItem(self, fileName, 'Symbolic Link') + elif f.isDir(): + d = Directory(self, fileName) + else: + if f.isFile(): + s = 'File' + else: + s = 'Special' + d = QListViewItem(self, fileName, s) + self.c.append(d) + + QListViewItem.setOpen(self, o) + + def setup(self): + self.setExpandable(1) + QListViewItem.setup(self) + + def fullName(self): + if self.p: + s = self.p.fullName() + self.f + '/' + else: + s = '/' + return s + + def text(self, column): + if column == 0: + return self.f + elif self.readable: + return 'Directory' + else: + return 'Unreadable Directory' + +a = QApplication(sys.argv) +mw = QListView() +a.setMainWidget(mw) +mw.setCaption('Directory Browser') +mw.addColumn('Name') +mw.addColumn('Type') +mw.resize(400, 400) +mw.setTreeStepSize(20) +root = Directory(mw) +root.setOpen(1) +mw.show() +a.exec_loop() diff --git a/python/pyqt/examples2/dragdrop.py b/python/pyqt/examples2/dragdrop.py new file mode 100755 index 00000000..4cc8c738 --- /dev/null +++ b/python/pyqt/examples2/dragdrop.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Ported to PyQt by Issac Trotts on Jan 1, 2002 + +import sys +from qt import * + +import dropsite, secret + + +def addStuff( parent, yn_image, yn_secret = 0 ): + tll = QVBoxLayout( parent, 10 ) + d = dropsite.DropSite( parent, 'dropsite' ) + d.setFrameStyle( QFrame.Sunken + QFrame.WinPanel ) + tll.addWidget( d ) + if yn_image: + stuff = QPixmap() + if not stuff.load( "trolltech.bmp" ): + stuff = QPixmap(20,20) + stuff.fill(Qt.green) + d.setPixmap( stuff ) + else: + d.setText("Drag and Drop") + d.setFont(QFont("Helvetica",18)) + if secret: + s = secret.SecretSource( 42, parent ) + tll.addWidget( s ) + + format = QLabel( "\n\n\n\nNone\n\n\n\n", parent ) + tll.addWidget( format ) + tll.activate() + parent.resize( parent.sizeHint() ) + + QObject.connect( d, PYSIGNAL('message(QString &)'), + format, SLOT('setText(QString &)') ) + + +app = QApplication( sys.argv ) + +mw = QWidget() +addStuff( mw, 1 ) +mw.setCaption( "Qt Example - Drag and Drop" ) +mw.show() + +mw2 = QWidget() +addStuff( mw2, 0 ) +mw2.setCaption( "Qt Example - Drag and Drop" ) +mw2.show() + +mw3 = QWidget() +addStuff( mw3, 1, 1 ) +mw3.setCaption( "Qt Example - Drag and Drop" ) +mw3.show() + +QObject.connect(qApp,SIGNAL('lastWindowClosed()'),qApp,SLOT('quit()')) + +app.exec_loop() diff --git a/python/pyqt/examples2/dropsite.py b/python/pyqt/examples2/dropsite.py new file mode 100644 index 00000000..7897109c --- /dev/null +++ b/python/pyqt/examples2/dropsite.py @@ -0,0 +1,96 @@ +# This is part of the dragdrop example. + + +from qt import * + +import secret + + +class DropSite(QLabel): + def __init__(self, parent=None, name=None): + QLabel.__init__( self, parent, name ) + self.setAcceptDrops(1) + + # this is a normal event + def mousePressEvent( self, e ): + if ( self.pixmap() ) : + drobj = QImageDrag( self.pixmap().convertToImage(), self ) + pm = QPixmap() + pm.convertFromImage(self.pixmap().convertToImage().smoothScale( + self.pixmap().width()/3,self.pixmap().height()/3)) + drobj.setPixmap(pm,QPoint(-5,-7)) + else : + drobj = QTextDrag( self.text(), self ) + drobj.dragCopy() + + def backgroundColorChange( self, qcolor ): + # Reduce flicker by using repaint() rather than update() + self.repaint() + + def dragMoveEvent( self, e ): + # Check if you want the drag at e.pos()... + # Give the user some feedback... + pass + + def dragEnterEvent( self, e ): + # Check if you want the drag... + if (secret.canDecode( e ) or + QTextDrag.canDecode( e ) or + QImageDrag.canDecode( e ) or + QUriDrag.canDecode( e )): + e.accept() + + # Give the user some feedback... + t = '' + i = 0 + while e.format( i ): + if ( t != '' ): + t += "\n" + t += str(e.format( i )) + i += 1 + self.emit(PYSIGNAL('message(QString &)'), (QString(t),)) + self.setBackgroundColor(Qt.white) + + def dragLeaveEvent( self, QDragLeaveEvent ): + # Give the user some feedback... + self.emit(PYSIGNAL('message(QString &)'), (QString(''),)) + self.setBackgroundColor(Qt.lightGray) + + def dropEvent( self, e ): + self.setBackgroundColor(Qt.lightGray) + # Try to decode to the data you understand... + str = QString() + if ( QTextDrag.decode( e, str ) ) : + self.setText( str ) + self.setMinimumSize( self.minimumSize().expandedTo(self.sizeHint()) ) + return + + pm = QPixmap() + if ( QImageDrag.decode( e, pm ) ) : + self.setPixmap( pm ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return + + # QStrList strings + #strings = QStrList() + strings = [] + if ( QUriDrag.decode( e, strings ) ) : + m = QString("Full URLs:\n") + for u in strings: + m = m + " " + u + '\n' + # QStringList files + files = [] + if ( QUriDrag.decodeLocalFiles( e, files ) ) : + m += "Files:\n" + # for (QStringList.Iterator i=files.begin() i!=files.end() ++i) + for i in files: + m = m + " " + i + '\n' + self.setText( m ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return + + str = secret.decode( e ) + if str: + self.setText( str ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return diff --git a/python/pyqt/examples2/gears.py b/python/pyqt/examples2/gears.py new file mode 100755 index 00000000..bf5b913f --- /dev/null +++ b/python/pyqt/examples2/gears.py @@ -0,0 +1,235 @@ +#!/usr/bin/env python + + +import sys +import math +from qt import * +from qtgl import * +from OpenGL.GL import * + +def gear(inner_radius,outer_radius,width,teeth,tooth_depth): + r0 = inner_radius; + r1 = outer_radius - tooth_depth/2.0; + r2 = outer_radius + tooth_depth/2.0; + + da = 2.0*math.pi/teeth/4.0; + + glShadeModel(GL_FLAT) + + glNormal3f(0.0,0.0,1.0) + + # draw front face + + glBegin(GL_QUAD_STRIP) + + for i in range(teeth+1): + angle = i * 2.0*math.pi/teeth; + glVertex3f(r0*math.cos(angle), r0*math.sin(angle), width*0.5 ) + glVertex3f(r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f(r0*math.cos(angle), r0*math.sin(angle), width*0.5 ) + glVertex3f(r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + + glEnd() + + # draw front sides of teeth + + da = 2.0*math.pi/teeth/4.0; + + glBegin(GL_QUADS) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + + glEnd() + + + glNormal3f( 0.0, 0.0, -1.0 ) + + # draw back face + + glBegin( GL_QUAD_STRIP ); + + for i in range(teeth+1): + angle = i*2.0*math.pi/teeth; + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ) + + glEnd() + + # draw back sides of teeth + + da = 2.0*math.pi/teeth/4.0 + + glBegin( GL_QUADS ) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), -width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), -width*0.5 ) + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + + glEnd() + + # draw outward faces of teeth + + glBegin( GL_QUAD_STRIP ) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + + u = r2*math.cos(angle+da) - r1*math.cos(angle) + v = r2*math.sin(angle+da) - r1*math.sin(angle) + + len = math.sqrt( u*u + v*v ) + u /= len + v /= len + glNormal3f( v, -u, 0.0 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), -width*0.5 ) + glNormal3f( math.cos(angle), math.sin(angle), 0.0 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), -width*0.5 ) + u = r1*math.cos(angle+3*da) - r2*math.cos(angle+2*da) + v = r1*math.sin(angle+3*da) - r2*math.sin(angle+2*da) + glNormal3f( v, -u, 0.0 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glNormal3f( math.cos(angle), math.sin(angle), 0.0 ) + + glVertex3f( r1*math.cos(0.0), r1*math.sin(0.0), width*0.5 ) + glVertex3f( r1*math.cos(0.0), r1*math.sin(0.0), -width*0.5 ) + + glEnd() + + glShadeModel (GL_SMOOTH) + + # draw inside radius cylinder + + glBegin( GL_QUAD_STRIP ) + + for i in range(teeth+1): + angle = i * 2.0*math.pi / teeth; + glNormal3f( -math.cos(angle), -math.sin(angle), 0.0 ); + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ); + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), width*0.5 ); + + glEnd() + +############################################################################## +class GearWidget(QGLWidget): + def __init__(self,parent=None,name=None): + QGLWidget.__init__(self,parent,name) + + self.angle=0.0 + self.view_rotx=0.0 + self.view_roty=0.0 + self.view_rotz=0.0 + + self.startTimer(10) + + def timerEvent(self,event): + self.updateGL() + + def paintGL(self): + self.angle = self.angle + 2.0 + self.view_rotx = self.view_rotx + 1.0 + self.view_roty = self.view_roty + 3.0 + self.view_rotz = self.view_rotz + 2.0 + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) + + glPushMatrix() + glRotatef( self.view_rotx, 1.0, 0.0, 0.0 ) + glRotatef( self.view_roty, 0.0, 1.0, 0.0 ) + glRotatef( self.view_rotz, 0.0, 0.0, 1.0 ) + + glPushMatrix() + glTranslatef( -3.0, -2.0, 0.0 ) + glRotatef( self.angle, 0.0, 0.0, 1.0 ) + glCallList(self.gear1) + glPopMatrix() + + glPushMatrix() + glTranslatef( 3.1, -2.0, 0.0 ) + glRotatef( -2.0*self.angle-9.0, 0.0, 0.0, 1.0 ) + glCallList(self.gear2) + glPopMatrix() + + glPushMatrix() + glTranslatef( -3.1, 2.2, -1.8 ) + glRotatef( 90.0, 1.0, 0.0, 0.0 ) + glRotatef( 2.0*self.angle-2.0, 0.0, 0.0, 1.0 ) + glCallList(self.gear3) + glPopMatrix() + + glPopMatrix() + + def resizeGL(self,width,height): + w = width / float(height) + h = 1.0 + + glViewport( 0, 0, width, height ) + glMatrixMode(GL_PROJECTION) + glLoadIdentity() + glFrustum( -w, w, -h, h, 5.0, 60.0 ) + glMatrixMode(GL_MODELVIEW) + glLoadIdentity() + glTranslatef( 0.0, 0.0, -40.0 ) + + def initializeGL(self): + pos=(5.0, 5.0, 10.0, 1.0 ) + ared=(0.8, 0.1, 0.0, 1.0 ) + agreen=(0.0, 0.8, 0.2, 1.0 ) + ablue=(0.2, 0.2, 1.0, 1.0 ) + + glLightfv(GL_LIGHT0,GL_POSITION,pos) + glEnable(GL_CULL_FACE) + glEnable(GL_LIGHTING) + glEnable(GL_LIGHT0) + glEnable(GL_DEPTH_TEST) + + self.gear1=glGenLists(1) + glNewList(self.gear1,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,ared) + gear(1.0,4.0,1.0,20,0.7) + glEndList() + + self.gear2=glGenLists(1) + glNewList(self.gear2,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,agreen) + gear(0.5,2.0,2.0,10,0.7) + glEndList() + + self.gear3=glGenLists(1) + glNewList(self.gear3,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,ablue) + gear(1.3,2.0,0.5,10,0.7) + glEndList() + + glEnable(GL_NORMALIZE) + +############################################################################## +if __name__=='__main__': + QApplication.setColorSpec(QApplication.CustomColor) + app=QApplication(sys.argv) + + if not QGLFormat.hasOpenGL(): + raise 'No Qt OpenGL support.' + + widget=GearWidget() + app.setMainWidget(widget) + widget.show() + app.exec_loop() diff --git a/python/pyqt/examples2/menu.py b/python/pyqt/examples2/menu.py new file mode 100755 index 00000000..36efffa8 --- /dev/null +++ b/python/pyqt/examples2/menu.py @@ -0,0 +1,301 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys, string +from qt import * + +TRUE = 1 +FALSE = 0 + +# XPM +p1_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFF0000", +" ", +" ", +" .... ", +" .XXXX. ", +" .............. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .............. ", +" " +] + +# XPM +p2_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFFFFFF", +" ", +" ...... ", +" .XXX.X. ", +" .XXX.XX. ", +" .XXX.XXX. ", +" .XXX..... ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" ......... ", +" ", +" " +] + +# XPM +p3_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFFFFFF", +" ", +" ", +" ......... ", +" ........... ", +" ........ .. ", +" ........... ", +" ........... ", +" ........... ", +" ........... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ......... ", +" ", +" " +] + +p4_xpm = [ +' 16 14 5 1', +'. c #000000', +'# c #848284', +'a c #c6c3c6', +'b c #ffff00', +'c c #ffffff', +'aaaaa.........aa', +'aaaa.cccccccc.aa', +'aaaa.c.....c.aaa', +'aaa.cccccccc.aaa', +'aaa.c.....c....a', +'aa.cccccccc.a.a.', +'a..........a.a..', +'.aaaaaaaaaa.a.a.', +'.............aa.', +'.aaaaaa###aa.a.a', +'.aaaaaabbbaa...a', +'.............a.a', +'a.aaaaaaaaa.a.aa', +'aa...........aaa' +] + +# Auxiliary class to provide fancy menu items with different fonts. +# Used for the "bold" and "underline" menu items in the options menu. + +#class MyMenuItem( QCustomMenuItem ): +# def __init__( self, s=None, f=None ): +# apply( QCustomMenuItem.__init__,( self, s, f ) ) +# string = QString( s ) +# font = QFont( f ) + +# def paint( self, p, TRUE, FALSE, x, y, w, h ) : +# p.setFont ( font ) +# p.drawText( x, y, w, h, Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, string ) +# def sizeHint( self ): +# return QFontMetrics( font ).size( Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, string ) + + +# +### Implementation of MenuExample class +# + +class MenuExample( QWidget ): + def __init__( self, parent=None, name=None ): + apply( QWidget.__init__,(self, parent, name) ) + self.p1 = QIconSet( QPixmap ( p1_xpm ) ) + self.p2 = QIconSet( QPixmap ( p2_xpm ) ) + self.p3 = QIconSet( QPixmap ( p3_xpm ) ) + self.p4 = QIconSet( QPixmap ( p4_xpm ) ) + #openIcon = QPixmap() + #saveIcon = QPixmap() + #printIcon = QPixmap() + + self.printer = QPopupMenu( self ) + #CHECK_PTR( self.printer ) + self.printer.insertTearOffHandle() + self.printer.insertItem( "&Print to printer", self.printDoc ) + self.printer.insertItem( "Print to &file", self.file ) + self.printer.insertItem( "Print to fa&x", self.fax ) + self.printer.insertSeparator() + self.printer.insertItem( "Printer &Setup", self.printerSetup ) + + self.file = QPopupMenu( self ) + #CHECK_PTR( self.file ); + self.file.insertItem( self.p1, "&Open", self.open, Qt.CTRL+Qt.Key_O ) + self.file.insertItem( self.p2, "&New", self.news, Qt.CTRL+Qt.Key_N ) + self.file.insertItem( self.p3, "&Save", self.save, Qt.CTRL+Qt.Key_S ) + self.file.insertItem( "&Close", self.closeDoc, Qt.CTRL+Qt.Key_W ) + self.file.insertSeparator() + self.file.insertItem( self.p4, "&Print", self.printer, Qt.CTRL+Qt.Key_P ) + self.file.insertSeparator() + self.file.insertItem( "E&xit", qApp, SLOT( "quit()" ), Qt.CTRL+Qt.Key_Q ) + + self.edit = QPopupMenu( self ) + #CHECK_PTR( self.edit ) + undoID = self.edit.insertItem( "&Undo", self.undo ) + redoID = self.edit.insertItem( "&Redo", self.redo ) + self.edit.setItemEnabled( undoID, TRUE ) + self.edit.setItemEnabled( redoID, FALSE ) + + self.options = QPopupMenu( self ) + #CHECK_PTR( self.options ) + self.options.insertTearOffHandle() + self.options.setCaption( 'Options' ) + self.options.insertItem( "&Normal Font", self.normal ) + self.options.insertSeparator() + + self.options.polish() # adjust system settings + self.f = QFont( self.options.font() ) + self.f.setBold( TRUE ) + self.boldID = self.options.insertItem( "&Bold" ) + self.options.setAccel( Qt.CTRL+Qt.Key_B, self.boldID ) + self.options.connectItem( self.boldID, self.bold ) + + self.f = QFont( self.options.font() ) + self.f.setUnderline( TRUE ) + self.underlineID = self.options.insertItem( "&Underline" ) + self.options.setAccel( Qt.CTRL+Qt.Key_U, self.underlineID ) + self.options.connectItem( self.underlineID, self.underline ) + + self.isBold = FALSE + self.isUnderline = FALSE + self.options.setCheckable( TRUE ) + + self.options = QPopupMenu() + #CHECK_PTR( self.options ) + self.options.insertItem( "&Normal Font", self.normal ) + self.options.insertSeparator() + self.boldID = self.options.insertItem( "&Bold", self.bold ) + self.underlineID = self.options.insertItem( "&Underline", self.underline ) + + self.isBold = FALSE + self.isUnderline = FALSE + self.options.setCheckable( TRUE ) + + self.help = QPopupMenu( self ) + #CHECK_PTR( self.help ) + self.help.insertItem( "&About", self.about, Qt.CTRL+Qt.Key_H ) + self.help.insertItem( "About &Qt", self.aboutQt ) + + self.menu = QMenuBar( self ) + #CHECK_PTR( self.menu ); + self.menu.insertItem( "&File", self.file ) + self.menu.insertItem( "&Edit", self.edit ) + self.menu.insertItem( "&Options", self.options ) + self.menu.insertSeparator() + self.menu.insertItem( "&Help", self.help ) + self.menu.setSeparator( QMenuBar.InWindowsStyle ) + + self.label = QLabel( self ) + #CHECK_PTR( self.label ) + self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 ) + self.label.setFrameStyle( QFrame.Box | QFrame.Raised ) + self.label.setLineWidth( 1 ) + self.label.setAlignment( Qt.AlignCenter ) + + self.label.setFont( QFont( "times", 12, QFont.Bold ) ) + self.connect( self, PYSIGNAL( "explain" ), self.label.setText ) + #self.connect( self, PYSIGNAL( "explain(const char *)" ), + # self.label, SLOT( "setText(const char *)" ) ) + + self.setMinimumSize( 100, 80 ) + + def open( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Open selected", ) ) + + def news( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/New selected", ) ) + + def save( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Save selected", ) ) + + def closeDoc( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Close selected", ) ) + + def undo( self ): + self.emit ( PYSIGNAL( "explain" ), ( "Edit/Undo selected", ) ) + + def redo( self ): + self.emit ( PYSIGNAL( "explain" ), ( "Edit/Redo selected", ) ) + + def normal( self ): + self.isBold = FALSE + self.isUnderline = FALSE + self.options.setItemChecked( self.boldID, self.isBold ) + self.options.setItemChecked( self.underlineID, self.isUnderline ) + self.emit(PYSIGNAL("explain"), ("Options/Normal selected",)) + + def bold( self ): + self.isBold = not self.isBold + self.options.setItemChecked( self.boldID, self.isBold ) + self.emit ( PYSIGNAL( "explain" ), ( "Options/Bold selected", ) ) + + def underline( self ): + self.isUnderline = not self.isUnderline + self.options.setItemChecked( self.underlineID, self.isUnderline ) + self.emit(PYSIGNAL("explain"), ("Options/Underline selected",)) + + def about( self ): + QMessageBox.about( self, "Qt Menu Example", + "This example demonstrates simple use of Qt menus.\n" + "You can cut and paste lines from it to your own\n" + "programs." ) + + def aboutQt( self ): + QMessageBox.aboutQt( self, "Qt Menu Example" ) + + def printDoc( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Printer/Print selected", ) ) + + def file( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Printer/Print To File selected", ) ) + + def fax( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Printer/Print To Fax selected", ) ) + + def printerSetup( self ): + self.emit ( PYSIGNAL( "explain" ), ( "File/Printer/Printer Setup selected", ) ) + + def resizeEvent( self, ev ): + self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 ) + +a = QApplication( sys.argv ) +m = MenuExample() + +a.setMainWidget( m ) +m.setCaption( 'MenuExample' ) +m.show() +#a.connect( a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()') ) +a.exec_loop() diff --git a/python/pyqt/examples2/qt.png b/python/pyqt/examples2/qt.png Binary files differnew file mode 100644 index 00000000..ca630a56 --- /dev/null +++ b/python/pyqt/examples2/qt.png diff --git a/python/pyqt/examples2/qtlogo.png b/python/pyqt/examples2/qtlogo.png Binary files differnew file mode 100644 index 00000000..25c1ebb5 --- /dev/null +++ b/python/pyqt/examples2/qtlogo.png diff --git a/python/pyqt/examples2/secret.py b/python/pyqt/examples2/secret.py new file mode 100644 index 00000000..7023a0b0 --- /dev/null +++ b/python/pyqt/examples2/secret.py @@ -0,0 +1,65 @@ +# This is part of the dragdrop example. + + +from qt import * + + +def canDecode(e): + return e.provides( "secret/magic" ) + + +def decode(e): + payload = str(e.data( "secret/magic" )) + if ( str(payload) != '' ): + e.accept() + return QString("The secret number is "+str(ord(payload)) ) + + return None + + +class SecretDrag(QStoredDrag): + def __init__(self, secret, parent=None, name=None): + QStoredDrag.__init__(self, 'secret/magic', parent, name) + data = QByteArray(chr(secret)) + self.setEncodedData( data ) + + +# XPM +picture_xpm = [ + "16 16 3 1", + " c None", + ". c #000000", + "X c #FFFF00", + " ..... ", + " ..XXXXX.. ", + " .XXXXXXXXX. ", + " .XXXXXXXXXXX. ", + " .XX..XXX..XX. ", + ".XXXXXXXXXXXXX. ", + ".XX...XXX...XX. ", + ".XXX..XXX..XXX. ", + ".XXXXXXXXXXXXX. ", + ".XXXXXX.XXXXXX. ", + " .XX.XX.XX.XX. ", + " .XXX..X..XXX. ", + " .XXXXXXXXX. ", + " ..XXXXX.. ", + " ..... ", + " " +] + + +class SecretSource(QLabel): + def __init__(self, secret, parent=None, name=None): + QLabel.__init__(self, "Secret", parent, name) + self.setBackgroundColor( Qt.blue.light() ) + self.setFrameStyle( QLabel.Box | QLabel.Sunken ) + self.setMinimumHeight( self.sizeHint().height()*2 ) + self.setAlignment( QLabel.AlignCenter ) + self.mySecret = secret + + def mousePressEvent(self, e): + sd = SecretDrag( self.mySecret, self ) + sd.setPixmap(QPixmap(picture_xpm),QPoint(8,8)) + sd.dragCopy() + self.mySecret = self.mySecret + 1 diff --git a/python/pyqt/examples2/semaphore.py b/python/pyqt/examples2/semaphore.py new file mode 100755 index 00000000..5a3ab92c --- /dev/null +++ b/python/pyqt/examples2/semaphore.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python +# +# A port of the semaphore example from Qt. + + +import sys + +# Check if thread support was enabled. +try: + from qt import QThread +except: + print "Thread support not enabled" + sys.exit(1) + +from qt import * + + +# The semaphore instances. +yellowSem = None +greenSem = None + + +class YellowThread(QThread): + def __init__(self,o): + QThread.__init__(self) + + self.receiver = o + self.stopped = 0 + self.mutex = QMutex() + + def run(self): + global yellowSem, greenSem + + for i in range(20): + yellowSem += 1 + + event = QCustomEvent(12345) + event.setData(QString("Yellow!")) + QThread.postEvent(self.receiver,event) + self.msleep(200); + + greenSem -= 1 + + self.mutex.lock() + if self.stopped: + self.stopped = 0 + self.mutex.unlock() + break + + self.mutex.unlock() + + yellowSem += 1 + + event = QCustomEvent(12346) + event.setData(QString("Yellow!")) + QThread.postEvent(self.receiver,event) + + greenSem -= 1 + + def stop(self): + self.mutex.lock() + self.stopped = 1 + self.mutex.unlock() + + +class GreenThread(QThread): + def __init__(self,o): + QThread.__init__(self) + + self.receiver = o + self.stopped = 0 + self.mutex = QMutex() + + def run(self): + global yellowSem, greenSem + + for i in range(20): + greenSem += 1 + + event = QCustomEvent(12345) + event.setData(QString("Green!")) + QThread.postEvent(self.receiver,event) + self.msleep(200) + + yellowSem -= 1 + + self.mutex.lock() + if self.stopped: + self.stopped = 0 + self.mutex.unlock() + break + + self.mutex.unlock() + + greenSem += 1 + + event = QCustomEvent(12346) + event.setData(QString("Green!")) + QThread.postEvent(self.receiver,event) + self.msleep(10) + + yellowSem -= 1 + + def stop(self): + self.mutex.lock() + self.stopped = 1 + self.mutex.unlock() + + +class SemaphoreExample(QWidget): + def __init__(self): + QWidget.__init__(self) + + self.yellowThread = YellowThread(self) + self.greenThread = GreenThread(self) + + global yellowSem, greenSem + yellowSem = QSemaphore(1) + greenSem = QSemaphore(1) + + self.button = QPushButton("&Ignition!",self) + self.connect(self.button,SIGNAL("clicked()"),self.startExample) + + self.mlineedit = QMultiLineEdit(self) + self.label = QLabel(self) + + vbox = QVBoxLayout(self,5) + vbox.addWidget(self.button) + vbox.addWidget(self.mlineedit) + vbox.addWidget(self.label) + + def __del__(self): + stopYellow = self.yellowThread.running() + stopGreen = self.greenThread.running() + + if stopYellow: + self.yellowThread.stop() + + if self.greenThread.running(): + self.greenThread.stop() + + if stopYellow: + self.yellowThread.wait() + + if stopGreen: + self.greenThread.wait() + + global yellowSem, greenSem + yellowSem = None + greenSem = None + + def startExample(self): + if self.yellowThread.running() or self.greenThread.running(): + QMessageBox.information(self,"Sorry", + "The threads have not completed yet, and must finish before " + "they can be started again.") + + return + + self.mlineedit.clear() + + global yellowSem + + while yellowSem.available() < yellowSem.total(): + yellowSem -= 1 + + yellowSem += 1 + + self.yellowThread.start() + self.greenThread.start() + + def customEvent(self,event): + if event.type() == 12345: + s = event.data() + + self.mlineedit.append(s) + + if s.latin1() == "Green!": + self.label.setBackgroundColor(Qt.green) + else: + self.label.setBackgroundColor(Qt.yellow) + + self.label.setText(s) + + del s + elif event.type() == 12346: + s = event.data() + + QMessageBox.information(self,s.latin1() + " - Finished", + "The thread creating the \"" + s.latin1() + + "\" events has finished.") + + del s + else: + print "Unknown custom event type:", event.type() + + +app = QApplication(sys.argv) +se = SemaphoreExample() +app.setMainWidget(se) +se.show() + +sys.exit(app.exec_loop()) diff --git a/python/pyqt/examples2/splitter.py b/python/pyqt/examples2/splitter.py new file mode 100755 index 00000000..1c2fef7b --- /dev/null +++ b/python/pyqt/examples2/splitter.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import sys +from qt import * + +class Test(QWidget): + def __init__(self, parent=None, name='Test', f=0): + QWidget.__init__(self, parent, name, f) + + def paintEvent(self, e): + p = QPainter(self) + p.setClipRect(e.rect()) + d = 1000 + x1 = 0 + x2 = self.width() - 1 + y1 = 0 + y2 = self.height() - 1 + + x = (x1+x2)/2 + p.drawLine(x, y1, x+d, y1+d) + p.drawLine(x, y1, x-d, y1+d) + p.drawLine(x, y2, x+d, y2-d) + p.drawLine(x, y2, x-d, y2-d) + + y = (y1+y2)/2 + p.drawLine(x1, y, x1+d, y+d) + p.drawLine(x1, y, x1+d, y-d) + p.drawLine(x2, y, x2-d, y+d) + p.drawLine(x2, y, x2-d, y-d) + + +if __name__=="__main__": + a = QApplication(sys.argv) + + s1 = QSplitter(Qt.Vertical, None, "main") + s2 = QSplitter(Qt.Horizontal, s1, "top") + + t1 = Test(s2) + t1.setBackgroundColor(Qt.blue.light(180)) + t1.setMinimumSize(50,0) + + t2 = Test(s2) + t2.setBackgroundColor(Qt.green.light(180)) + s2.setResizeMode(t2, QSplitter.KeepSize) + s2.moveToFirst(t2) + + s3 = QSplitter(Qt.Horizontal, s1, "bottom") + + t3 = Test(s3) + t3.setBackgroundColor(Qt.red) + t4 = Test(s3) + t4.setBackgroundColor(Qt.white) + + t5 = Test(s3) + t5.setMaximumHeight(250) + t5.setMinimumSize(80,50) + t5.setBackgroundColor(Qt.yellow) + + s1.setOpaqueResize(1) + s2.setOpaqueResize(1) + s3.setOpaqueResize(1) + + a.setMainWidget(s1) + s1.show() + a.exec_loop() diff --git a/python/pyqt/examples2/table.py b/python/pyqt/examples2/table.py new file mode 100755 index 00000000..58fd04bd --- /dev/null +++ b/python/pyqt/examples2/table.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python + +import sys +from qt import * + +class Table(QTableView): + def __init__(self, numRows, numCols, parent=None, name=''): + QTableView.__init__(self, parent, name) + self.curRow = self.curCol = 0 + self.setFocusPolicy(QWidget.StrongFocus) + self.setBackgroundMode(QWidget.PaletteBase) + self.setNumCols(numCols) + self.setNumRows(numRows) + self.setCellWidth(100) + self.setCellHeight(30) + self.setTableFlags(Tbl_vScrollBar | + Tbl_hScrollBar | + Tbl_clipCellPainting) + self.resize(400,200) + self.contents = [''] * (numRows * numCols) + + def cellContent(self, row, col): + return self.contents[self.indexOf(row,col)] + + def setCellContent(self, row, col, c): + self.contents[self.indexOf(row,col)] = c + self.updateCell(row, col) + + def paintCell(self, p, row, col): + w = self.cellWidth(col) + h = self.cellHeight(row) + x2 = w-1 + y2 = h-1 + + p.drawLine(x2,0,x2,y2) + p.drawLine(0,y2,x2,y2) + + if row == self.curRow and col == self.curCol: + if self.hasFocus(): + p.drawRect(0, 0, x2, y2) + else: + p.setPen(Qt.DotLine) + p.drawRect(0, 0, x2, y2) + p.setPen(Qt.SolidLine) + + p.drawText(0,0,w,h,Qt.AlignCenter,self.contents[self.indexOf(row,col)]) + + def mousePressEvent(self, me): + oldRow = self.curRow + oldCol = self.curCol + clickedPos = me.pos() + self.curRow = self.findRow(clickedPos.y()) + self.curCol = self.findCol(clickedPos.x()) + if self.curRow != oldRow or \ + self.curCol != oldCol: + self.updateCell(oldRow, oldCol) + self.updateCell(self.curRow, self.curCol) + + def keyPressEvent(self, ke): + oldRow = self.curRow + oldCol = self.curCol + edge = 0 + key = ke.key() + if key == Key_Left: + if self.curCol > 0: + self.curCol = self.curCol - 1 + edge = self.leftCell() + if self.curCol < edge: + self.setLeftCell(edge-1) + elif key == Key_Right: + if self.curCol < self.numCols()-1: + self.curCol = self.curCol + 1 + edge = self.lastColVisible() + if self.curCol >= edge: + self.setLeftCell(self.leftCell()+1) + elif key == Key_Up: + if self.curRow > 0: + self.curRow = self.curRow - 1 + edge = self.topCell() + if self.curRow < edge: + self.setTopCell(edge-1) + elif key == Key_Down: + if self.curRow < self.numRows()-1: + self.curRow = self.curRow + 1 + edge = self.lastRowVisible() + if self.curRow >= edge: + self.setTopCell(self.topCell()+1) + else: + ke.ignore() + return + + if self.curRow != oldRow or \ + self.curCol != oldCol: + self.updateCell(oldRow, oldCol) + self.updateCell(self.curRow, self.curCol) + + def focusInEvnet(self, fie): + self.updateCell(self.curRow, self.curCol) + + def focusOutEvent(self, foe): + self.updateCell(self.curRow, self.curCol) + + def indexOf(self, row, col): + return (row * self.numCols()) + col + +numRows = 20 +numCols = 20 +a = QApplication(sys.argv) +v = Table(numRows, numCols) +for i in range(numRows): + for j in range(numCols): + v.setCellContent(i,j,'%d %c' % (j, 65+(i%26))) +a.setMainWidget(v) +v.show() +a.exec_loop() diff --git a/python/pyqt/examples2/themes.py b/python/pyqt/examples2/themes.py new file mode 100755 index 00000000..b3dae552 --- /dev/null +++ b/python/pyqt/examples2/themes.py @@ -0,0 +1,2484 @@ +#!/usr/bin/env python + +# This is a port to PyQt of the Qt v2.x example program. It does not (yet) +# include the implementation of all of the example widgets. + + +FALSE=0 +TRUE=1 + +# Python modules + +import os, sys + +# include files for QT + +from qt import * + + +class ButtonsGroups(QVBox): + + def __init__(self, parent=None, name=None): + QVBox.__init__(self, parent, name) + + # Create widgets which allow easy layouting + box1=QHBox(self) + box2=QHBox(self) + + # first group + + # Create an exclusive button group + grp1=QButtonGroup( 1 + , QGroupBox.Horizontal + , "Button Group 1 (exclusive)" + , box1 + ) + grp1.setExclusive(TRUE) + + # insert 3 radiobuttons + rb11=QRadioButton("&Radiobutton 1", grp1) + rb11.setChecked(TRUE) + QRadioButton("R&adiobutton 2", grp1) + QRadioButton("Ra&diobutton 3", grp1) + + # second group + + # Create a non-exclusive buttongroup + grp2=QButtonGroup( 1 + , QGroupBox.Horizontal + , "Button Group 2 (non-exclusive)" + , box1 + ) + grp2.setExclusive(FALSE) + + # insert 3 checkboxes + QCheckBox("&Checkbox 1", grp2) + cb12=QCheckBox("C&heckbox 2", grp2) + cb12.setChecked(TRUE) + cb13=QCheckBox("Triple &State Button", grp2) + cb13.setTristate(TRUE) + cb13.setChecked(TRUE) + + # third group + + # create a buttongroup which is exclusive for radiobuttons and + # non-exclusive for all other buttons + grp3=QButtonGroup( 1 + , QGroupBox.Horizontal + , "Button Group 3 (Radiobutton-exclusive)" + , box2 + ) + grp3.setRadioButtonExclusive(TRUE) + + # insert three radiobuttons + self.rb21=QRadioButton("Rad&iobutton 1", grp3) + self.rb22=QRadioButton("Radi&obutton 2", grp3) + self.rb23=QRadioButton("Radio&button 3", grp3) + self.rb23.setChecked(TRUE) + + # insert a checkbox... + self.state=QCheckBox("E&nable Radiobuttons", grp3) + self.state.setChecked(TRUE) + # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State() + self.connect(self.state, SIGNAL('clicked()'),self.slotChangeGrp3State) + + # fourth group + + # create a groupbox which lays out its childs in a column + grp4=QGroupBox( 1 + , QGroupBox.Horizontal + , "Groupbox with normal buttons" + , box2 + ) + + # insert two pushbuttons... + QPushButton("&Push Button", grp4) + tb=QPushButton("&Toggle Button", grp4) + + # ...and make the second one a toggle button + tb.setToggleButton(TRUE) + tb.setOn(TRUE) + + def slotChangeGrp3State(self): + self.rb21.setEnabled(self.state.isChecked()) + self.rb22.setEnabled(self.state.isChecked()) + self.rb23.setEnabled(self.state.isChecked()) + + +class LineEdits(QVBox): + + def __init__(self, parent=None, name=None): + QVBox.__init__(self, parent, name) + + self.setMargin(10) + + # Widget for layouting + row1=QHBox(self) + row1.setMargin(5) + + # Create a label + QLabel("Echo Mode: ", row1) + + # Create a Combobox with three items... + self.combo1=QComboBox(FALSE, row1) + self.combo1.insertItem("Normal", -1) + self.combo1.insertItem("Password", -1) + self.combo1.insertItem("No Echo", -1) + # ...and connect the activated() SIGNAL with the slotEchoChanged SLOT to be + # able to react when an item is selected + self.connect(self.combo1, SIGNAL('activated(int)'), self.slotEchoChanged) + + # insert the first LineEdit + self.lined1=QLineEdit(self) + + # another widget which is used for layouting + row2=QHBox(self) + row2.setMargin(5) + + # and the second label + QLabel("Validator: ", row2) + + # A second Combobox with again three items... + self.combo2=QComboBox(FALSE, row2) + self.combo2.insertItem("No Validator", -1) + self.combo2.insertItem("Integer Validator", -1) + self.combo2.insertItem("Double Validator", -1) + # ...and again the activated() SIGNAL gets connected with a SLOT + self.connect(self.combo2, SIGNAL('activated(int)'), self.slotValidatorChanged) + + # and the second LineEdit + self.lined2=QLineEdit(self) + + # yet another widget which is used for layouting + row3=QHBox(self) + row3.setMargin(5) + + # we need a label for this too + QLabel("Alignment: ", row3) + + # A combo box for setting alignment + self.combo3=QComboBox(FALSE, row3) + self.combo3.insertItem("Left", -1) + self.combo3.insertItem("Centered", -1) + self.combo3.insertItem("Right", -1) + # ...and again the activated() SIGNAL gets connected with a SLOT + self.connect(self.combo3, SIGNAL('activated(int)'), self.slotAlignmentChanged) + + # and the lineedit + self.lined3=QLineEdit(self) + + # give the first LineEdit the focus at the beginning + self.lined1.setFocus() + + def slotEchoChanged(self, i): + if i == 0: + self.lined1.setEchoMode(QLineEdit.EchoMode.Normal) + elif i == 1: + self.lined1.setEchoMode(QLineEdit.EchoMode.Password) + elif i == 2: + self.lined1.setEchoMode(QLineEdit.EchoMode.NoEcho) + + self.lined1.setFocus() + + def slotValidatorChanged(self, i): + if i == 0: + self.validator=None + self.lined2.setValidator(self.validator) + elif i == 1: + self.validator=QIntValidator(self.lined2) + self.lined2.setValidator(self.validator) + elif i == 2: + self.validator=QDoubleValidator(-999.0, 999.0, 2, self.lined2) + self.lined2.setValidator(self.validator) + + self.lined2.setText("") + self.lined2.setFocus() + + def slotAlignmentChanged(self, i): + if i == 0: + self.lined3.setAlignment(Qt.AlignLeft) + elif i == 1: + self.lined3.setAlignment(Qt.AlignCenter) + elif i == 2: + self.lined3.setAlignment(Qt.AlignRight) + + self.lined3.setFocus() + + +class ProgressBar(QVBox): + + def __init__(self, parent=None, name=None): + QVBox.__init__(self, parent, name) + + self.timer=QTimer() + + self.setMargin(10) + + # Create a radiobutton-exclusive Buttongroup which aligns its childs in two + # columns + bg=QButtonGroup(2, QGroupBox.Horizontal, self) + bg.setRadioButtonExclusive(TRUE) + + # insert three radiobuttons which the user can use to set the speed of the + # progress and two pushbuttons to start/pause/continue and reset the + # progress + self.slow=QRadioButton("&Slow", bg) + self.start=QPushButton("S&tart", bg) + self.normal=QRadioButton("&Normal", bg) + self.reset=QPushButton("&Reset", bg) + self.fast=QRadioButton("&Fast", bg) + + # Create the progressbar + self.progress=QProgressBar(100, self) + + # connect the clicked() SIGNALs of the pushbuttons to SLOTs + self.connect(self.start, SIGNAL('clicked()'), self.slotStart) + self.connect(self.reset, SIGNAL('clicked()'), self.slotReset) + + # connect the timeout() SIGNAL of the progress-timer to a SLOT + self.connect(self.timer, SIGNAL('timeout()'), self.slotTimeout) + + # Let's start with normal speed... + self.normal.setChecked(TRUE) + + def slotStart(self): + # If the progress bar is at the beginning... + if self.progress.progress() == -1: + # ...set according to the checked speed-radionbutton the number of steps + # which are needed to complete the process + if self.slow.isChecked(): + self.progress.setTotalSteps(10000) + elif self.normal.isChecked(): + self.progress.setTotalSteps(1000) + else: + self.progress.setTotalSteps(50) + + # disable the speed-radiobuttons + self.slow.setEnabled(FALSE) + self.normal.setEnabled(FALSE) + self.fast.setEnabled(FALSE) + + # If the progress is not running... + if not self.timer.isActive(): + # ...start the time (and so the progress) with an interval fo 1ms... + self.timer.start(1) + # ...and rename the start/pause/continue button to Pause + self.start.setText("&Pause") + else: + # ...stop the timer (and so the progress)... + self.timer.stop() + # ...and rename the start/pause/continue button to Continue + self.start.setText("&Continue") + + def slotReset(self): + # stop the timer and progress + self.timer.stop() + + # rename the start/pause/continue button to Start... + self.start.setText("&Start") + # ...and enable this button + self.start.setEnabled(TRUE) + + # enable the speed-radiobuttons + self.slow.setEnabled(TRUE) + self.normal.setEnabled(TRUE) + self.fast.setEnabled(TRUE) + + # reset the progressbar + self.progress.reset() + + def slotTimeout(self): + p = self.progress.progress() + + # If the progress is complete... + if p == self.progress.totalSteps(): + # ...rename the start/pause/continue button to Start... + self.start.setText("&Start") + # ...and disable it... + self.start.setEnabled(FALSE) + # ...and return + return + + # If the progress is not complete increase it + self.progress.setProgress(p+1) + + +class ListBoxCombo(QVBox): + + def __init__(self, parent=None, name=None): + QVBox.__init__(self, parent, name) + + self.setMargin(5) + + row1=QHBox(self) + row1.setMargin(5) + + # Create a multi-selection ListBox... + self.lb1=QListBox(row1) + self.lb1.setMultiSelection(TRUE) + + # ...insert a pixmap item... + self.lb1.insertItem(QPixmap("qtlogo.png")) + # ...and 100 text items + for i in range(100): + str=QString("Listbox Item %1").arg(i) + self.lb1.insertItem(str) + + # Create a pushbutton... + self.arrow1=QPushButton(" -> ", row1) + # ...and connect the clicked SIGNAL with the SLOT slotLeft2Right + self.connect(self.arrow1, SIGNAL('clicked()'), self.slotLeft2Right) + + # create an empty single-selection ListBox + self.lb2=QListBox(row1) + + def slotLeft2Right(self): + # Go through all items of the first ListBox + for i in range(self.lb1.count()): + item=self.lb1.item(i) + # if the item is selected... + if item.selected(): + # ...and it is a text item... + if not item.text().isEmpty(): + # ...insert an item with the same text into the second ListBox + self.lb2.insertItem(QListBoxText(item.text())) + # ...and if it is a pixmap item... + elif item.pixmap(): + # ...insert an item with the same pixmap into the second ListBox + self.lb2.insertItem(QListBoxPixmap(item.pixmap())) + + +class NorwegianWoodStyle(QMotifStyle): + + def __init__(self): + QMotifStyle.__init__(self) + + def polish(self,o): + if isinstance(o,QApplication): + self.polish_qapplication(o) + elif isinstance(o,QWidget): + self.polish_qwidget(o) + else: + QMotifStyle.polish(self,o) + + def unPolish(self,o): + if isinstance(o,QApplication): + self.unPolish_qapplication(o) + elif isinstance(o,QWidget): + self.unPolish_qwidget(o) + else: + QMotifStyle.unPolish(self,o) + + def polish_qapplication(self,app): + global button_xpm, polish_xpm + + self.oldPalette=app.palette() + + # we simply create a nice QColorGroup with a couple of fancy wood pixmaps + # here and apply it to all widgets + + img=QImage(button_xpm) + orig=QImage(img) + orig.detach() + button=QPixmap() + button.convertFromImage(img) + + background=QPixmap(polish_xpm) + + for i in range(img.numColors()): + rgb=img.color(i) + c=QColor(rgb) + (r, g, b)=c.dark().rgb() + img.setColor(i,qRgb(r, g, b)) + mid=QPixmap() + mid.convertFromImage(img) + + img=QImage(orig) + for i in range(img.numColors()): + rgb=img.color(i) + c=QColor(rgb) + (r, g, b)=c.light().rgb() + img.setColor(i,qRgb(r, g, b)) + light=QPixmap() + light.convertFromImage(img) + + img=QImage(orig) + for i in range(img.numColors()): + rgb=img.color(i) + c=QColor(rgb) + (r, g, b)=c.dark().rgb() + img.setColor(i,qRgb(r, g, b)) + dark=QPixmap() + dark.convertFromImage(img) + + op=QPalette(QColor(212,140,95)) + + nor=QColorGroup(QBrush(op.normal().foreground()), + QBrush(op.normal().button(), button), + QBrush(op.normal().light(), light), + QBrush(op.normal().dark(), dark), + QBrush(op.normal().mid(), mid), + QBrush(op.normal().text()), + QBrush(Qt.white), + QBrush(QColor(236,182,120)), + QBrush(op.normal().background(), background)) + disabled=QColorGroup(QBrush(op.disabled().foreground()), + QBrush(op.disabled().button(), button), + QBrush(op.disabled().light(), light), + QBrush(op.disabled().dark()), + QBrush(op.disabled().mid(), mid), + QBrush(op.disabled().text()), + QBrush(Qt.white), + QBrush(QColor(236,182,120)), + QBrush(op.disabled().background(), background)) + active=QColorGroup(QBrush(op.active().foreground()), + QBrush(op.active().button(), button), + QBrush(op.active().light(), light), + QBrush(op.active().dark()), + QBrush(op.active().mid(), mid), + QBrush(op.active().text()), + QBrush(Qt.white), + QBrush(QColor(236,182,120)), + QBrush(op.active().background(), background)) + + app.setPalette(QPalette(nor, disabled, active), TRUE) + + def unPolish_qapplication(self,app): + app.setPalette(self.oldPalette, TRUE) + + def polish_qwidget(self,w): + # the polish function will set some widgets to transparent mode, to get the + # full benefit from the nice pixmaps in the color group. + + if w.inherits("QTipLabel"): + return + + if w.inherits("QLCDNumber"): + return + + if not w.isTopLevel(): + if w.inherits("QLabel") \ + or w.inherits("QButton") \ + or w.inherits("QComboBox") \ + or w.inherits("QGroupBox") \ + or w.inherits("QSlider") \ + or w.inherits("QTabWidget") \ + or w.inherits("QTabBar"): + w.setAutoMask(TRUE) + + def unPolish_qwidget(self,w): + if w.inherits("QTipLabel"): + return + + if w.inherits("QLCDNumber"): + return + + if not w.isTopLevel(): + if w.inherits("QLabel") \ + or w.inherits("QButton") \ + or w.inherits("QComboBox") \ + or w.inherits("QGroupBox") \ + or w.inherits("QSlider") \ + or w.inherits("QTabWidget") \ + or w.inherits("QTabBar"): + w.setAutoMask(FALSE) + + def drawroundrect(self, p, x, y, w, h, d): + rx=(200*d)/w + ry=(200*d)/h + p.drawRoundRect(x, y, w, h, rx, ry) + + def drawButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None): + qDrawShadePanel(p, x, y, w, h, g, sunken, 5) + + oldBrush=p.brush() + oldPen=p.pen() + p.setPen(Qt.NoPen) + if fill != None: + newBrush=fill + else: + if sunken: + newBrush=g.brush(QColorGroup.Mid) + else: + newBrush=g.brush(QColorGroup.Button) + self.drawroundrect(p, x+3, y+3, w-6, h-6, 5) + p.setBrush(oldBrush) + p.setPen(g.foreground()) + self.drawroundrect(p, x, y, w, h, 8) + p.setPen(oldPen) + + def drawBevelButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None): + QMotifStyle.drawBevelButton(self, p, x, y, w, h, g, sunken, fill) + + def drawPushButton(self, btn, p): + g = btn.colorGroup() + + (x1, y1, x2, y2)=btn.rect().coords() + + p.setPen(g.foreground()) + p.setBrush(QBrush(g.button(),Qt.NoBrush)) + + if btn.isDown(): + fill=g.brush(QColorGroup.Mid) + elif btn.isOn(): + fill=QBrush(g.mid(),Qt.Dense4Pattern) + else: + fill=g.brush(QColorGroup.Button) + + if btn.isDefault(): + a=QPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1, + x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1]) + p.setPen(Qt.black) + p.drawPolyline(a) + x1=x1+2 + y1=y1+2 + x2=x2-2 + y2=y2-2 + + if btn.isOn() or btn.isDown(): + sunken=TRUE + else: + sunken=FALSE + + self.drawButton(p, x1, y1, x2-x1+1, y2-y1+1, g, sunken, fill) + + if btn.isMenuButton(): + dx=(y1-y2-4)/3 + self.drawArrow(p, Qt.DownArrow, FALSE, + x2-dx, dx, y1, y2-y1, + g, btn.isEnabled()) + + if p.brush().style != Qt.NoBrush: + p.setBrush(Qt.NoBrush) + + def drawPushButtonLabel(self, btn, p): + r=btn.rect() + (x, y, w, h)=r.rect() + + (x1, y1, x2, y2)=btn.rect().coords() + dx=0 + dy=0 + if btn.isMenuButton(): + dx=(y2-y1)/3 + if dx or dy: + p.translate(dx,dy) + + x=x+2 + y=y+2 + w=w-4 + h=h-4 + g=btn.colorGroup() + if btn.isDown() or btn.isOn(): + pencolour=btn.colorGroup().brightText() + else: + pencolour=btn.colorGroup().buttonText() + self.drawItem(p, x, y, w, h, + Qt.AlignCenter|Qt.ShowPrefix, + g, btn.isEnabled(), + btn.pixmap(), btn.text(), -1, + pencolour) + + if dx or dy: + p.translate(-dx,-dy) + + def buttonRect(self, x, y, w, h): + return QRect(x+3, y+2, w-6, h-4) + + def drawButtonMask(self, p, x, y, w, h): + self.drawroundrect(p, x, y, w, h, 8) + + +class MetalStyle(QWindowsStyle): + + def __init__(self): + QWindowsStyle.__init__(self) + + def polish(self,o): + if isinstance(o,QApplication): + self.polish_qapplication(o) + elif isinstance(o,QWidget): + self.polish_qwidget(o) + else: + QWindowsStyle.polish(self,o) + + def unPolish(self,o): + if isinstance(o,QApplication): + self.unPolish_qapplication(o) + elif isinstance(o,QWidget): + self.unPolish_qwidget(o) + else: + QWindowsStyle.unPolish(self,o) + + def polish_qapplication(self,app): + global stone1_xpm, stonebright_xpm + + self.oldPalette=app.palette() + + # we simply create a nice QColorGroup with a couple of fancy pixmaps here + # and apply it to all widgets + + f=QFont("times", app.font().pointSize()) + f.setBold(TRUE) + f.setItalic(TRUE) + app.setFont(f, TRUE, "QMenuBar") + app.setFont(f, TRUE, "QPopupMenu") + + button=QPixmap(stone1_xpm) + background=QPixmap(stonebright_xpm) + dark=QPixmap(1,1) + dark.fill(Qt.red.dark()) + mid=QPixmap(stone1_xpm) + light=QPixmap(stone1_xpm) + op=app.palette() + + backCol=QColor(227,227,227) + + nor=QColorGroup(QBrush(op.normal().foreground()), + QBrush(op.normal().button(), button), + QBrush(op.normal().light(), light), + QBrush(op.normal().dark(), dark), + QBrush(op.normal().mid(), mid), + QBrush(op.normal().text()), + QBrush(Qt.white), + QBrush(op.normal().base()), + QBrush(backCol, background)) + nor.setColor(QColorGroup.ButtonText, Qt.white) + nor.setColor(QColorGroup.Shadow, Qt.black) + disabled=QColorGroup(QBrush(op.disabled().foreground()), + QBrush(op.disabled().button(), button), + QBrush(op.disabled().light(), light), + QBrush(op.disabled().dark()), + QBrush(op.disabled().mid(), mid), + QBrush(op.disabled().text()), + QBrush(Qt.white), + QBrush(op.disabled().base()), + QBrush(backCol, background)) + active=QColorGroup(QBrush(op.active().foreground()), + QBrush(op.active().button(), button), + QBrush(op.active().light(), light), + QBrush(op.active().dark()), + QBrush(op.active().mid(), mid), + QBrush(op.active().text()), + QBrush(Qt.white), + QBrush(op.active().base()), + QBrush(backCol, background)) + active.setColor(QColorGroup.ButtonText, Qt.white) + + newPalette=QPalette(nor, disabled, active) + app.setPalette(newPalette, TRUE) + + def unPolish_qapplication(self,app): + app.setPalette(self.oldPalette, TRUE) + app.setFont(app.font(), TRUE) + + def polish_qwidget(self,w): + # the polish function will set some widgets to transparent mode, to get the + # full benefit from the nice pixmaps in the color group. + + if w.inherits("QPushButton"): + w.setBackgroundMode(QWidget.NoBackground) + + def unPolish_qwidget(self,w): + if w.inherits("QPushButton"): + w.setBackgroundMode(QWidget.PaletteButton) + + def drawButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None): + global img1, metal_xpm + + if not img1: + img1=QImage(metal_xpm) + + scaledImage=img1.smoothScale(w, h) + pix=QPixmap() + pix.convertFromImage(scaledImage) + p.drawPixmap(x, y, pix) + g2=QColorGroup() + g2.setColor(QColorGroup.Light, Qt.white) + g2.setColor(QColorGroup.Dark, Qt.black) + + if sunken: + linewidth=2 + else: + linewidth=1 + + qDrawShadePanel(p, x, y, w, h, g2, sunken, linewidth) + + def drawBevelButton(self, p, x, y, w, h, g, sunken=FALSE, fill=None): + self.drawButton(p, x, y, w, h, g, sunken, fill) + + def drawPushButton(self, btn, p): + g = btn.colorGroup() + + (x1, y1, x2, y2)=btn.rect().coords() + + p.setPen(g.foreground()) + p.setBrush(QBrush(g.button(),Qt.NoBrush)) + + if btn.isDown(): + fill=g.brush(QColorGroup.Mid) + elif btn.isOn(): + fill=QBrush(g.mid(),Qt.Dense4Pattern) + else: + fill=g.brush(QColorGroup.Button) + + if btn.isDefault(): + a=QPointArray([x1, y1, x2, y1, x2, y2, x1, y2, x1, y1+1, + x2-1, y1+1, x2-1, y2-1, x1+1, y2-1, x1+1, y1+1]) + p.setPen(Qt.black) + p.drawPolyline(a) + x1=x1+2 + y1=y1+2 + x2=x2-2 + y2=y2-2 + + if btn.isOn() or btn.isDown(): + sunken=TRUE + else: + sunken=FALSE + + self.drawButton(p, x1, y1, x2-x1+1, y2-y1+1, g, sunken, fill) + + if btn.isMenuButton(): + dx=(y1-y2-4)/3 + self.drawArrow(p, Qt.DownArrow, FALSE, + x2-dx, dx, y1, y2-y1, + g, btn.isEnabled()) + + if p.brush().style != Qt.NoBrush: + p.setBrush(Qt.NoBrush) + + def drawPushButtonLabel(self, btn, p): + r=btn.rect() + (x, y, w, h)=r.rect() + + (x1, y1, x2, y2)=btn.rect().coords() + dx=0 + dy=0 + if btn.isMenuButton(): + dx=(y2-y1)/3 + if btn.isOn() or btn.isDown(): + dx=dx-1 + dy=dy-1 + pencolour=btn.colorGroup().brightText() + else: + pencolour=btn.colorGroup().buttonText() + if dx or dy: + p.translate(dx,dy) + + x=x+2 + y=y+2 + w=w-4 + h=h-4 + g=btn.colorGroup() + self.drawItem(p, x, y, w, h, + Qt.AlignCenter|Qt.ShowPrefix, + g, btn.isEnabled(), + btn.pixmap(), btn.text(), -1, + pencolour) + + if dx or dy: + p.translate(-dx,-dy) + + def drawPanel(self, p, x, y, w, h, g, sunken, lineWidth, fill): + QStyle.drawPanel(self, p, x, y, w, h, g, sunken, lineWidth, fill) + + +class Themes(QMainWindow): + + def __init__(self, parent=None, name=None, f=Qt.WType_TopLevel): + QMainWindow.__init__(self, parent, name, f) + + self.appFont=QApplication.font() + self.tabwidget=QTabWidget(self) + + self.buttonsgroups=ButtonsGroups(self.tabwidget) + self.tabwidget.addTab(self.buttonsgroups,"Buttons/Groups") + self.hbox=QHBox(self.tabwidget) + self.hbox.setMargin(5) + self.linedits=LineEdits(self.hbox) + self.progressbar=ProgressBar(self.hbox) + self.tabwidget.addTab(self.hbox, "Lineedits/Progressbar") + self.listboxcombo=ListBoxCombo(self.tabwidget) + self.tabwidget.addTab(self.listboxcombo, "Listboxes/Comboboxes") + + self.setCentralWidget(self.tabwidget) + + self.style=QPopupMenu(self) + self.style.setCheckable(TRUE) + self.menuBar().insertItem("&Style", self.style) + + self.sMetal=self.style.insertItem("&Metal", self.styleMetal) + self.sWood=self.style.insertItem("&Norwegian Wood", self.styleWood) + self.sPlatinum=self.style.insertItem("&Platinum", self.stylePlatinum) + self.sWindows=self.style.insertItem("&Windows", self.styleWindows) + self.sCDE=self.style.insertItem("&CDE", self.styleCDE) + self.sMotif=self.style.insertItem("M&otif", self.styleMotif) + self.sMotifPlus=self.style.insertItem("Motif P&lus", self.styleMotifPlus) + self.style.insertSeparator() + self.style.insertItem("&Quit", qApp.quit, Qt.CTRL | Qt.Key_Q) + + self.help=QPopupMenu(self) + self.menuBar().insertSeparator() + self.menuBar().insertItem("&Help", self.help) + self.help.insertItem("&About", self.about, Qt.Key_F1) + self.help.insertItem("About &Qt", self.aboutQt) + + self.style=NorwegianWoodStyle() + qApp.setStyle(self.style) + self.menuBar().setItemChecked(self.sWood, TRUE) + + # In the following we cannot simply set the new style as we can in C++. We + # need to keep the old style alive (if it is a Python one) so that it's + # unPolish methods can still be called when the new style is set. + + def styleWood(self): + newstyle=NorwegianWoodStyle() + qApp.setStyle(newstyle) + self.style=newstyle + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sWood) + + def styleMetal(self): + newstyle=MetalStyle() + qApp.setStyle(newstyle) + self.style=newstyle + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sMetal) + + def stylePlatinum(self): + newstyle=QPlatinumStyle() + qApp.setStyle(newstyle) + self.style=newstyle + p=QPalette(QColor(239, 239, 239)) + qApp.setPalette(p, TRUE) + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sPlatinum) + + def styleWindows(self): + newstyle=QWindowsStyle() + qApp.setStyle(newstyle) + self.style=newstyle + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sWindows) + + def styleCDE(self): + newstyle=QCDEStyle(TRUE) + qApp.setStyle(newstyle) + self.style=newstyle + self.selectStyleMenu(self.sCDE) + + p=QPalette(QColor(75, 123, 130)) + p.setColor(QPalette.Active, QColorGroup.Base, QColor(55, 77, 78)); + p.setColor(QPalette.Inactive, QColorGroup.Base, QColor(55, 77, 78)); + p.setColor(QPalette.Disabled, QColorGroup.Base, QColor(55, 77, 78)); + p.setColor(QPalette.Active, QColorGroup.Highlight, Qt.white); + p.setColor(QPalette.Active, QColorGroup.HighlightedText, QColor(55, 77, 78)); + p.setColor(QPalette.Inactive, QColorGroup.Highlight, Qt.white); + p.setColor(QPalette.Inactive, QColorGroup.HighlightedText, QColor(55, 77, 78)); + p.setColor(QPalette.Disabled, QColorGroup.Highlight, Qt.white); + p.setColor(QPalette.Disabled, QColorGroup.HighlightedText, QColor(55, 77, 78)); + p.setColor(QPalette.Active, QColorGroup.Foreground, Qt.white); + p.setColor(QPalette.Active, QColorGroup.Text, Qt.white); + p.setColor(QPalette.Active, QColorGroup.ButtonText, Qt.white); + p.setColor(QPalette.Inactive, QColorGroup.Foreground, Qt.white); + p.setColor(QPalette.Inactive, QColorGroup.Text, Qt.white); + p.setColor(QPalette.Inactive, QColorGroup.ButtonText, Qt.white); + p.setColor(QPalette.Disabled, QColorGroup.Foreground, Qt.lightGray); + p.setColor(QPalette.Disabled, QColorGroup.Text, Qt.lightGray); + p.setColor(QPalette.Disabled, QColorGroup.ButtonText, Qt.lightGray); + qApp.setPalette(p, TRUE) + qApp.setFont(QFont("times", self.appFont.pointSize()), TRUE) + + def styleMotif(self): + newstyle=QMotifStyle(TRUE) + qApp.setStyle(newstyle) + self.style=newstyle + p=QPalette(QColor(192, 192, 192)) + qApp.setPalette(p, TRUE) + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sMotif) + + def styleMotifPlus(self): + newstyle=QMotifPlusStyle(TRUE) + qApp.setStyle(newstyle) + self.style=newstyle + p=QPalette(QColor(192, 192, 192)) + qApp.setPalette(p, TRUE) + qApp.setFont(self.appFont, TRUE) + self.selectStyleMenu(self.sMotifPlus) + + def about(self): + QMessageBox.about(self, "Qt Themes Example", + "<p>This example demonstrates the concept of " + "<b>generalized GUI styles </b> first introduced " + " with the 2.0 release of Qt.</p>" ) + + def aboutQt(self): + QMessageBox.aboutQt(self, "Qt Themes Example") + + def selectStyleMenu(self, s): + self.menuBar().setItemChecked(self.sWood, FALSE) + self.menuBar().setItemChecked(self.sMetal, FALSE) + self.menuBar().setItemChecked(self.sPlatinum, FALSE) + self.menuBar().setItemChecked(self.sCDE, FALSE) + self.menuBar().setItemChecked(self.sMotif, FALSE) + self.menuBar().setItemChecked(self.sMotifPlus, FALSE) + self.menuBar().setItemChecked(self.sWindows, FALSE) + self.menuBar().setItemChecked(s, TRUE) + + +def main(argv): + QApplication.setColorSpec(QApplication.CustomColor) + QApplication.setStyle(QWindowsStyle()) + a=QApplication(sys.argv) + + themes=Themes() + themes.setCaption('Theme (QStyle) example') + themes.resize(640,400) + a.setMainWidget(themes) + themes.show() + + return a.exec_loop() + + +# Put these here where they are out of the way of most of the code. + +polish_xpm = [ +" 96 96 254 2", +".. c #9c4a34", +".# c #a4825c", +".a c #bc5e2c", +".b c #d48432", +".c c #dc9f51", +".d c #bc6e1c", +".e c #d4855d", +".f c #94664c", +".g c #bc714e", +".h c #8c6664", +".i c #d4923c", +".j c #bc8444", +".k c #d49360", +".l c #d4794e", +".m c #ecaf68", +".n c #bc8365", +".o c #d47439", +".p c #a46954", +".q c #dc9f70", +".r c #e48544", +".s c #bc7b51", +".t c #a47761", +".u c #bc7b42", +".v c #a4523c", +".w c #e4945e", +".x c #9c784c", +".y c #d4844a", +".z c #eca053", +".A c #bc614c", +".B c #e4855c", +".C c #bc8350", +".D c #c48e68", +".E c #b16634", +".F c #e49339", +".G c #bc703a", +".H c #bc7c67", +".I c #a45f34", +".J c #cc714d", +".K c #d48c5f", +".L c #a47057", +".M c #cc703a", +".N c #dca674", +".O c #b47859", +".P c #bc6729", +".Q c #d49475", +".R c #d48b4a", +".S c #cc8351", +".T c #cc8466", +".U c #ac6841", +".V c #e4a651", +".W c #e49576", +".X c #d47d31", +".Y c #ac6e4b", +".Z c #c07650", +".0 c #e48c43", +".1 c #e49452", +".2 c #9c745f", +".3 c #e47e54", +".4 c #cc7c4f", +".5 c #cc7c32", +".6 c #b46133", +".7 c #d49a68", +".8 c #d67e4f", +".9 c #bc7643", +"#. c #b47056", +"## c #d48b3a", +"#a c #dc9f5e", +"#b c #e49a60", +"#c c #cc6a31", +"#d c #8c6244", +"#e c #dc9a41", +"#f c #eca753", +"#g c #bc8a58", +"#h c #d48c76", +"#i c #bc693f", +"#j c #bc715d", +"#k c #9c6857", +"#l c #f4b171", +"#m c #bc8a6a", +"#n c #eca16d", +"#o c #a87e58", +"#p c #a4613f", +"#q c #a48569", +"#r c #d4846d", +"#s c #dc935f", +"#t c #c47c50", +"#u c #dc8449", +"#v c #bc6950", +"#w c #cc9678", +"#x c #c4703a", +"#y c #cc7b67", +"#z c #dc8c5e", +"#A c #ac7067", +"#B c #eca86e", +"#C c #b4786d", +"#D c #dc8c4a", +"#E c #b46842", +"#F c #d47c41", +"#G c #e48d51", +"#H c #e59a52", +"#I c #9c6e3f", +"#J c #d49351", +"#K c #cc843b", +"#L c #ecb678", +"#M c #9c5a38", +"#N c #d4795c", +"#O c #c47b39", +"#P c #ec9560", +"#Q c #ac764c", +"#R c #c48351", +"#S c #c48e74", +"#T c #cc7650", +"#U c #cc8a84", +"#V c #bc6a5c", +"#W c #e4af74", +"#X c #b46855", +"#Y c #e4a06e", +"#Z c #ac775b", +"#0 c #e48d5d", +"#1 c #c47d65", +"#2 c #cc763f", +"#3 c #b47e5d", +"#4 c #cc8a55", +"#5 c #cc8a67", +"#6 c #bf622f", +"#7 c #dc853b", +"#8 c #e49f4a", +"#9 c #9c505c", +"a. c #8c5644", +"a# c #cc7329", +"aa c #a45a51", +"ab c #b48264", +"ac c #9c7a7c", +"ad c #9c5f4f", +"ae c #b4844c", +"af c #a46749", +"ag c #dca664", +"ah c #b46e1c", +"ai c #c4762c", +"aj c #a45a3c", +"ak c #dc9a74", +"al c #ac7e46", +"am c #ac6a6c", +"an c #eca862", +"ao c #e49a41", +"ap c #e49a78", +"aq c #bc7660", +"ar c #d57e5e", +"as c #9c6e5c", +"at c #ab7e65", +"au c #cc8a44", +"av c #9c6240", +"aw c #bc6244", +"ax c #bc5d3f", +"ay c #e48550", +"az c #eca060", +"aA c #cc7160", +"aB c #cc7c42", +"aC c #b46241", +"aD c #b4726c", +"aE c #eca67f", +"aF c #9c6a3c", +"aG c #94685a", +"aH c #c48240", +"aI c #c48465", +"aJ c #dc7640", +"aK c #cc8f54", +"aL c #e4a76f", +"aM c #c4692e", +"aN c #dc9474", +"aO c #ac6050", +"aP c #b47048", +"aQ c #94614b", +"aR c #ac836c", +"aS c #a47048", +"aT c #b4764a", +"aU c #ec8e5c", +"aV c #dc9a53", +"aW c #cc765e", +"aX c #b48a64", +"aY c #dc9a63", +"aZ c #c47640", +"a0 c #ec9a60", +"a1 c #c48a54", +"a2 c #c48a67", +"a3 c #ac5a3c", +"a4 c #ac8458", +"a5 c #dc855d", +"a6 c #c4714d", +"a7 c #dc9243", +"a8 c #dc794e", +"a9 c #ac6955", +"b. c #cc8f67", +"b# c #ac6032", +"ba c #ac7056", +"bb c #dc7a34", +"bc c #ec9553", +"bd c #dc8d3b", +"be c #e4a060", +"bf c #f4a654", +"bg c #c46842", +"bh c #c46f62", +"bi c #ac613d", +"bj c #dc866c", +"bk c #c4694e", +"bl c #dc7d42", +"bm c #ec8d4f", +"bn c #dc9351", +"bo c #cc9177", +"bp c #c4695f", +"bq c #ecb075", +"br c #e4a75f", +"bs c #d4843c", +"bt c #bc722c", +"bu c #d4936c", +"bv c #d47644", +"bw c #bc7d5c", +"bx c #ac563c", +"by c #e4956c", +"bz c #a47a4c", +"bA c #d48454", +"bB c #bc825c", +"bC c #e49544", +"bD c #bc7044", +"bE c #bc7e74", +"bF c #d48d6c", +"bG c #cc7144", +"bH c #b47864", +"bI c #bc6a34", +"bJ c #d49684", +"bK c #d48b54", +"bL c #cc845c", +"bM c #cc8474", +"bN c #ac684c", +"bO c #cc7d5c", +"bP c #eca27c", +"bQ c #dc946c", +"bR c #c47c5c", +"bS c #dc8554", +"bT c #c47244", +"bU c #dc8c6c", +"bV c #dc8c54", +"bW c #b4684c", +"bX c #cc8344", +"bY c #c47b44", +"bZ c #c4825c", +"b0 c #e4a17c", +"b1 c #ac7a64", +"b2 c #e48c6c", +"b3 c #c47a74", +"b4 c #e49f54", +"b5 c #9c674c", +"b6 c #946764", +"b7 c #c48674", +"#u#G#G#P#G#G#G.1#G#G.1.1.1.w#G.r#D.1.1.1#D#DbVbV.K.K.K.KbO.Z.Z#TaP.GaT.Z.O.O.O.H.9aP.ZaPaPaPbZbo.i.k#J.k#JbKbnbn#b#sbVbV#G#G.r.ray.r.0#G.0#G.1bc.r.0.0bc.0.0.0.r.1.1.1.1#G#D.0#D.0.0.0bcbcbc.1.0", +"#aagaLbrag#a#a#a#DbVbn#G#0.1#0#Da5#za5.4.J.Jbk#vbt.G#x.9bY.4#tbYbw.saPaP.Ub#af.Y.s.s.Z.saP#E.gbw.U.U.UaObWbWbWaPb#b#.E#t.K.K#z#s#s#sbQ#s#sbn#s#sbn#s.w#s.w#s#sbn.ybV#s#sbV#s#sbQ#aak.7.k.7.k.k.k", +"#..g#.#.#j#.#XbW#Z#o.O.O#3.n.n.Halalalala4aXaXa4#t.u.9#R#5bu.k#5bob7aIaI.nbwbw#m#5aIa2#5#5aIb7#5.DbBbB#3bwbw.C.O#oabab.naI.C#t#R.9#tbY#tbY.ZbY.s#t#t#t#R.sbY.s#tbD.Z.Z#t.9.Z#t.4bBbw.s.saT.9aTaT", +".ybS.ybSbVbVbVbVbl#u#u#ubSaybSay#s#za5#z#z#z.KbA.Qb.aIbZbZbB.g.U.gaP#.aP#.aPaP.O.9aP.g.s.O.ZaP.Z#CaD#Aamamamam#X#3#Z.OaPaPaPaP.saZbY#t#t#tbY#tbY#t#tbLbZ.SbR#t#tbZbRbZbRbR.sbRbR.4aBaB.4bY.4.4.4", +"bKbV#zbKbA.ybK#zbV#z#0bS#0#0#0aya5bA.4.4.4#T#xbgbwaq.O.g.O#j#.aPaCaC#v.g.gaPaP.Z#R#R#t#t#t.Z.s.Z#O#O.5aH#KbY.S#4bD.G#xaZaZ#2.SbVbV#s.wbV#zbSbAa5.e.KbQbQbU#s#z.K#5.K#5.T#4#5.Kb..4bZbL.T.ebL.K.K", +"#A#A#C#C#AaD#CbEatataRb1b1abb1.t#I.f#IaSbz.x.#.##v.g.g#1bR.T#5#hbObO.T.K.K#5.KbubL.4.4#t.4.Z#tbL.e#r.K.K.e.e.T#r.K#z.K#z#sbVbS#zbV#u#ubVbl#F.8.l#2.4.8bAbA.l.4bva6.g#x.g#x#i#i#i.L.Lba#Z#Z#Z#Zba", +"aPaT.u.u.s.C.C.C.SbA.S.4.SbA.8.8#r#rbF#h.TbO.T#h.KbF.e.e.S.S.S.S#u.y.8bA.e.4bA.e.K#zbQ#s.K.KbUbQ.y.R.y.yaB#O#xbT#t.4bLbLbL.4bL.S.4.S.4#T.Za6.Z.JbD.g.Z.g.Z.g.Z.ZaP.g#iaP#i#E#EaC.Obababa.ObH#Z.O", +"#zbSbA.e#za5.e.8bV.KbV.ybAbK#zbK.8.ybV#z.y#F.y#sbKbA.Rbn#sbn#b#b#Y.w#sbV.y.4.lbA.y.y.ybA#T.MbG.4bObO.4.SbLbOaq#..O.Yaf#p#p.I.U.UaT.Z.O.Oaq.O.H.Hb1b1#Z#Z.L#Zat#3bw.s.HbBb7aIaIaIbA.l.4aBbAbA.e.e", +"#DbVbn.w#s.w#sbVbAbSbSbV#D#GbS#0.1#H#H#H#b.1bn.1#4.S#t#t.S.TbL.S.K.K.K.S.SbK.e.S#t.4#t#tbDaPb#b#.U#E.9.S.ebVbS#G.K.K#r.l#y#T.Z.Z#2aB.S.ybS#u.8#F#Kau.y.S.y.y.R.y#z#z#sbn.1bna7bd#F#DbVbVbV#s.w#s", +".1#s.1#s.1bVbS.y.K#z#sbVbVbA.8#FbA.8ar.8.e#r.e#NbKbA.S.S.S.SbLbLaBaBaB#2aB.SbKbAbVbVbV#s.w#YbebQ.KbA.e.KbV.ybl.ybsbsbs#D#u#D#u.R.y#D#DbVbV#s#0.wbebe#b#bbQ.wbn#GbV#G#D#G#D#GbV#D.ybV#sbV#s#s.w#s", +".wbn.w.w#bbQbVbV.4.4.ybKbnbV#z#z#G#D#D#D#u#D.y.R#2aB#2.M#x.M#2#2#z#s.w#sbV#s.w#s.1.w.w#b.w.1#G#G#s#zbVbVbVbSbVbVbd#ubd.r#D#D#D#D.1bC.1.1.1.1#D.1bV#G#0#0#G.w.1a0bC#G.0aybS.Ba5a5bVbVbV.w#z.w#sbV", +"#ubVbVbVbV#GbV#D#s#sbn#b.w.w.1bVb2b2a5#z#z.K#zbA.w#s.w#sbV#s#z#s.w#b.w.w#GbV.w.w.X#Da0a0#G.1bcaz#G#GbS#GbV#ubV#0#z#0#0a5#0#0b2#0.0.r.0.0#u#u#F.o.M.M.M#F#ubV#G.1#b#P.w.w.w#0aya5.y#u.y.ybVbnbVbV", +".wbV#GbV#G#s#G#0.1#G.1.1.1#G#G.0#0#0.w.wby.wbQbn.w.w#G.w.wa0#b#P#u#G#G#0#G#G#G.w#baz#Yaz.1.0#D.0#G#G#G#GbVbl.8blbva8.8.B#z.Ba5#0ay#G#G#z#G#z#z#z#zbU#z#z#zbQbybQ#zbK#z#s#sbn.R.y#2#2aB.8bVbV#0bV", +".w.w.w#z.w.w.w.w#GbV.r.0.0#G#G#Gbda7a7#H#8#8#8#H#u#u#F#u#D#GbV#u#G#G.w.1.w#G.wa0bV#D#DbV.w#baz.w#G#G#G#G#0.BbSa5#u#u#D.1.1bn.0#7#z#0bSbSbSa5#z#z#r.e.e.4.4#2#2bT.4.4.4.S.R.Rbn.i#s.K#zbV#s#0bV.w", +"#u.8#u#u#ubV#GbVby.wbQ.w#b.wbVbl#T#T.l.ear.Ba5.8.w#G#G#G.w.1.1.1.1#G#G.w.1#G#G.w#P.w#G.1.w#P.w#0#D#DbV.w.w#0#0#0.w#b#baVaVbn.1#G.y.y#F#F#2.obv#Fay#z#GbVbV#z.e.e#z#z#zbV#s#s#s#sbQbQ#sbQ.wbV#G#0", +"#0#0#0#G#0#u#ublbDbT.4#4#zbQ.e.e#s#s#s#z.w#0#0aU#DbSbVbV#D#D#D#G.w#G#G.w#P.w.w.w#Gbmbmbmay#u#G.waz#b.w.w#Ga5bl#uaraW#i#i#ia6.4.ebVbnbQ#b.w.w#GbV#u.r.r#G#G#G#0a5.1.wbV#zbSar.J.JbT#x#2.y#F.8#u#G", +"#5.TbL#tbD#i.g.Z.SbA#zbAbKbSbSbA#u#D#G#u#u#u#DbV#GbVay#G#0#G#G.r#D#Gbn.w#b#b#HaY.1bVbV.y#u.y#F#Fbv.o.M#2#2#2aBbG.9#OaB.y#D.1.1.1.w#s.1.w#G#G#G.rbdbda7bdbnbn#sbQ.nbw.s.Z.4.8.8.8.obl#u#zbV#z.K.K", +"#i#x.Z#tbL.K.kbQbAbVbK#u.ybSbV#z#G.w.w#G#D#G#0#G.1#G#D.1.1.1.1.1bVbV#z.yaBaM.M.5.y.y.y#ubV.w#P.w.w.w#b.1.1.w.wby#b.w#b.w#b.w.1.1#u#u#ubVbAbK#z.S.T.TbO.Z#vbga3axbD#xaZ.8bAbAbAbA.e#4bA#ta6.P.6.6", +".S.4bL.e.e.e.ebA.8bSbSbSbVay#0#G.1.1a0.1#ba0#H#bbc#Hbc#Ha0bc.1.0#z.8#T.J.l.ebVbV#G#G#G.w.w.w.w#P.w#b#n#b.1.1.w#n.1.1.1#G#G#D#ublbl#2.4.4.g.Z#ZbN#9#9aa#X.g.ZbOar.Mbvbla5#z#zbA.laPbNbi.U.U#..Zbw", +"bL.e.e.e#zbSbSbl#u#DbS#G#G#0#G#G.1.1.1.1bc#Ha0.1#G.1.1a0#b.1#u#F.e.4#T.8by#b#na0a0#b.w.w.w.w#P#0bVbV.1.1#G#G#u#G.1#G#G#ubS.8.l#T.Z.g#ibW.UbNa9#p.UaP.9.S.ybVbV#Dayay#z#z.e.4bT#i.pad#pbN#.bRaI.T", +".4.e.KbS.8blblbSbSbS#GbV#G#0#G#G#G.0.1.1bcaz#H.1#G.1.w#P.w.w#z.8bK.KbQbQbV#u#D.1#0#G#G#G#G#G.1#P.1.1beazbe.1#G#u#zbK.K.4bO.Z#j#v#A#ka9.YbW.ZbL.4.R.R.ibn#D#u#F#FbS.S.4aqaPbNbi.I#.bWaP.gbObL.8bL", +".K.K#z.e#F.lbv#F#z#GbS#u#u#G.w#G#u#G#G#G.1a0bc.1#P#P#P.w#GbVarar.R#J#HaY.1.1.1#H#H#b.1.1bc.1#P.1.w#b#bazbe.w#zbA#t#t.Z.Z.Z.g#.#.b1ba#..Z.Z.lbS#u.y#u#ubSbS#N.laA#j.ga9#kad#ka9#..g.g#tbO.e.e.ebA", +".l.l.8.y.8bAbAa5bSbS#ubSbS#0.w#G#G#G#G#G.1bc.1bCbm.1.1.0#Dblbv#T#D.R.ybVbe#nazanananbeaz#b#bbc#H.wa0.1#sbV.S.S#t#t.s.Z.sbwaIaIaI#t#t.4bA.lbl#ubl.3a5a5.e.4bh#V#XbN#k#kaG#k.L.OaIbL.e.K.ebA.y.4.8", +"bSbAbAa5.ebA.8.4.8.ybS#z#G.w#0bSay#0bm#G#G.0.1.0bc#H.zbf.zbe.1#z.KbVbSbA.y#D#D.1bebebe#HbeazazazazazbebV.S.4#1bMbZbR.Z.Z.Z#t#tbYbl.o#ubS#Gay#0#uarbl.laB#t.uaT.Oad#kaGb6#ka9.g.Z#t#t.4.4#t.4bK.K", +"aBbs.y.ybA.l.lar.4aBaB.8.y#F#u.wbn#D#D#G.0.0a7.FbdbCbc.1.1.0.1bc.F#8#H.1.ybG.4.ebn#s#s#baY#saYaV#b.w#s#J.SaZbD.sbR#t.S#z#ubs#F.R#D#D.0#G#G#G#G.0#D.R.yaBbDbDaP.g#Zb1.L.fb6.h.hac.I.YaT.u#t.Z.Z#2", +"b3bR#1.4.4.4bX.R.K.KbV.ybl#F#F#F#za5a5.B#z#0#sby.1#G.1.1.1bm#G.1a0a0#H#H#b#b#s.ya#.X.y.ybVbn.w#bbebeaY#sbAbRbZa2au.S.R#s#z.y.e#zbs#ubn.1.1.1#G#D.0#D#D.RbA.4bO.4aPbD#Eb#af.I#Maf.2.x.L.L#Z.O.n#S", +"aObi#Xbw.s.sbY.SbXbK#z#z.w.w.wa0#z#za5bS.l.l.8bVbSbVbS#G#G#G.w#Pbe.w#b#bazbrb4#Hbebebe.1#u#F.5.X#F.y#s#Y.NaN.Q.Q.T.Tbu.w#sbn.1be#sbVbV.y.y.ybn#b#G#G#G#G#0bn#zbSbn#bbn#D.R.RaBbX#3.O.Yaf.I.Ibi#E", +"aVbX.G.6a3aCb3#U.y#z#s#0#z.w.w#s#H#H.1.1.0#G#Hb4bVbV#u#u#u#D.0#D.1.1.1#D#7#D#Hb4bCbc.1.w#b#b#n#nbe.1#u.yaBbX.S.kb4.cb4aYbA#T.4#r.4.K.K#s#s#s#D.y#GaybV.w.w.w.w.w#G.w.w.w#b.1bn.1#P.w.w#0#0aybS#G", +"bnaVaYbeaNarbp.A.P#2#F.y#u#s.w#sb4b4.1.1.1.1#H#H#nbeaz#b#HbnbCa7.zbe.z.1#D#D.w#Baz.z#H.w#P.w.w.wbebeanbrbebn.RbX.4bQb0aL#BaYa7.bbA.4#xaMaZ.ybK.kbA.4.4#F.8.ybA.ybv#u#ubS#sbV#D#zbl.ray#G#G#P.w#P", +".w#0bSbVbV#D#D.1aY#b.w#zbS#FaBaB#x.M.l.8a5byap#bbn.1bebebebebeaza7.0bd#u#ubSbS.BbC#D.0#D#G.w.w.1anazb4bebebebr#B.V.c#D#Oai.S#s.WaE#Y#Y#YaY.kaB#x#4.S.S.4aBbX.y.y.y.K#z.KbV#z.ybV.ybKbKbK.K.K#z.k", +".8.8#u#G.w#HaV.1#s.w#s#0#zbV.wbQ#na0by#0a5bSbvbg.M#F.y#ubSbA#z.k.w.w.w.wa0a0.w.w#H.w#HbV#D#u#G.1.1.1#b.w.1.1#D#DbVakaLaLaLbq#B.VaB.XaB.ybKbQaLaL.q.qaY#a#b.w#b#b#b#b.wbn#s#D.y#D#s#s#s#JbKau.SbA", +"b4#Hbe#baY#s.K.S.y#F.ybSbS.R#zbe#H#H.1#Gbc#b#bbn.w#bbybQ.4#xbga6#T.l#za5bV#G#Gbc.w#b#b.wbV#D.1beby.wbVbV#z#s.w#Y#bbeaY#J#s#Ybe.1#B#B#Bbr#s.RbA.KbKbnaV.w#b.w#Ha0b4anbe#Hbe.1.1#bbC#8bc#Ha0a0#Pbc", +"b4#8#8#H#HbCbC.1b4#b.w.1#P#G#G.0akbVbXaB#2#2.4bAbA.KbAbV#s#b#YaY.1bV.8aZ.GbYaB.S.RaV#abebn.1#8az#b.w.w#b#ba0by.w.1#Hazbebe.1#s#b#ebnbnbnaVaVaYbnbnb4bebe#abe#abebnbnbnbn.ibnbnbn##a7#8#8#ea7beaL", +"#Y.w.w#s.w#0#z#0#D#DbVbVbVbV#bana7#D.1.1#b.1#D#D#u#u#Fa#.o.y#D#D.r.r.w#b#Y#b#b.w.gbkbg#Tar#za5a5####.5.b.Ra7.1bn#HaV#H#Hbn#D#D.ybQbQ#z.K.e.K.e.ea7bnaVa7bnaY#aaL.m#Wbrbr#Ybr#W.m#L#L#L.mbeb4.w#b", +"#sbK.ybS#z#zbSbS.k.k.K.S.SbAbKbn.w.1#D#GbV#GbV.w#G#G#G#u#u#ubl#7.r#G#G#0#zayay.0#Y.wa5bS#zbS.8.M.4.Z#xbka6#TbObO#D.Rbn#s#bbebebebV.R.R.y.R#D#DbVbebe#BbqaLbebn.Rbnbnbebr#BbrbeaV#Da7bran.mbr.1#D", +"anazbean#Banbe#H.y#O#x#x.ybKbK.R.Jbvar.ebja5#N#TbvbS#z#0#0.1#0bV#G#u#u.o#Fbb#7bm#F#7#u#D#Dbn#bbe#s#s#sbn.w#zbVbVbkbpbpbpbhbhbhbhaAaAaWaW#N#r#rbFbs.ybKbn#b#YaLbq#Bbrbebebebr#BbqbeaLbe#Y#B#B#B#B", +"a7#DbCb4azananan#BaL#b#Yby#b#G#ub0aN.e#x#i#xaWbObAa5.e.8.4#2.4.4.w.wbQ#zbSbSbVbV.w#z#zbS.JbGbG.l#D#GbV.1.w.1#G#G#H#8#8#8aoa7#8#8#D#Dbn.1bnbC.1bC#b.w#D#D.y.5bs.y##a7#Hbranbe.1.i#sbn#D.Rbsbs#ubs", +"#b#0.y.8#2#2#2#2#F#u#G.w#0#G#Pazb4b4beb4bnbn##.5#xaB.4.4.4.e#z.K.e.SbA.8bA.ebK.K#zbV.y#ubVbVbVbVar.8ara8ara8a5ar.RbV#zbVbA.y#D#sbSa5a5bV#zbSbVbS#G#DbV#b#b.1bn#bananbeb4b4anananbean#B#B#Bazbebe", +"#0a5bSbV.w#Y#BaE.1#0.wbSay#uay#Gbd.FbCbC#H.zanaz#b#b#b.w#zbA#2#c.P#6#6.M#2.e.K.k#KaB.Xbsbn.1.1#7#Hbna7#D#D#D#D.0#0#zbVbV#u#F#FblbdbCbC.1bC#G.1.1bV#u#D#G#Hbean.manbeanan#B.manan.mbebe.1bV.1.1.1", +".zbCa7#Hazanb4#8#Y.w.y.8#z.w#G#D#G#0#P#0#0#0#uaJ#D#u#ubl#D#0.wb2.w.1#0#0.w#z.4.G#vbhbRbO#rar#N.l#4bL.S.4.4.4.4bLay#D#uay.1#Ha0.w.1.w.1.w#G#s#0.w#G.1.1an#Bazb4b4anazb4b4.zananan#f#f#8#b#H.w.1#b", +"b4#Hbd#Ha7#H.1.0a7#H#b.wbV#s.w#0#D#D#D#D#G#u#u#G#G#G#GbV#u.8.y#ubs#7#G.1.1bn#D.y#xbXbAbAbYbt.Z#RbXbK#s.k.R.S.RbAbl#F.o.o#Fbv.yblbV#u#7#G.1.z.z.z.w.1#G#u#D.0#G#nb4#H.1.1#b.zb4.z#H.1.1.1#Hbe.m#B", +"#Y.w#D.1ay.w.w#Ga7#H#H.w#G#G#G#G#D.wbV#G.1.w#G.1#D#D#ubSbA#u.KbV#s#G#u#u#ubVbn#s.zb4b4#sbO.g#V#X.MaB.yaBaB#2aZ#2.y.y.R.KbQ.KbQbu#zbAbK#s#bbe#Ybea0be#bbn.w#D.y#G.1bC.1.1a0#b.z.z.zbc#H.zbCao#HbC", +".wbS#0.wa0a0#na0azaz#b#H.1#G.0.0.w#P.w#G#0#G#uay#D#DbAbK#z.KbSbK.l.4bv.8#F.l.e.S#ubAbA.RbK.K.K#s.4bAa5#z#z#z#z#z#w#m#3ba.p.p.L.L.ZaZbD#t#R.SaKaKakap#Y#bak#s#zakbn#D#u#D.y#7bs#7#F#F#u#0#0#0by.w", +"bna7anbran#8az#8.1#ba0#bbcbeaza0a0.w#G#G.1bm#G#0.1#z#GbV#z#0#s#G.e#z#z#za5.8bGbgaAbv#T.l#F#Da7a7bQbybQ#z.e#z.ebAblblay.0ay.raJ.obR.s#tbR#t.s.s#tbDaZa6bT.Z.gbT.SbA.S.S.KbQ.q.q#YbqaLbeaV#D#u#D#u", +"auauaL#W#Wbr#L#Wbe#nbe.w.w.w.1a7.1#H.1.0#u#7#7.r.0#ubl#uay#Gay#u#z#za5#u#ubS#za5#D#u#u.8.8.8.8#r.4bYaZ.G.GaZaZaZ#t.SbLbFb.#5bO.Z#t.Z.Z#t.Z#iaC.E.Z#1.g.ga6#ibWbR.C.s#..OaPbNbi.Ua9ajaO#X#v#y#r#h", +"bL#1b.aI.g.I.UaP.GaZ#t.4.SbK#sbQbe#Bbe#b.1#D#D.w#G#DbSbl.8bl#u#F.8aB#F#F#F#ubV.w.ybSbS#u.8.8a5#z.k.K.KbK.KbQaYakbu.K.S.4.4.4.S.e.4.8.4.ebF.Kb.#h.gbR#taq.ZbW#E.gaP.YbNba#.babaaP#3.u.s#R#R.S.KbK", +"a6a6.Z.ebO.T.QaNa2a2aIaT.Ub#.6.EbIaZaZ.4.S.SbA.kakbQ.k.KbF.ebA.y.e.ebSbS#u.8#FbG#r#r#r.e#F.ybsbdbV#zbV.yaBaB#2#2#MavaS#Z.O.O.OaPa6#i#i.ZbRaI.H.n.ZaIaI.T#5aIbRb.b.bLaIbRbR.gbWaP.g#v.g.Z#x.gbT#i", +"#H.1#DaY.ybV.SaB.Y.O.O#.#X.ObBaIbR.T#1#t#1.Z.g.ZaP.U.U#EbW.g.g.g#T#T.4.l.l.8bS.e#F.8#F.l.8arararblbSa5#0bS.BbS#ubV#u#ubl#ublblbl#5bZ.gaP#.babN.pb##E#E#E.Z.g.gaIaB#2.ZbL.T.e.e.K#z.kby#b#b#Y#Baz", +"brbrb4#Hb4.1#D.0.R.y.y#F.yaBbvaB.Z.g.g.g#jaOaxbxaFaS.Y.O.s.s#ta2#Fbla5bSay#ua8bl.y.y.RbK#J.KbKbK.S#F.y.8.8bA#F.l.y.y.8.8.4.4.4.4aPbtaPaP#E.YaPbNaP.Z.sbwbw.C.CbZbB.C.Z#..O.H.OaP#RbX.SbK#JbnaV#a", +"aZ#taZ.Z.4bLbO.ebLbR.S.TbL.T#4buaK.S#R#R#4.Sbw#t#3aT.Z.ZbD#i.E#i#Z#ZafafbN#Z.na2.3ay.B.Bay.B.8a8bn.y.4.4.4.8.8bAbl.y.ybKbS.e.e.8#F.K#s#s.k.KbLbObL#t.Z.9.G.GbI.E.G.9aP.g.ZbZbZ#tbJaI#.#EbW#E.g.Z", +"aKaKaH.u.C.C.sbw.O.O.O.O.Y.Uba.O.uaPbtaT.u.s.s#Rb.#4#5bLbL#T.Z.4.4#t.4.4#t.4.y.ebKbAbV.KbAbAbA.K.KbVbAa5#z#z#z.y#z#zbS.8aB#2.M#2.o#F#ubl#F#u#G.wbQbKbKbnbQ#YaL#Y#saY.KbAbYaBaBbY#.bibiaPaI.Tb7bR", +"#h#5#1#X#jaOaaaa#M#paf.Ybaba.n#S.H#.#.aDaqaqaq.HaPbW#x.Z.4.Z.4bR#RbLb.b..k#4#R.4#RaH.u.u.u.ja1aK#F.S.4.K#zbQ#zbVbSbSbS.ybS#DbVbVayayayblbbbl#u#G#D#u#u#D.1.1#b#H#H#b#b#GbV#s#b.1#L#WaL#WbqaLbK#K", +".zanbeb4be#aaY#aak.k#4bL#t.G.G#i#1#j#j.gaq#j#.bW.ZaT#tbRbObRbLb.#u.r.r.r.r.rbmbm#za5bv.la5a5a5a5.K.4#xbg#xbg.MaM#2.8bV#s.w#sbV#ubS#z.1#z#G#G.1#G.1.1.1.1.1.1bc.1.1.1.1#G.wazaz#Bb4#8bC#Hbebe#H#b", +"#D#G#G#u#0#zbSbSbVbVbAbAbV#z#z#s#JbK.R#s#saYaVaYb.#4.SbL.4.Z#t#t.L.LaS.Lba.O.n#mbQ#z.K#zbQ#0.e#2bQ.K.K.K#z#s#z#D.y#F#F#F#F#F.oaB.8.y.8.y#ubV#0#D#u.r#G.0#G#G#Gbc.1#G#G#G#G#Hbc.1#naz#b.w.1#0#0#P", +".z.zbcbCbcbC.0.0be#b#ba0#H.1.1.w#Dbdbdbn#H#8.z.z#BaL#b.w#sbV#z#s.K.K.K#z.K.K#z.K#R.C.j#RauaubYbt.6#6a6bL#zak#bak#D#D#D.y#u#u#0#0.w#sbV#u#F#Fbl#u.w#0#G#G.1#G.1#G.r#GbV#GbV.1bc#H.w.w.wa0#0bS#G#0", +".w.w.1#G.1#P#G#P.w.1#H.1.1#D#D.1by#0#0#G#P.w.w#b#Hbc#Gay#G.r.1.wbv#F.l#F.laJbvblbA.8.l.8a5#z#zbS.K#4bO.4#TaBaB#Fb4#baz#b#P#zbl.o#F#D#0#G#G#GaU#0.B#u#u#u#G#G#0.1.w.w.w.w#0#G.1.1b4anbraz#8.1#8az", +"b4.1bnbC.1b4.zaz#f#fbr#fb4#8.Van#f#8#8ananbe#G#u.1#G#DbC.1.1.w.1.w.1#G#G#GbS#ubSaiaB.SbXaB#2.4bKbvar.ebF.T#1#j.gah#O##bnbn#D#baY.1#D#DbS#u#D#7#7.o#u#0.wbya0a0#0.wbn#0bSbAbS#z#0#8#8an.z.1bd.1a0", +"#b.1.1bn.1bebran#W.man.manbran.m.m#Bbebe.1#D#D#bbCbCbC#GbC#G.1#G#u.8#ubSbVbS#z#z.w#s#D#ubV.1.w.w#Da7bd#Dbs.5.5#O.Q.Q.K#N.Jbgawax#O.y#z#s#z#z#b#B.zazaz.1#GbC.0bd#7#D#ubSbV#G.wbebr.Vbe#8#D#7#7#G", +"#b#b#b#b.w#b#bbeb4#H.cbebe#bbnbK.e#z#z#sbVbs#D#G#z#z#za5a5#za5a5#sbn#z#z#z.y.8bAbl#F.o.o#u#G#G.r.1bnbn#D#DbV#z.w#T#x.MbGbla5a5.eaB.S.SbT.6.a#2bK.1bn.1bn.1bean#lazazbe.1.R#F.5a#.S.e.ebUbU.W.Wap", +".ybAbAbKbK#DbV.waV#HbebebeaYbnbn#z#FaB#F.y#D#Dbnbe#H.1bn.1#Dbnbn#8#eao#e#8#8#8#8#0#0#0.w#G#G.ray#2.J#2#2.la5#z.w#b.1#u#Gbnbn#D#DbAbA.4.4.8bA#z#z.e.8#T.J#x.l.K#z#D#0.w.w#b.qbraLanbr.Vbr#8bd.b.b", +"#B#B#Bazbrbebebe#8brbrbrbe.zbrbr.mbrb4#H#b#sbVbV#NaW#T#T.J.JbkbkaAbp#Vbpbhbpbpbp.e#zbQ.w.w#s.1.w#H#b.1#G#D#7#7#FbS.8.l.l.8a5#sbybV#G#0.w#0#z#Fa#.4#NbOar#r#r#z#za8.ybS.8.4aB.SbK.cb4anan.mbeanan", +"brbrbebrazbr#f.Vbr#f.manb4bebean.V.V.m.maL.1bA.y.Rbnbnbnbnbn#Hb4#Y.w#saYbQbnbK.RbT.GaM#2.4bVbVbK.8#F#u#z.wbybyby#G#G#zbV#u#F#F.obb#uay#0#0.w.w.w#b#b#sbn#D.X.5.b#z#0#za5bAbA.K#s#TaAbObO#T#T#raN", +"bnbnbnbeanbq#l#Lan.maLbrbebebrbeaVb4b4aVbnbn.wbe#T.4.ybAbK.KbQbQ#D.R#D.1.1#H.1#H#Y#s#zbVbV#z#u.ya5a5ar.l#T.J#vawa7#Hb4be#b.1.0.0#G#ublbv#c#c#2#u#Dbd#D.1.w#Hbean#b.w.wbVbSbVbVbVbVbV#D.1bV.1#ban", +"#Bbebe#abebeaVbnbn#sbn#D#s#a#b.w.q#b.q#Y#Ybe#HbnaY#baY#baVbnaVaV#bbn.w#bbebeaV#H#D.1bebe.w#G.wa0.z.z#HaV#HaYbnaV.ebLa6a6a6bOa5b2.w#b.w#zbU#s#s#zbA.lbv#T#T.l.y#0#8.1#D.1.wazaza0.w#P.wbebe#H#baz", +"az.1bcbc.1.1bCa0#H#8b4b4#H#Hbebr#b#bbn.ybXbK#s.c.ia7bebe#zbV.8a5bnaY.caLaLbe#H#H.kbKbKbK#s#b#b#H#bbV#DbV.wbe.w.1bCbCbn#D#2bg#i#i.J.lbA#s#b#bbQbQ#JbVbVbS#G#u.R.R.SaB#2#2aB#Fbd#H.z.1.wa0#b#Ybe#Y", +"au.S.S#J.k.R.kaY#DbVbV#sbn#s#s#b#Y#Y#Y#Yak.q#Y.N#Y#Y#a.R.y.y.ybV#ebrbq#WaL#B#bbV.i.RbVbn.1#bb4b4#s#D.y#ubV.1#b#H.1.1#bbe#Y#b#s#z#z#z#D#7bs#u.y.lai.5#F#u#0.wbebe.qakbQbQ#baY#b#b.1.1.0#G#D#ubb#F", +".k#s.k.k.K.KbK.KbA.KbK.K#z#s#z.K.5aBbX.4bY#RaHbY.Z.4.e#s#sbnb4#H.q#Y#sai.dbs#8anbeanan#Ybe#H#H#8#b#H.wbV#G#G.0.1.wbV#u#F#7#D.1b4#bbebebeazb4.1bVbebe.w#z#u#FaBai.4#2.4.ebQbQ.w#Y.w#G#GbVay#u#z.w", +"bm#G#Gaybl#ublblbAbA.8bSbAa5bS#F#D.1#zbnbVbK.K.K.K.e.4aB.y#Dbnbea7#8brbq#Y.K.ebU#Hbe#Yanazbeazanazaz#n#n.w.1.1.1.w.w.1#Pa0#b.1.0bV#G.1.1az#b.w#s#sbVbV#ubVbV.1#s#z.yaB#2bG.M#xbgbG.8#z#Yb0#b#s#z", +"bS#GaybS#G.w#b#b#zbV#0bV.w.w#G#G#G#G.1#G#zbV#D#u.y#D#z#s#s.K.8aiar.4.4bV#sbn.cbr#s#u#2.M#x.y#D#b.1#b#b#b#na0a0a0a0.1.0.X#7#u.1a0#z#D#u#F#u#ubVbV#n#n#b#Pby#b#Y#n#bbn#D#DbV.KbV#z.K#1#i.6.6bDbL.Q", +"#Ebi#p.U.Y#Z#C#3bAbAbKbV#s#G#s#0#D#G.w.w#0bc#Gay.1#D#7#F.ya5#s.WaV.cbebn#sbQ#h.T.K.kbQb0aE#YbV.X.y.y.y.ybV.w#b.1#8.1azazaza0a0.wa0.w#0#GbV#z#z#0#F#F#F#F#F#u#ubVbe#b.1aY.wbV.ybAbRbR.Zaq.Z#E.U.U", +".n#Z.p.Las.faQ.fafaf.U.UaPbD.Z#t.4bK#za5#z#G#G#G#G#G.w#G#GbV#u.ybUbQ#z#zbV#JbKbYb.#R.Z#tbA.wbe#n.R#D.y.y.8#Dbn#D#Y.w.wbn.w.waza0.1.1#H#b#P.w#GbV.w#0bV#u#u#u#u#ubv.o#F.y#DbK#z.K#z#4.4.S.TbL#t#t", +"bLaZbD#R#taP.U#Z.hb6as.L#k.pba#ZbD.s.ZbTbG.8bS#Gay.B#G#0#G#D.0#D#s.y.ybVbV.4.ZbL.s.s#R#4#s.w#H.1aY.qbebQ#s#s#sbnar.l.l#u.1#HbC.FbC.1bC.1.1.1.1.1aybVbV.w#s.w#s#0by#za5#u.y.4.l#r.y.8#F.8.K.e.4#T", +"#4#4.S.4#taZ#T#2aZaTbNaQ#daQ.fasaS#QaT.s.4.8ararbl#ubVbV#ubl#F.XbT.G#t.S#tbkbT.T.uaH#OaB#D.1.zaz.z#f.z.zb4.za0.z#Jbn#JbK.ybAbK#s#z#baz.z.z.zaobc.0.1#G.0#G#u#G#G#ubS#0bVa5bS#uaBaB.y.y#u#F#FbA.K", +"#zbK.e.S.8.S.S.T.O#Z.LaQaQaQb5af#..Z#t.4#F.yblblbl#ubVbVbK.S#t.saI#tbwbZaI#t#t.S.n#1.TbF#zbQby.wbebranbraz#b.1.wan#nbe.w#z.y#FaB.8.ybn#Haobcbcbc.1.1.1.1#G#G#G#0#G#0#GbV#ubVbVbV.8bAblbAbSbS.K.K", +"#F.l.8.4bLbRbRbR#Z.L#kafafbN#..Zbg.Jbv.8#u#D.0#7#ubS.y#t.s.Obaas#3baaP.Z.sbD.Z.Z.y#JaY#a#Ybe#b.wb4#b#bbebebebe#bbm.0#u#G.w.w#0bVbGbAbVbV.1.1.w#P.1#Ha0bc.1#Day#D#0.1bS#u#ubV#zbVar.8.l.8a5a5.e#N", +"#T.4.4bObw#.bNad#k.pba#.bR.4bAa5ara5#zbVbV#u.y.4.K#t.gbi#pb5.p#k.ZaP.Z#t.S.y#Dbna7bCb4.zazb4ao.1#b.1.1bVaybV#G.wa0.w#G#z#0#z.K.y.8bV.w.1.1.1bc.1bcbc#Ha0.1.0#G#G#G#G#G#G#GbVbV#ubla8a8blbSa5.8.4", +".e.T#1bw#..paQa.#E#v.Z.8.ebSbSay#FblbA.y.S.T.TaIaDbN#paj.U#v.g#ta6#TbAbSbS#G.1bc#GaU#P.w#0#GbSbS#G#Gay.r#D#G.w#P#D.y.8.4.4.e.e.e#u.1#P.1bc.1.1.1.0#Ha0#Hbc.1.1.way#0.w#0bV#GbV.ybl#F#u#zbVbKbA.y", +".g#.bW.UaOa9#..O.4.8bAbSbS#u.lbv.K.K.S#x#Eb#.v...Yba#..Z#T.4#Fbvbl#ubS#G.0#GbCbc#Pbc#P#P#G.w.w#P#Gbc.w.w.w.w#P.wb0.qbQ.K#r.S.S.S#G.1b4#P#H.1bc.1.1bca0.1#P.w.w.w#G#z#GbVbVbSbSbS#DbV#s.K#4.S.4.4", +"#EaC#i.gbT.4.4bAbAbAbSbAbA.4.ZaPa3.6#6#E#x.4bLbL.4bAbKbAbSbS#ubS#0#P#P.w.w.1.w.1#H.1a7bCbn#H#H#Hbybyby#z#z.8.4.4aM#xaZ#2.8.y#GbV#Gbc.w.1#G.w.1.wbcbC#G#G.1#G#GaybSbSbS.8bla5bA.8#z#z.KbZbRaT.ZaP", +".4#r.K#z#z#G#ubb.8.y.y.y#R.O#Z.tbMbM#5.ebA.R#D#Day.rayaybV#G.wby.1#G.w#G.w.wbV#u.TbObO.Z.Za6bD#ia6bTbDbD#iaP.s#t.K#s.wbya0#P.1bm#G#0#0.BbSayb2#0.1#G#u#GbVay.8.8blbSa5bSa5#za5bAar.Z.gbaa9baba.O", +"b2bS.8#N#T.Ja6bk.M.M.lbS#z#G#z.w#ubV#GbV.1#G#D.ra7bnaV#H#Hbnbn#D.l.4#2.E.6.6bT.T.X.X#u#D.1.1b4be.1#G#G#G.0#Gbcbc.1.1.w.1.w.1#D#G#D.0.0#D#GbVaybS#G.1.1#Dbn#DbnbV.SbA.KbVbK.4aZbD#F#ubVbSaybV.wbn", +"#D.0#Dbn.1#sbQ#s#za5#z.w#zbS.y#ubV.kbVbVbVbVbVbnaW.l.l.4#Narar.8bCbn#HaVbnaVbebea0.w.w.1.1a7#u#7.1#s#H.1.w#Ha0#b#G.w.w.w.1.w#G#G.0#G.1#0.w#0#0.wbS.ebS.e.l.4.JbG.y#u#D.w.w.w#sbQbV#s#0ay#ubV#D#D", +".0bn#Gbn#D.R.R.RbV#G#z#0bV#u#u.y.SaBbYaB#t.4bA.ea5#zb2bSbSbVbV.w.0.0a7#Hb4#Hbn#7a5#z#z.w.wa0a0#bbeaz#b#b#bbn#D.y.1#G#G#G#G#u#G#u.1.1#b.1aybl#Fa8bG#T.8.eby.Wb0bP#G#Gbm#Gbm#G#G#G#sbn.w#z#G#G#zbn", +"#z.w.w#zar.4#T.Jbv#F.ybSbV#ubSbVaY#s#s.Ka5.K#z.Kbl#u#D#G#D.rbd.ra5#0bS.BbVa5#ua8.ybla8#u#0#G#G#G.0#D#G.wbe#B#Ybe#P.w.w.w.1#0#G#G#G.1#P.w.w#0#0.w#baY#s.wbn.0#D#7ay.rbm.r#G#G#G#GbV#0#z#0#G#z.1.w", +".8ara5.Ka5.ear.e.w.w.wa0#bby.w#b#0#0bV#u#F#FbGbv.8.8ay#z#0#0#0#0#z#0a5aya5ayb2#0bV#GbV#D#u#u#D#Ga0a0bc.1bc#G#D#u#Day#D#GbV#G.w#s.w.w.w.w.w#z.w.waBbs.y#D#DbC.1bCbV#G#0.1#0#G#0#zbKbSbSbS#u#ubVbV", +"#Hb4bebeazbeaz#Y#ubV#u#z#u.y.8#F.w.w.w.w#0.w#0#z#G#ubl#F#u#u#u#Fbd#u#D.0#7#7#7#D#u#D#GbV#G.w#bbebc.1#G#G.1.w#P.w#b.wby#s.w.w#s.w#z#z.KbA.4#F#T#2ar.e.ebA.ebAbAbSbQ.w#s.w#z#zbK.4.y.8bSbS#0bSbVbn", +"bn.1a7bnbn#D###u.1#0bn.w#G#z#D#0#0bV.w.w.w#bbe#bb4b4#HbCa7#Dbd.ybs.R#D#u#u#F#7bs#u#u#u.ybA.S.4bLap#b.WbQ#z#s#z#z.8.4.8#2#2bG.MbT.4.SbA.S.4.S.K.Kararar.ea5.ebS.e.8.8.ybS#z#z#s.KbAbla5#0#0.w#s.w", +"#s#z#s#z#z#z#za5#D#D#GbV.wbV#z#0.Ka5bKbAau.R.S.R.lbAa5.e#r#NaAaAa6.ZaW#N#N.e.e.e.BbSa5.earbOa6#Ebi#EbDbDa6#t.4.4.ebA.SbA.e.K.K#zbL.T.KbL#t#TbL.Kbn.1.1.1.w#Hbeb4bV#z#z#G.w#z#z.K#za5#zby#0bVbV#z", +"#u#D#DbV#u#ua8#ubXau.y.y.ybs#DbsbK.SbL#RaIaI.C#3bw#t#R#R.S.S.S.y#t.gaPaP.gaT.Z.ObabaaP.Z.Z.Z.4.l#F#2#2#O.S.ebA.8.S#2aB.y#zbKbS.y#u#D.1.w.1bnbVbn#zbK.y.SbK#4.S#tbSbV#u.8.8#u.8#ubV.y.y.y#ubA#ubV", +".##q#qat.tas.2.2#A#A#AbH.H#C.H#CaMbI#x.GaZ.9bD.G.9bD.GbT#2#2aBaBbK.ybAbKbK.S.S.S#t.Z.Z.4bAbK#zbV#sbV.K.K.K#s.KbV.K.y.SbA.KbK.y.S.4.ybAbK.K.K.K.K.K.K.e.K#4.K#4bLa2#5.D#5a2aIaIa2aIbBbZbwbw.s.OaP", +"ba.O.Obaba#.#.#..A.A#v.Abkbkbk.A.y.8.SbA.e.S.S.4.K.e.e.e.e#z#z#0bS#ubV#zbV.y.ybS#4.SbY.S.y.yaBaB.4#t#t#t#t.S.S.S.e.4.4.S.K.KbL.S#hbF.TbR.gaPbWaP#Z#ZbaaS.p#kb5b5bNa9#..O.O.Oaq.ObaaP.O.O#Zba.Y.Y", +"#D#u#u#uaybSbS#u#s#s#z.w#s#s.1bnbQbQbQbQbQ.Q.K.T#t.4.Z#2#T.4.4.4bAbA.SbA.S.S.K.KbQ.K.K.K#5bLbL.SbO#R.T#5b.#5.K.kb.#5bLbZbZbR.Z.gaP#.aPbNbNbN.O.Hbwbwbwbw#3.O.O.O#2.4.8.8.8.8.ybAbA.e#z#s#z#s#z#s", +"#5.TbLbL.TbLbLbL#m#gae.CaX.Caeae.Z.4#tbLbLbZbR#tbObR#tbR.4.4.4#t.saP.U#E.YaP.U#..UbWbibWbNbNa9#..gbW.Z.sbwaP.G.9aP#E.U#E#EaPaP.U.Y#3bBaIbw.Cb.#w.ybSa5bVbSbV#z.w#z#z#z.K.K.e.ea5bAa5.ea5.ea5a5.e", +".U.Y.YaTaT.Z.O.gbRbRbwbw#tbB.s.ZbTbT.Z#t.4.4.4a6#t.Z#t#t#t#ta6bDaIbZbB.n#m.n#3#3#X#.aq.HbH#..H#m.TbRaIa2.DaI.T#4bwbRbwbwbZb.bob.#4b.buaK#R.s.9#t#3.O.O.Obw.sbw.sbwbwbwbw#tbwbRbB.Z.gaP.gaP.gaP.g", +"aB#FbSbVbV#D#ubVaya8bl.8aybS#u#u#zbVbV#zbV#zbK#u#u#u.y.8.ybA.ybA.4bY.4.4#t#tbDaZ#tbR.4#t.4#t#tbL.K#tbwaI#5aIbLbFaIaIbwbD.U#E.Ubi#EbDbD.ZbT#xbT#xabaRaR#oabat.O#Z.s#t.SbLaI#4aKb.b.b..Kbu.7.Qbub.", +".w#b#b#Y.w#0.1#G#z#G#z#G#b#b#b#s.1#G#G#G.1bc#G#G#G#Day#G#G#G#G#G.w#G#GbV.1#z.w#b.kbnbKbn#s#DbVbV.K#t#iaP.ZbW.g.Z.s.s.gaPaP.Zbw.Za6.Z.Z.8#r#z#ra5#D.r.r.r#Gbcbmbm#G.1.w.wbc.w#G#G#G#G#G#Ga0#P.1.r" +] + +button_xpm = [ +" 96 96 254 2", +".. c #9c3218", +".# c #a4733e", +".a c #bc450a", +".b c #d4700c", +".c c #dc8c29", +".d c #bc5e00", +".e c #d46b37", +".f c #945431", +".g c #bc5a2c", +".h c #8c4e4b", +".i c #d47e16", +".j c #bc7422", +".k c #d47d3a", +".l c #d45e28", +".m c #ec9b3e", +".n c #bc6b43", +".o c #d45a13", +".p c #a45236", +".q c #dc8848", +".r c #e46b1b", +".s c #bc652f", +".t c #a46243", +".u c #bc6920", +".v c #a4391e", +".w c #e47b35", +".x c #9c6b30", +".y c #d46d24", +".z c #ec8a29", +".A c #bc452a", +".B c #e46833", +".C c #bc702e", +".D c #c47845", +".E c #b15314", +".F c #e47e10", +".G c #bc5a18", +".H c #bc6145", +".I c #a44d16", +".J c #cc5728", +".K c #d47439", +".L c #a45b39", +".M c #cc5815", +".N c #dc8f4c", +".O c #b46239", +".P c #bc5307", +".Q c #d4794f", +".R c #d47624", +".S c #cc6c2c", +".T c #cc6941", +".U c #ac5222", +".V c #e49328", +".W c #e4754d", +".X c #d4650b", +".Y c #ac592c", +".Z c #c05e2d", +".0 c #e4751a", +".1 c #e47d29", +".2 c #9c6143", +".3 c #e45f2b", +".4 c #cc632a", +".5 c #cc660d", +".6 c #b44b13", +".7 c #d48442", +".8 c #d66228", +".9 c #bc6221", +"#. c #b45736", +"## c #d47714", +"#a c #dc8936", +"#b c #e48237", +"#c c #cc530c", +"#d c #8c522b", +"#e c #dc8819", +"#f c #ec9129", +"#g c #bc7936", +"#h c #d46f50", +"#i c #bc521d", +"#j c #bc553b", +"#k c #9c523b", +"#l c #f49a45", +"#m c #bc7548", +"#n c #ec8643", +"#o c #a86d3a", +"#p c #a44d21", +"#q c #a4754b", +"#r c #d46547", +"#s c #dc7937", +"#t c #c4642d", +"#u c #dc6c21", +"#v c #bc4d2e", +"#w c #cc7e53", +"#x c #c45917", +"#y c #cc5c42", +"#z c #dc7036", +"#A c #ac5448", +"#B c #ec8f44", +"#C c #b45c4d", +"#D c #dc7622", +"#E c #b45222", +"#F c #d4651b", +"#G c #e47328", +"#H c #e58429", +"#I c #9c5f23", +"#J c #d47f2b", +"#K c #cc7116", +"#L c #eca24e", +"#M c #9c471c", +"#N c #d45b36", +"#O c #c46716", +"#P c #ec7836", +"#Q c #ac642d", +"#R c #c46f2e", +"#S c #c47551", +"#T c #cc5b2b", +"#U c #cc685f", +"#V c #bc4b3a", +"#W c #e49a4b", +"#X c #b44c35", +"#Y c #e48745", +"#Z c #ac613c", +"#0 c #e47234", +"#1 c #c46242", +"#2 c #cc5e1a", +"#3 c #b4683d", +"#4 c #cc7430", +"#5 c #cc7042", +"#6 c #bf4b0d", +"#7 c #dc6e13", +"#8 c #e48c21", +"#9 c #9c3445", +"a. c #8c432b", +"a# c #cc5e04", +"aa c #a43f33", +"ab c #b46d44", +"ac c #9c5e62", +"ad c #9c4833", +"ae c #b4742c", +"af c #a4522b", +"ag c #dc943c", +"ah c #b46000", +"ai c #c46309", +"aj c #a4441e", +"ak c #dc7f4c", +"al c #ac6e27", +"am c #ac4b4e", +"an c #ec9238", +"ao c #e48518", +"ap c #e47c4f", +"aq c #bc5c3e", +"ar c #d56238", +"as c #9c5840", +"at c #ab6946", +"au c #cc761f", +"av c #9c5024", +"aw c #bc4922", +"ax c #bc421d", +"ay c #e46927", +"az c #ec8836", +"aA c #cc513b", +"aB c #cc661d", +"aC c #b44a21", +"aD c #b4544c", +"aE c #ec8a55", +"aF c #9c5a20", +"aG c #94533f", +"aH c #c4701d", +"aI c #c46b42", +"aJ c #dc5a18", +"aK c #cc7b2f", +"aL c #e49046", +"aM c #c4520b", +"aN c #dc774c", +"aO c #ac4631", +"aP c #b45b28", +"aQ c #944e30", +"aR c #ac6e4d", +"aS c #a45f2a", +"aT c #b4612a", +"aU c #ec7032", +"aV c #dc872b", +"aW c #cc5939", +"aX c #b47844", +"aY c #dc843b", +"aZ c #c4601d", +"a0 c #ec7f36", +"a1 c #c47531", +"a2 c #c47344", +"a3 c #ac431d", +"a4 c #ac7439", +"a5 c #dc6735", +"a6 c #c4582a", +"a7 c #dc7c1b", +"a8 c #dc5d26", +"a9 c #ac5036", +"b. c #cc7742", +"b# c #ac4b13", +"ba c #ac5a37", +"bb c #dc5f0c", +"bc c #ec7a29", +"bd c #dc7813", +"be c #e48b37", +"bf c #f48e28", +"bg c #c44e1f", +"bh c #c44e3f", +"bi c #ac4b1e", +"bj c #dc6544", +"bk c #c44c2b", +"bl c #dc611a", +"bm c #ec7125", +"bn c #dc7d29", +"bo c #cc7752", +"bp c #c4473c", +"bq c #ec994b", +"br c #e49336", +"bs c #d46f16", +"bt c #bc600a", +"bu c #d47a46", +"bv c #d45b1e", +"bw c #bc653a", +"bx c #ac3c1d", +"by c #e47943", +"bz c #a46b2e", +"bA c #d46b2e", +"bB c #bc6c3a", +"bC c #e47f1b", +"bD c #bc5b22", +"bE c #bc6052", +"bF c #d47346", +"bG c #cc561f", +"bH c #b46044", +"bI c #bc5312", +"bJ c #d4775e", +"bK c #d4732e", +"bL c #cc6b37", +"bM c #cc644f", +"bN c #ac512d", +"bO c #cc6137", +"bP c #ec8552", +"bQ c #dc7944", +"bR c #c46339", +"bS c #dc6a2c", +"bT c #c45a21", +"bU c #dc6f44", +"bV c #dc732c", +"bW c #b4502c", +"bX c #cc6d1f", +"bY c #c46521", +"bZ c #c46939", +"b0 c #e48653", +"b1 c #ac6445", +"b2 c #e46e43", +"b3 c #c45851", +"b4 c #e48b2b", +"b5 c #9c5430", +"b6 c #944d49", +"b7 c #c46a51", +".waB.U#5#Dba.##u#sbn#H.8#z.0#Db2.4#E.g.e#T#F#z#4bL.n#EbSbm.kauaz#Bbnbr#B.y#b#bb4.w.z#D.z#haKaZbr#Ha6bLaubn.w#Yb4.z#0#ba7an#s#Yb4b4.8.wbnaVaOb3aBbS.l.K.4bL.S#i#5#0#u.w.w#u.w.1#D#zaP#AbK.y#.#a#u", +"#b#F.Y.T#u.O#q#D#z.1b4ar.wbn.0bS#raC#..T.4.lbK#4aZ#Zbi#G#G#s.S.1bebnbr#BbA#b.1.1.w.z#Gan#5aK#tbr.1a6#1aua7bS.w#HbCa5#0#DazbK.w#8#H.8#0aVbXbibRbsbA.l.K.e.e.4#x.T#0.8.wbVbVbn#sbVbSaT#AbVbS.gag#G", +"#bbS.YbL#u.O#q#D#sa7bea5.w#G#D.8.K#ibW#1.4.8.e.SbD.p#pay#G.k.Sbcbebnbe#BbA#b.1bn.1bc#Gbe#1aHaZb4#D.Zb.aLan#0#Dbda7bS.ybCbe.y.w#8be#ubSaY.G#X#1.ybA.8#z.K.ebL.ZbL#0#u.w#GbV.w.1bnbA.u#C#z.y#.aL#G", +"#YbVaTbL#ubaatbV#zbnbe.K#zbnbn#N#z.g.UbwbO.4.S.4#R.L.UbSay.k#Jbc#abebrazbK#bbnbC#GbC#ub4#X.u.Z#HaY.eaI#Wbr.w.1#H#HbV.8b4anbS#s#H#b#GbVbe.6bw.4.ya5.y.ebS.e.e#t#t#G#u#zbVbV.w#s.w.e.u#CbKbS#.br#P", +".wbVaT.Tayba.t#u#zbnaza5ar#D.1#T#zbTaO#.bwbL.8#t#tas.Y#Gbl.K.k.1beanazbrbK.w.1.1.1bc#0be#j.C.4b4.ybO.g#Wana0aya7az.w#2az#B#z.w#HaY.wbVaNa3.s.4bA.e.8#F.8#z.ebLbD#0#u.w#GbV#b.1#s#z.s#AbAbV#jag#G", +"#0#D.ZbLbS#.as#u#z#Dbe.e.4.R#s.J#G.4a9.p#.bR.SaZaP.f#Z.w#u.K.R.1bebqbrbe#D#bbeb4#PbC#z#aaO.CbL.1bV.T.Ibr#8a0.w#Han#Y#2anan#z#0bC#s#H#DaraC.s.4.lbAbA.lblbS.e.K#i#ubV.w#s#GbQbV.wa5.CaD.ybV#.#a#G", +".1#u.ObLbS#..2a8#z##azar#T.RbQa6#u.4#.aQbNbR.S#T.UaQ#C#bblbK.kbCaV#l#fbebV#bbr.z#G.0bSaYaa.sbO#D.S.Q.U#Laz#n.w.1b4#B#2anbebS#zbC.KaV#Dbpb3bYbX.l.8bAbvblbS.e.k.g#u#G.w#GbVbVbS#s.e.C#CbKbV#X#a#G", +"#GbV.gbL#u#..2#ua5#u#Y.e.J.R#sbkbbbA.Oa.adbR.T#2#Z.f#3#bbl.KaYa0bn#L.Vbe.wbeanaz#P.0bS#aaabw.e.0aBaNaP#W#8a0#G.0#8aE#2an#HbS#0.1.S.1.1.A#U.S.Rar.4a5#FbSblbAbQ.ZblbV.w#0#DbV.ybV.8.CbE#zbVbW#a.1", +"#zaybR#m#s.A#AbX#D.1#u.wbvbV#z.M.8bA.4#E#k#Z.OaZ.hafbA#zbAbA#D#Hbnanbr#8aVb4#W#f.wbebVak#M.ObL.R.Ya2.Gbe.1aza7a7#Y.1#F#B.y.k#Db4.y#saY.P.ybX.K.4.8bS#zbS#u.8bA.SbDby#G.1#s.4.KbAbV.SatbVbl#Z#D#G", +"#Ga8bR#g#s.A#Aau#D#0bV.w#F#Ga5.M.ybA.8#v.p.L#ZaTb6afbAbVbA.KbV#8#s.m#fbr#H#H.m#f.1#bbV.k#p.ObR.y.Oa2aZ#n#baz#H#H.w#0#uaL#O.k#D#b#F.w#b#2#zbK.KaB.ybS#GbS#DbSbVbAbT.wbV#G#s.4#zbS.KbAat#z#u#obV#G", +"#zblbwae#z#v#A.y#Gbn#u.w.y#z#z.l.ybSbA.Zba#k.LbNas.UbK#0.8bKbVb4bnaL.mbrbe.canbr#H#bbA#4af.O.S.y.OaI#tbea0#b#H#b.y.w#G#b#x.KbV.w.y#s.w#F#s#zbVaBbS#ubS#GbSbSbK#z.4bQ.r.1bn.y#sbSbV.SaR#0#u.Obn.1", +"#G.8bw.C.w.AbH.ybV.w#za0bS#0.wbS.ybAbS.8#.afaQaQ.L.UbVbVbS.K#sb4#Dbranbrbebe.m#f.1a0bAbL.Y.O.T#F#.aT.4.w#b#H.w.w.8bS.w#Y#x.SbV.1bS#0#z.y#0#z.y.8#zbS#ubV#GbS#ubA#4.w.0.1#bbKbVbV.y.4b1bS#u.O#G.1", +"#bay#taX#sbk.H.y.w#G#u#bbVbV#z#z#RbAbS.ebRafaQ#d#kaP#s.wbA#zbn#H#sbeb4bebebeanb4.1#HbV#tba.YbL.y#X.U.S.wbc.1#GbV#zay#0by.y.SbV#PbS#zbS#u#z.wbl.y#GbS#u#G#GbV.ybK#z#b.0.1.wbnbV#DbA.Sb1#0bS#3#0.1", +"#bbSbB.C#sbk#CbsbV#z.yby#u#ubS#G.O.4#ubS.4bNaQaQ.pbD#G.wa5#s#s#H#abebe.zaY#bbr#8#D.1#z.Gba.U.TaB.Ob#bK.wbe#G#G#s.w#u#G#bbKbAbV#G.RbV#F#s.w.w#F#F.w#0#G#0#0aybSbSbQ.w#G#G.wbVbA#GbKbAab#0ay.n.1.w", +"#b#u.sae.1bk.H#D#z#D.8.wbS#u.y#z#Z.Z.lbSbA#.b5.fba.Z#s#GbS#z#sbe#bbrbebrbnbnan.V#D.1#z.G.nba#4bvbB.6#s.1az.0#G.w#Gay#P#GbKbK#b#G#z.waB.w.w.w#F#u#0.w.w#G#G#0bVbS.ebV#G#G.1#z.8bS#z.8b1#0bS.n#0#G", +"#s#u.Zaebn.A#Cbs#0#0#F#bbV.y#u.w.taPbvaya5.Zafas#Z#t#0#G#F.K#bbr.wbeanbrbnbK.man.1.w#s#i#S.ObuaBaI.EbQa7a0.0#G#0#D#Gaz#u.Rbnan.0bebQaB#s#sa0#F.wbS#G#G#G#G#G#zbA.ebl#G.0bV#z#F#0bK.8.tayay.H#D.r", +".1#zbT.ZbQ.yaMbK.K#0.w#0aY.SbV#ubMa3.K#Farbg#.aSbD.4#D#G#D.5#Y#b.qaV.V.m#z.e.m#fby#D#J#1.H.uaK.ZbRbIbe.1a0.w#D#D#Gbdb4b0.J.wa7ak#H#n#xb4#H#z#zbnay#G#u#G.1.1#G#u#s#Tbd#0b2#GbA.1.8#r#Ia5#sala5#D", +"#GbVbT.4bQ.8bI.Sa5bV.w#0#saB.kbVbM.6.Kbla5.J.Z#Q.sbK#G#G.1aB#Y#b#bb4.Vbr#F#z#B#8#0bdbK#j#.aP.S.g.TaZ#B#H.w#P.w#D#0.Fb4aNbv.1#DbV#Ha0.Mb4#H#za5#D#0#G#G.0.1.1.w#D#s#Ta7#0b2#D.8#H.y#r.fbA#zal#z.1", +"#GbV.Z#tbQ.S#xbLbK.w.wbV#sbYbV#G#5#6.SbA#zbv#taT.Z#z.w.1#zbX#Ybn.qb4.mb4aB#zbe#8#0bd.R#j#.bt#R.g#1aZbe.1#G.wbV#D#PbCbe.ear#D.1bX.1by.l.1.1a5a5#Dbm#G#G.1.1a0.w#G#s.la7.wa5#Dar#HbVbF#I.4a5ala5.1", +"#G#z#tbLbQbA.G#RbA.w.w#u.KaBbVbV.e#E#x.ybV.8.4.sbTa5.w#Gbn.4#Y.y#YaV.m#H#F#sbean#Gbn#s.gaDaT#R.g#t.4#b.0#G#G#G#D#0bCb4#x.e#G.1aB#G#0.8.1.1bS.B#G#G#G#G.1.1.1#G#u#z.e#H.w#z#D.8#H#z#haS.4#zal.4.1", +".1bV.4bLbQ.eaZaIau.w#0#Fa5#tbV.1bA#x#E.SbV#u#F.4bG#z#0#zbVbYakbX#YbnaL#b.ybV.1an#P#H#saqaq.u#4#j#1.S.1#u.1#0.1#G#0#Hbn#ibjbV#b#2bca5a5.1.0.l#z.0#G.1.1bcbc#b#D#u.war#8by#z#u.e#b.y.Tbz.4#za4.J#D", +"bc#z.4bZ.Q.S.9aI.R#b.w#F.K.4bV#G.R.4b#.T#u#D.y.8.8#GbcbVbK#R.qbKbebn.1#s#Dbs#Dbe.w#8aY#jaq.s.SaO.Z.S#D#7bm#G.w#u#0.zbn#xa5#G.1#2#bbSby.1#G.l#0.0.0bca0az#Ha0#G#u#0.B#8.w.K#D#r.1#FbO.x#T#zaX.J#D", +"#GbK.4bR.K.SbD.C.Sbe#0bG#zbAbV#D#DbL.v.T.y.0blarbS#G#G#D.KaH#Y#s#H.wbAbV#D#D#D#G.w.zaV#.aq.sbwax.gbA#D#7#G#u#G#u#uan##aW#NbV#D.4#bbvap#H#H.8#sa7.1.1bc#Ha0#H#0#D#0a5#8bQ#z.y.ebn.y.T.##x.KaXbkbV", +"#G#ua6#t.T.4.G#3.R#b#zbv.K.ebn.r#DbL..aI.4#7blar#G#Gay#u.KbY.N.cbnbe.ybVbn#G#b#u#b.zaYbW.H#R#tbx.Z.k.w.r#0ay.1#GaJaz.5bO#T.w#DbAbnbg#b#Hb4bVby.F.0bC.1.1.1#b#GbVaU.8#HbnbA.R#N.1#s#h.#bgbAa4#vbV", +"#G#u#tbO#t.K.9bw.lb4#G.8bla5aWa7ay.4.YaD.K#ublblay#G.1.y.K.Z#Y.iaY#T.R#Nbe#zbC.1#H#Bb..ZaPb.#3aFaPak#G.0.1#D#D#G#D#b#xbAbv#G#ubA.w.Mbn#nbVbS.1bdbcbm#P#G#Gbc.1#G#D.w#u.w.w#2bK#4bK.K#vbw.Q#tbt.K", +"#D#u.ZbR.4.ebD#tbAb4#u.8#u#z.lbn.rbAbabN#tbS#u#u.B#G#D#D.e.4#Ya7#b.4bnaW#H#zbC#GbcaL#4aTbW#4aTaS.UbQ#D#u#z#D#D#G#u#baBa5bS#G#u.K#b#F.1bebVbV#GbC#H.1#P.1.1#H#GbVbS#G#u.w#saBbA.SbAbF.gaqb..u.G.K", +"ay.y#t#t.Z.e.G#Ra5#Hblay#Db2.laVaybK#.#p.g.ybVbV#G.w#7#z.4.e#abeaY.ybn#T.1#zbC#D#G#b.S#t#x#5.Z.Y.U.kbSbl#GbA#u#G#u#b.4.e#z#G#FbAby.ybeaz#ubS.1bc.z.1#P.w.1bc#DaybV#G#F#G.w#2.S#t.R.e.g.OaI.9#x.K", +"#G.8#tbR#2.ebT#R.ebC#F#z#GbS.4#HaybA.Zajbi#tbVbV#0#G#F#saB#s.Rbe#bbAbn#Tbna5#GbCay.wbLbR.ZbL.Z.O#E.Kbl#ubVbKbSbVbl.w.4.8#0#ua#bVbQ#ube#b#u#G.1.1bf.0.w#Pa0#H.1#GbV#G#u.w#s.M.S#tbn.e#1.gbZ#R.9.K", +"#G.y#t.4#T.e#2.S#ra7#u#0#DbS#N#HbVbS#T.U#p.sbK#u#G#G.y#s.y#s.y#zaVbKbn.J.1a5bC.1#G#s.4bO.4bLbD.sbWbF.8ay#z#zbA#u#D#z.4.4#0#u.o#s.4bSbe#H#u#G.1.1.z#D#G.w#ba0.1#0#D.w#D.wbV#x.S.S#s.SbR.ObZ#5bYbO", +"#GbA#t.4.4#z#2.S#N#D#u#0.rbVarbn#GbS.4#vb5.O.Sbl#DbVa5.K#Dbn.ybVbn.Kbn.J#D#z#G.1.rbV.ZbR.Z#T#i.s.g.ebl#G#0.K#u.8#0bA.e#2.1#u.y#b#xbAbebn#D#Gbm.0beblbV.w.1bc.1#G#D.1#Ga0#s.M.S.Tbn.S.T#jbBbu.4.Z", +"#G.ya6.4.4#zaB.SaAbd#u#0bdbVarbn.w#u#F.g.pba#t#F.0#u#s.8bnb4.y.8aVbQ#Hbkbna5.1.w.1#z#tbL.4.Z.E#t.gbA#uay#sbS.K.y.w#2#z.4#0bl#D#Ybg#zbebC.0.w#G.1.1bvar#z#u.1.1#G#D.1bV#b#z#2bLbL#b.S#5#..g.k#t.Z", +"#GbAbD#t.4#0aB.yaA.y#F#0.r.w.8#DbybSbv#t#kas.s.X#D.y.Waibe#HbVa5aVbQb4bkbna5#G.1.w#s#tb.bR.4#ia2.g.y#F#u#GbKbV#ub2#c.K.4bV#7#DaYa6.kaza7#D#P.1bc#z#Tar.8#F.0.1.r#G.1#u#P#s#2bL.S#b.S#haP.U#5bY#T", +".w.4aI.sbAbSbK#ta6bsbd#za5.0bC.l.1#0bla6.Z#3aIbT#sbUaVara7.q#ebn#b#D#YaA#8#s#u.wbv.K.L#u#R.4#Z#F#T.e.8#z.e.l#sbs.w.P.e.w#G.r.r.1#T.wa7.z.1bea0.F.K#D.RbK.e#zbV#D.w.1#G#u.w#zaB.K#Y#ubOaC.gbobwaP", +"#GbYbZaPbA#u.y.g.Z.R#u#0#0.0bn.4#G#P#u#TaPba#t.G.ybQ.c.4#8#YbraYbn.R.wbp#ebn.8.1#F.K.L.rbL#t#Zbl#T.eaB#z#z.4#G#7.1#6.S.w#u#G.rbV.l.w.0be.1.wa0#8bV.R#J.K.4.8bV#G#G#G#G#G#b#saB.K.w.ybOaCaPb7.s.G", +"#G.4bB.U.SbVbAaPaW#D#Da5bSa7#H#2.w#PbSbA.ZaPbw#t.y#zbe.4br#sbq.c.w#D#s#Vao#z#u#G.l.KaS.rb..4afa5.4bS#Fa5#zbv#u#G#0#6bAbQ#u#G.w.8#z.wbd.z.1#b#H#HbS.y#HbQ#T#T#zbn#G#G.w#G.w.waB.K#s.8.T#v#.aIaPaT", +"bV.4.n#EbA#zbKaP#N#u.0ay.B#HaV.E#G.w#GbS#t.ZbZ.SbV#zbnbVbqai#WaL#b.1aYbp#e#zbS#G#F#z.L.rb..4afbS.lbS#F#u#z.8#u.1#0.M.8#z.o#0#baZa5.w#u.1#D#b#H.1bAbVaYbQ.8.J.y.w.w.w.1#0.w#s#2.SbVbA.K.gaPaIaP.Z", +".1#t#m.Y.SbVbK.g#N#u#7a5bVb4bn.6.w.w.0bS.S.saI#tbVbV#s#s#Y.daLaLbe.1bQbh#8#zbV#G.l.Kba.r.k#tbNay.l#u#F#ua5#F#u.1.w#2bAbS#F#z#Y.GbVa0#u#D#7az#b.y.ybe.1bVby.laB#b#P.1.w#G#GbVaB.S.y.e.K.g#..n.U.O", +"#z#t.naP.S.y.SaT.e#F#7aya5#HaV.6.w.1#G#G.ybD#tbk.4#JbQbn.Kbs#Bbebe#Hbnbp#8.ybSbSaJ.K.O.r#4.4#Z#u.8.8#ubS.8.lbVbn#z.e.ebSbbay#bbY#Ga0bS#D#Dbr#bbG#D#n.1#u#b.eaM#b.w#G#G#GbV#s.SbK.4.4#5aPaPbwb#.O", +".wbD#3.U.K.y.S.Z.e#7#7b2#ubnbebTbV.wbC.1#D.Z#tbT.ZbK#h.c.e#8#b#HaV.1bKbp#8.8#z#ubv#z.nbm#R.y.na8bS#FbV#zbG.ebn#D.4.KbKbV#7ay#baB#G.wbS.w#Hb4#s.4#Daz.1#D#nbV.M#H.w#G.w#G.w.wbK.e.lbA.KaPaPbwaf.O", +"#baZ#3#..KbS.S.O.ebs#D#0a8#7be.T#u.1bcbcbn.Z.S.TbLbY.TbrbUanbV#H#H#H.Rbp#8bA#zbSbl.K#mbm.4.ea2bl.ebG.wa5bg.S#s.y.G.k.KbVbm.0.w.Sbc.w.B#Bb4#H.y.e.1an#H.1a0bV.5aY.w.wa0.w.w#sbA.SbA.ebu.Z.O#m.Y.H", +".k#t#X.UbQ#4#tba.B#u#ubV.ya5a0.X.T#H#P#Ga7.y.n.u.sb..K#s#Hbe.i.k#D#YbT.e#0bl.waibA#RbQ#z#RbK.3.y#F#r.y#DaA#u.z#x#v#K#z.w#F#Y.g.R.w#HbCazbCbea#bnbean#H#0a0#G.y.1#G#PbV#b.X.1bV#t.y.KbL#R.9#5.s.9", +"bnbR#.bW.K.S.ZbabS#u#D#Gbl#z.w.XbO.1bcaUbC#J#1aH.s#R.k#ubean.RbK.1#s.G#z#0#F#saB.8.C#za5aHbAay.y.8#rbS#ubvbAb4bXbhaBbV#z#7.wbkaV#b.w#D.zbcbe.X#sbean#b#G#b#G.ybVbm.w#Daz#D.wbV.4.y#z.4#RaPaI.saP", +"bK.4aqbi.KbY.ZaPa5#u#GbVa8#z.w#ubOa7#P#Pb4aY.T#O#R.ZbQ#2#YanbVbKbe#zaMbQ#0.o#D.S.l.j.Kbv.ubV.B.R#F#rbS#u#TbAb4bAbR.X.y#z#ua5bg#a#b#H.0#H.1be.y#sbebe.1#G.w#G.ybVbm#G#D#Ya0.wbV#t.ybQ.4#t.ga2.Z.Z", +"bn#t.HbW.K.S.4.Z.e.ybV#D#u.w.1#D.ZbC#P.w.z#abFaB#4#tb0.Man#YbnbKbebV#2.w.w.o#ubX.8#R#z.l.u.K.BbK.l.e#u.8.l.R#sbAbObs#ubS#DbS#Tbe.wbV#D.w.w.1.y#b#Haz.1#G.w.w#u.ybm.1bVaza0#b#s#tbA#s#t#t.s#5.saP", +"#s.4bHbN#5.ybA.ZarbA#G#u#0.w.1.1.Zbn#G#0az#Y#z#D#sbAaE#xazbe.1#s.wbV.4.w#G#ubVaBa5aubQa5.ubAay#J.8#F.8.8#FbKbObY#rbnbV.J#D#zarbnbV#D#G#P#b#ubVaYbe#bbc#G.w.wbV#uay.w.w.1#G.w.wbD#T.K.4#t.O#5aPaP", +"#D#t#.bNbL.ybK.ZbO.S.w#u#Ga0a7.1a6#H.w#Gb4bebQ.1.w.w#Y.ybe#H#b#b#G#zbV#s#G#G.1#2#zau#0a5.jbA.B.Kar.y.8.8#D.K.gbtar.1bVbGbnbS#z.1#D#u.w.w#b#Fbn#saz#b.1#G.w.w.w.y#u#P#b.0.1.1#YaP.M.K.Z.Z.ZaI#EaP", +"bV#t.Ha9bLaB#z.4a6.4#b#D#Ga0#ub4bD#H.wbSao#bby.z#HbebV#Daz#Hb4#b.w#ubV.1.r#G.w.4#zbY.ea5a1bA.8bKarbsa5.8a7.K#V.Z#N.1bVbG#b.8a5#8.1#G.w.w#n.5.waYazbc#P.1#P.w#P#F#G.waz#Dbc#Gbeb#bGbU#t.saPb7.gbZ", +"bVbL#m#..SaBbV.l#EbLbe#G#G#b#7be#i#H#PbS.1.w.waz.1#n.X#ban#8b4#Ha0.ybK.way.r.wbKbSbt#2a5aK.Ka8bKarbd#z#ra7#s#X#R.l#7bV.lbe.Ma5azbe.1.1.w#n.X#baVaz#H.1#P#0#P.w#F.w#0.w.0az#GbQb#.4bQbL.Z.Z#5bwbo", +".K.K.T.gbO.4#s#Fbiapbca0.0be.1.1a6by#G#G#bb4be.zaY.R.y.1az#b#s#b.za5.8#H#2.1#Dbv.K.6bQ.K#F.Kbn.SblbV.k.4bQ.4.MbX#4#Har#D#s.4###bby.1anbebe#Fbe#baz.w.w.1bV.w.wbvaz#D#G#G#G#s.K.UbO.y.e#O#C.D.U.i", +"#t#tbRbW#R#tbV#2#E#b.1a0#Daz#s#GbTbybc#G.1#bbr#f.q#D.y#baz#H#DbV.za5#F#b.Jbna7ar#4#6.K.4.SbV.y#FbS#z.KbYbybAaBbKbLbn.8#G#s.Z##.w.w.1azbe.1.ybe.waza0#b.1bV#b.w.o#b#D#G#G#G#zbA#EbO.R#r#OaDbB.U.k", +"#ibwaI.Z.T#t.K#2bD.W#Gbc#G#b#H#GbDby.way.1#ban.zbe.y.y#b#n.w.y#D#Har#u.1#2bnbd.ebOa6.K#x.4bA.4.ya5bV.KaZbQa5.y#s.Sa7arbV#s#x.5.wbV#bb4an#u#saY#sbe.1#bbe.1#n#b.M.wbV#G#GbSbV.e.9.4.y.K.5#AbB.U#J", +"aPaIa2.s#5#t.K#ObDbQ#G.1.w#b.1#GbD#z.w.rbVbebr.zbQ.y.y#b#nbV#ubVaV.l#z#G#2#D#DbF.4bL.Kbg.Ka5.4.8#0.ybK.G#z#zaB.k.4#Da8.1bnbk.b#bbV.wbebr.y#Y#s#JbV#sazaz.1#b.1#2.w.w#G#G#GbV.K.S.S.y.KaHam#3aO.k", +".Z#5.Dbwb.#t.K.Sa6#z.1bcbe#b.w.0#i#z.w#Daybeazb4#s.8bV#n.w#GbV.w#H#T.w#D.l#Dbs.T#T#z#z#x#z#z.4.8bSaB.K.G.e#zaB.R.4#Dar.w.wa6.R#b#z.1bebeaB.NbA.S.SbVbebe#G.1.1#2#G.w#0bVbVbVbV.ebLaB.e#KambwbW#J", +"bWaIaIaP#5.S#s.e#t#s.w#G#Bbn#H#GaP.8.w#GbVbe#b.z#s#D.wa0.1#G.1beaY.Jby#7a5bV.5#1aBak#sbgbQ#z.8bA.BaBbQaZ#z#z#2.S.4#Da8.1#z#Ta7a0#s.1bebnbXaNbRaZ.4.S.w.1#G.1.w#2a5#0.Bbl#ubS.ybVbO#O.ebYambwbWbK", +".gbL.T.G.K.S.KbA.4#z#P#D#Y#Da0bc.s.4#P.w#Gbe.1a0#sbn#ba0.1.0#b.wbn#vby#7#z#z.5#jaB#b#z.M#z#z.8#FbS#2aYaZ.e#zaZ.R.4#Da5#GbVbO.1by.w#Dbr.R.S.QbZbD#1.S#z#G#u.w.waBbl#0bS.8bVbVblbSaq#x.T.Sam.CbWbn", +".ZbF#4.9.k.SbV.8.4#z.w#ube.y#bbc#t.4.w#P.w#b.w.zbn#D.1a0.1.1#H.1aVawby#F.w.w#O.g#Fak#DaMbV.ybA.l#u#2akaZbA#z#2bAbL.0ar#GbVbObn.w#Y#D#BbX.k.Qa2.sbM#tbA#u#G#nbybG#u#0a5bl#0bV.y#G#.bT#r#4#X.OaPbn", +".saIbwaPb..e.K.S.e.8#b#D#P.1#G.1.KaMb0#Da0bman#Jar#Y#8a0.w.w.1bC.ea7#GbS#b#T.Qahb4#D.y#2bS#zbl.ybV#Mbu#tbl#w.yblay#0.R#Hbk#D#H.1#bbV.V.4b4.TaubRbZ#t#t#z.1.1#b.9ar.w#ubv#zbdbs.K.O#t.KbD#3#ob##b", +".saIbR#E#5.4.y#2bA.4.way.w#G.w.1#s#x.q.y.w.0#nbn.l.w.1.1.wbV.1bCbL#H#G.8.1#x.Q#O#b#D#F.8bS#z.y.y#uav.K.Sbl#m.y#F#D#zbV#8bp.RaV#Hbeak.cbQ.c.T.S#tbR.s#tbK#G.1.w#OaW#b#ua8#0#ubs.K.Y.4#z.G#Zabb##s", +".gbwbw.UbL.4.SaB.S.8by#D.w#G.w.w.waZbQ.8#G#ube#J.l.waz.0.1#u#bbna6b4#z.l#u.M.K##az#D#FbVbSbS.y.8#uaS.SbLay#3.R.o#ubV#z#8bpbn#HazaYaL#Db0b4bu.R.S.Z.Z.Z.K#G.1#baB#i#b#D.8#0bdbs#rafbL.K#x.Oab.EbV", +"aPbDbw#EbZ.SbA.ybA#2#s#G.w#G.w.1by#2.K.4#z#G.wbK#ubnaz.X#P#Fbe#Da6bebV.l#GbG#Nbn#b.y#F#s.y.8bK.8bl#Z.4bF.0ba.K.oaybVbV#8bp#s#Hbe#JaL#OaLaY.w#s#z.Z.s.Z.4#u#G.w.y#iaV.1.Ba5.r#D.l#pbL#zaZaP.n#tbV", +"aP.UbZ#EbZ.K.K#z.e#2.wbV.1#G.1.wa0.8#r.4#0.w#z.y.1.waz#7a0#7#Y#2a6#b#u.8bnbl.Jbn#P#u#F.wbSaBbS.4#u.O.4b.ay.pbQ#F.1#ubAaobh#bbnbe#saLai#BbA#s#z#u.Zbw.ZbObS#G#b#D#iaV.1#z#0#D#u#y#pbL#saZaPaI.K#G", +".Z#Eb.aPbR.KbKbK.KbG.w#G#0#u.w.1#P.y.S.e#z.w.ybA#H.wa0#u#b#D#bbgbO.1#Fa5bna5bg#D#z#u#F#s#D#2.e.4bl.O.4#5.r.p.Kbv#H#F.ya7bhbe#D.1#Ybq.SaY#Tbn.ybs#taI.g.Z.8#D.w.1a6bnbn.B#0#D#D#T.I.4bV#2aP.C.K#G", +"bw.UboaP.ZbL.ybS.K.M#s.w#G#G#G#D.1#G.S.e.K#0#FbKbCaza0.1.1.1#s#ia5.0#F#s#Da5aw#bbl#0.obVbV.M.e.4bl.O.SbOaJ.LbQ.ya0#F#D#8bhbe#D#sbe#B#sa7.4.1.e#F#taI#.#j.l#u.1.1.4.1.0a5b2#D#u.Z.UbLbS.SaP#t#z.r", +".Zbib..U.g.S.S.y#zbT.w#s#G#u#G#GbmbV.S.e.ybVaB#s.Fa0.wa0.0b4#z#ib2.0.oby#D.eaxaY.o#0aB#ubV#2.8.4blaP.e.Z.o.Lbubl.wbl#s#8bhbe.y#b.1.V.W.b#rbe#z.RbYaI#.#v#Tbl.1.1.e#G#7#0#0#D.R.Z.U.S#zbV.s#R#s.r", +"a6#E#4.YaP#h.4#ubL.4#z.w#G.1.0#D#G#G#G#u.8bG.8#zbC.1a0#zbV#b#z.J.w#GbbbVbAaB#O.1#F.w.8bSay.o#FaP#5a6.4#tbR.Z#zbV.1bdbS#DaAbVbQ#e#BaBaEbA.4#sbs#Dbl#tb1#A.Zbl#u.wbV.y#zay.0.1.y#2aT.4bVbVaZ.9#say", +".ZbDb.#3#.bF.y#D.T.S#z.w.1.1#G.0#0bc.1.1bVbA.y#b.1.1.w#D#Gbe#z.l#b#u#u#GbA.S.y#D#D#s.y#zay#F.KbtbZ#i.8.Z.saZbA#u.wbCa5#DaA.RbQbn#B.X#Y.4.KbV#u#D.o#tba#k.g#2#u#sbn.y#0#G.rbC#DaB.Z.S#u#sbY#t#s.r", +".ZbDbubBaP.TbA.1.KbA.K.w#P#b.1.0#0.wb4#P.wbVbnazbC#H#0#u.1be#DbA.wblay#0.4.S#z#D#0bV.8.1ay#u#saP.g#i.4.Z#tbDbK#7.1bCa5bnaW.R#zbn#BaB#Y#x.KbVbn.0#u.4#.a9#i.4#u.1bQ#FbS#G.0.1#D.S.O.4#u.w#tbYbQ.0", +".8.ZaKaIbNbRbK.wbL.SbA.w.w.1#0#D.B.1#P.1.1bV#H.z.1#b#G#F.1be#7#s#zbv#0.w.4bT#sbS#G#u.y#zblbl#saPaP.Z.e#tbR#t#s#G.w.1bV.1aW.y.Kbnbr.y#YaM#s.y.1#GbSbA.Z.YbW.4bV.w#b#FbS#z.0.1bV.y.O#TbVbV#t#t#s#G", +"#rbT#RbwbN.g.K.1#t.4.4.w.way.w#GbS#G#Hbc.1.1ao.z.1#PbV#uazazbs#bbU#c#0#0.8.6#z#u#G#F#u#Gbb#F.k#E#.bRbF.Z#t#R#b.1#GbC#zbn#N.R.eaV#sbKaYaZ#s.y.1#G#G.l.ZbW.U.gbA#G.w#2bS#G#u.1bVbSaq.Zbl#z#tbY#s.0", +"#z#x.s.CbNaP.Kbn#T.S#F#z#0bl#0bVay.w.1.1.1.1bc.z.1.w#z#u#bb4#u#b#s#c.w#zbA.a#z#D#G#FbV#Gbl#u.K.YbaaI.K#i.s.Sbe.z#s#GbSbC#r#D.KaV.RbQ.k.y#s.y.1#Gaybl.l.ZbN.ZbK#G.w.oa5#z#u.1#s#u.Oa6#FbSbY.Zbn#G", +"#rbT.9b..ObW.KbVbL.K#T.w#0#F#0ayb2.1bc.1bc.wbcao.1#G#zbV.w.1.ybQ#s#2.w#F#z#2#b#7aUbl#0.1#u#GbLaPbN.Hb.aC.saK#Y.z#0.1bV.1#r#D.eaYbAaLaBbK#Dbn#G#G#0#ubSbLa9#Z#z#G#Gbv#z#z#F#D#0.8.H.Z.8bA#tbY#s.1", +"a5#x#t#w.HaP.Kbn.K.K#2.w.wa8.wbS#0.w.1.1.1#Pbcbc.1bV#0bV#sbV.lbQ#z#u.wa##zbK#B#7#0#u#D#G#G.wbObN.p.n#h.E#taKbe.z.w.1bSbCbFbV.ebn.KaL#x.k.y#b#D.0#ubl#u.4#pbN.S.rbV#F#z#z.o.1.w#F.H.J.la5bY.s#sbc", +"#Dab#3.ybw#Z.K#zbnararaB#bbGbS#G.1bc.1.0bc.1.1.0ay.w#F#n#sbeai#JbA#D#b.4.e.1.z.o.B.w#u.1#DbQbLaPb#.Z.g.ZbDaka0.w#GbV#G#bbsbea7bnbK.q#4bA#G#G.0#Dar.3.y.R.U#9.Tbd#uay#r#z.MbVbe#Kb1bD#2.e#t#tbn.r", +".raR.ObSbw#Z.KbK.1ar.ebsaY#T.e.1#GbCbc#Hbc#H.1.1bV#0#F#nbVbe.5bV.lbd#b#N.8bnaz#u#u#0.r.1#ubK#t.Z#EaIbR#1aZapbe.1.1#u#D.w.ybebnb4bn.q.S.4ay#G#D.Rbla5#u.RaP#9.Tbd.r#z.ebU.M#Gbeaub1.g.4.K#t#t#s.0", +".raR.Oa5bwba.e.y.1ar.e.y#s.8bS.1#u#Ga0a0#Ha0.1#GbVbV#F#bbV.w#FbVbv#D#sbO#T.1az#0#u#G#G.1#ubK.Z.s#EaI#t.ga6#Y#b#G.1#DbV#DbK#BaVbeaVaY.S.4bV#G#D.y.la5#u.i.9aabOa7.r#G.e#z.M#0#b.y#Z.Z.8bQbL#t.w.0", +".r#o.ObVbwaS.K.S.1.ebA#D.w.e.e#D#G#G.1#Ha0bc.1.0.w#u#F#P#u#z#ubS#T.1bnar.Jbn.1.w#u#G.0.1#Dbn.9bw#E.Taq.gbT#bbn#uan#G#b#Dbnbqa7be.w#a.4#F.w#G.RaBaB.ebSbn.S#X.Zbd#GbV.4#z#F#0#b.S#Z.gbAbQbZ#R#sbc", +"#GabbwbS#3.p#4bK.wa5.e#Dbnby.lbnbV.1#Pbc.1.1#G#G#s#u#FbybV#u#0#G#T.w#D#r#x.1#Gby#G.1#G.1.1bQ.Gbw.Z#5.Za6.Zak.w#D#B#H#b.y#baLbn#a#b#baB.8.w#0bAbD#t.4bS#D.y.g#vbn#GbV.4#z#u#GbQ.y.L.ZbAbU.S.s.w.0", +"bcat.sbV.O#k.K#4#H.ebAbC.0.W.4#Day#G.w.1.0#D#G#u.w#u#u#bbV#F.w#u.l#H.X#r.lbebCa0#G#G#G.1.1#Y.G.C.gaIbW#i.g#s#D.0azbe.1.5#YbeaYbe.w.wbX.y.wbn.4bD.ubh#N#ubV.Zbgbn#G#z#2bQbV.w.w.y#Z.g.l#sbRbY#s.0", +"bm.Obw#z.Ob5#4.SbebSbA.1#Db0.Jbn.8#G.w.1#Gay#G#G#s#u#u#Y.1aBbe.R.ybe.5#z.Kan.0a0#0.1#Gbc#baLbI.C.gbR#EbWbT#z.y#Gb4anbnbsaLbn#a#a#H#b.ybA.w#zbOaPaT#V.l#FbVbOa3#s#0.e#2by#G.1bn.Rat.Z.4#z#t.s#s.0", +"bm#Z.s.w.Ob5bL#tb4.ebSbC#7bPbGbV.8ay.w.w#G#D#0#G#0#ubV#n#saibe.R#0an.b#z#z#lbd#0.1#Gbc.1#H#Y.EbZaIb..gbR.Sak#G#nb4.m#b.ybq.RaLbea0#b.y.y.wbS.4.g.O#XaA#F#DaraxbQa5.ebTbQ.1a0#G.y#3.Zbv.K#t#tbn.r", +"#G.sbw#z#2bNa2bSbV.8bQbVay#G.y.SblbS#Gay#G#0#G#ubybvbe#b#z.4.q.S#8#b#za8#Daz#7.w.w.r.1.1#H#s.GbBaBb.aP.CbAbn.1b4ananan###Bbn.mbnb4#b.ybv#GbnaP#ZadbN#jbSay.MbD.n.1#z.4#z#bbCbV#zbwaPa6#5bZbD.y.1", +".1#tbw#z.4a9#5bV#z.8.w#G.r#G#ubAbSbS#z#0#G.1#0bS#z.o#bbn.y#2akaB.1.w#0.y#0az#Dbn.w#G#G.1#baY.9.C#2bL.Y.s.S#DbC#Hazbeana7brbn#Wbnan#b.K#u.w#bbDb1#k#k.g.Saybv#xbw.w#z.4bK#P#G#G#z.s.g.g.KbR.ZbV.1", +".w.Sbw#z.8#..D#u#z.y#s#0bmbm#D.Ka5bS#G.w#GbS#G#0a5#F.1#DaB.4bQ#2#D.w#zbS.wbe#u#0.wbV#G.1#b.KaP.Z.ZaIbN#..S#u.1.1b4anbe#Hbebebrbnbe.w#z#u.wbn#E.LaG#ka9.4#zblaZ.sbV#z.4#z.w.0#D#s.H#i#x#5bZ.Z#s.1", +".wbLbw.K.8.O#5.8#GbS.w.1.r#G.wbVbS.8bV#0#G#ubVbV#u.yaY#D#2.ebQ#2.1bVa5.8.w.1bSbS.w#G#G#G#GbA.g#.bLbRba.O.K#D.1.1b4anb4brbebrbrbn#Hbn.KbS.w#Db#.fb6aG#kaq#za5.8.Z#zbV.S#s.way#GbnbBaP.g.TbR#t#s.1", +"bcaI#t.K.8.Oa2.8.w#z#z#0#Gbm.wbKa5blbVbV#G#u#ua5.y#D.wbVbGbQ#baB.wbSbA.4#b.RbVbA#0bV#G.wbVbY.Z.O.TbR#.aPbQ.ya0#b.z#Bb4anbe#B#Y.ibe#sbV#s#b.Rafb6#k#kadaP.e#zbA.4bS#s.R#s.wbS#D.1b7#i#x#4bR.9bV#G", +".w#4bw.e.8.OaI#u#z#z#z#G#G#G.w.4#za5bS#GbVbVbVbS.4bKbV.K.MbQaY#FazbVbAaB.q#F#GbS#G.1#Haz#saBbZ.H.e.gbabN.q#7#b.zan.manbebrbrbrbn.1#D#zbV.1.R.I.ha9.L#kbN.4#zbA.8ar#s.Rbn#0.B#GbnaI#E#i#5.s.Z#s#D", +"#GaKbR.e.yaqaI.8#z#sbK#0#G#G#saZa5bAbSbVbV#zbV#u.l#z.ybV#x.w#bbdazbV.K.Sbr.5.w#z.1bcbcaz#baBbZ.O.ebWbabi.qbs.zb4ananan.1#Bbe#Wbn.1.y.y#DbnaB#M.h.g.Oa9bibTbAbA.8.J#sbn.Raya5bVa7aI#E#i.KbR#t#s.0", +"#Gb.bBa5bA.Oa2#u.K.K.4#z#G#GbQbDbA.8bS.y#ubVbVaB#r.KbA#zbg#Y#b#Ha0bV#sbKaLa#be#0.1#H.1#B.1bY#taP.KaPaP.U#Y#7.z.zananan.ibqaV.mbn#b#DbV#z.1bXafac.ZaI#..I#i.lbA.8.J#s.i.ya5a5#DbdaIaC#ib.bR.4bQ#D", +"#Gb..ZbAbAbaaIbV#zbA.ybKbV#sbV#Far#z#Dblblar.8aB.y#zbR.KbG.w.1.z.wbV#T.can.Sbr#8b4.w#nb4#L#.bJ#R#z.g#3a9bq#F.z#H#f.mbe#sbe#D#L##bC#s.ybl#P#3.2.I#tbL.g#..paP.e.obTbQ#s#2.ybV.y#FbA.O.L.4.4bB#a.0", +"#Gb..ga5.eaPbB.ya5bl.8bS#0bn#s#u.Z#zbV#Fa8.8bA.y.8#4bR#1.8#G.1.1#PbVaAb4br.e.V#8an.waz#8#WbiaIbX.k#v.uajaL#Fbc.1#fbeanbnaLa7#La7#8#sbK.r.w.O.x.Y#t.e.gbWadbN#4bl#xbQ.K#2#ubVbV#D.lba.LbZaBbwak.0", +"#G.KaP.e#z.ObZ.y#za5bSbS#z.w#0bV.g.K#s#ua8.lbl.y#F.4.Z#i#z#G.0.w.w#DbOan.V.ebeanbr.w#bbCaLbi#..Sby.g.saObe#u#H.1#8be#B#Dbebr#L#8bc#sbKay.w.Y.LaT.4.K#taP#pbibA#u#2#s#zaB.ybV#sbV.4bababLaB.s.7.0", +"#Gbu.ga5#s.Obw.yby#0bSbS#0#zaybSbabZ.K#zbl.8bA#u.8.Saq.6#YbV#Ga0be.1bOanbrbU#8.zaza0.w#H#WaP#EbK#b.Z#R#XaV#0.z.1#b.1#B.R#Yan.m#8#H#JbK#G#0af.L.u.4.ebO.gbN.U#t#z.ybQbV.8.y.wbVbVaBba#Z.T.4.s.kbc", +"a0.7aP.e#z#Zbw#u#0#0#0#u#G#G#uaya9bR#4bVbSa5bS#F.K.T.Z.6b0ay#D#bbebV#T.m#8bU#D.1#8#0.1bebqaIbW#J#b#x#R#v#D#0bC#H#HbV#Bbs#B.mbe#ea0bK.K#G#0.I#Z#t#tbA.ebO#..Ua6bV#F.w#sbVbV#z#sbVbA.O#Z.ebYaT.7bc", +"#P.Q.ga5#sba.sbAbV.wbS#u#z#GbVbVbaaT.SbKa5a5bS#F.ebL#EbD#b#u#u#Y#H.1#Tbebd.W#7bd.1bS#0beaL.T#Ebn#Y.g.S#y#u#0aobe.w.1azbs#Bbrb4a7a0au.K#Pay.I.O.Z.4.y.ebLbR#..P#z.8bV#0bVbn.w#s#sbAbH#ZbL.4.9.kbc", +".1buaPa5#z.Y.O#ubV#sbVbV.1#z#D.wba.Z.4bA.8.e.KbA.4#t.UbL#s#zbbbe#b#b#ran.b.W#7.1#8#G#0#HbKb7.gaV#BbT.K#r#Dby#H.m.1.1be#u#B.1.wbe#P.S#z.wbSbi.n.ZbK.4.e.8aI.Z.6.K#u#GbV#0bV#s.w.w.e#Z#Z.K.4aT.k.1", +".rb..g.e#s.YaPbV#z.wbnbV.wbn#Dbn.OaP.4.y.4#N.K.K#T#t.U.Q#z.w#F#YazanaNan.bap#Ga0az#0#P#b#KbR.Z#aaz#ibK#h#u.wbC#B#b.1bebs#B#D#baLbcbA.k#P#G#E#S#2.K.8bAbL.Tbw.6.K#G#0.wbVbVbV#s#s.e.Oba.K.4aT.k.0" +] + +stone1_xpm = [ +" 96 96 250 2", +".. c #343e34", +".# c #94a28c", +".a c #64726c", +".b c #c4d2c4", +".c c #7c8a7c", +".d c #acbaac", +".e c #4c5a4c", +".f c #dceadc", +".g c #949284", +".h c #7c7a6c", +".i c #acaaa4", +".j c #c4c2b4", +".k c #64625c", +".l c #dcdad4", +".m c #8c967c", +".n c #a4ae9c", +".o c #6c7e74", +".p c #f4f2ec", +".q c #444e3c", +".r c #bcc6b4", +".s c #8c8a7c", +".t c #5c6654", +".u c #ccdecc", +".v c #7c826c", +".w c #a4a294", +".x c #949a8c", +".y c #bcbaac", +".z c #747264", +".A c #5c5a4c", +".B c #c4cabc", +".C c #d4d2c4", +".D c #ecf2e4", +".E c #acb2a4", +".F c #646a5c", +".G c #8c867c", +".H c #54524c", +".I c #9c9a8c", +".J c #849284", +".K c #7c827c", +".L c #44463c", +".M c #9caa9c", +".N c #b4c2b4", +".O c #dce2d4", +".P c #cccabc", +".Q c #b4b2a4", +".R c #94a29c", +".S c #848a7c", +".T c #f4faec", +".U c #6c6a5c", +".V c #6c7a6c", +".W c #acbab4", +".X c #546254", +".Y c #4c564c", +".Z c #a4aa9c", +".0 c #747a6c", +".1 c #ccdacc", +".2 c #545a4c", +".3 c #74867c", +".4 c #4c4e44", +".5 c #bcc2b4", +".6 c #5c6254", +".7 c #d4dacc", +".8 c #fcfaf4", +".9 c #3c463c", +"#. c #6c7264", +"## c #e4eadc", +"#a c #949294", +"#b c #847e74", +"#c c #8c968c", +"#d c #a4b6ac", +"#e c #747e6c", +"#f c #949a9c", +"#g c #9c9a9c", +"#h c #84827c", +"#i c #e4e2d4", +"#j c #848a8c", +"#k c #9ca294", +"#l c #ccd2c4", +"#m c #7c7e7c", +"#n c #c4c6c4", +"#o c #a4aeac", +"#p c #bcc6c4", +"#q c #8c8e8c", +"#r c #d4decc", +"#s c #848274", +"#t c #a4a6a4", +"#u c #bcbebc", +"#v c #747674", +"#w c #c4cecc", +"#x c #d4d6d4", +"#y c #acb6b4", +"#z c #646a6c", +"#A c #cccecc", +"#B c #b4b6b4", +"#C c #545e5c", +"#D c #6c7674", +"#E c #747e7c", +"#F c #3c3e34", +"#G c #b4baa4", +"#H c #949684", +"#I c #7c7e6c", +"#J c #acaeac", +"#K c #c4c6b4", +"#L c #646664", +"#M c #dcdedc", +"#N c #8c8e7c", +"#O c #a4a694", +"#P c #949e8c", +"#Q c #bcbeac", +"#R c #747664", +"#S c #5c5e5c", +"#T c #c4cebc", +"#U c #d4d6c4", +"#V c #acb6a4", +"#W c #545654", +"#X c #9c9e8c", +"#Y c #eceedc", +"#Z c #4c4a44", +"#0 c #dce6d4", +"#1 c #cccebc", +"#2 c #b4b6a4", +"#3 c #9ca29c", +"#4 c #848e7c", +"#5 c #8c928c", +"#6 c #b4bab4", +"#7 c #7c8e8c", +"#8 c #44524c", +"#9 c #6c6e6c", +"a. c #e4eeec", +"a# c #d4e2dc", +"aa c #a4aaac", +"ab c #747a7c", +"ac c #5c6264", +"ad c #94a694", +"ae c #acae9c", +"af c #646654", +"ag c #dcdecc", +"ah c #a4b2a4", +"ai c #bccabc", +"aj c #5c6a5c", +"ak c #7c8674", +"al c #5c5e54", +"am c #ecf6ec", +"an c #646e64", +"ao c #545644", +"ap c #7c867c", +"aq c #444a40", +"ar c #f4fef4", +"as c #6c6e64", +"at c #545e54", +"au c #4c5249", +"av c #fcfef7", +"aw c #6c766c", +"ax c #e4eee4", +"ay c #8c9a8e", +"az c #748274", +"aA c #84867d", +"aB c #e4e6dc", +"aC c #ccd6cb", +"aD c #d4e2d4", +"aE c #3c4238", +"aF c #b4beac", +"aG c #9ca69c", +"aH c #b4beb4", +"aI c #f4f6ec", +"aJ c #3c4a3c", +"aK c #949694", +"aL c #949e9c", +"aM c #9c9e9c", +"aN c #848e8c", +"aO c #9ca694", +"aP c #a4b2ac", +"aQ c #bccac4", +"aR c #5c6a64", +"aS c #848674", +"aT c #646e6c", +"aU c #74827c", +"aV c #94a294", +"aW c #7c8a84", +"aX c #dceae4", +"aY c #94928c", +"aZ c #7c7a74", +"a0 c #c4c2bc", +"a1 c #8c9684", +"a2 c #a4aea4", +"a3 c #444e44", +"a4 c #bcc6bc", +"a5 c #8c8a84", +"a6 c #5c665c", +"a7 c #7c8274", +"a8 c #a4a29c", +"a9 c #949a94", +"b. c #bcbab4", +"b# c #74726c", +"ba c #5c5a54", +"bb c #c4cac4", +"bc c #d4d2cc", +"bd c #ecf2ec", +"be c #acb2ac", +"bf c #646a64", +"bg c #8c8684", +"bh c #9c9a94", +"bi c #84928c", +"bj c #eceae4", +"bk c #b4c2bc", +"bl c #dce2dc", +"bm c #cccac4", +"bn c #b4b2ac", +"bo c #848a84", +"bp c #f4faf4", +"bq c #8c9284", +"br c #6c6a64", +"bs c #6c7a74", +"bt c #a4aaa4", +"bu c #747a74", +"bv c #ccdad4", +"bw c #545a54", +"bx c #4c4e4c", +"by c #bcc2bc", +"bz c #5c625c", +"bA c #d4dad4", +"bB c #6c726c", +"bC c #e4eae4", +"bD c #8c9694", +"bE c #747e74", +"bF c #ccd2cc", +"bG c #d4ded4", +"bH c #b4baac", +"bI c #94968c", +"bJ c #7c7e74", +"bK c #c4c6bc", +"bL c #8c8e84", +"bM c #a4a69c", +"bN c #949e94", +"bO c #bcbeb4", +"bP c #74766c", +"bQ c #c4cec4", +"bR c #d4d6cc", +"bS c #acb6ac", +"bT c #9c9e94", +"bU c #eceee4", +"bV c #dce6dc", +"bW c #cccec4", +"bX c #b4b6ac", +"bY c #848e84", +"bZ c #8c9294", +"b0 c #acaea4", +"b1 c #64665c", +"b2 c #dcded4", +"b3 c #54564c", +".x.0.OaHbI.2azbK.rbJaF.Zbq.EbqbT#..x#6at.S.KaGbOaz#5albJb1b0bAayaw#..S##.xb0an#IbI#NalaFbH.5a6bN#kbSbobT.5bObu.Z#k.5.ZaYbL.ga9aZ#e.EaDbqap#..Z.S.SbP.ZbMaF.BbI#lbT#3ap.xbYbO.SbL.ZbEbXb0awbL#PbI", +"#k#c#..San#c.5bqa7bqb0bR.SbW#P.KbLawbqbLbCbHbT.5bY.c.ibObMa0aD.5.xbHa9.6bHa1bT.raAbIb0an#3#5bt#caAbXbWbYbtbSbM.SaCbq.t.xa5.SbLaAbLapbP#cbo.SaCbt#kbPaybIaOaGbMaOaG#c#k#S.Z#5#3blbIaO#k.Z.xbHbLaH", +"#3bOaHa1.xb0bH.YasbN#c#kbq#cbM#kbYbMboatbNbTbG.K.B#6.Eb0#t#kbz.cbPbqaw#1bt.EaHa9bTaA.KbCbu#pbobkbo.EapbSbJ.YaGbba7bLbSbMbHaZbIbIaCaH.0bH.D.N#.bSaCbM.ta7#3aB.E.EbJbNbOa7aGb0bY.0#lbT.5bt.0bEbq.S", +"bM#VbJbnbObIb0bMbQbOaqapbM.ZbobL.xbfbT.EbJ#caAbHa4#5bTb2bt#lbqa9#k#caBbtbt.SbJa2bmaY#JbyaMbybz#f#5.5awbOb0.Z.KbXbY.xb2a9bLaSbH.Uapa9bY#c#E#5.N#tbHbtbTbebEbKbebQbP#cb0bFbE.SbJaw.Ba9aG.xbM.Z.EbM", +".l.xbR#P#sbI.0.ZbnbVbNaA.Z#3.0a6bEbJbG#k#6bIbqbebK.EaGbMap.Ka7bIaAbF.ZbqaH.O#3#.boaMbhbf#3aaab#o#kbt.S.5bYbubRau.MaMaAbMbMbM#s.x#5bX#6aEbSbAbEa9.0bHaGbq.B#ca7bI#cbY.0bXa9bMbb#3#4#3bqbSbq#kan#4", +"aY.F#ibha7aA.iasbbbo#3bebybL#ybLbN.xbu#la6bSaBbNbrbl.xbV.W#lalbIa.bI#taHb..KbN.ibPb0.Kbb#va9a9aL.K.ZaCbObea7bo.F#v#5aGbMbL#1.E#I#6bu#3.K#5bP#3aG#Sbta9#JbObBa2bobIbW.Z#6#ka9.Z#5bqbHbO.7#lbK.EbR", +"bUbJ.ia4.wbHbh.Zba.O#3ap#3a4#nbUaA#kbYbI#c.7b0.5a8a9bS.NbQ.BbFaA.Zbtbtbt#6bIbFbtaAaAbXbHbLbNbpap.SbebI#5awbq.xan#cbo.KbobHbT#R#Ha9#E#5.Kbe#catbfbIbSbubIbeaKbtaKbY#casaG#kbH.ZbybTaO#cbJ.O.ZbIaG", +"b2.PbIaAaAb1.sbX#Ebfb1#t#qaAbAaH.Ebua4#6#kasboapb2.x.xaGbEbe.5br#9bubX#6bEaKbo#qag.ZbTa7bPbH.5#5#k#5aGb0a7btbY.K#LbL#5bM#X#2#N.ya2bu#C#y#3bo#jbB#B#qbb#c#9al.K#5bTbNb0#cas#3bN.x.ZbEbXaHbN.0.Z.0", +"bq#6bS.na9#ca4bq.Zbtbu.Ea9a7#LblbXapbebqbo#6bYbPa4bXbYbT#IaAaZbqay.B.ba4bNboa2#5.x.EbYbo.F#5#DaAap#5bI#ka4bX.EbRat#kasbJas.O.Zbq.7a1aO.nas.S#2#e.2.ZbHbX.S#5#L.SaVbY#caV.MbSbG.dbObqbIbMa3bb#c#L", +"#kaG.San.6#l.EbAa2b0#k.Za4.Oa2#3.FbMbb.ObJaH#kbRbGa1.nbn.5bn#sbM#N.Y.EbSbEawbebqaC.BbIbJbq#6.K#J#cbT.B#3.0beb0bQaAb0bLbqbIb.b#bO.baya7.E#P#kbP.z#e.x.db0btbE#6bBbTbT#caHbTa2aGbY#3bAbBbSbTb3.EbK", +"bwbYbMbEbo.Eap.x#5bHbebo.LbLawbE.x.ZbqbYbMa2.x#5.ZbJbXa7.ZauasbPai#kbE.BbYb2bzaHbP.Z#.a4a2bJ#5#6a9bQ#k#3bLbqanbM.xa8.0a0aObM#PbR#Xa7bq#O.gbRbRbK.xaAbUapbJ.KbNb.awa6b0a7bYbN.SbY.ZapaObubYbY.0a9", +".1bqbA#PaHawaCbVb2bNbWaCbG.EbYbXaGbKbSaw.E#W.Sap.IaGaIalbJb.#Hb1bH.Z#3bqbH#6#Sbl#k.xb1btbN#JawaKbI#kbKbQ.Sboasa4#6#IaCbMbXbJaAbIbT#sbLbrbL#ibW.zbI#5bHbObu.SbSbLaG#5bEa2bt.x#3bX.wbEbjbo.7b0apbW", +".ZaDaGbNbTbQ.6.Z#3a2#3#5aA#lbMbFb0blaAbq#5apbqbXbI.5bO.5bIb2.E.Z.Zbq.Sa9.KaCaGbT#cbRaHbI.xb0bua4#5.B#5aGbLapbMbo.g.Ea0#QbF#N#5.Sbr.wb..z#hbLbTbObB.BaGaHbXbEbTa9bH.ZbLbPa7bX#c#.bSbt.E.BbNbKbNbO", +".5bGbKbYbNa2.da6bJbq#6.Za2bNboa4#c#lbEbbbNbXbu#3bTa0asb2.E.YbTb0.E.s.SbK.B#maAbbbI.0.x#3bNbI#B#ha7bGbFbTbq#3.S.ZbebT.SbWbqaB.gb0bObmbtbIbLbT#3b0byaw#tbJbQbO.x.Sbo#Lb3bNbmbobKbOawbRa2bJb0.YaAa2", +"btaGbEa7#cb1byaGbobqbL.Bbe.7bIbqaBbWbq#5bq#3#cbX.ybHbnbqbIbq#ca7a7bTbJbPbmaKbIaMa1a7bJ.6.xa9atboa9.5bWax#6bW.NbXbUbTa5bT.Kbq#3as.waYa7aMb0bH.Ea6bNa5aG#5aCbTak.EbTaA#5bHbL.xbobhbS#5bHbea4bIap#6", +"bN.5a2bX.xbQaH.B.Z#3.dbU#kbNbMbFa4btbWbM.E.S.x#6asbL.ZbLb1.Z.0akb..0aZb0bTbP.ia9aAbHaGbH#L#cbeaAbPa2#lbQbLbHbw#3bHbq.5.SbM.SbMbIbB#qa5.xbbbi.M#c#tbebob.bYbJbTbA.wbo.wa5aAa8#t.h#3#ibS.ObIan#3.0", +"bHb#bM.Zbq.sb2b0.a.SbbazaRbNbN.nay#3aG.J#ybSbNbNbWaB.YbL#6anbYbE.Z.xaO#cbea9a9be.mbH.nbq.EbBbebB.O#.#6.x#6bI.Kb2bybAbqaAbP.5boat#k#c.ca#.ZbQap.MbTa2be.Za7bQaw#Oan#ObP#5bY#5#5bJbu#6bBan.E.xbI#3", +"bWbX.Z#5bKaua5a7bTbNbY.B.5bRbVbt.6.xaHapbO.bbqbz.x#5bNbJ.Z#3bHa9#2.EbebN#k.Z#5#q.Z.ZafbV.ZbMbNbqbXbSbI#5b0aG#5bDb0bKaHa4aAbu.0bIa2.xaG.E.BbAbNbHa9.SbYbI#6.ZbIbQ#2#cbIbQ.0.KbO#6#c#PaHbM.EbfbHbo", +"bKbIbI.i.0bL.7.waG.Tap.Sa4.0buai.KbS.Oaw.Sap.6aGbO#c.Sa2bJa7bebH.x.0.BbI#c#Bbu#cbR.YbRa7a7bM.xbI.x#Tb0bVa9bI#cb1bq#c#hap#c.x#3#kbI.KbT#mbqbO#6bPbYbYa9bNatbWawala2bq.xaAbTbobtbf#hbO#5bo#3bIa6aw", +".Eb#.E#2b0bTbMbe.S#3bP#6bOaHbSbSbMbYbP.xawasblbQa2by.TbJasaHbe.KbT.KasbqbtaAbH#3bIbobybGbWaC.E#G#..EbqbqaA#6a9bYaM.6#caB.Ea9bKay.ibL#5.Pbta8b0bMbFa7bqbIbea2bJ.E.KbqbS#6bJbYa9.O.raubA.xbY#kaAb2", +"bJbO#lbXbM#laYbT.Zbl.F#5bBbX.xb0bHbebI#3bNbtbTa7.5bO#3bo#cbObNb2#6bOb1a0aYaAbWb2#6bC#9asbH.0bHaC#T#kaHbXbqaA#5#h#3bYb1apaAawbTbS.k.ibha9aYbMb#bMblbeb..nbtasbKbEbzblaA.ZbQbJbYbTa4bTa2b1.EaGbIbF", +"bT.xbKbHbWbq.B#ka7aubqb1anbUbL#JbT.5bM#6.xaAbIbubL#ca7.SbUapbM.5bu.ka9aAbMbJaYbT#SbPbBbfa9#ca9bH.S#cbXby#waA#taHala2.5bKbSa9.EbMa9.SbhbLbM#6b3bTala7ana2bLbqbTbe#3aAbQ.6a9bN#Qbtbqa2.xb1a4bzbqa6", +".x#lb0b..Ebhbqb1a8btbmbbbhbJa2#5b0bebTa5b0bJbBbIbNa9#5a9.x#3.SbXaZa5.HbX#B#UbLb1a2bYbYbMa9bobtbF.0bJ.SapaAaGbG#gaGbSbJana9b1bY#3.E.x.Z#cbqbQ#cbqby#cbMbIa6bLawbEbH.KbtbLbeaOa7bqbealbube.5bK#.bo", +"bK.BbLbX.ZbXbL#3bKbhbu.ya5.ibPbTbLbh#5.Qby.k.i.k#5.Bb0.BbPaHa4a9a0a8#qbL.Qbnbq.ga7#laAa9bT#B#v#jbK#k#ka4#kaKbTaHbL.Ebl.5bN.6a4bIaza2apbt.cbY#cbb.ZbI#cbfapbSbIan.iaMa9bN#l.i.5#4bI#c.na9bIa9bHbe", +"btapapaW#kawbe.0#8aVaW#5a4a9.i.IbNa2a7bw.OasaGbh.F.naG#l#5bBa9#qbBbFbO#5bMbOaAbB#k#X#kb0#kb0aZ#kbS.e.S.0ahaObSaybHa7#k#kaA#U.nbH.0.Z.0bHb0#P#k.S.BbHbebMbI.x.Zbt.J.7.Z#k.S#T#k.E#4aObN.daF.e#4#P", +"#kbQa7btaGa9azbY.WaGaGa4a9.Ob0b0a4bJaHbFaza5aAas#VbL#kbe.0bMbWbwb0bL.xa8bIb1bJbJ.O.F.I#ka2#ibHbBbIaFaC.SaHbY#l.0.0asbPaAa1.KapbPbMbS.0bSbq#l.xbqbTbY#kaH.0a9bt.K#O.Y#P.Ja7bSbQbEahbq.E.Zat.BaVbH", +"btaGaH.7aCbHbNbS.WbsapbSbLa5bO#6.b#k#lbo#5.gaGbcbTax.5be#k#xa6#n#3bIboasbFbebJbO.jbRbLaKaMbo#m.ia6.xa4#PaHbOaFbqa7bBaO.xasb0.E.Z.Eas.x#lbqbzbKbV#c.Z#xb0bY.SaH.EaC#m#.axb0bNbMapbL.4#.by.CbTas#l", +"aF.SaHbJbNbMbC.Zapa2bGbQ#6.KbC.IbG#cbq.K.5#m##b1awbX#k.5aGa9bT#5.xbm.Sa0.FbhbH#qau#6#JaA#B#hbc#5.B#k#4bO#.aGbSbIbeaDbM#k#5apbLbu.E#3bXbtbX.nbob0bKbT#Va2#6bJbIaG.KbDbEab#5bEbS#tb0a0as#lbMa5aA#B", +"bHbOakbE.E#..Ba7aLaT#c#3btaG#NbY.dbfbN.ZaIbKbPa8aC#NbNbSbXaGaAbebObR#5.xbBaZbJa7.k#9aZ#Lbu#vbeaZbKbHby.xbHbO#.#PbTatasbyaB.VbS.x#cbt.FaGbXbLbN.Zbi#cbT.Ea6bYaG#kbObY#ubEbobuapaGa5b2aZbPaZbLau.G", +"btaSaB.D#lbT#ObP#ta6#3#3bBbHbe#k#5.5.ZbFbEby#hbqbq#.bu#lbKby#5#BbEbXaYb.bL.9bXbX.i#BbB#Ab0bLbJ#lbM#k.F.5bJbTb0a7#9btbe#5bt#JbebMaMbqaMa2bzbobt#3bTa4bMbo.0bXbIat#J#3bYa2bJ#6bo#6.K#5#mbtbBbKboaA", +"b1#l.j#Q.D#H.B.xaHbyanbYar.1.xaya2a6bY.x.ZasbIaA.Ba4.5asbE#B#5bL.KbLasaCb#bKbXa2#qaAalbua5.S.5.Ebt.zbXbMbTb1.xbzbIaCaAbyatal#5bt#ca8au#6bebRa9#6as#cbN#cbWa9a7#kaH#Va6.E.E#c.xam#lbBaw#5.5bBbEbA", +"#U.4.0.Q.ZbMbObX.KaKawaKbP#5.bbq.M.Ta2bWawa8aAbI#kbRaGa4bJbubPa9#3bIbPb0bTblbWbn#3bLbt.w#V#U.Z.z.I.ZbRbKb1bLbXbWbBbebLbtbfaK#c#uaA#6#6#S#vbSaMbe.EbHbI.0bo.xa9.Zb1#k#V.xbNa1a1.ZaU#q.dbNaL#6aRbN", +"ah#4bS.Va7#e.Maibqan#kbXaw.BbLbYa2aha9bIaAbGahawaAbB.ibXbT#c.xbbbJapalbe.xbO.#asawbJ.QaObXakaZa9bXb0aAbA.0br#5.sbNaha9#cbVaCbYaVbDaw#c.ZbeaBaebMbKbP.qbMaAbYa1b0bEbSbE.Ba7.i.Q.BbObNboa7bM.Sa7bW", +"aOaw.xambN.M#2bGbJ.0.Z.xbT.E.ZbHapa2bt#k#3bIaibQbTaAbRbT#k#BbMbMbybybNbe.S.O#..Zb2.2.5b0#H#kbKbt#5bu.ZbM.k.K.xbe.xapbea7aG.0aG.5a4bEal#6awbT#Ob0akbT#c#.bH.SbLbIaUa2.xalbH.0.S#sbebf#J.ObNbJbN.O", +".7#l#4.SakasanaObMaGbqbN.0b1bQ#..daGbIbJbTbTa6aCbObIbH#S.Za5aY.xa5#jbobo.K#5bFbLbtb##U#Rbq.hblba.0bna0#5.QbO.EbM#haA#.bLbMbKa5aAbCbBbfbTbqas#3bWa7bNas.Za7.EbYa1bMaVbt.EbYa7#O.BaKbXbuaHbqasbH.E", +".S#6.Z#kapbT#4bIanbHbRb2.S#cbO.xaybb.BbX#t.Z.V.abJbTaA#5.i.F.KbKbFbFaa#3bf#vbobbbnapbM.S#2#lbKbra9bXbI.0bebMb0#h#6bXaAbM#3bnbPbubobH#.bzapbLbNbIaHbP#ca2bI#5a4bLbK#k#k.Z.B#3bPa7bYbbbobJaG.Ea9ak", +"bLbq#kbJ.S.x#c.E#PbW.Z#l.6a6.nasbQ#4btap.0bBbS#cb0bTbBbLaIa9bL#5#q#taAaaaK#nbtbt#n.ZbH#Rb1bqbUbJbKbz.K.ZbobLbtaZb.aZ.kbM#vbIbM.ibTbFan.KbRbEaA#5bqa9bebI#cbLa2bu.x.xbFbPbIan#HbeaA.KbT#m#kbo.Zbq", +"aIbMb1bHbP.pbLbP.xaGbJapbSbX#.#caCaUbTbTbAbX#c.JbXalbXbb#ia7bJala4aM.Ka2#LaC.Kbwb2bBbO.BbL#U.0#mbXbJaAb.bIaG.PawbMb0bMbn.0aKbHbXa4ae.iap#lbIbo#kbBb0bo#cbPaGaAbua7bI.ZbE.E.xaybbbBboatby.2.Sbq#V", +"bLbTbMa9bP.S.xbRbLbYbPakaAa7bM.E.N##.K.Fa8.SbtbNaG#kbPbrbTbIb1bK#Ra7a7#3bbbxbu#qaA.x.5.0.x#XaK#3.xbX.Ka7bLbIbyaAbq#cbq.Y#3aObb.S#k.sa7a9bPbt.aa2bTaAaGb#btbubt.KagaSbL.SbLawa9aVbI.KbtbM#3#cbJbX", +"bc.FbT.g.haqbMbPbP#ebIbN.6a7#kaAaV.cbtb0b2apaObEa5aAb2.KbIbubl.K.B.Z.7bM#5.0.KbE#vbHbXaf#ObY.IbobhbNbm.ibTbhbT#u.SaWaVbHaG#c.ZaU.A#YbIbYbfbSbGbibo#3aMa9#mbP.K.Kb0.Q.S.xa2.ZbNaCbb#6bo.5bTa7bq.B", +"aw.S#4.cawaS#P#.bqa2bX#.#c#caPa2bHbQ.FbY.d.3aw.o.J.5.5btaGa8auaY#GaebXbWasaK#v#a.H#ObPbJ#3aAaU#cbL.KbIbK#5.xb0bI.a#4.ZbbbL.SbI#..I.SbT.E#k#1bL.6bTaNbo#5#3.YalbLanbqbSbTa7bPaxbubfa7bz.0.Yaw.5a4", +".Ea1.6#2bSbqazbX#kal#c.xawaGbSaUa1.5.5a2.WaCaybYbEaVaH.SaAbq.kbaak#k.0bX.xaY#v#5as#sbB.S#ca9#ca9bK.I.Kb0b0bI#kbKaO#VbHaw#3.Sa7aebX#I.xao.wbq.5bM#5.Zbua5bEbe#vaGbybB.S.Ka2#cbz.SbYb0bBbB.Z#5bo#k", +"bNaG.6apbY#k.r.7aSawawbXaC#caCaP.xbYak.VbNbb.WaWaxbM#c#lbNbXaAbIae#O#.bq#tbO#9aKbRbT.S.ZbNbyaHbNb0bPaAbBbJ#LbebMa1bq#kaKa9bL.x#NaH#Q.x.Z.S#Hbq#Xbyb0#5bMbFbBb1beaAbL.xbtbP.KagbJbqbtbL.xbubTbqbM", +"awbIaCaC.x.0a2aG#k.O#kbq.xbGbS#6.SbHbMbSaCahaGbB.Saz.ZbLanbPbTaY#l#.bTaAbqbeaA#La7aGbFaBawb1boap#Jasa9bWbWbIbObX.NaGbSbP#5.ZbrbMaAbL#kbIbM#hbKbX#caA#3bebuaAbebfbq#6bNa7#5a7bEbobubEbTbE#4#3aGbL", +"###caG.SbEboaGbMbMbY#Vbea4bvahaW#PaC.Zbq.0#6bz#6.J#Waz#J#lbPbLbt.0b0.xaKbO#mbLa5bwb0#kaH.Sa2bWaAbIbJatb0#6.iap.xa1bY#5awa0a9bnaebaa7aY.EbXb0#l#ka8#Ca9bobTaKbYaK#rasbIbLbN.SasaG.4a2.SbobXbK.Ybq", +"an.5bua4by#5.O#c.haCbJanbY#caJbfbHasbNbY.2aq#JaAa7aGa2bybOaAapaYb2#9bLbPbWbXb2.SaHaHanby#3.hbTaObX#3bL.SbT.x.ibTa2bN#5bBaGbobJbqbt#lb#.EbJ.5a9bL#3beaKbOa9bu.E#vbK.MbtbqbN#5bM#3#k.KbtbMbI#c#cbo", +"bobfbLbYaAayaA.M.Eal.nbybLbubE#caia1.7btbBaM.L#BbSaC.5#kaCb0bOaYbMbAb1btbPbL#nbLaU#u.SbebNb..5#sbMbub0a9a8b3bTbI#V#3bubF#q#vbn.2.KbMbo.kbObLbJbJboboaC.KbY#man#mbqbBbLapbMbbaGbS.5aHa7a7bYbebLaG", +"bT#Eam#p#5aAaL#3bOanbqbVbEajaHapaO.SaH.SbObhbM.H.a.SalaGbTbYbh#6bJbM.p.2a9aA.0aoboay#9.E.x.E.g.2a8.5bn.sboaA.Z#6axbF#Ea5ab.4btbJb#bbbPbzbNaAbxbM#5#5.K.iaqbB.K.Fa9anbTbH#k.EbP.SbIbeb0bYbu.x#3bq", +"#PbN#Ta9aVaWbtaG#VbP.ZbhbXbM#h.G#d...ubYbq.7#k.0bNbwadbSbea6aV.5.X.1bE.J.ZaAbS#5.5.Z#T##bY.E.F#l.EbH#c.Ebu.ZaH.CbTbMbXbT#n.5bMbM.JbEbG.5bBbSah.KasbqbtaYala5bJbJ#cbo#3bNbubnaC.gan.cby.Obu.waAa0", +"#4aGbN.E.BataG#ubY.x.EbLbM.2.iaKa9ap#EaGbAas.S#..BbYbNbN#c.Ea2#3#c.JbN.5apa2bRb0.FbNaA.6bWbQ#.bPa9by.Sb2a2bTbE#6bTbIbq#5aA#5bua0beapbEaGbq#capa7aAbMa0bIbt.KaAb0ay#3.Ka2.BbI.sbqbSay.x.Z.xbo#SbI", +"ak.EbSaVbRbSbbbbapbi.KapbF#5bCbtbBbbbOaAbIbI.EbXbI.0.Ba2bqaG.5.dbSbNaCap#mapbubLaM#kapbFbhapbuapaCbJbobSbqbo#FbHbub#asbJbhbJbh.B.FbHbq.0a2aw.BbtaAbubXbI#kbXbPbAaPasbo#5aC.5a7.hbt#kaH#5#c.IbL#5", +"aB.0bMa4#6bP.KbtbDaW#5.W#yaw#qbybLbI#vbXbT#hbLb0ay#5#3#kbA#cbBa9blaGaMbo#Ebh#W#maG#q#Lb2bobe#vbz#AbNaB#5bo#5aw#v.0b0.KbK.EaAbJb1#3bKa9.KbObJ#c.xaAbLbobLbMbubIaYbDbSa6aAbI.Eb0.5bt.xbubH#ca7bbbL", +"aq.nbX.SaH#3bLa9#B#BbiaTap#wbi#Cbh#kbh#5a5#6bm.ibJbqbMbpbM.0bMbb#p#jbu#m#J#9#9aMblbu#6a9#5bfbIb0a9bfbUbIbyb0bobWb0bt.i.SbX#m.Bbbbq#c.KbNbza4b1bKbWbSbLbObobLbeb0arbbbu#k#6bLbMal.EbMbE.Bala9#k#c", +"#kasbMbybXaZ#v#qbn#3boaAbWaXbK.R#I#hbJ.5bU#ha2a2aAbTbEbO#5aAbM.0b0bb#m#6#tbTbhbnbzbobT#9bobeaAbb#ubIbe#p#q.Kbbbua9bPbI.KaY#kbh#6.8a7a7a5bXbBbJbI#kbu#la8.OaYasbMbN#3bL#5.D.i.S#Hbf#h.EbubNa9.Bbe", +"#QbLbIbPas#5a9bP#Lbra7bBbtbI#c.x.Z.EbKbJaha4.RaNbTbLaZ.ZbMbtbFbJbtaAakbO#q.ibWas#3#I#3bY#2bJaGbHaLbeaAbebybt#9bT#kbPbMbPbtbebH.EbX#nbIbObqb1b0#vbRaZbt.BaYaw.5aA.R#3#8#k#cbHbXbMbhbcb1b0bTawaV.0", +"bTbTa7bmbRbhbma9.g#b.y.waG.UanaCbKaH.Ea4bN.Jaya4aYbKbubTbL#hbr.Z.SbYaY.ObL#sbPaYbq.5ak.E.7a4aebY.kaLaMaM#mbS#qbtbra9bTbobLbhbX#haZbP#hbXa8#h.xb##.aAbPbPbXaYbJ#v.Bawbe.x.KaA#k.QbTbTbXapbE.xaCbQ", +".K.K.E.x.xbY.Ka9.bawaDbq.v.ZaO#da1a2.ca2.aa2aGawbMbTbObTb0bB.zbe#T.V.xb0#ca9a8#Ja4.S#5bH.Oa9.B.SbtbTbL.ZbH#lbBb0aG.ZaAbI.ZbubLb0#k#K.n.bbNazaq#q.SbE#iap#Db1#l.5#3.KbMbAaAbE#BaAaKapaAa5b1bTbua8", +"bwanbObI#r.7bu#ybSaG.5.Q#G#.bVaw#cbLa4.BbObQbqbGbMbLbtb1.KbPbMa9#..MbqbobRbMaBa8a9.5b1awbTbSbybKaAbX.S#3bXbP#NbM#qasa5bMaAbIaAbL.S.x#4.M.SbYa5bLbqbSa9#zaAboan#.bLbwbubebX#qbS#5.x.i.KbI#m.2asaA", +"#6be#3a1.E##bmbMbBbYbP#UbRbRa7#6bObWbXbI.E#qbJbTb0byaqbJbMbXbWbt#X.NbH.ZbNaAbu.i#cbKbKbfa2bBbXbN.ZbTbRbT#sb0#5bJ.Z#.bPbXaMb1#6.E.IbR.naObN#kbTb.bI.EbobMaAbAbHaAaGbJaA#c#qbCbo#5bLbMbL#cbObXbObX", +".KbJ.7#XbSbWbtaG.Sa0#sbTa8a7a8bTbIaKbLbIbJbhbR#3aAbLbMb0bMaAbIaA.7bMbN.ZbS#BbX.Kap#AaibW#kbNbTbIb0bXa7#k#3.IbH.iasboaYa2asbqa5bIbLa7bMaW#ratasa0a1bq#c#va9#3.xak#5#nbe#3#5bebXbIbMbtbJaY#kbXbTbo", +"bFbz.7bT.5#kbybo#hbWbobtb3#na5.7#J.IaYboaYb2bPbOasaCbe.Kb0bPbeaBbWaObMaHbJ#EbY#mbqa2#kaAa2#5aO#c.5b#ag.5b0bObK#2aZbL.EbT#5bLaYbJ.K#vbNaG#k#3bubIbT.F#Lbea9#A.ZbKbQ#3b1bL#3#6bObtaAbOanaBbJaAbTbb", +".Kbna2bq.Z.0#m#vaZbTbo#L#BbubPaAbr#cb1##bM#tbH#vbMbT.Za8beb0#.aA#ka9bPbObL#kbB#5bSb0aGbIbqbT#Ja7b#bIbObnbP.Bb1bEbLbobza0bLbobI.Ka5b0byapapbQ.Ea8bHbLa2bobS#3aG.xb0bfbE#3bub0bz#c#6bIbhbI#6bLbebM", +".KaKbYae.S.B#5bIbqbtbu#y#E#cbSbJ.F#3#ca2awbIa4aHbIa9bIbTbWaA#hbq.h.7bHby.fbt#6bYbqapa9bMbBbYbNb1#k.F#k.0bI.0bh.ZbIbh.Eb0bt.Bbha7#maK#Sbi.V#k.KbX.E#kb0a8bua5.5.0aI#AaKbuaK#5aHb0#hbtbRaGbLbKbLbA", +"b0be#P##.EbBaAapbPa7bNbv#7.a.0bObsaFapaGbGbSa2.6aAbTbMbObJ#5bI#5bIb0bWbtbIa7aWbVbtbM.xa9.ZbTbqap.x.s#3.g#3bL#NbK#3##a9aY.xbh.0#5#Jbh#EbebM#cbT.6bqa4b1aLbNa9bM#VaM#6apaA.xa9aM#5bJbM.BaZbXa9bubX", +"bybIbSaGb0.caMbYbJ.r.5#k#P#XbL#.as#XbJbK.2btaGbD.Z.PaYbH#h.B#cbb#KbebqbbbNbiay.Ya7.Z#UaObH.6#2.7bJbH.0#3asbKaA#5#2bOaSbLbPb0.S.g.d.KbGbEbNb0bXbn#X.B#H.0#2.Z.n.SbYbHbMbE.KbTa2.Za9#caKbo.KbtbMbo", +".5aAbWbS.Ebo.Z.K.BbJbEbX.5aH.5bqaA.EasaHbobeaGaC#s#XbIbLbIap#3.O#3.xbIbtaCa2aLbs.SbObIbU.s.xaAbPbIb0bLaAb1bb#6#mbM.0bt#UbN.g.ZbLbu#VaH#ka0bo.5aK.ZbP.KbJbWa8bJ.Ia7aK.SbEb#a4bLat#nbobebLbNaAbTaM", +"bbapb1a9bobP.xa4aGbqbq.Ba9bOaHbqbT.jbXbI#cbMbiaGbWbI#XapaSbObIbEbqbua2bo#5bV#6aybW#XaF#IbL.Oaea7#O.0#kaBbM#qaA#maA.gbbbTbJ.EbBbJ.dbMaGaAbNbTb0b#b0.hbH.BbRbIbEbWaAawa7beaFaAbMbebtbWbL#t#L#5#3#c", +".5a4.E#kbd#lbXbOa7#cbo.xbHbO.E#3#ka6bobLaGbKbq#3ae#.#Nb0a8a7aH#6#tbzbI#6#cbCapbobMbMbF#k.Bbr#.b#.Zb0#6bOasbMbybMb.a9.i.SbqbLbcbTbNa4#6a7#cbTbJbIbbbT.KbObKbF.g.K.0#3bS.4aG#3bY.xbubTaGapbYbMaAbL", +".5aA.K.K.ZbGbBbVbobHbybz#kbB#c.SbNbebHbea7a4bTbMbTbM.IbT#.aGbJbSbF.E#EbJbebtaYbu#s.SbWb3bybI.5bIbH.gb#bLaAaY#qbIb2bMbY.iaAbXbLbf#eawbOapb3bLbBbT#ha9bIbh.0b0bLbPbY#5bX.BboalbI.Kby#A.KaAbe.K#5aH", +"#kbtaGbqbebX.7bO#c#JaGbPbo#3b0bu#haHbebWbXbBbqbW.Pa7bJbO.EbubKapaM#3bXaYaAbRaZbPbBbP.Qa9.gbI#3bI.xbTbI#cbmbebobJaMbM#3bKbP.Y#ua8#cbG.K#kbebqbnbLas.KbXaAbP#3a9bMasap.5#6#l.x.6awbzbubtbfbbbeaAaK", +".B#5.5bebYbta7#3#6bXaG#x.KbY#qbNboa4.Ma9bNaA.gas#..l.QbMb0#c#5b0#5#j#3bIby.kbWaYbMbBbCbr#3bKb0aAbL#ObLbP#3bhbT#nbLbobPbybeaA#Z.K.MbH.ZaC#6bTbtasaZ.Kbt#5bobLaYbebWaCbya7bNbuby.7bob.bebtbL#nbYaA", +"#t.5bTbMbHapbMa7bea9bobo#maAa9.KaHbl#AbQ.4.5bq#saS#2.Fakbh.x.BbDbo#5a9bMa0b..g.I#qb0a8bJ.Zbrbt#3#HbXbN.ibTbobP#u.i#g#3.iaAaK#6bnaP.xaGbtbM.EaYbLbIaM#ma8bIabaAaKbt#ka9bIbebFbHbqbmanbT#3#5#5#5bl", +".nbH#c.n#lbq#kaHbX.SbTapa7bEbBb2#ca2.J.6a9.ib#bT#cbe#t#3bI#DaAbX#6alaAa9bB.E#mbH.ib0asbebbbKas#3.0.KbPa7#l#cbo.Z#5a2#5aAa9bybTa9#Q.x#N.x.ZbJ#kbqbL.BaebWa7.O.UaSbN#qby.Zbo.0.SbNbqay.E.N.Ea9.MbE", +"a7bYb2.EbYbP.xb0.SbobVb0.KbNb0.Eaya1aGaA.ZbqbtbJbzaAbeaAa4.K#BbTaqbBbIb0bRaYbIbobJ.KbubPbLaAbo.sa9#c#k.KbubIaqb1axaw.0be#.#3#kaGbTbLbIbqbP.jbM.B.S#R.xaO.i#2.x.ZbYbIbua9.BbI#lbKapbfbubMa4a2at.Z", +"bLbH.E.K.Zb0.xaxbYbMbq#6#lbO#3aAapb0bEbEbn#.bOb.#Lbbb1bt.Kbe#.aGbMbLbTa9#.bObJbIbB.z#5bLbobI#ibb.SbebXa9#kaGbz#c.ZbTbN#kbO.Sa7bQ.PbPbobLbI.F#5bXaA#NbMbT#Ia7.IbIboa9btbObNbP#V.ra7bNbNaObw.fbOap", +"apbyaw.5bL.SbEbK.x.E#5.Z#cbA#caGan.Ba4.Faqb.bbaYawaA#5bSbLaMa9#5b#bMbBaAbTa9b0bqbo.Eas#hbWbXbL#3a7bR.FaHbt.6.SbIbqbtbtbJbqbobebEasbybXbfbX#3bJ.F.h#lbI.BaA.sbQbMbP.E.ZbNbIa9bB#k#3asaHawbqbX.K#.", +"aAbSasaGa4bIbS#6bobla7#5bLbS.xbA.x.Nbo#kbEbTbqaMbtbtbt#qawbLaAbt.KbLa8bTb#bIbh.BbXbca9#kbIbNbX.8bF.VbJapbLa9bybNbJ.0.Y#k#6.xbu##bO.xbK.SbIa8#k#tbWaAbIbIbH#lb1.0bt#6b0a2.EbAaCbIbS.EbL.0boaHbRbN", +"bT#6btbt#L.Kbh.KbI.FbobIbJbqaAboaw.BbNbIaHbXb#.U#3bwbT#6a9.Ka9aG.Ha9#kbJbebLaAbU.KbMa9aAbMa9bJbL#3aGb0a9bubL#rbtbNbobO.EboaG.K#6bTaMbOaMbtaYbtaMa7bJaAb0bOaK.Fbo.0bYbqaqaAbt#5aZ#kbebObobX.gbuas", +"#qbSbPbKbubAanboapb0.Eby.5bYb0bYa4#cbRbPa6bObL#qa4a9aA#3#6bubu#5.ga2b1b0bJapbL#3.saA#lb0bTbtbHbIbQ.Da9.7.x.7apbJa2bPaHbLbY#k#6bMbEa8bB.ibJbIbOa9.ibMbqbnbe.Ba5bJbT.0.Z.S#5.B#t#c#q.xaAbta5.SbMaA", +"aHbxa2be#6bBby#t#k.xbua4a4bPa9aHap.0#cbAbWbIa2.l#JbKa9bo#AbTb0bzbeaAaAa0btbI.lbLbybXbAbTa5bLaZbubJbubLbya2anbJbT.2a9a2bXa4bTaHbHbubnaA#Lby#3a5bobubB#q#5#hb0btb0a7bM.xbA.xa9bYaKbKa8asbrbOaY#vbT", +".5a9apbX#cbH.SbybYbM#5bYbKapbIbX.M.Vazay.ObAbI.SbFbPbf.Ca4b0bobLbP.xapbN.7.KbwaAbqbL#ka2.SbLapa2buaGbPa9b0au#c#6.Maw.Va9aAbPbtbL.N#c.cbF.E#6aGalbPbM.YbNbW#cbLaGbHaC#4bLbX#cbIbHaF.Zak#l.B#k#Pa7", +"a9.xaw#kbN#cbo.6bMawbIbMboaFbuap.MaH#ka2.Kaw#3bL.hbPapa8#5bTbLb#bq.Z#kbJa9#JaubebY#6btbP#3bT#c.Ia9bOa9byaAbu#5bea9.0a4aAapbqbOa5bYaQa7.R.0.EbIbIbfahbO.S#3bqbTbo.7.xbf#3.xa9#ebeb1bMa7bo#.#Ha9.E", +".K.nbNa2bA.Z.6bYbY#kbK.M.xaBas#3.Zad#5#.a2#k.EbNaAasbMbTbXbP#3b0bqbNaA.xapbJaHaKbTbfawaHbb.Ea2bK#3bebtbeaKapby#5anap#kbYbT#tbqbT.S.x#5#haC#qaYbJana7#3bY#3#3bHbJbI#6bSaA.FbQbOaw.0bG#kbLb0bQ.rbM", +"bQa4bHbqaCbbajbQapbMby.KbtaG.SbyaGapan#ka9bX.K#6bMbK#cbRbI.7#hbP#4bLaObSasbebB#xaw.E.SbP#lbobQanaKbtbWbtb0bL#Mb0bLa7apa8bObTbHaMbPbT#6a0.zbIaAbh#lbbbLbSbq#5bWaCbo#6bqbybebPbubFbq#kbPbYaCbJbta2", +"awbLa4.S.Map#lblbUaw.xaAbNbr.ZbPaAbIbtaGapbQbRb1awaYbM#vbfbJbtbXaS.xbTbebMbYbfbI.5bSaA#c#6bHb0#cbbbOaLaAbubN#5bo#5bWalbIaAbybJbTa0bobIbTa5bMaMbPbTbSbPb0#5bN.EbybI#c#v#6aA#5btbI#3#cbI.S#6bu.ZbT", +"aGbqboaGbJ.5.K.SbE#c.5bobO.S#5.bb0bh.hb.asbMaG.7bLbzaZ#3#kasbPbI#ka2.ZaH.Ya5awbtbQ.KbMbubY.5bybPasbe#vbQbFbb#JbubXbn.ib0bLa0bTa9bObJ.gbebMbSbJbNaGbqa7bo.xaGbIaHbB#mbobwbe#3.KbBa9#5by.KbEbTbTap", +".xbyawbqa2bzbHbNa9bL.E#3bNaG#3aAa9a8aZbLbKb0anbYaY.SbLbOaAbL#5b0.E#kaGbIbOblbB#vbX.7#5.ZbuaGbMawbBbya9b0#3bfb0#5a5.G#5.ibMbeaAbMa7#xbf.Z.ZbEaC#c.EbTbSbMaG.0bfapbIapbRbtbl#m#3bOa9b#a9bL#mbB#c#n", +"bz.xaGaia6#kay.ZbIapbP.xbYbP#kby#bavbh.Ka9a7be.xbS.i.EbtbJa5.xaA.E#5#kbTat#5boa9bNat.EbTaEbXaGbWa9.KbebE.KbT#5#3bg.k#h.sbnaA.5a9bTbB#Pbo.Ma2adaVb0#cbuap#ka8a4bT#faAabaM#qbobeaA#5bo#v.K#6bE#tas", +".5#4bfb.be#t#k#c.F.0.0bYbO#P#c.FaFakapbYbWbNaM.K.MaGbBbqaH.SbmaZ#d.BaiaGaGaHaCby#P.B#e#PbR.x.xasb0.IbWbTbIbo.ZbMbYa7bIbN#k.E.x.I.6bLbMbYb0bX.M#6#lbJ.Z#NbT.t.s.xa4#3a6bR.S.Ka2bo.WbY.J#cbua7bX#3", +"aG.EbfbebEbE.n.Eb0aw.FbEasbMa1bL#k.naAaGbMaw#.bA#caCbYaAbzaAbMav#T#k#V#lazbT.RbObq.0.7bLaFbIbQa7#kaK.EaKbXbMb0b.aHa9bSbe#kbP.Eae#kbobo.YbuaAa6bT.IbM#..EbIbMbBbTbIbqbL#c#6bMa9bq#fbSa9aH.K#3#can", +"bX#caKas#6#ta7bIa7bBbLbPbYbo#5a2bK#4.JbI.MbBbobbaybqbY.xbJbMa9bI.xaGaqawaHbTbQ#cbW#c.5bfbxbobt#SbtbIbRbJaYasbXbtazbXbobMbPbJbTa8#ca7.ZbN#kaH#3an.B.4aZ.ZbhbK#Q.x.xbt.EbP.EbYbLbt.R#caUb0aGbqbyag", +".5aObobnapa8#c#Pbb#t#3aK#tbo#JbB.JbLbEbQ#kbuaH.Jb0bX.6#5.xa4#5#kbTbNaCbMawbK.KbLbybPbu#6bbbZ#vac.Zbn#kbTbebLbfbIaybobfbo#DbM#nasaHbX#5bMbSaAbMbM.E#5bJbM#3a7a9.ibybSbNaM.xaw#3bHaW#6aLbea9b.#B#.", +"bIbKbeaG#vbe#c.x#3blan#t#k#xbubobRaVa9bNbMa2.EbEbObtbB.0ap#5.0.xawaAbMbHa9bS.S.K.KaKbwbt#q#ubZ#jbLbTbObTbNaYbebTbYbSbY#6aAbt#m#qbqbo#c.S#5bo.O.KbtbTa8.6.Eb.aAbL.5bTa7bHbe.x.ZbtbtbPbYb0be#.bnbH", +"aC#.a9bFbobtbPbLbLbobe#3bbbbbt#qbban.EawbE#.bqbEbHbfb0#5bI.x#c#cbLbXbybtbm.SbI.ybN.Kbe.K#qbD#q#za8.5bfbBbJ.BbTbLaVbMbV#3a6brbT#u.ZbA#kbF#.bMbEbW#B#.bB#naA.K#3bT#cbLapboa2#5#.bobu.KbubyaAbhbIb0", +"#Oa2bX.KbeaA.5a1b0.xaAaAa1#kb1.6a9aA#DbH.ZaVbKbqaA.SbJaA.XbS.S.b#gaA#t.EbL.xbMbWbea2bRbtbubWaM#5.ZaZbP.EbMbJ#mbJ.V#GbHaH#3bc.KaYbL#ca9.0#5a2bqbfbMaZbtaZaAbM#tasbeaCb0bTa4.x.K.E#vbE#LbraKbKbIaA", +".xakaKbybW#6bM#l#ka7#k.nbM.0bH#Pa2#3by#..K#kak#0bnbMaA.5.K.BbNa6aK.ka9bLbc.wbL.7.xaAbqbAbo#JawaB.KbLbq#BbebMbMbL.##Va7#2.S.B.0bIbEb2.7#6.Z.KbJbq#m#5a8bWby#ua8#6#3#lawbTbea7bL#3#3#J#5#.#3.ib#bM" +] + +stonebright_xpm = [ +" 96 96 250 2", +".. c #7b927b", +".# c #daefcf", +".a c #b5cec3", +".b c #ebfceb", +".c c #cce2cb", +".d c #e5f8e5", +".e c #99b499", +".f c #effeef", +".g c #e8e4cf", +".h c #d7d3bb", +".i c #f3f0e7", +".j c #faf7e6", +".k c #bfbbb0", +".l c #fdfbf4", +".m c #dae9c1", +".n c #e6f4db", +".o c #bbd9c7", +".p c #fffdf7", +".q c #91a680", +".r c #effbe4", +".s c #e3e0c9", +".t c #b0c2a0", +".u c #eafeea", +".v c #d3ddb8", +".w c #f0ecd8", +".x c #e3ecd7", +".y c #f8f5e3", +".z c #d0ccb3", +".A c #b6b297", +".B c #f4fbea", +".C c #fdfaea", +".D c #f9fff0", +".E c #eef6e3", +".F c #bbc6ab", +".G c #e3d9c9", +".H c #ada99d", +".I c #ede9d5", +".J c #d1e7d1", +".K c #d3ddd3", +".L c #989c86", +".M c #dff3df", +".N c #e8fae7", +".O c #f7feee", +".P c #fcf9e9", +".Q c #f6f3e0", +".R c #daefe6", +".S c #d9e2cb", +".T c #f9fff1", +".U c #c8c4ab", +".V c #bdd6bd", +".W c #e5f8f0", +".X c #a2bda2", +".Y c #9baf9b", +".Z c #ebf3df", +".0 c #ccd6bd", +".1 c #edfded", +".2 c #a9b499", +".3 c #c1dfce", +".4 c #a2a690", +".5 c #f3fae7", +".6 c #b2bda2", +".7 c #f6fded", +".8 c #fffdf7", +".9 c #869c86", +"#. c #c4ceb5", +"## c #f8feef", +"#a c #e8e5e8", +"#b c #ded3c3", +"#c c #d9e9d9", +"#d c #dff7e9", +"#e c #c8d9bb", +"#f c #e1eaed", +"#g c #edeaed", +"#h c #dedbd0", +"#i c #fefcec", +"#j c #d7e0e3", +"#k c #e6efda", +"#l c #f5fceb", +"#m c #d5d9d5", +"#n c #f9fbf9", +"#o c #e6f4f1", +"#p c #effbf9", +"#q c #e2e5e2", +"#r c #f3feea", +"#s c #dedac3", +"#t c #eef1ee", +"#u c #f6f9f6", +"#v c #ced2ce", +"#w c #f0fcfa", +"#x c #fbfdfb", +"#y c #e9f7f4", +"#z c #b9c4c8", +"#A c #fafcfa", +"#B c #f4f7f4", +"#C c #a4b8b4", +"#D c #c0d2ce", +"#E c #c7d9d5", +"#F c #8d927b", +"#G c #f0f8db", +"#H c #e6e9cd", +"#I c #d6d9bb", +"#J c #f1f4f1", +"#K c #f9fbe4", +"#L c #bec2be", +"#M c #fcfefc", +"#N c #e2e5c8", +"#O c #eff1d7", +"#P c #dfeed3", +"#Q c #f7f9e1", +"#R c #cfd2b2", +"#S c #b4b8b4", +"#T c #f0fce6", +"#U c #fbfde8", +"#V c #eaf7df", +"#W c #abafab", +"#X c #eceed3", +"#Y c #fdffec", +"#Z c #a39f92", +"#0 c #f3feea", +"#1 c #fafce6", +"#2 c #f5f7df", +"#3 c #e6efe6", +"#4 c #d5e5c8", +"#5 c #dee7de", +"#6 c #f0f8f0", +"#7 c #c8e5e2", +"#8 c #8daa9d", +"#9 c #c6cac6", +"a. c #f4fffd", +"a# c #eefef7", +"aa c #e7f0f3", +"ab c #c9d4d7", +"ac c #b0bcbf", +"ad c #d8f1d7", +"ae c #f2f4db", +"af c #bfc2a0", +"ag c #fcfeea", +"ah c #e3f6e3", +"ai c #eafbea", +"aj c #abc6ab", +"ak c #cfdfc1", +"al c #b4b8a4", +"am c #f5fff5", +"an c #b8cab8", +"ao c #abaf8a", +"ap c #cfdfcf", +"aq c #94a18b", +"ar c #f5fff5", +"as c #c6cab8", +"at c #a4b8a4", +"au c #9daa97", +"av c #fdfff8", +"aw c #c0d2c0", +"ax c #f4fff4", +"ay c #d7ecd9", +"az c #c6ddc6", +"aA c #dcdfd0", +"aB c #fcfef3", +"aC c #f1fdf0", +"aD c #eefeee", +"aE c #899780", +"aF c #ecf9e1", +"aG c #e2f1e2", +"aH c #ecf9ec", +"aI c #fdfff5", +"aJ c #83a182", +"aK c #e6e9e6", +"aL c #dfeeeb", +"aM c #ebeeeb", +"aN c #d5e5e2", +"aO c #e3f1d7", +"aP c #e3f6ed", +"aQ c #eafbf4", +"aR c #abc6bb", +"aS c #dcdfc1", +"aT c #b8cac6", +"aU c #c6ddd3", +"aV c #dbefda", +"aW c #cbe2d8", +"aX c #effef7", +"aY c #e8e5dc", +"aZ c #d7d3c9", +"a0 c #faf7f0", +"a1 c #dae9cd", +"a2 c #e6f4e6", +"a3 c #91a690", +"a4 c #effbef", +"a5 c #e3dfd7", +"a6 c #b0c2b0", +"a7 c #d3ddc6", +"a8 c #f0ede4", +"a9 c #e3ece3", +"b. c #f8f5ee", +"b# c #d0ccc2", +"ba c #b6b2a6", +"bb c #f4fbf4", +"bc c #fdfaf4", +"bd c #f9fff9", +"be c #eef6ee", +"bf c #bbc6bb", +"bg c #e3d9d7", +"bh c #edeae1", +"bi c #d1e7dd", +"bj c #fffdf6", +"bk c #e7faf2", +"bl c #f7fef7", +"bm c #fcf9f2", +"bn c #f6f3ec", +"bo c #d8e2d8", +"bp c #f9fff9", +"bq c #dee7d1", +"br c #c8c4b9", +"bs c #bdd6cb", +"bt c #eaf3ea", +"bu c #cbd6cb", +"bv c #edfdf6", +"bw c #a9b4a8", +"bx c #a2a6a2", +"by c #f2faf2", +"bz c #b2bdb2", +"bA c #f6fdf6", +"bB c #c3cec3", +"bC c #f8fef8", +"bD c #d9e9e6", +"bE c #c9d9c7", +"bF c #f5fcf5", +"bG c #f3fef3", +"bH c #f1f8e5", +"bI c #e6e9d9", +"bJ c #d6d9c7", +"bK c #f9fbef", +"bL c #e2e5d5", +"bM c #eef1e2", +"bN c #dfeedf", +"bO c #f6f9ec", +"bP c #cfd2c0", +"bQ c #f0fcf0", +"bR c #fbfdf1", +"bS c #e9f7e9", +"bT c #ebeedf", +"bU c #fdfff4", +"bV c #f3fef3", +"bW c #fafcf0", +"bX c #f4f7e9", +"bY c #d5e5d5", +"bZ c #dce5e8", +"b0 c #f1f4e6", +"b1 c #bec2b0", +"b2 c #fcfef3", +"b3 c #abaf9b", +".x.0.OaHbI.2azbK.rbJaF.Zbq.EbqbT#..x#6at.S.KaGbOaz#5albJb1b0bAayaw#..S##.xb0an#IbI#NalaFbH.5a6bN#kbSbobT.5bObu.Z#k.5.ZaYbL.ga9aZ#e.EaDbqap#..Z.S.SbP.ZbMaF.BbI#lbT#3ap.xbYbO.SbL.ZbEbXb0awbL#PbI", +"#k#c#..San#c.5bqa7bqb0bR.SbW#P.KbLawbqbLbCbHbT.5bY.c.ibObMa0aD.5.xbHa9.6bHa1bT.raAbIb0an#3#5bt#caAbXbWbYbtbSbM.SaCbq.t.xa5.SbLaAbLapbP#cbo.SaCbt#kbPaybIaOaGbMaOaG#c#k#S.Z#5#3blbIaO#k.Z.xbHbLaH", +"#3bOaHa1.xb0bH.YasbN#c#kbq#cbM#kbYbMboatbNbTbG.K.B#6.Eb0#t#kbz.cbPbqaw#1bt.EaHa9bTaA.KbCbu#pbobkbo.EapbSbJ.YaGbba7bLbSbMbHaZbIbIaCaH.0bH.D.N#.bSaCbM.ta7#3aB.E.EbJbNbOa7aGb0bY.0#lbT.5bt.0bEbq.S", +"bM#VbJbnbObIb0bMbQbOaqapbM.ZbobL.xbfbT.EbJ#caAbHa4#5bTb2bt#lbqa9#k#caBbtbt.SbJa2bmaY#JbyaMbybz#f#5.5awbOb0.Z.KbXbY.xb2a9bLaSbH.Uapa9bY#c#E#5.N#tbHbtbTbebEbKbebQbP#cb0bFbE.SbJaw.Ba9aG.xbM.Z.EbM", +".l.xbR#P#sbI.0.ZbnbVbNaA.Z#3.0a6bEbJbG#k#6bIbqbebK.EaGbMap.Ka7bIaAbF.ZbqaH.O#3#.boaMbhbf#3aaab#o#kbt.S.5bYbubRau.MaMaAbMbMbM#s.x#5bX#6aEbSbAbEa9.0bHaGbq.B#ca7bI#cbY.0bXa9bMbb#3#4#3bqbSbq#kan#4", +"aY.F#ibha7aA.iasbbbo#3bebybL#ybLbN.xbu#la6bSaBbNbrbl.xbV.W#lalbIa.bI#taHb..KbN.ibPb0.Kbb#va9a9aL.K.ZaCbObea7bo.F#v#5aGbMbL#1.E#I#6bu#3.K#5bP#3aG#Sbta9#JbObBa2bobIbW.Z#6#ka9.Z#5bqbHbO.7#lbK.EbR", +"bUbJ.ia4.wbHbh.Zba.O#3ap#3a4#nbUaA#kbYbI#c.7b0.5a8a9bS.NbQ.BbFaA.Zbtbtbt#6bIbFbtaAaAbXbHbLbNbpap.SbebI#5awbq.xan#cbo.KbobHbT#R#Ha9#E#5.Kbe#catbfbIbSbubIbeaKbtaKbY#casaG#kbH.ZbybTaO#cbJ.O.ZbIaG", +"b2.PbIaAaAb1.sbX#Ebfb1#t#qaAbAaH.Ebua4#6#kasboapb2.x.xaGbEbe.5br#9bubX#6bEaKbo#qag.ZbTa7bPbH.5#5#k#5aGb0a7btbY.K#LbL#5bM#X#2#N.ya2bu#C#y#3bo#jbB#B#qbb#c#9al.K#5bTbNb0#cas#3bN.x.ZbEbXaHbN.0.Z.0", +"bq#6bS.na9#ca4bq.Zbtbu.Ea9a7#LblbXapbebqbo#6bYbPa4bXbYbT#IaAaZbqay.B.ba4bNboa2#5.x.EbYbo.F#5#DaAap#5bI#ka4bX.EbRat#kasbJas.O.Zbq.7a1aO.nas.S#2#e.2.ZbHbX.S#5#L.SaVbY#caV.MbSbG.dbObqbIbMa3bb#c#L", +"#kaG.San.6#l.EbAa2b0#k.Za4.Oa2#3.FbMbb.ObJaH#kbRbGa1.nbn.5bn#sbM#N.Y.EbSbEawbebqaC.BbIbJbq#6.K#J#cbT.B#3.0beb0bQaAb0bLbqbIb.b#bO.baya7.E#P#kbP.z#e.x.db0btbE#6bBbTbT#caHbTa2aGbY#3bAbBbSbTb3.EbK", +"bwbYbMbEbo.Eap.x#5bHbebo.LbLawbE.x.ZbqbYbMa2.x#5.ZbJbXa7.ZauasbPai#kbE.BbYb2bzaHbP.Z#.a4a2bJ#5#6a9bQ#k#3bLbqanbM.xa8.0a0aObM#PbR#Xa7bq#O.gbRbRbK.xaAbUapbJ.KbNb.awa6b0a7bYbN.SbY.ZapaObubYbY.0a9", +".1bqbA#PaHawaCbVb2bNbWaCbG.EbYbXaGbKbSaw.E#W.Sap.IaGaIalbJb.#Hb1bH.Z#3bqbH#6#Sbl#k.xb1btbN#JawaKbI#kbKbQ.Sboasa4#6#IaCbMbXbJaAbIbT#sbLbrbL#ibW.zbI#5bHbObu.SbSbLaG#5bEa2bt.x#3bX.wbEbjbo.7b0apbW", +".ZaDaGbNbTbQ.6.Z#3a2#3#5aA#lbMbFb0blaAbq#5apbqbXbI.5bO.5bIb2.E.Z.Zbq.Sa9.KaCaGbT#cbRaHbI.xb0bua4#5.B#5aGbLapbMbo.g.Ea0#QbF#N#5.Sbr.wb..z#hbLbTbObB.BaGaHbXbEbTa9bH.ZbLbPa7bX#c#.bSbt.E.BbNbKbNbO", +".5bGbKbYbNa2.da6bJbq#6.Za2bNboa4#c#lbEbbbNbXbu#3bTa0asb2.E.YbTb0.E.s.SbK.B#maAbbbI.0.x#3bNbI#B#ha7bGbFbTbq#3.S.ZbebT.SbWbqaB.gb0bObmbtbIbLbT#3b0byaw#tbJbQbO.x.Sbo#Lb3bNbmbobKbOawbRa2bJb0.YaAa2", +"btaGbEa7#cb1byaGbobqbL.Bbe.7bIbqaBbWbq#5bq#3#cbX.ybHbnbqbIbq#ca7a7bTbJbPbmaKbIaMa1a7bJ.6.xa9atboa9.5bWax#6bW.NbXbUbTa5bT.Kbq#3as.waYa7aMb0bH.Ea6bNa5aG#5aCbTak.EbTaA#5bHbL.xbobhbS#5bHbea4bIap#6", +"bN.5a2bX.xbQaH.B.Z#3.dbU#kbNbMbFa4btbWbM.E.S.x#6asbL.ZbLb1.Z.0akb..0aZb0bTbP.ia9aAbHaGbH#L#cbeaAbPa2#lbQbLbHbw#3bHbq.5.SbM.SbMbIbB#qa5.xbbbi.M#c#tbebob.bYbJbTbA.wbo.wa5aAa8#t.h#3#ibS.ObIan#3.0", +"bHb#bM.Zbq.sb2b0.a.SbbazaRbNbN.nay#3aG.J#ybSbNbNbWaB.YbL#6anbYbE.Z.xaO#cbea9a9be.mbH.nbq.EbBbebB.O#.#6.x#6bI.Kb2bybAbqaAbP.5boat#k#c.ca#.ZbQap.MbTa2be.Za7bQaw#Oan#ObP#5bY#5#5bJbu#6bBan.E.xbI#3", +"bWbX.Z#5bKaua5a7bTbNbY.B.5bRbVbt.6.xaHapbO.bbqbz.x#5bNbJ.Z#3bHa9#2.EbebN#k.Z#5#q.Z.ZafbV.ZbMbNbqbXbSbI#5b0aG#5bDb0bKaHa4aAbu.0bIa2.xaG.E.BbAbNbHa9.SbYbI#6.ZbIbQ#2#cbIbQ.0.KbO#6#c#PaHbM.EbfbHbo", +"bKbIbI.i.0bL.7.waG.Tap.Sa4.0buai.KbS.Oaw.Sap.6aGbO#c.Sa2bJa7bebH.x.0.BbI#c#Bbu#cbR.YbRa7a7bM.xbI.x#Tb0bVa9bI#cb1bq#c#hap#c.x#3#kbI.KbT#mbqbO#6bPbYbYa9bNatbWawala2bq.xaAbTbobtbf#hbO#5bo#3bIa6aw", +".Eb#.E#2b0bTbMbe.S#3bP#6bOaHbSbSbMbYbP.xawasblbQa2by.TbJasaHbe.KbT.KasbqbtaAbH#3bIbobybGbWaC.E#G#..EbqbqaA#6a9bYaM.6#caB.Ea9bKay.ibL#5.Pbta8b0bMbFa7bqbIbea2bJ.E.KbqbS#6bJbYa9.O.raubA.xbY#kaAb2", +"bJbO#lbXbM#laYbT.Zbl.F#5bBbX.xb0bHbebI#3bNbtbTa7.5bO#3bo#cbObNb2#6bOb1a0aYaAbWb2#6bC#9asbH.0bHaC#T#kaHbXbqaA#5#h#3bYb1apaAawbTbS.k.ibha9aYbMb#bMblbeb..nbtasbKbEbzblaA.ZbQbJbYbTa4bTa2b1.EaGbIbF", +"bT.xbKbHbWbq.B#ka7aubqb1anbUbL#JbT.5bM#6.xaAbIbubL#ca7.SbUapbM.5bu.ka9aAbMbJaYbT#SbPbBbfa9#ca9bH.S#cbXby#waA#taHala2.5bKbSa9.EbMa9.SbhbLbM#6b3bTala7ana2bLbqbTbe#3aAbQ.6a9bN#Qbtbqa2.xb1a4bzbqa6", +".x#lb0b..Ebhbqb1a8btbmbbbhbJa2#5b0bebTa5b0bJbBbIbNa9#5a9.x#3.SbXaZa5.HbX#B#UbLb1a2bYbYbMa9bobtbF.0bJ.SapaAaGbG#gaGbSbJana9b1bY#3.E.x.Z#cbqbQ#cbqby#cbMbIa6bLawbEbH.KbtbLbeaOa7bqbealbube.5bK#.bo", +"bK.BbLbX.ZbXbL#3bKbhbu.ya5.ibPbTbLbh#5.Qby.k.i.k#5.Bb0.BbPaHa4a9a0a8#qbL.Qbnbq.ga7#laAa9bT#B#v#jbK#k#ka4#kaKbTaHbL.Ebl.5bN.6a4bIaza2apbt.cbY#cbb.ZbI#cbfapbSbIan.iaMa9bN#l.i.5#4bI#c.na9bIa9bHbe", +"btapapaW#kawbe.0#8aVaW#5a4a9.i.IbNa2a7bw.OasaGbh.F.naG#l#5bBa9#qbBbFbO#5bMbOaAbB#k#X#kb0#kb0aZ#kbS.e.S.0ahaObSaybHa7#k#kaA#U.nbH.0.Z.0bHb0#P#k.S.BbHbebMbI.x.Zbt.J.7.Z#k.S#T#k.E#4aObN.daF.e#4#P", +"#kbQa7btaGa9azbY.WaGaGa4a9.Ob0b0a4bJaHbFaza5aAas#VbL#kbe.0bMbWbwb0bL.xa8bIb1bJbJ.O.F.I#ka2#ibHbBbIaFaC.SaHbY#l.0.0asbPaAa1.KapbPbMbS.0bSbq#l.xbqbTbY#kaH.0a9bt.K#O.Y#P.Ja7bSbQbEahbq.E.Zat.BaVbH", +"btaGaH.7aCbHbNbS.WbsapbSbLa5bO#6.b#k#lbo#5.gaGbcbTax.5be#k#xa6#n#3bIboasbFbebJbO.jbRbLaKaMbo#m.ia6.xa4#PaHbOaFbqa7bBaO.xasb0.E.Z.Eas.x#lbqbzbKbV#c.Z#xb0bY.SaH.EaC#m#.axb0bNbMapbL.4#.by.CbTas#l", +"aF.SaHbJbNbMbC.Zapa2bGbQ#6.KbC.IbG#cbq.K.5#m##b1awbX#k.5aGa9bT#5.xbm.Sa0.FbhbH#qau#6#JaA#B#hbc#5.B#k#4bO#.aGbSbIbeaDbM#k#5apbLbu.E#3bXbtbX.nbob0bKbT#Va2#6bJbIaG.KbDbEab#5bEbS#tb0a0as#lbMa5aA#B", +"bHbOakbE.E#..Ba7aLaT#c#3btaG#NbY.dbfbN.ZaIbKbPa8aC#NbNbSbXaGaAbebObR#5.xbBaZbJa7.k#9aZ#Lbu#vbeaZbKbHby.xbHbO#.#PbTatasbyaB.VbS.x#cbt.FaGbXbLbN.Zbi#cbT.Ea6bYaG#kbObY#ubEbobuapaGa5b2aZbPaZbLau.G", +"btaSaB.D#lbT#ObP#ta6#3#3bBbHbe#k#5.5.ZbFbEby#hbqbq#.bu#lbKby#5#BbEbXaYb.bL.9bXbX.i#BbB#Ab0bLbJ#lbM#k.F.5bJbTb0a7#9btbe#5bt#JbebMaMbqaMa2bzbobt#3bTa4bMbo.0bXbIat#J#3bYa2bJ#6bo#6.K#5#mbtbBbKboaA", +"b1#l.j#Q.D#H.B.xaHbyanbYar.1.xaya2a6bY.x.ZasbIaA.Ba4.5asbE#B#5bL.KbLasaCb#bKbXa2#qaAalbua5.S.5.Ebt.zbXbMbTb1.xbzbIaCaAbyatal#5bt#ca8au#6bebRa9#6as#cbN#cbWa9a7#kaH#Va6.E.E#c.xam#lbBaw#5.5bBbEbA", +"#U.4.0.Q.ZbMbObX.KaKawaKbP#5.bbq.M.Ta2bWawa8aAbI#kbRaGa4bJbubPa9#3bIbPb0bTblbWbn#3bLbt.w#V#U.Z.z.I.ZbRbKb1bLbXbWbBbebLbtbfaK#c#uaA#6#6#S#vbSaMbe.EbHbI.0bo.xa9.Zb1#k#V.xbNa1a1.ZaU#q.dbNaL#6aRbN", +"ah#4bS.Va7#e.Maibqan#kbXaw.BbLbYa2aha9bIaAbGahawaAbB.ibXbT#c.xbbbJapalbe.xbO.#asawbJ.QaObXakaZa9bXb0aAbA.0br#5.sbNaha9#cbVaCbYaVbDaw#c.ZbeaBaebMbKbP.qbMaAbYa1b0bEbSbE.Ba7.i.Q.BbObNboa7bM.Sa7bW", +"aOaw.xambN.M#2bGbJ.0.Z.xbT.E.ZbHapa2bt#k#3bIaibQbTaAbRbT#k#BbMbMbybybNbe.S.O#..Zb2.2.5b0#H#kbKbt#5bu.ZbM.k.K.xbe.xapbea7aG.0aG.5a4bEal#6awbT#Ob0akbT#c#.bH.SbLbIaUa2.xalbH.0.S#sbebf#J.ObNbJbN.O", +".7#l#4.SakasanaObMaGbqbN.0b1bQ#..daGbIbJbTbTa6aCbObIbH#S.Za5aY.xa5#jbobo.K#5bFbLbtb##U#Rbq.hblba.0bna0#5.QbO.EbM#haA#.bLbMbKa5aAbCbBbfbTbqas#3bWa7bNas.Za7.EbYa1bMaVbt.EbYa7#O.BaKbXbuaHbqasbH.E", +".S#6.Z#kapbT#4bIanbHbRb2.S#cbO.xaybb.BbX#t.Z.V.abJbTaA#5.i.F.KbKbFbFaa#3bf#vbobbbnapbM.S#2#lbKbra9bXbI.0bebMb0#h#6bXaAbM#3bnbPbubobH#.bzapbLbNbIaHbP#ca2bI#5a4bLbK#k#k.Z.B#3bPa7bYbbbobJaG.Ea9ak", +"bLbq#kbJ.S.x#c.E#PbW.Z#l.6a6.nasbQ#4btap.0bBbS#cb0bTbBbLaIa9bL#5#q#taAaaaK#nbtbt#n.ZbH#Rb1bqbUbJbKbz.K.ZbobLbtaZb.aZ.kbM#vbIbM.ibTbFan.KbRbEaA#5bqa9bebI#cbLa2bu.x.xbFbPbIan#HbeaA.KbT#m#kbo.Zbq", +"aIbMb1bHbP.pbLbP.xaGbJapbSbX#.#caCaUbTbTbAbX#c.JbXalbXbb#ia7bJala4aM.Ka2#LaC.Kbwb2bBbO.BbL#U.0#mbXbJaAb.bIaG.PawbMb0bMbn.0aKbHbXa4ae.iap#lbIbo#kbBb0bo#cbPaGaAbua7bI.ZbE.E.xaybbbBboatby.2.Sbq#V", +"bLbTbMa9bP.S.xbRbLbYbPakaAa7bM.E.N##.K.Fa8.SbtbNaG#kbPbrbTbIb1bK#Ra7a7#3bbbxbu#qaA.x.5.0.x#XaK#3.xbX.Ka7bLbIbyaAbq#cbq.Y#3aObb.S#k.sa7a9bPbt.aa2bTaAaGb#btbubt.KagaSbL.SbLawa9aVbI.KbtbM#3#cbJbX", +"bc.FbT.g.haqbMbPbP#ebIbN.6a7#kaAaV.cbtb0b2apaObEa5aAb2.KbIbubl.K.B.Z.7bM#5.0.KbE#vbHbXaf#ObY.IbobhbNbm.ibTbhbT#u.SaWaVbHaG#c.ZaU.A#YbIbYbfbSbGbibo#3aMa9#mbP.K.Kb0.Q.S.xa2.ZbNaCbb#6bo.5bTa7bq.B", +"aw.S#4.cawaS#P#.bqa2bX#.#c#caPa2bHbQ.FbY.d.3aw.o.J.5.5btaGa8auaY#GaebXbWasaK#v#a.H#ObPbJ#3aAaU#cbL.KbIbK#5.xb0bI.a#4.ZbbbL.SbI#..I.SbT.E#k#1bL.6bTaNbo#5#3.YalbLanbqbSbTa7bPaxbubfa7bz.0.Yaw.5a4", +".Ea1.6#2bSbqazbX#kal#c.xawaGbSaUa1.5.5a2.WaCaybYbEaVaH.SaAbq.kbaak#k.0bX.xaY#v#5as#sbB.S#ca9#ca9bK.I.Kb0b0bI#kbKaO#VbHaw#3.Sa7aebX#I.xao.wbq.5bM#5.Zbua5bEbe#vaGbybB.S.Ka2#cbz.SbYb0bBbB.Z#5bo#k", +"bNaG.6apbY#k.r.7aSawawbXaC#caCaP.xbYak.VbNbb.WaWaxbM#c#lbNbXaAbIae#O#.bq#tbO#9aKbRbT.S.ZbNbyaHbNb0bPaAbBbJ#LbebMa1bq#kaKa9bL.x#NaH#Q.x.Z.S#Hbq#Xbyb0#5bMbFbBb1beaAbL.xbtbP.KagbJbqbtbL.xbubTbqbM", +"awbIaCaC.x.0a2aG#k.O#kbq.xbGbS#6.SbHbMbSaCahaGbB.Saz.ZbLanbPbTaY#l#.bTaAbqbeaA#La7aGbFaBawb1boap#Jasa9bWbWbIbObX.NaGbSbP#5.ZbrbMaAbL#kbIbM#hbKbX#caA#3bebuaAbebfbq#6bNa7#5a7bEbobubEbTbE#4#3aGbL", +"###caG.SbEboaGbMbMbY#Vbea4bvahaW#PaC.Zbq.0#6bz#6.J#Waz#J#lbPbLbt.0b0.xaKbO#mbLa5bwb0#kaH.Sa2bWaAbIbJatb0#6.iap.xa1bY#5awa0a9bnaebaa7aY.EbXb0#l#ka8#Ca9bobTaKbYaK#rasbIbLbN.SasaG.4a2.SbobXbK.Ybq", +"an.5bua4by#5.O#c.haCbJanbY#caJbfbHasbNbY.2aq#JaAa7aGa2bybOaAapaYb2#9bLbPbWbXb2.SaHaHanby#3.hbTaObX#3bL.SbT.x.ibTa2bN#5bBaGbobJbqbt#lb#.EbJ.5a9bL#3beaKbOa9bu.E#vbK.MbtbqbN#5bM#3#k.KbtbMbI#c#cbo", +"bobfbLbYaAayaA.M.Eal.nbybLbubE#caia1.7btbBaM.L#BbSaC.5#kaCb0bOaYbMbAb1btbPbL#nbLaU#u.SbebNb..5#sbMbub0a9a8b3bTbI#V#3bubF#q#vbn.2.KbMbo.kbObLbJbJboboaC.KbY#man#mbqbBbLapbMbbaGbS.5aHa7a7bYbebLaG", +"bT#Eam#p#5aAaL#3bOanbqbVbEajaHapaO.SaH.SbObhbM.H.a.SalaGbTbYbh#6bJbM.p.2a9aA.0aoboay#9.E.x.E.g.2a8.5bn.sboaA.Z#6axbF#Ea5ab.4btbJb#bbbPbzbNaAbxbM#5#5.K.iaqbB.K.Fa9anbTbH#k.EbP.SbIbeb0bYbu.x#3bq", +"#PbN#Ta9aVaWbtaG#VbP.ZbhbXbM#h.G#d...ubYbq.7#k.0bNbwadbSbea6aV.5.X.1bE.J.ZaAbS#5.5.Z#T##bY.E.F#l.EbH#c.Ebu.ZaH.CbTbMbXbT#n.5bMbM.JbEbG.5bBbSah.KasbqbtaYala5bJbJ#cbo#3bNbubnaC.gan.cby.Obu.waAa0", +"#4aGbN.E.BataG#ubY.x.EbLbM.2.iaKa9ap#EaGbAas.S#..BbYbNbN#c.Ea2#3#c.JbN.5apa2bRb0.FbNaA.6bWbQ#.bPa9by.Sb2a2bTbE#6bTbIbq#5aA#5bua0beapbEaGbq#capa7aAbMa0bIbt.KaAb0ay#3.Ka2.BbI.sbqbSay.x.Z.xbo#SbI", +"ak.EbSaVbRbSbbbbapbi.KapbF#5bCbtbBbbbOaAbIbI.EbXbI.0.Ba2bqaG.5.dbSbNaCap#mapbubLaM#kapbFbhapbuapaCbJbobSbqbo#FbHbub#asbJbhbJbh.B.FbHbq.0a2aw.BbtaAbubXbI#kbXbPbAaPasbo#5aC.5a7.hbt#kaH#5#c.IbL#5", +"aB.0bMa4#6bP.KbtbDaW#5.W#yaw#qbybLbI#vbXbT#hbLb0ay#5#3#kbA#cbBa9blaGaMbo#Ebh#W#maG#q#Lb2bobe#vbz#AbNaB#5bo#5aw#v.0b0.KbK.EaAbJb1#3bKa9.KbObJ#c.xaAbLbobLbMbubIaYbDbSa6aAbI.Eb0.5bt.xbubH#ca7bbbL", +"aq.nbX.SaH#3bLa9#B#BbiaTap#wbi#Cbh#kbh#5a5#6bm.ibJbqbMbpbM.0bMbb#p#jbu#m#J#9#9aMblbu#6a9#5bfbIb0a9bfbUbIbyb0bobWb0bt.i.SbX#m.Bbbbq#c.KbNbza4b1bKbWbSbLbObobLbeb0arbbbu#k#6bLbMal.EbMbE.Bala9#k#c", +"#kasbMbybXaZ#v#qbn#3boaAbWaXbK.R#I#hbJ.5bU#ha2a2aAbTbEbO#5aAbM.0b0bb#m#6#tbTbhbnbzbobT#9bobeaAbb#ubIbe#p#q.Kbbbua9bPbI.KaY#kbh#6.8a7a7a5bXbBbJbI#kbu#la8.OaYasbMbN#3bL#5.D.i.S#Hbf#h.EbubNa9.Bbe", +"#QbLbIbPas#5a9bP#Lbra7bBbtbI#c.x.Z.EbKbJaha4.RaNbTbLaZ.ZbMbtbFbJbtaAakbO#q.ibWas#3#I#3bY#2bJaGbHaLbeaAbebybt#9bT#kbPbMbPbtbebH.EbX#nbIbObqb1b0#vbRaZbt.BaYaw.5aA.R#3#8#k#cbHbXbMbhbcb1b0bTawaV.0", +"bTbTa7bmbRbhbma9.g#b.y.waG.UanaCbKaH.Ea4bN.Jaya4aYbKbubTbL#hbr.Z.SbYaY.ObL#sbPaYbq.5ak.E.7a4aebY.kaLaMaM#mbS#qbtbra9bTbobLbhbX#haZbP#hbXa8#h.xb##.aAbPbPbXaYbJ#v.Bawbe.x.KaA#k.QbTbTbXapbE.xaCbQ", +".K.K.E.x.xbY.Ka9.bawaDbq.v.ZaO#da1a2.ca2.aa2aGawbMbTbObTb0bB.zbe#T.V.xb0#ca9a8#Ja4.S#5bH.Oa9.B.SbtbTbL.ZbH#lbBb0aG.ZaAbI.ZbubLb0#k#K.n.bbNazaq#q.SbE#iap#Db1#l.5#3.KbMbAaAbE#BaAaKapaAa5b1bTbua8", +"bwanbObI#r.7bu#ybSaG.5.Q#G#.bVaw#cbLa4.BbObQbqbGbMbLbtb1.KbPbMa9#..MbqbobRbMaBa8a9.5b1awbTbSbybKaAbX.S#3bXbP#NbM#qasa5bMaAbIaAbL.S.x#4.M.SbYa5bLbqbSa9#zaAboan#.bLbwbubebX#qbS#5.x.i.KbI#m.2asaA", +"#6be#3a1.E##bmbMbBbYbP#UbRbRa7#6bObWbXbI.E#qbJbTb0byaqbJbMbXbWbt#X.NbH.ZbNaAbu.i#cbKbKbfa2bBbXbN.ZbTbRbT#sb0#5bJ.Z#.bPbXaMb1#6.E.IbR.naObN#kbTb.bI.EbobMaAbAbHaAaGbJaA#c#qbCbo#5bLbMbL#cbObXbObX", +".KbJ.7#XbSbWbtaG.Sa0#sbTa8a7a8bTbIaKbLbIbJbhbR#3aAbLbMb0bMaAbIaA.7bMbN.ZbS#BbX.Kap#AaibW#kbNbTbIb0bXa7#k#3.IbH.iasboaYa2asbqa5bIbLa7bMaW#ratasa0a1bq#c#va9#3.xak#5#nbe#3#5bebXbIbMbtbJaY#kbXbTbo", +"bFbz.7bT.5#kbybo#hbWbobtb3#na5.7#J.IaYboaYb2bPbOasaCbe.Kb0bPbeaBbWaObMaHbJ#EbY#mbqa2#kaAa2#5aO#c.5b#ag.5b0bObK#2aZbL.EbT#5bLaYbJ.K#vbNaG#k#3bubIbT.F#Lbea9#A.ZbKbQ#3b1bL#3#6bObtaAbOanaBbJaAbTbb", +".Kbna2bq.Z.0#m#vaZbTbo#L#BbubPaAbr#cb1##bM#tbH#vbMbT.Za8beb0#.aA#ka9bPbObL#kbB#5bSb0aGbIbqbT#Ja7b#bIbObnbP.Bb1bEbLbobza0bLbobI.Ka5b0byapapbQ.Ea8bHbLa2bobS#3aG.xb0bfbE#3bub0bz#c#6bIbhbI#6bLbebM", +".KaKbYae.S.B#5bIbqbtbu#y#E#cbSbJ.F#3#ca2awbIa4aHbIa9bIbTbWaA#hbq.h.7bHby.fbt#6bYbqapa9bMbBbYbNb1#k.F#k.0bI.0bh.ZbIbh.Eb0bt.Bbha7#maK#Sbi.V#k.KbX.E#kb0a8bua5.5.0aI#AaKbuaK#5aHb0#hbtbRaGbLbKbLbA", +"b0be#P##.EbBaAapbPa7bNbv#7.a.0bObsaFapaGbGbSa2.6aAbTbMbObJ#5bI#5bIb0bWbtbIa7aWbVbtbM.xa9.ZbTbqap.x.s#3.g#3bL#NbK#3##a9aY.xbh.0#5#Jbh#EbebM#cbT.6bqa4b1aLbNa9bM#VaM#6apaA.xa9aM#5bJbM.BaZbXa9bubX", +"bybIbSaGb0.caMbYbJ.r.5#k#P#XbL#.as#XbJbK.2btaGbD.Z.PaYbH#h.B#cbb#KbebqbbbNbiay.Ya7.Z#UaObH.6#2.7bJbH.0#3asbKaA#5#2bOaSbLbPb0.S.g.d.KbGbEbNb0bXbn#X.B#H.0#2.Z.n.SbYbHbMbE.KbTa2.Za9#caKbo.KbtbMbo", +".5aAbWbS.Ebo.Z.K.BbJbEbX.5aH.5bqaA.EasaHbobeaGaC#s#XbIbLbIap#3.O#3.xbIbtaCa2aLbs.SbObIbU.s.xaAbPbIb0bLaAb1bb#6#mbM.0bt#UbN.g.ZbLbu#VaH#ka0bo.5aK.ZbP.KbJbWa8bJ.Ia7aK.SbEb#a4bLat#nbobebLbNaAbTaM", +"bbapb1a9bobP.xa4aGbqbq.Ba9bOaHbqbT.jbXbI#cbMbiaGbWbI#XapaSbObIbEbqbua2bo#5bV#6aybW#XaF#IbL.Oaea7#O.0#kaBbM#qaA#maA.gbbbTbJ.EbBbJ.dbMaGaAbNbTb0b#b0.hbH.BbRbIbEbWaAawa7beaFaAbMbebtbWbL#t#L#5#3#c", +".5a4.E#kbd#lbXbOa7#cbo.xbHbO.E#3#ka6bobLaGbKbq#3ae#.#Nb0a8a7aH#6#tbzbI#6#cbCapbobMbMbF#k.Bbr#.b#.Zb0#6bOasbMbybMb.a9.i.SbqbLbcbTbNa4#6a7#cbTbJbIbbbT.KbObKbF.g.K.0#3bS.4aG#3bY.xbubTaGapbYbMaAbL", +".5aA.K.K.ZbGbBbVbobHbybz#kbB#c.SbNbebHbea7a4bTbMbTbM.IbT#.aGbJbSbF.E#EbJbebtaYbu#s.SbWb3bybI.5bIbH.gb#bLaAaY#qbIb2bMbY.iaAbXbLbf#eawbOapb3bLbBbT#ha9bIbh.0b0bLbPbY#5bX.BboalbI.Kby#A.KaAbe.K#5aH", +"#kbtaGbqbebX.7bO#c#JaGbPbo#3b0bu#haHbebWbXbBbqbW.Pa7bJbO.EbubKapaM#3bXaYaAbRaZbPbBbP.Qa9.gbI#3bI.xbTbI#cbmbebobJaMbM#3bKbP.Y#ua8#cbG.K#kbebqbnbLas.KbXaAbP#3a9bMasap.5#6#l.x.6awbzbubtbfbbbeaAaK", +".B#5.5bebYbta7#3#6bXaG#x.KbY#qbNboa4.Ma9bNaA.gas#..l.QbMb0#c#5b0#5#j#3bIby.kbWaYbMbBbCbr#3bKb0aAbL#ObLbP#3bhbT#nbLbobPbybeaA#Z.K.MbH.ZaC#6bTbtasaZ.Kbt#5bobLaYbebWaCbya7bNbuby.7bob.bebtbL#nbYaA", +"#t.5bTbMbHapbMa7bea9bobo#maAa9.KaHbl#AbQ.4.5bq#saS#2.Fakbh.x.BbDbo#5a9bMa0b..g.I#qb0a8bJ.Zbrbt#3#HbXbN.ibTbobP#u.i#g#3.iaAaK#6bnaP.xaGbtbM.EaYbLbIaM#ma8bIabaAaKbt#ka9bIbebFbHbqbmanbT#3#5#5#5bl", +".nbH#c.n#lbq#kaHbX.SbTapa7bEbBb2#ca2.J.6a9.ib#bT#cbe#t#3bI#DaAbX#6alaAa9bB.E#mbH.ib0asbebbbKas#3.0.KbPa7#l#cbo.Z#5a2#5aAa9bybTa9#Q.x#N.x.ZbJ#kbqbL.BaebWa7.O.UaSbN#qby.Zbo.0.SbNbqay.E.N.Ea9.MbE", +"a7bYb2.EbYbP.xb0.SbobVb0.KbNb0.Eaya1aGaA.ZbqbtbJbzaAbeaAa4.K#BbTaqbBbIb0bRaYbIbobJ.KbubPbLaAbo.sa9#c#k.KbubIaqb1axaw.0be#.#3#kaGbTbLbIbqbP.jbM.B.S#R.xaO.i#2.x.ZbYbIbua9.BbI#lbKapbfbubMa4a2at.Z", +"bLbH.E.K.Zb0.xaxbYbMbq#6#lbO#3aAapb0bEbEbn#.bOb.#Lbbb1bt.Kbe#.aGbMbLbTa9#.bObJbIbB.z#5bLbobI#ibb.SbebXa9#kaGbz#c.ZbTbN#kbO.Sa7bQ.PbPbobLbI.F#5bXaA#NbMbT#Ia7.IbIboa9btbObNbP#V.ra7bNbNaObw.fbOap", +"apbyaw.5bL.SbEbK.x.E#5.Z#cbA#caGan.Ba4.Faqb.bbaYawaA#5bSbLaMa9#5b#bMbBaAbTa9b0bqbo.Eas#hbWbXbL#3a7bR.FaHbt.6.SbIbqbtbtbJbqbobebEasbybXbfbX#3bJ.F.h#lbI.BaA.sbQbMbP.E.ZbNbIa9bB#k#3asaHawbqbX.K#.", +"aAbSasaGa4bIbS#6bobla7#5bLbS.xbA.x.Nbo#kbEbTbqaMbtbtbt#qawbLaAbt.KbLa8bTb#bIbh.BbXbca9#kbIbNbX.8bF.VbJapbLa9bybNbJ.0.Y#k#6.xbu##bO.xbK.SbIa8#k#tbWaAbIbIbH#lb1.0bt#6b0a2.EbAaCbIbS.EbL.0boaHbRbN", +"bT#6btbt#L.Kbh.KbI.FbobIbJbqaAboaw.BbNbIaHbXb#.U#3bwbT#6a9.Ka9aG.Ha9#kbJbebLaAbU.KbMa9aAbMa9bJbL#3aGb0a9bubL#rbtbNbobO.EboaG.K#6bTaMbOaMbtaYbtaMa7bJaAb0bOaK.Fbo.0bYbqaqaAbt#5aZ#kbebObobX.gbuas", +"#qbSbPbKbubAanboapb0.Eby.5bYb0bYa4#cbRbPa6bObL#qa4a9aA#3#6bubu#5.ga2b1b0bJapbL#3.saA#lb0bTbtbHbIbQ.Da9.7.x.7apbJa2bPaHbLbY#k#6bMbEa8bB.ibJbIbOa9.ibMbqbnbe.Ba5bJbT.0.Z.S#5.B#t#c#q.xaAbta5.SbMaA", +"aHbxa2be#6bBby#t#k.xbua4a4bPa9aHap.0#cbAbWbIa2.l#JbKa9bo#AbTb0bzbeaAaAa0btbI.lbLbybXbAbTa5bLaZbubJbubLbya2anbJbT.2a9a2bXa4bTaHbHbubnaA#Lby#3a5bobubB#q#5#hb0btb0a7bM.xbA.xa9bYaKbKa8asbrbOaY#vbT", +".5a9apbX#cbH.SbybYbM#5bYbKapbIbX.M.Vazay.ObAbI.SbFbPbf.Ca4b0bobLbP.xapbN.7.KbwaAbqbL#ka2.SbLapa2buaGbPa9b0au#c#6.Maw.Va9aAbPbtbL.N#c.cbF.E#6aGalbPbM.YbNbW#cbLaGbHaC#4bLbX#cbIbHaF.Zak#l.B#k#Pa7", +"a9.xaw#kbN#cbo.6bMawbIbMboaFbuap.MaH#ka2.Kaw#3bL.hbPapa8#5bTbLb#bq.Z#kbJa9#JaubebY#6btbP#3bT#c.Ia9bOa9byaAbu#5bea9.0a4aAapbqbOa5bYaQa7.R.0.EbIbIbfahbO.S#3bqbTbo.7.xbf#3.xa9#ebeb1bMa7bo#.#Ha9.E", +".K.nbNa2bA.Z.6bYbY#kbK.M.xaBas#3.Zad#5#.a2#k.EbNaAasbMbTbXbP#3b0bqbNaA.xapbJaHaKbTbfawaHbb.Ea2bK#3bebtbeaKapby#5anap#kbYbT#tbqbT.S.x#5#haC#qaYbJana7#3bY#3#3bHbJbI#6bSaA.FbQbOaw.0bG#kbLb0bQ.rbM", +"bQa4bHbqaCbbajbQapbMby.KbtaG.SbyaGapan#ka9bX.K#6bMbK#cbRbI.7#hbP#4bLaObSasbebB#xaw.E.SbP#lbobQanaKbtbWbtb0bL#Mb0bLa7apa8bObTbHaMbPbT#6a0.zbIaAbh#lbbbLbSbq#5bWaCbo#6bqbybebPbubFbq#kbPbYaCbJbta2", +"awbLa4.S.Map#lblbUaw.xaAbNbr.ZbPaAbIbtaGapbQbRb1awaYbM#vbfbJbtbXaS.xbTbebMbYbfbI.5bSaA#c#6bHb0#cbbbOaLaAbubN#5bo#5bWalbIaAbybJbTa0bobIbTa5bMaMbPbTbSbPb0#5bN.EbybI#c#v#6aA#5btbI#3#cbI.S#6bu.ZbT", +"aGbqboaGbJ.5.K.SbE#c.5bobO.S#5.bb0bh.hb.asbMaG.7bLbzaZ#3#kasbPbI#ka2.ZaH.Ya5awbtbQ.KbMbubY.5bybPasbe#vbQbFbb#JbubXbn.ib0bLa0bTa9bObJ.gbebMbSbJbNaGbqa7bo.xaGbIaHbB#mbobwbe#3.KbBa9#5by.KbEbTbTap", +".xbyawbqa2bzbHbNa9bL.E#3bNaG#3aAa9a8aZbLbKb0anbYaY.SbLbOaAbL#5b0.E#kaGbIbOblbB#vbX.7#5.ZbuaGbMawbBbya9b0#3bfb0#5a5.G#5.ibMbeaAbMa7#xbf.Z.ZbEaC#c.EbTbSbMaG.0bfapbIapbRbtbl#m#3bOa9b#a9bL#mbB#c#n", +"bz.xaGaia6#kay.ZbIapbP.xbYbP#kby#bavbh.Ka9a7be.xbS.i.EbtbJa5.xaA.E#5#kbTat#5boa9bNat.EbTaEbXaGbWa9.KbebE.KbT#5#3bg.k#h.sbnaA.5a9bTbB#Pbo.Ma2adaVb0#cbuap#ka8a4bT#faAabaM#qbobeaA#5bo#v.K#6bE#tas", +".5#4bfb.be#t#k#c.F.0.0bYbO#P#c.FaFakapbYbWbNaM.K.MaGbBbqaH.SbmaZ#d.BaiaGaGaHaCby#P.B#e#PbR.x.xasb0.IbWbTbIbo.ZbMbYa7bIbN#k.E.x.I.6bLbMbYb0bX.M#6#lbJ.Z#NbT.t.s.xa4#3a6bR.S.Ka2bo.WbY.J#cbua7bX#3", +"aG.EbfbebEbE.n.Eb0aw.FbEasbMa1bL#k.naAaGbMaw#.bA#caCbYaAbzaAbMav#T#k#V#lazbT.RbObq.0.7bLaFbIbQa7#kaK.EaKbXbMb0b.aHa9bSbe#kbP.Eae#kbobo.YbuaAa6bT.IbM#..EbIbMbBbTbIbqbL#c#6bMa9bq#fbSa9aH.K#3#can", +"bX#caKas#6#ta7bIa7bBbLbPbYbo#5a2bK#4.JbI.MbBbobbaybqbY.xbJbMa9bI.xaGaqawaHbTbQ#cbW#c.5bfbxbobt#SbtbIbRbJaYasbXbtazbXbobMbPbJbTa8#ca7.ZbN#kaH#3an.B.4aZ.ZbhbK#Q.x.xbt.EbP.EbYbLbt.R#caUb0aGbqbyag", +".5aObobnapa8#c#Pbb#t#3aK#tbo#JbB.JbLbEbQ#kbuaH.Jb0bX.6#5.xa4#5#kbTbNaCbMawbK.KbLbybPbu#6bbbZ#vac.Zbn#kbTbebLbfbIaybobfbo#DbM#nasaHbX#5bMbSaAbMbM.E#5bJbM#3a7a9.ibybSbNaM.xaw#3bHaW#6aLbea9b.#B#.", +"bIbKbeaG#vbe#c.x#3blan#t#k#xbubobRaVa9bNbMa2.EbEbObtbB.0ap#5.0.xawaAbMbHa9bS.S.K.KaKbwbt#q#ubZ#jbLbTbObTbNaYbebTbYbSbY#6aAbt#m#qbqbo#c.S#5bo.O.KbtbTa8.6.Eb.aAbL.5bTa7bHbe.x.ZbtbtbPbYb0be#.bnbH", +"aC#.a9bFbobtbPbLbLbobe#3bbbbbt#qbban.EawbE#.bqbEbHbfb0#5bI.x#c#cbLbXbybtbm.SbI.ybN.Kbe.K#qbD#q#za8.5bfbBbJ.BbTbLaVbMbV#3a6brbT#u.ZbA#kbF#.bMbEbW#B#.bB#naA.K#3bT#cbLapboa2#5#.bobu.KbubyaAbhbIb0", +"#Oa2bX.KbeaA.5a1b0.xaAaAa1#kb1.6a9aA#DbH.ZaVbKbqaA.SbJaA.XbS.S.b#gaA#t.EbL.xbMbWbea2bRbtbubWaM#5.ZaZbP.EbMbJ#mbJ.V#GbHaH#3bc.KaYbL#ca9.0#5a2bqbfbMaZbtaZaAbM#tasbeaCb0bTa4.x.K.E#vbE#LbraKbKbIaA", +".xakaKbybW#6bM#l#ka7#k.nbM.0bH#Pa2#3by#..K#kak#0bnbMaA.5.K.BbNa6aK.ka9bLbc.wbL.7.xaAbqbAbo#JawaB.KbLbq#BbebMbMbL.##Va7#2.S.B.0bIbEb2.7#6.Z.KbJbq#m#5a8bWby#ua8#6#3#lawbTbea7bL#3#3#J#5#.#3.ib#bM" +] + +metal_xpm = [ +" 154 77 46 1", +". c #040204", +"# c #4c4e4c", +"a c #6c767c", +"b c #5c6264", +"c c #848a8c", +"d c #545a5c", +"e c #7c8284", +"f c #646e74", +"g c #3c3e3c", +"h c #444644", +"i c #8c9294", +"j c #4c565c", +"k c #7c7e84", +"l c #646a6c", +"m c #747e84", +"n c #4c525c", +"o c #74767c", +"p c #64666c", +"q c #8c8e94", +"r c #5c5e64", +"s c #84868c", +"t c #6c6e74", +"u c #444244", +"v c #4c4a4c", +"w c #4c5254", +"x c #5c666c", +"y c #848e94", +"z c #545e64", +"A c #7c868c", +"B c #3c4244", +"C c #444a4c", +"D c #8c969c", +"E c #747a7c", +"F c #6c7274", +"G c #4c4e54", +"H c #5c626c", +"I c #848a94", +"J c #545a64", +"K c #7c828c", +"L c #3c3e44", +"M c #44464c", +"N c #8c929c", +"O c #54565c", +"P c #646a74", +"Q c #747a84", +"R c #6c727c", +"DNDDDDDDDDDDNDNDNDNNiNNiNiNyiyiyqyyyyIyIcIcIcAsAsAAKAKeKememkmmmQEQEEaoaoaaFRFFFftftlfPllllpxpxpxHbbbrbrzrzrJddddOdOOjOjOnwwwwwGwGG#GCGC#CCCCCCCMCMMMhMBhB", +"DDDNDNDNDNDNDDNDiDNDNDiyNNiNNyNyiyqyqyIyIIcIcIAcAsAseAKeKekemkmkEmEQEEoaoaoRFRFFtFtftltlPllplpxpbpbHbbrbrrzrdrdJdddOOOOjOwOwOGwwwGwGGGCGCG#CvCCMCMCCMMMMMM", +"NNDNDNDNDNDNDiDNDNiNiNNDNNyNyqNqyqyqycyIcIcIAIAsAsAKAKKeKkKmkmkEmQQoQoEaoFoaFRtRFftftfPlPpllpxpbpbHbbbbrzrrdrdrdddOddOOwOOwOwwwwGwGwCGwCGGCvCCvCCChCMCBhMB", +"DDiDNDNDNDiDNNNiNNDiNyNiyNiyNyyNyyyIqIIcIcIAIcAsAAseKeKemKmkmkQmEEQEoaEaoaFRoFFtttftltlPlPppxppxbpbHbrrrrzrzrdddJdOdjOOOjwOwwOGwGwGGw#CGGCvCvCCCMMCMhCMCBM", +"iNNNiNiNiNNiDNDNNiNyNiNiNyNyiyqyqIqyIIyIcIcIcAsAsKAKAKeKeekmkmEkQQEEQaooaRoFFtRFFftltflPllllppxpHbpbHbbzrrdrdrOrOddOOjOwOOGOwGwwGwGwCGGCGCCGCCMvCCMCMMhMMB", +"NiNNNNNNNNiNiNiNiNNNiyNyiqyNyqyyyyIyIcIcIAcAsAsAAAseKeKmkmkmkQmEEQEoaEaoRoFRRFtfttftlPtllppxpxpbpbbrbrrbrzrdddddOdOOdOOwOwwOGOGwGGGGwCGGCGCCvCvCMMCMhMBChM", +"iNNiiNiiNiNNiNiNyiyNyNyNyyqyqyyqIqycIcIcIsIsAsAAseKeKeeeKmkmmkQQQoEQooaoFaFRFFRFtftPtlllPplpxpbpbbHbbbrrzrrdrdrdddOdwOOjOwOwwwwGwGwCGGGCGCGCGCCCMCMCMCMMMB", +"NyNiNiNiNiNiyNiyNNyiNyqyNyyqyyqIIIIIcIcAIAcAsAsKAKKeKkmkmkmkQEQEEQaoaoaaoFRFFtftftflPlPllpxppxpbbpbbrbrzrrdrdOJOdOOOOOwOwOwwOGwGwGGw#CGCGCvCCCvMCMMMhMhBMh", +"yNiyNyNyiyNyiNyNiyqyyiyqyqyyyIIIycIcIAsIcAsAsAKAeKeKeeKmkmkmEmQEQoEEaoRoRFRFRtFttltftlPlplppxpbpbHrbbrrrrdrddrOrdOdOdwOwOwOGwGwwGGwCGwCGCGCCvMCCMCMCCBMMMB", +"qyNyiqyNyNyNyyqyyNyqyyqyyyqIIyIycIcIcIAcAsAAAKsKKeKemkmkmkmQkEEQEoaoaoaFFRFFtRftftlPllllpxpxpbbHpbbrrrzrzrdJrOdOOdOjOOOwOwwwOGGwGG#GGCGCGCvCCvCMCCMhMCMBMh", +"NyqyqyNyqyqyqyNyqyqyqyyIqIIyIcIcIIcIAsIAsAsAsAeAKeKkKkKmkmEQEQEQaoEaoaRFoRFRfttftPflPlPplpxppHpbbrHbbzrrzrdrdddddOOdwOwOwwOwGwGwGwCwCGGCGCCGCCCCMMCMMMMhMB", +"yqyqyyqyqyqyqyqyyqyyIyqIyIyIcIIcIsAIcAsAAsAKKKKeeKmemmmkmQkQEQEoEaoaoFoFRFFtFtftftltlllpplpxbpbHbbbrrrzrdrdddJdOdOOOOjOwOwwwwwGwGGGGGCGCGCvCCGMMCMMhMBCBMB", +"yyyyyqyyqyyqyyyqyyyIyIyIIcIcIIcIAIcAsAsAsKAeAKeKekKmkkmQkmQEQEoQaooaoaFRFRtFttftPlPllPplpxpxpbpbbHrbzrrrrdrdrOddOdjOwOwOwwOGOGwGw#GGCGCGCCGCCMCCMChCMMMhMB", +"IqyqyyqyyyqyyqIIIIqIIIIcIIcIccIscAsAsAAAKAsKeeKekmekmmkmEEEQEEoaoaoaRFoFFFtftftltlPlPplpxpxpbbbHbrbrrzrdzddddddOOOOOOwOwO#wGGwGGGCw#GCGCvCCvMCMCMMMMBCBMBM", +"IyIIIIIIIIIIIIyIyIIIyIcIccIcIcAIAsAsAAsKsKKeKeKmeKmkmkEmQQQEQaoEaoaRoFRFRtRFtftfltlPlplxpppbbpHbbbrbrrzrdrdrJOdOdOdwOwOwwwOwwGwwGwCGCGCGCCGCCCvMCMCMMhMhMB", +"IIIyIyIyIyIyIyIcIcIccIcIcAIAcAsAsAsAsKKAeKeKekKkkmkmkmQkEEEQoEoaoaoFRFRtFftftftlPlllplppxxpbpbbbrHrzrzrdrddOddOOOjOOwOwOwwGwGwG#GGGCwCGCvCCMvMCMMMhMBMBMBh", +"cIcIcIcIcIcIcIcIcIcIcIcIAscsAIAsAAsAKAKeKeKkeKmemkmkQmQEQEQoEoaoaoFRRFFRtFttltPltPpPlppxppbpbHbHrbrrrrdrdrOrdOddOdwOjOwOGOwwGwGGwCGGvGCGCCvCCCMCMCMhCMMhMB", +"IcIcIcIcIcIcIcIcIcIAIAcAIAAsAsAsAsKAKseKeKeKmkkmkmmQmkEQEEoaEaoaaRaoFFtFftftfPtllllppxppxbpbbbbbrrzrzrdrdddOdOdOOOOwOwwO#wGwGwG#CwCGCCvCvCCCMCMCMMMBMBhBMh", +"IAccIcIcIcIcIccIAIAscsAsAIsAsAsAAKAeKeKeKemkemkmmkQkEQEEQoQoaoaoFoFFFRtRttftltllPlPllppxppbHbpHrbbrrrdrddrddOdOOOjOOwwOwwwwGwGGwGGGCGCGCCCvCvMCMhCMMhMMMBB", +"csAIAsAsAsAAsAsAcsAIAAsAsAAAAAKKsKKKeKeKkeKmkmkmkQmEQEQoEaoaoaoRRFRFRtfFftftPlPlPlppxpxpbbHprrbrrzrzrdrdrOOddOOjOwOwOwO#OGwGwG#CwCGGCGCGCGMCMCMMMMBCBMBMhB", +"IAsAIAIsIAsIAIAIAsAsAsAsAsAsKsAKeAeeKeKemkmkmkmkQmEQEQEaQoEaoaFoRFRtFFtttftlfltPplplppxpHpbbbbrbbrzrrdrdOdddOdOOOOwOwOwwGwGwGGwGGGCGCvCvCCMCCMCMCMhMMhMBMB", +"sAsAsAsAsAsAsAsAsAsAsAAAKAKKKeKeKeKeekmKkmkmkmQmEQEQEEoEaoaoaoRFaFFRttftftltlPlpllpxpxpbxbpbHrbrrrrdzdrdrOdOdOjOjOwOwwwOGwwGGGCwGCGCGCCCGMCCMCMMhMBMBMBhBu", +"sAAsAsAAAsAAsAAsAAAAAsKsKKsAeKKeKeeKkKmkmkmkmmQEkEQEoQaooaoaRFoRFRFFfFtftftlPlPlplpxpbpbpbbrbrbrzrzrdrdOddOdOOOOOOwOwOwwwwGwGwGGGCGGCGCGCCMvCMMCMMCMMBMuMB", +"AAsAAAAsAAAsAAsKAsKKAKKKeKeKeKeKekkmmemkmmkQmkEQEQEEoEoaoaoRoFRFFttRtftfftlPtllpPpxpxpbbHbHbbrrzrzrdrddrOddOOjOwOwOwO#wGOGGGw#CGCGCCvCvMCvCMMMCMhBMhhMBMBu", +"KKAKKsAKKsAKAKKAKKKKKeAeKeKkKeeekKmKmkmkmkmQEEQEQEoQaoaoaoFaFRFFRFFtfttltlllllplpxpppbpbpbbrbrbrrrdrdrdddOdOdOOOwOwOwGOwGGwGwCwGGCGGCGCCMCMCCMMMMCBMBMBMBB", +"eAeKKeKKKKKKeKAeKAeeKeKeKeeKkmkmKmkmkmkmQmEQQEQEooQaooaoaRoFRFRFttfttfftlPPlpPppxppxbxbHbrbbrzrzrdrddddOddOOjOwOwOwwwOGwGwGGGGGC#CGCCCvCGMCMMCMhMMMhBMhBuB", +"eKeKeKKeKeeKeKeKeeeKeKeKeKmemkKkmkmkmkQQkEkEEQoEQEaEaoaFoaRFRFFRftFftftPltlPlllxppxpbpbpbHbrbrrzrzdrdrdJOdOdOOOOwOwOwwwwGwG#wCGGCGCvCGCCMCMCMhMMCBMBMBMBMB", +"KeKeKeeKeKeKeKeKeKeKekkkmekmKmmkmmkQQmEQEQEQEEoQaooaoaoRFFFRFFtFtftftlllPllpppppxpxbpbbrbrbrrzrrdrdddOddOdOjOwOwOwO#wGwGwGGGCwGCGCGCvCCvCMCCMCMhBCMhBMBuBu", +"kkKeeKeKeeKeKkKkkkkkKmKmkkmkmkkmmkEmmEkQEQEQoQaoaoaoaaFoFRRFFRtFfttltPtfllPllxlpxpbpbpbHbrbrzrrdrdrdrddOdOOOOdwOwOwwGOwwGw#wGGCGCGCGCCCMCMCMMMMMMhMBMMBMBB", +"KmekmekekKmememKmKmemkmkmmkmmmmkQQmkEEQEQoEoaEoEaoaaoFRRFFFRttfttfftllllPlppppxpxpbbHbbrbrrrrzrzdrOddOddOOjOwOwOwwOwwGGGGGCGCGG#CGCCvCvCMCMMChMBMBMMBhBuBu", +"ekmKkmkmkmkkkmkkmkmkmkmkmkmkmkQQEQEEQEQoEEaQoaoaoaoFRFoRFRFtFtFftPtfPltPplplxppxpbbpbHbHrbzrzrrdrdddJddOOdOOOjOwOw#OwwGwwGwGwCGCGCCGCCMCvMCMMMhCMMBMBuBMBB", +"kmkmkmkmkmkmkmkmkmkmkmmkmQmQQEEmkEQEQEEoQooaooaaRoFRoFFFFttFftftftlltllplPpppxpxpbpbbrbrbrrrzrdrddrOdOOOdjOwOwOwwOGGwGwG#GCGCG#CvCvCMGMCMCMMCMBMBMhBMBMBuB", +"mkmmmkmmkmmkmmkmmkmmmkQmQkQEkQEQEEQoEooEaEaoaoaoFaRFFRtRtRtfttftPltPllPllplxpxpbpHbbHbrbrrzrdrddrddOdddOOOOOwOwOwwwwwGwGGGGGGGCGCCGCCMCMCMChMhCMMBMMBuBuBB", +"QQQkQmkmmkmmkQQmkQQkEQEQEQEQEEQEoQoEoaQaoaoaaaoFRoFRFFFtFfttfftlftllPplppxpxpxpbbbprbrbrrrzrzdrdddddOOOjOjwOwOwwOGwOGwG#GCwC#CGCGCCvCCCMCMMMMBMBhMBhBMBMBu", +"EkmEkQQkQQkQQEkQEEQEmQkEQEQEEQoEQoEaQaoaoaoaoRFRRFFFRtRftFftftltllPllPlxppxpbpbbpbbHrbrbzrrdrrddrOdOdOdOOOOwOwOwwwGGGGwGwGGGCGCvCCvCCMvCMMCMhMMMMBuMBuBuBB", +"QEQEQEQEQEQEmQEQmEQEQEEQEEQEoEaQaoaooaoaoRRFFoFRFFRFtFtFftftlPflPlplppppxpxpbxpbbbrbbrrrrzrzdrddOdJOdOOjOwOwOwwOGwwGwG#CGCGCGCGCGCCMvCMMMCMhBCBhBMBMBMBBuB", +"EQEQEQEQEQEQEEQEEEQEEQEEQEoQaQooEaoaoaoaFoaoRFRFFRtFftftftftltltlPlPplxppxpbpbbHbHbrbzrzrdrdrddOrdOdOjOdwOwOwwOwGwGwGGwGwC#GCGCvCMGCCMCCMMMMMMMBMMBMBuBuBB", +"QEEQEEQEEQEEQEQEQEEQooaooaoaooaoaoaaaoRFoFFFRFFFttFttftftPtlPllplpplpxppxpbHbpbbrbrbrrrzrzdrddrOdOdOOOOwOOwOwO#wO#wGGwCGGGCGCGCCvCMCMCMMMChBChMMBhBMBBuBBB", +"EaoEoEoQoEoQoEoEoooEaEoQaoEoaoaoaoaoRFoRFRRRFtRtRttfttftltPltlPlPllpxppxpxbpbbbHbrbrrrzrrdrOrdOdOdOdOjOOwOjwOwwGGwGwGGG#GCGCGCCGCCvCMCMChMMMMBhBMBMBuuBBuL", +"oQaoaoEaEoaEoaoaoaQaoaoaoaaoaaoRRoFFRFRFRFFFFtFtfFftftftlPlPlPlpppplpxxpbpbbHbrbrbrrzrzrdrddddddOdOOOOwOwOwwwwOGwGwG#CwCGGCGCvCCCGMCMCMMMMBCMMBMhBuBBBuBBB", +"oaoaQoaooaEaoQaooaoaoaoaoaoaoaFoaRFoaRFRFFRttRfttftftltfPltlllplllxpxpxpxbHbpHbrbrbrzrrdzddrdOdOdOOjOjOwOwO#OwGwGwGGGwGGGCGCGCCvCMCMCMMChMMMhBMMBMBuMBuBuL", +"oaoaoaoaaoaoaoaoaoaoaoaaoRFRFoFRFFRFFFFFttFtFttftftfltlllllpPplppxppxpbbpbbbrbrbrrzrrzdrdrddOddOOOOOOOwOwwOwGwwGwGGwCGCGCGCGCvCCCCMvMMCMMBCBMMBhBuBBBuBBBB", +"FoaoaaaoaoaoaaoaaoRoaRoFFoRoRFRFRFFRtRttFRtfftftftltflPltlPlplppxppbpbbpbbHbbrbrzrrzrdrdrddddOdOdjdwOwOwOw#OwwGwGwG#GGwCGCGCvCCMvCCMCMMhMMhMhBMBMBMBMBBuBL", +"aRaFaoRoRRoRoFaFoFaFRoFRaFFFRFFRFFFFtFtftfttftfftlPlPtlPpplplpxpxpxpbpbbbprbrbrrrzrzdrdddOrOOdOOOOOjOwOwwOwGwwGwG#GCwCG#CGCCCGCGMMCMMMCMBCBMBMuBMBuBuBuLBB", +"RFoFoRFFoRFRFRoFRRFRFFFRFFRFFRFFRttRttFfttfftfltPltPllpllplpxppxpbpHbHbHbrbrbrbzrrdrdrdOrdOdOdOdOOwOwOwOwwwwwGwGGwGGGGCGCvCvCCCMCMCMCMMhMMMhMMBMBuBBuBLBBL", +"RFRFFFRRFFaFRFFRFRoFRFRFRFFRFtFtFttftfttfftftltllPllPlPplppppxpxpbxpbpbbHrbrrzrrzrzdrddrOOdOdOOjOjOOwwOwwOGwGwGG#CwCGCGCGCGCCvMCCMCMMMBCBMBuBMBuBMBMLBuBLB", +"RFtRFRFFFRFFFRFRFFtFRFtFtttttRttfFftftftftltlPlPllPllpplxlxpxpbpbpbbbrHrbrbzbrzrdrdrdddOddOdOdOOwOOwOwwOwGwGwGwGwGGGC#GCGCCvCCCvMCMChCMMMMBMBMBMBuBBuBLuBL", +"tFRFtFRFFFFRFFFtRFtFtFtRtFtfFftfttftftfltlflPtllPllplplppxpxpxpbHbprbbbrbrrrrzrrzdrddrOddOdOOjOOOwwOwOw#wwO#GGG#GCGCGCGCCvCCCvMCMCMMMMBhBMMhBMBuBBuBBBBBLB", +"fFtFtFtttttttttFtFtRfttftfFtfttftftftltfPltlllPlllpPpxpxppxpbpbbpHbbbHrbrbzrzrdrdrdrOdddOdOOOOjOwOwOwwGOwGGwGwGwCGGGGCGCvCCvCMCMCMMMMhMMhMBMBuBuBMBBuLuLBL", +"ttfttttRtRtFtfRftftftfttftftftftfltlPllltlPlPlllpPppppxpxpxpbHpbbbrHrrbrrrrzrzrdrdOdddOdOOdjOjOOwOwwOwwGwGwGG#GCwGC#CGCvCCGMCMCMMMChBCBMBMuBMBMBBuBLBBBLBL", +"tfttfftfftffttftttftftftftftftPltflPltPPlPlplpplpplxpxppxpbbpbbHbHbbrbrrrzrzrdrdddrdOddOdOOOwOOwOwwOw#OwwGwGGGGwCGCGCvCCGCMCCCMCCMMMMMCBhMBMBuBuBBuBuLuLBL", +"ftffttftftftftftfftftftfftlltlftlltlPlllplpPplppxpxpxpxbpbbpbbbrbrrbrrzrzrzdrddrddOddOdOOjOOOwwOwOwwwGGGwGG#GCwGGCGCGCGCCCvCMMCMMMhBCuMMBMBMBMBBMBBBBBLBLL", +"ltftffftftftfftfPtltltltlltPlPlllPlPlllPplplppxpxppxpbpHbpHbbHbHrbbrbrrzrrdrdrdddOddOdOdOOjOwOOwwwOGOwwwGwGwGwCGCGCGCvCCvCMCMCMMMMCMMBMBMBMBuBuBuBLuBLBLBg", +"PlPtltlltltltlltlflPlPlPlPllPtlPlplplpplpppxpxppxpxpbxpbbbbbprbrbrrrzrzrzdrdrOdrOdOdOOOjOjOOwOwOwwwwGwGwG#GCG#GCGCGCCCvCMCCMCMMCMhBMMhBMhBMBMBBuBLuBLBuLLL", +"ltllPltlPlPlPltPltltlfPlltlPlplplPlpPpPpplxpppxpxpbbpbbrpbHbrbrbrrrrzrrdrdrddddOddOdOdOdwOOwOwwwwOGwwGwGGwGwCGC#GCvCvCCGCMvCMCMhMMCBMBMMBMBuBBuBBBBLBLBLBg", +"lPlPllPlPlPllPlllPllPtllPplllPplpplpppxpxppxxpxpbpbpbbpbrbrrbrrrrzrzrzrdrddrOdrOOdOOOjOOOwwOwOwOw#wO#wGG#GCwGCGCCGCCGCCMCMCMMMMMhBMMhBMBhBuBuBBBMLuBLBLLLL", +"lllllPlPllPlPllPplpllppllplplplplpplxpxppxxppbpbpbHrbHbrbHbbrbzrzrrzrdrddrdddOdOdOOdOOjOwOOwOww#OwwGGGGwGGwCGGCGGCCvCCCMvCMCMCMMMMhMBMMBuBMBuBuBLBBLuLBLBg", +"lpPlPllllPlllPplPlpPpllpPplpppxpxpxppxpxpxpbxbbbbbpbbbbHrrrrrrrzrzrdrddrOdOdddOdOOdjOjOOwOwwwOwwGGGwGw#GCG#GCGCGCGCCCvCCMMCMMMhBCBMBMBhBMBBuBBBuLBLBLBLgLL", +"PplppppppppppplplplplppppppxlxpppxpxxpxpbpbpbpbpHbrHrbrrbrbzrzrrzrdrdrdOrdOrOOdOdjOOOwOwOwwOww#OwwGwGGGGwCGCGCGCCCCGCCMCMCMMCMMMMCBhMBMBuBuBBMBLBuBLBLLBLg", +"pppplplplplplppppppxpxlxxpxppxpxxpbppbbpbbbbbbHbrbbbrHrbrzrrzrzrdrdddddddOdOOdOOOOjOwOwOwOwwO#wGGwG#G#CGGGCGCGCvCvCMCMCMCMMMhMBChBMMBMBuBuBuBLBuBLLBLLgLLg", +"pxxpxpxpxpxpxpxpxpxpppxppxpxpxpxpbpbbpbbHbpHrprbbHrrbrrzrrrzrzrdrdrdrdrdddOdOOdjOOwOOwOwwwOwwGwwGwGwGGwCGC#GCvCCvCCvCMvCMMCMMMhMBMMBMBMBMBBBBuLBLBLBLBLBLg", +"xppxpxpxpxpxpxpxpxpxxpxpxpxpbpbpbHbHpbHprbbrbrbrrbrbrrrrzrzrdrddrdOddOOdOOdOdOOOjOOwwOwOwwGwGwGwGG#GCwGGCGCCGCGCCCvMCMCMMMMhBCBMhBhBMBuBBuBMLBBuLBuLLgLgLL", +"xpxpxpxpxpxpxpxpxpxpbpbpbbpbbbbbpbpbbbbbbbHbHrbbrrrrzrzrrdrdrddrddrdOdddOdOOjOjOOwOwOwOw#OwGOwGwGwGGG#GCGCGGCvCCGMCCMCMCMCMMMMMMBMBMBuBuBMBBLuBLBLLgBLBgLg", +"bpbpbpbpbpbpbpbpbpbpbxpbHpbHpHprbbbHbrHrbrrrbrrrbzrzrrzrzrddrdrOddOddOOdOOOOOjOwOwOwwO#wOGGwGGGG#GCwCGCGCGCCCCvCMCCMCMMMMhBCBhBMhBMBuBBuBBuLBBLBLBLBLgLLgL", +"pbbbbpbbpbbpbbpbHbbbpbbpbbbbbbbbbHbbHbrbrbbrrrbzrrzrrzrdrddrddddddddOdOOdOOjOwOOwOwwOwwwGwwwGwGwGG#GGCGC#CGCGCCvCMvCMCMCMMMhMMMBMBuBMBMBuBLBuLLuBLLLBLgLLg", +"bbpbbbbpbbpbbpbbpbpbbHbbHbprbrHrHbrrrbrbrrrbzrzrrzrzdrdddrddrOddOdOOdOOdjOjOOOwwOwOwwwOGwGGw#GG#CwCGCGGCGCvCCvCCCMCMMMMMhBCBMBMhBMBMBuBBBBuBBLBLLLBgLgLLgL", +"bHbbpbHbbHbbHrbHbbrbHbrbrbrbHbbrbrbbrrrrbrrzrzrrzrdrdrdrdOrOddOdJOdOOOjOOOOOwwOwOwwwOwGwGwwGGwGGGGC#GCGCvCCvCCMCMCMCMChMMMMMBhMBMBuBuBBMLuLBLuBLBgLLgLLgLg", +"bbrHrbrHrbrHbbHrbHbbrbHbrHrbrrbrrrrrbrzrzzrrzrddrdrdrdddrdddddOdOOOdOOOjOwOwOOwwwOww#wwGwGGG#GCwCGGCGCvCCGCCCGMCvMMMMMMBCBMhMBMBMBMBBuBLBBuLBLLLLLBgLLgLgL", +"rbrbrbrbrbrbrrbrbrrHrbrrbrbrbrrbrbrrrzrzrrzdrdrrddrddOrdddOdOOdOOdOOOjOOwOwOwwwOw#OGwwGwGwGwCGwCGGCGCGCCvCCvCMCMMMCMCMhMMCBMBMBMBuBBuBuBuLBBLBBgBLgLLgLgLg", +"rbrbrbrbrbrbrbrbrbrrrrrbrrrzrrzrzrzzrrzrzrrdrdddrdddrdOdOddOddOOdOjOjOOwOwOwOwOwwwGwGwGGG#GGGGCG#CGCGCGCCCvMCMCMCMMMMBCBMBMhBMBuBMBuBBBBBBLBLBLLLgLgLLgLgL", +"zrrrrrrrrrrrrrrrrrrbrbrrrzrrzrzrrzrrzdrdrddrddrddOrddOddOdOdOOOOOOOwOOwOwOwwww#OwGOGwGwGwGG#GCGGCGCGCvCCvCCCMCMCMMCMhMMMMhMBMBMBuBBuBLuLuBLuBLBLBLgLLgLgLg", +"rrzrzrzrzrzrzrzrzrzrzzrzrrzrrrzrdrdrdrdrdrdddrddddOdOdOdOdOOOOOjOjOOwwOwOwwOwO#GwGGwGGG#G#CwCw#CGCvCCCvCCMCMCMCMMMMBCBMBhBMBhBuBBuBBBuBBLLBLLLgLgLLgLgLgLg", +"rzrrzrrzrrzrrzrrzrrzrrzrzzrzdrdrdrddrdrddddrdddOrddOdOdOOOdOOjOOwOjwOwOwwOwOwGwwGwwGGwGwCGwCGGCGCGCCvCCvCCMCMCMMChMhMMhMBMBMBMBMBuLMBBLBLuLBLBLBLLgLLgLgLg", +"zrzrzrzrzrzrzrzrzrzrzrdrdrdrdzrddrdrddddrOddOJddOOOdOOOOdOOjOOjOjwOOwOwwww#GwwwGwG#Gw#GGGCGGCGCvCCvCCCCMCvMCMMMMMBCBMBMBMuBuBuBBuBBBuLBLBLBLLgLgLgLgLgLgLg", +"rdrdrdrdrdrdrdrdrdrdddrdrdrdrddrJdddOrJOddddddOOdOdOdOdOjOjOOwOwOwOwwwwOwOwGOGwGwGwGGGCGCGGCGCGCCvCvCGCCMMCMCMCMMMMMhMhMBMBMBMBuBBuBLBLuLBLBLBLLLgLLgLgLgg", +"drddrddrddrddrddrdrdrddrdddddrOddrdddOddrOOOdOddOOOOOOjOOjOwOjOwOwwwOwww#Gww#GGGGG#GCwGGCGCGCGCvCGCCCMCMCCMMMMMhBCBMBMBuBMBuBBuBBuBLuBLBLLLgLgLgLLggLgLgLg", +"ddrddrdddrddrddrdddddrddOrdrddddOdOJdddOOOdOdOOOdjOOjOOOwOOwOwOwwwwO#OwGOwGwGwGwGwCGGCGCGC#CvCGCCCMvCCMvMMCMCMCBMhMhMBMBMBMBuBBuBLBBBLBLBLBLBLgLgLgLgLgLgg" +] + +img1=None + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples2/trolltech.bmp b/python/pyqt/examples2/trolltech.bmp Binary files differnew file mode 100644 index 00000000..220861e2 --- /dev/null +++ b/python/pyqt/examples2/trolltech.bmp diff --git a/python/pyqt/examples2/trolltech.gif b/python/pyqt/examples2/trolltech.gif Binary files differnew file mode 100644 index 00000000..f674369e --- /dev/null +++ b/python/pyqt/examples2/trolltech.gif diff --git a/python/pyqt/examples2/tt-logo.png b/python/pyqt/examples2/tt-logo.png Binary files differnew file mode 100644 index 00000000..a0d9e340 --- /dev/null +++ b/python/pyqt/examples2/tt-logo.png diff --git a/python/pyqt/examples2/tut1.py b/python/pyqt/examples2/tut1.py new file mode 100755 index 00000000..2eca8c5d --- /dev/null +++ b/python/pyqt/examples2/tut1.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +# Qt tutorial 1. + +import sys +from qt import * + + +a = QApplication(sys.argv) + +hello = QPushButton("Hello world!",None) +hello.resize(100,30) + +a.setMainWidget(hello) +hello.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut10.py b/python/pyqt/examples2/tut10.py new file mode 100755 index 00000000..0470a85d --- /dev/null +++ b/python/pyqt/examples2/tut10.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python + +# Qt tutorial 10. + +import sys +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.f = 0 + self.setPalette(QPalette(QColor(250,250,200))) + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(),0) + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def force(self): + return self.f + + def setForce(self,newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(PYSIGNAL('forceChanged(int)'),(self.f,)) + + def paintEvent(self,ev): + if not ev.rect().intersects(self.cannonRect()): + return + + cr = self.cannonRect() + pix = QPixmap(cr.size()) + pix.fill(self,cr.topLeft()) + + p = QPainter(pix) + + p.setBrush(Qt.blue) + p.setPen(Qt.NoPen) + + p.translate(0,pix.height() - 1) + p.drawPie(QRect(-35,-35,70,70),0,90 * 16) + p.rotate(-self.ang) + p.drawRect(QRect(33,-4,15,8)) + p.end() + + p.begin(self) + p.drawPixmap(cr.topLeft(),pix) + + def cannonRect(self): + r = QRect(0,0,50,50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange(self,'angle') + self.angle.setRange(5,70) + + self.force = LCDRange(self,'force') + self.force.setRange(10,50) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce) + self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue) + + grid = QGridLayout(self,2,2,10) + + grid.addWidget(quit,0,0) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + leftBox = QVBoxLayout() + + grid.addLayout(leftBox,1,0) + + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,500,355) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut11.py b/python/pyqt/examples2/tut11.py new file mode 100755 index 00000000..32fb436d --- /dev/null +++ b/python/pyqt/examples2/tut11.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python + +# Qt tutorial 11. + +import sys +import math +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = QTimer(self,'movement handler') + self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + + self.setPalette(QPalette(QColor(250,250,200))) + + self.barrelRect = QRect(33,-4,15,8) + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(),0) + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def force(self): + return self.f + + def setForce(self,newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(PYSIGNAL('forceChanged(int)'),(self.f,)) + + def shoot(self): + if self.autoShootTimer.isActive(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + + def moveShot(self): + r = QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + else: + r = r.unite(QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self,ev): + updateR = ev.rect() + p = QPainter(self) + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.autoShootTimer.isActive() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + def paintShot(self,p): + p.setBrush(Qt.black) + p.setPen(Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintCannon(self,p): + cr = self.cannonRect() + pix = QPixmap(cr.size()) + pix.fill(self,cr.topLeft()) + + tmp = QPainter(pix) + tmp.setBrush(Qt.blue) + tmp.setPen(Qt.NoPen) + + tmp.translate(0,pix.height() - 1) + tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(),pix) + + def cannonRect(self): + r = QRect(0,0,50,50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = QRect(0,0,6,6) + r.moveCenter(QPoint(x,self.height() - 1 - y)) + return r + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange(self,'angle') + self.angle.setRange(5,70) + + self.force = LCDRange(self,'force') + self.force.setRange(10,50) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce) + self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue) + + shoot = QPushButton('&Shoot',self,'shoot') + shoot.setFont(QFont('Times',18,QFont.Bold)) + self.connect(shoot,SIGNAL('clicked()'),self.cannonField.shoot) + + grid = QGridLayout(self,2,2,10) + + grid.addWidget(quit,0,0) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + leftBox = QVBoxLayout() + grid.addLayout(leftBox,1,0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = QHBoxLayout() + grid.addLayout(topBox,0,1) + topBox.addWidget(shoot) + topBox.addStretch(1) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,500,355) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut12.py b/python/pyqt/examples2/tut12.py new file mode 100755 index 00000000..65490cab --- /dev/null +++ b/python/pyqt/examples2/tut12.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python + +# Qt tutorial 12. + +import sys +import math +import random +from qt import * + + +class LCDRange(QVBox): + def __init__(self,s=None,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + + self.label = QLabel(' ',self,'label') + self.label.setAlignment(Qt.AlignCenter) + + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + def text(self): + return self.label.text() + + def setText(self,s): + self.label.setText(s) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = QTimer(self,'movement handler') + self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = QPoint(0,0) + + self.setPalette(QPalette(QColor(250,250,200))) + + self.barrelRect = QRect(33,-4,15,8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(),0) + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def force(self): + return self.f + + def setForce(self,newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(PYSIGNAL('forceChanged(int)'),(self.f,)) + + def shoot(self): + if self.autoShootTimer.isActive(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + + def newTarget(self): + r = QRegion(self.targetRect()) + self.target = QPoint(random.randint(200,390),random.randint(10,265)) + self.repaint(r.unite(QRegion(self.targetRect()))) + + def moveShot(self): + r = QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('hit()'),()) + elif shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('missed()'),()) + else: + r = r.unite(QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self,ev): + updateR = ev.rect() + p = QPainter(self) + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.autoShootTimer.isActive() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self,p): + p.setBrush(Qt.black) + p.setPen(Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self,p): + p.setBrush(Qt.red) + p.setPen(Qt.black) + p.drawRect(self.targetRect()) + + def paintCannon(self,p): + cr = self.cannonRect() + pix = QPixmap(cr.size()) + pix.fill(self,cr.topLeft()) + + tmp = QPainter(pix) + tmp.setBrush(Qt.blue) + tmp.setPen(Qt.NoPen) + + tmp.translate(0,pix.height() - 1) + tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(),pix) + + def cannonRect(self): + r = QRect(0,0,50,50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = QRect(0,0,6,6) + r.moveCenter(QPoint(x,self.height() - 1 - y)) + return r + + def targetRect(self): + r = QRect(0,0,20,10) + r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y())) + return r + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange('ANGLE',self,'angle') + self.angle.setRange(5,70) + + self.force = LCDRange('FORCE',self,'force') + self.force.setRange(10,50) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce) + self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue) + + shoot = QPushButton('&Shoot',self,'shoot') + shoot.setFont(QFont('Times',18,QFont.Bold)) + self.connect(shoot,SIGNAL('clicked()'),self.cannonField.shoot) + + grid = QGridLayout(self,2,2,10) + + grid.addWidget(quit,0,0) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + leftBox = QVBoxLayout() + grid.addLayout(leftBox,1,0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = QHBoxLayout() + grid.addLayout(topBox,0,1) + topBox.addWidget(shoot) + topBox.addStretch(1) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,500,355) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut13.py b/python/pyqt/examples2/tut13.py new file mode 100755 index 00000000..7231a7ab --- /dev/null +++ b/python/pyqt/examples2/tut13.py @@ -0,0 +1,329 @@ +#!/usr/bin/env python + +# Qt tutorial 13. + +import sys +import math +import random +from qt import * + + +class LCDRange(QWidget): + def __init__(self,s=None,parent=None,name=None): + QWidget.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + + self.label = QLabel(' ',self,'label') + self.label.setAlignment(Qt.AlignCenter) + + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + l = QVBoxLayout(self) + l.addWidget(lcd,1) + l.addWidget(self.slider) + l.addWidget(self.label) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + def text(self): + return self.label.text() + + def setText(self,s): + self.label.setText(s) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = QTimer(self,'movement handler') + self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = QPoint(0,0) + self.gameEnded = 0 + + self.setPalette(QPalette(QColor(250,250,200))) + + self.barrelRect = QRect(33,-4,15,8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(),0) + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def force(self): + return self.f + + def setForce(self,newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(PYSIGNAL('forceChanged(int)'),(self.f,)) + + def shoot(self): + if self.isShooting(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + self.emit(PYSIGNAL('canShoot(bool)'),(0,)) + + def newTarget(self): + r = QRegion(self.targetRect()) + self.target = QPoint(random.randint(200,390),random.randint(10,265)) + self.repaint(r.unite(QRegion(self.targetRect()))) + + def gameOver(self): + return self.gameEnded + + def setGameOver(self): + if self.gameEnded: + return + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 1 + self.repaint() + + def restartGame(self): + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 0 + self.repaint() + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + + def moveShot(self): + r = QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('hit()'),()) + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + elif shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('missed()'),()) + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + else: + r = r.unite(QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self,ev): + updateR = ev.rect() + p = QPainter(self) + + if self.gameEnded: + p.setPen(Qt.black) + p.setFont(QFont('Courier',48,QFont.Bold)) + p.drawText(self.rect(),Qt.AlignCenter,'Game Over') + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.isShooting() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if not self.gameEnded and updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self,p): + p.setBrush(Qt.black) + p.setPen(Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self,p): + p.setBrush(Qt.red) + p.setPen(Qt.black) + p.drawRect(self.targetRect()) + + def paintCannon(self,p): + cr = self.cannonRect() + pix = QPixmap(cr.size()) + pix.fill(self,cr.topLeft()) + + tmp = QPainter(pix) + tmp.setBrush(Qt.blue) + tmp.setPen(Qt.NoPen) + + tmp.translate(0,pix.height() - 1) + tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(),pix) + + def cannonRect(self): + r = QRect(0,0,50,50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = QRect(0,0,6,6) + r.moveCenter(QPoint(x,self.height() - 1 - y)) + return r + + def targetRect(self): + r = QRect(0,0,20,10) + r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y())) + return r + + def isShooting(self): + return self.autoShootTimer.isActive() + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class GameBoard(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange('ANGLE',self,'angle') + self.angle.setRange(5,70) + + self.force = LCDRange('FORCE',self,'force') + self.force.setRange(10,50) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce) + self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue) + + self.connect(self.cannonField,PYSIGNAL('hit()'),self.hit) + self.connect(self.cannonField,PYSIGNAL('missed()'),self.missed) + + self.shoot = QPushButton('&Shoot',self,'shoot') + self.shoot.setFont(QFont('Times',18,QFont.Bold)) + self.connect(self.shoot,SIGNAL('clicked()'),self.fire) + self.connect(self.cannonField,PYSIGNAL('canShoot(bool)'),self.shoot,SLOT('setEnabled(bool)')) + + restart = QPushButton('&New Game',self,'newgame') + restart.setFont(QFont('Times',18,QFont.Bold)) + self.connect(restart,SIGNAL('clicked()'),self.newGame) + + self.hits = QLCDNumber(2,self,'hits') + self.shotsLeft = QLCDNumber(2,self,'shotsleft') + hitsL = QLabel('HITS',self,'hitsLabel') + shotsLeftL = QLabel('SHOTS LEFT',self,'shotsleftLabel') + + grid = QGridLayout(self,2,2,10) + grid.addWidget(quit,0,0) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + leftBox = QVBoxLayout() + grid.addLayout(leftBox,1,0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = QHBoxLayout() + grid.addLayout(topBox,0,1) + topBox.addWidget(self.shoot) + topBox.addWidget(self.hits) + topBox.addWidget(hitsL) + topBox.addWidget(self.shotsLeft) + topBox.addWidget(shotsLeftL) + topBox.addStretch(1) + topBox.addWidget(restart) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + self.newGame() + + def fire(self): + if self.cannonField.gameOver() or self.cannonField.isShooting(): + return + self.shotsLeft.display(self.shotsLeft.intValue() - 1) + self.cannonField.shoot() + + def hit(self): + self.hits.display(self.hits.intValue() + 1) + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + else: + self.cannonField.newTarget() + + def missed(self): + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + + def newGame(self): + self.shotsLeft.display(15) + self.hits.display(0) + self.cannonField.restartGame() + self.cannonField.newTarget() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +gb = GameBoard() +gb.setGeometry(100,100,500,355) +a.setMainWidget(gb) +gb.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut14.py b/python/pyqt/examples2/tut14.py new file mode 100755 index 00000000..aeb4ca61 --- /dev/null +++ b/python/pyqt/examples2/tut14.py @@ -0,0 +1,377 @@ +#!/usr/bin/env python + +# Qt tutorial 14. + +import sys +import math +import random +from qt import * + + +class LCDRange(QWidget): + def __init__(self,s=None,parent=None,name=None): + QWidget.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + + self.label = QLabel(' ',self,'label') + self.label.setAlignment(Qt.AlignCenter) + + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + l = QVBoxLayout(self) + l.addWidget(lcd,1) + l.addWidget(self.slider) + l.addWidget(self.label) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + def text(self): + return self.label.text() + + def setText(self,s): + self.label.setText(s) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = QTimer(self,'movement handler') + self.connect(self.autoShootTimer,SIGNAL('timeout()'),self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = QPoint(0,0) + self.gameEnded = 0 + self.barrelPressed = 0 + + self.setPalette(QPalette(QColor(250,250,200))) + + self.barrelRect = QRect(33,-4,15,8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(),0) + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def force(self): + return self.f + + def setForce(self,newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(PYSIGNAL('forceChanged(int)'),(self.f,)) + + def shoot(self): + if self.isShooting(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + self.emit(PYSIGNAL('canShoot(bool)'),(0,)) + + def newTarget(self): + r = QRegion(self.targetRect()) + self.target = QPoint(random.randint(200,390),random.randint(10,265)) + self.repaint(r.unite(QRegion(self.targetRect()))) + + def gameOver(self): + return self.gameEnded + + def setGameOver(self): + if self.gameEnded: + return + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 1 + self.repaint() + + def restartGame(self): + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 0 + self.repaint() + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + + def moveShot(self): + r = QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('hit()'),()) + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + elif shotR.x() > self.width() or shotR.y() > self.height() or shotR.intersects(self.barrierRect()): + self.autoShootTimer.stop() + self.emit(PYSIGNAL('missed()'),()) + self.emit(PYSIGNAL('canShoot(bool)'),(1,)) + else: + r = r.unite(QRegion(shotR)) + + self.repaint(r) + + def mousePressEvent(self,ev): + if ev.button() != Qt.LeftButton: + return + if self.barrelHit(ev.pos()): + self.barrelPressed = 1 + + def mouseMoveEvent(self,ev): + if not self.barrelPressed: + return + pnt = ev.pos() + if pnt.x() <= 0: + pnt.setX(1) + if pnt.y() >= self.height(): + pnt.setY(self.height() - 1) + rad = math.atan(float(self.rect().bottom() - pnt.y()) / pnt.x()) + self.setAngle(int(round(rad * 180 / math.pi))) + + def mouseReleaseEvent(self,ev): + if ev.button() == Qt.LeftButton: + self.barrelPressed = 0 + + def paintEvent(self,ev): + updateR = ev.rect() + p = QPainter(self) + + if self.gameEnded: + p.setPen(Qt.black) + p.setFont(QFont('Courier',48,QFont.Bold)) + p.drawText(self.rect(),Qt.AlignCenter,'Game Over') + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if updateR.intersects(self.barrierRect()): + self.paintBarrier(p) + + if self.isShooting() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if not self.gameEnded and updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self,p): + p.setBrush(Qt.black) + p.setPen(Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self,p): + p.setBrush(Qt.red) + p.setPen(Qt.black) + p.drawRect(self.targetRect()) + + def paintBarrier(self,p): + p.setBrush(Qt.yellow) + p.setPen(Qt.black) + p.drawRect(self.barrierRect()) + + def paintCannon(self,p): + cr = self.cannonRect() + pix = QPixmap(cr.size()) + pix.fill(self,cr.topLeft()) + + tmp = QPainter(pix) + tmp.setBrush(Qt.blue) + tmp.setPen(Qt.NoPen) + + tmp.translate(0,pix.height() - 1) + tmp.drawPie(QRect(-35,-35,70,70),0,90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(),pix) + + def cannonRect(self): + r = QRect(0,0,50,50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * math.pi / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = QRect(0,0,6,6) + r.moveCenter(QPoint(x,self.height() - 1 - y)) + return r + + def targetRect(self): + r = QRect(0,0,20,10) + r.moveCenter(QPoint(self.target.x(),self.height() - 1 - self.target.y())) + return r + + def barrierRect(self): + return QRect(145,self.height() - 100,15,100) + + def barrelHit(self,p): + mtx = QWMatrix() + mtx.translate(0,self.height() - 1) + mtx.rotate(-self.ang) + (mtx, invertable) = mtx.invert() + return self.barrelRect.contains(mtx.map(p)) + + def isShooting(self): + return self.autoShootTimer.isActive() + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class GameBoard(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange('ANGLE',self,'angle') + self.angle.setRange(5,70) + + self.force = LCDRange('FORCE',self,'force') + self.force.setRange(10,50) + + box = QVBox(self,'cannonFrame') + box.setFrameStyle(QFrame.WinPanel | QFrame.Sunken) + + self.cannonField = CannonField(box,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce) + self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue) + + self.connect(self.cannonField,PYSIGNAL('hit()'),self.hit) + self.connect(self.cannonField,PYSIGNAL('missed()'),self.missed) + + self.shoot = QPushButton('&Shoot',self,'shoot') + self.shoot.setFont(QFont('Times',18,QFont.Bold)) + self.connect(self.shoot,SIGNAL('clicked()'),self.fire) + self.connect(self.cannonField,PYSIGNAL('canShoot(bool)'),self.shoot,SLOT('setEnabled(bool)')) + + restart = QPushButton('&New Game',self,'newgame') + restart.setFont(QFont('Times',18,QFont.Bold)) + self.connect(restart,SIGNAL('clicked()'),self.newGame) + + self.hits = QLCDNumber(2,self,'hits') + self.shotsLeft = QLCDNumber(2,self,'shotsleft') + hitsL = QLabel('HITS',self,'hitsLabel') + shotsLeftL = QLabel('SHOTS LEFT',self,'shotsleftLabel') + + accel = QAccel(self) + accel.connectItem(accel.insertItem(Qt.Key_Enter),self.fire) + accel.connectItem(accel.insertItem(Qt.Key_Return),self.fire) + accel.connectItem(accel.insertItem(Qt.CTRL + Qt.Key_Q),qApp,SLOT('quit()')) + + grid = QGridLayout(self,2,2,10) + grid.addWidget(quit,0,0) + grid.addWidget(box,1,1) + grid.setColStretch(1,10) + + leftBox = QVBoxLayout() + grid.addLayout(leftBox,1,0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = QHBoxLayout() + grid.addLayout(topBox,0,1) + topBox.addWidget(self.shoot) + topBox.addWidget(self.hits) + topBox.addWidget(hitsL) + topBox.addWidget(self.shotsLeft) + topBox.addWidget(shotsLeftL) + topBox.addStretch(1) + topBox.addWidget(restart) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + self.newGame() + + def fire(self): + if self.cannonField.gameOver() or self.cannonField.isShooting(): + return + self.shotsLeft.display(self.shotsLeft.intValue() - 1) + self.cannonField.shoot() + + def hit(self): + self.hits.display(self.hits.intValue() + 1) + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + else: + self.cannonField.newTarget() + + def missed(self): + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + + def newGame(self): + self.shotsLeft.display(15) + self.hits.display(0) + self.cannonField.restartGame() + self.cannonField.newTarget() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +gb = GameBoard() +gb.setGeometry(100,100,500,355) +a.setMainWidget(gb) +gb.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut2.py b/python/pyqt/examples2/tut2.py new file mode 100755 index 00000000..a31b7842 --- /dev/null +++ b/python/pyqt/examples2/tut2.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Qt tutorial 2. + +import sys +from qt import * + + +a = QApplication(sys.argv) + +quit = QPushButton("Quit",None) +quit.resize(75,30) +quit.setFont(QFont("Times",18,QFont.Bold)) + +QObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()")) + +a.setMainWidget(quit) +quit.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut3.py b/python/pyqt/examples2/tut3.py new file mode 100755 index 00000000..2cc3576c --- /dev/null +++ b/python/pyqt/examples2/tut3.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# Qt tutorial 3. + +import sys +from qt import * + +a = QApplication(sys.argv) + +box = QVBox() +box.resize(200,120) + +quit = QPushButton("Quit",box) +quit.setFont(QFont("Times",18,QFont.Bold)) + +QObject.connect(quit,SIGNAL("clicked()"),a,SLOT("quit()")) + +a.setMainWidget(box) +box.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut4.py b/python/pyqt/examples2/tut4.py new file mode 100755 index 00000000..23c44d0e --- /dev/null +++ b/python/pyqt/examples2/tut4.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Qt tutorial 4. + +import sys +from qt import * + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.setMinimumSize(200,120) + self.setMaximumSize(200,120) + + quit = QPushButton("Quit",self,"quit") + quit.setGeometry(62,40,75,30) + quit.setFont(QFont("Times",18,QFont.Bold)) + + self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")) + + +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,200,120) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut5.py b/python/pyqt/examples2/tut5.py new file mode 100755 index 00000000..01c20aa0 --- /dev/null +++ b/python/pyqt/examples2/tut5.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Qt tutorial 5. + +import sys +from qt import * + + +class MyWidget(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + quit = QPushButton("Quit",self,"quit") + quit.setFont(QFont("Times",18,QFont.Bold)) + + self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")) + + lcd = QLCDNumber(2,self,"lcd") + + slider = QSlider(Qt.Horizontal,self,"slider") + slider.setRange(0,99) + slider.setValue(0) + + self.connect(slider,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) + + +a = QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut6.py b/python/pyqt/examples2/tut6.py new file mode 100755 index 00000000..38f07d8b --- /dev/null +++ b/python/pyqt/examples2/tut6.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Qt tutorial 6. + +import sys +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,"lcd") + slider = QSlider(Qt.Horizontal,self,"slider") + slider.setRange(0,99) + slider.setValue(0) + self.connect(slider,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)")) + + +class MyWidget(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + quit = QPushButton("Quit",self,"quit") + quit.setFont(QFont("Times",18,QFont.Bold)) + + self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")) + + grid = QGrid(4,self) + + for c in range(4): + for r in range(4): + LCDRange(grid) + + +a = QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut7.py b/python/pyqt/examples2/tut7.py new file mode 100755 index 00000000..d40ae749 --- /dev/null +++ b/python/pyqt/examples2/tut7.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Qt tutorial 7. + +import sys +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + +class MyWidget(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + quit = QPushButton("Quit",self,"quit") + quit.setFont(QFont("Times",18,QFont.Bold)) + + self.connect(quit,SIGNAL("clicked()"),qApp,SLOT("quit()")) + + grid = QGrid(4,self) + + self.lcdlist = [] + previous = None + + for r in range(4): + for c in range(4): + lr = LCDRange(grid) + + if previous is not None: + self.connect(lr,PYSIGNAL("valueChanged(int)"),previous.setValue) + + previous = lr + self.lcdlist.append(lr) + + +a = QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut8.py b/python/pyqt/examples2/tut8.py new file mode 100755 index 00000000..045a4ef9 --- /dev/null +++ b/python/pyqt/examples2/tut8.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python + +# Qt tutorial 8. + +import sys +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.setPalette(QPalette(QColor(250,250,200))) + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint() + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def paintEvent(self,ev): + p = QPainter(self) + p.drawText(200,200,'Angle = %d' % (self.ang)) + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange(self,'angle') + self.angle.setRange(5,70) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + grid = QGridLayout(self,2,2,10) + + grid.addWidget(quit,0,0) + grid.addWidget(self.angle,1,0,Qt.AlignTop) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + self.angle.setValue(60) + self.angle.setFocus() + + +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,500,355) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/tut9.py b/python/pyqt/examples2/tut9.py new file mode 100755 index 00000000..16c7d697 --- /dev/null +++ b/python/pyqt/examples2/tut9.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python + +# Qt tutorial 9. + +import sys +from qt import * + + +class LCDRange(QVBox): + def __init__(self,parent=None,name=None): + QVBox.__init__(self,parent,name) + + lcd = QLCDNumber(2,self,'lcd') + self.slider = QSlider(Qt.Horizontal,self,'slider') + self.slider.setRange(0,99) + self.slider.setValue(0) + self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) + self.connect(self.slider,SIGNAL('valueChanged(int)'),self,PYSIGNAL('valueChanged(int)')) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self,value): + self.slider.setValue(value) + + def setRange(self,minVal,maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, 'LCDRange.setRange(): invalid range' + self.slider.setRange(minVal,maxVal) + + +class CannonField(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + self.ang = 45 + self.setPalette(QPalette(QColor(250,250,200))) + + def angle(self): + return self.ang + + def setAngle(self,degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint() + self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) + + def paintEvent(self,ev): + p = QPainter(self) + + p.setBrush(Qt.blue) + p.setPen(Qt.NoPen) + + p.translate(0,self.rect().bottom()) + p.drawPie(QRect(-35,-35,70,70),0,90 * 16) + p.rotate(-self.ang) + p.drawRect(QRect(33,-4,15,8)) + + def sizePolicy(self): + return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + + +class MyWidget(QWidget): + def __init__(self,parent=None,name=None): + QWidget.__init__(self,parent,name) + + quit = QPushButton('&Quit',self,'quit') + quit.setFont(QFont('Times',18,QFont.Bold)) + self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) + + self.angle = LCDRange(self,'angle') + self.angle.setRange(5,70) + + self.cannonField = CannonField(self,'cannonField') + + self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) + self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) + + grid = QGridLayout(self,2,2,10) + + grid.addWidget(quit,0,0) + grid.addWidget(self.angle,1,0,Qt.AlignTop) + grid.addWidget(self.cannonField,1,1) + grid.setColStretch(1,10) + + self.angle.setValue(60) + self.angle.setFocus() + + +QApplication.setColorSpec(QApplication.CustomColor) +a = QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100,100,500,355) +a.setMainWidget(w) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples2/widgets.py b/python/pyqt/examples2/widgets.py new file mode 100755 index 00000000..7b85ab35 --- /dev/null +++ b/python/pyqt/examples2/widgets.py @@ -0,0 +1,512 @@ +#!/usr/bin/env python + + +import sys, string +from qt import * + +# +## Constructs an analog clock widget that uses an internal QTimer. +# +def QMIN( x, y ): + if y > x: + return y + return x + +# +## Constructs an analog clock widget that uses an internal QTimer. +# + +class AnalogClock( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + self.time = QTime.currentTime() # get current time + internalTimer = QTimer( self ) # create internal timer + self.connect( internalTimer, SIGNAL("timeout()"), self.timeout ) + internalTimer.start( 5000 ) # emit signal every 5 seconds + +# +## The QTimer::timeout() signal is received by this slot. +# + + def timeout( self ): + new_time = QTime.currentTime() # get the current time + if new_time.minute() != self.time.minute(): # minute has changed + self.update() + +# +## The clock is painted using a 1000x1000 square coordinate system. +# + def paintEvent( self, qe ): # paint clock + if not self.isVisible(): # is is invisible + return + self.time = QTime.currentTime() # save current time + + pts = QPointArray() + paint = QPainter( self ) + paint.setBrush( self.foregroundColor() ) # fill with foreground color + + cp = QPoint( self.rect().center() ) # widget center point + d = QMIN( self.width(), self.height() ) # we want a circular clock + + matrix = QWMatrix() # setup transformation matrix + matrix.translate( cp.x(), cp.y() ) # origin at widget center + matrix.scale( d / 1000.0, d / 1000.0 ) # scale coordinate system + + h_angle = 30 * ( self.time.hour() % 12 - 3 ) + self.time.minute() / 2 + matrix.rotate( h_angle ) # rotate to draw hour hand + paint.setWorldMatrix( matrix ) + pts.setPoints( [ -20,0, 0,-20, 300,0, 0,20 ] ) + paint.drawPolygon( pts ) # draw hour hand + matrix.rotate( -h_angle ) # rotate back to zero + + m_angle = ( self.time.minute() - 15 ) * 6 + matrix.rotate( m_angle ) # rotate to draw minute hand + paint.setWorldMatrix( matrix ) + pts.setPoints( [ -10,0, 0,-10, 400,0, 0,10 ] ) + paint.drawPolygon( pts ) # draw minute hand + matrix.rotate( -m_angle ) # rotate back to zero + + for i in range( 0, 12 ): # draw hour lines + paint.setWorldMatrix( matrix ) + paint.drawLine( 450,0, 500,0 ) + matrix.rotate( 30 ) + + +class DigitalClock( QLCDNumber ): + def __init__( self, *args ): + apply( QLCDNumber.__init__,(self,) + args ) + self.showingColon = 0 + self.setFrameStyle(QFrame.Panel | QFrame.Raised) + self.setLineWidth( 2 ) + self.showTime() + self.normalTimer = self.startTimer( 500 ) + self.showDateTimer = -1 + + def timerEvent( self, e ): + if e.timerId() == self.showDateTimer: + self.stopDate() + else: + if self.showDateTimer == -1: + self.showTime() + + def mousePressEvent( self, e ): + if e.button() == Qt.LeftButton: + self.showDate() + + def showDate( self ): + if self.showDateTimer != -1: + return + d = QDate.currentDate() + self.display('%2d %2d' % (d.month(), d.day())) + self.showDateTimer = self.startTimer(2000) + + def stopDate( self ): + self.killTimer(self.showDateTimer) + self.showDateTimer = -1 + self.showTime() + + def showTime( self ): + self.showingColon = not self.showingColon + s = list(str(QTime.currentTime().toString())[:5]) #.left(5) + if not self.showingColon: + s[2] = ' ' + if s[0] == '0': + s[0] = ' ' + s = string.join(s,'') + self.display( s ) + + def QMIN( x, y ): + if y > x: + return y + return x + +TRUE = 1 +FALSE = 0 +MOVIEFILENAME = "trolltech.gif" + +# +# WidgetView contains lots of Qt widgets. +# + +class WidgetView ( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + + # Set the window caption/title + self.setCaption( "Qt Widgets Demo Application" ) + + # Install an application-global event filter + qApp.installEventFilter( self ) + + # Create a layout to position the widgets + self.topLayout = QVBoxLayout( self, 10 ) + + # Create a grid layout to hold most of the widgets + self.grid = QGridLayout( 6, 3 ) + + # This layout will get all of the stretch + self.topLayout.addLayout( self.grid, 10 ) + + # Create a menubar + self.menubar = QMenuBar( self ) + #self.menubar.setSeparator( QMenuBar.InWindowsStyle ) + self.menubar.setSeparator( 1 ) + + # Create an easter egg + QToolTip.add( self.menubar, QRect( 0, 0, 2, 2 ), "easter egg" ) + + self.popup = QPopupMenu() + self.id = self.popup.insertItem( "&New" ) + self.popup.setItemEnabled( self.id, FALSE ) + self.id = self.popup.insertItem( "&Open" ) + self.popup.setItemEnabled( self.id, FALSE ) + self.popup.insertSeparator() + self.popup.insertItem( "&Quit", qApp, SLOT("quit()"), Qt.CTRL+Qt.Key_Q ) + + self.menubar.insertItem( "&File", self.popup ) + + # Must tell the layout about a menubar in a widget + self.topLayout.setMenuBar( self.menubar ) + + # Create an analog and a digital clock + self.aclock = AnalogClock( self ) + self.aclock.resize( 50, 50 ) + self.dclock = DigitalClock( self ) + self.dclock.setMaximumWidth( 200 ) + self.grid.addWidget( self.aclock, 0, 2 ) + self.grid.addWidget( self.dclock, 1, 2 ) + + # Give the dclock widget a blue palette + col = QColor() + col.setRgb( 0xaa, 0xbe, 0xff ) + self.dclock.setPalette( QPalette( col ) ) + + # make tool tips for both of them + QToolTip.add( self.aclock, "custom widget: analog clock" ) + QToolTip.add( self.dclock, "custom widget: digital clock" ) + + # Create a push button. + self.pb = QPushButton( self, "button1" ) # create button 1 + self.pb.setText( "Push button 1" ) + self.pb.setFixedHeight( self.pb.sizeHint().height() ) + self.grid.addWidget( self.pb, 0, 0, Qt.AlignVCenter ) + self.connect( self.pb, SIGNAL("clicked()"), self.button1Clicked ) + QToolTip.add( self.pb, "push button 1" ) + self.pm = QPixmap() + self.pix = self.pm.load( "qt.png" ) # load pixmap for button 2 + if not self.pix: + QMessageBox.information( None, "Qt Widgets Example", + "Could not load the file \"qt.png\", which\n" + "contains an icon used...\n\n" + "The text \"line 42\" will be substituted.", + QMessageBox.Ok + QMessageBox.Default ) + + # Create a label containing a QMovie + self.movielabel = QLabel( self, "label0" ) + self.movie = QMovie( MOVIEFILENAME ) + self.movie.connectStatus( self.movieStatus ) + self.movie.connectUpdate( self.movieUpdate ) + self.movielabel.setFrameStyle( QFrame.Box | QFrame.Plain ) + self.movielabel.setMovie( self.movie ) + self.movielabel.setMargin( 0 ) + self.movielabel.setFixedSize( 128 + self.movielabel.frameWidth() * 2, + 64 + self.movielabel.frameWidth() * 2 ) + self.grid.addWidget( self.movielabel, 0, 1, Qt.AlignCenter ) + QToolTip.add( self.movielabel, "movie" ) + + # Create a group of check boxes + self.bg = QButtonGroup( self, "checkGroup" ) + self.bg.setTitle( "Check Boxes" ) + self.grid.addWidget( self.bg, 1, 0 ) + + # Create a layout for the check boxes + self.vbox = QVBoxLayout(self.bg, 10) + + self.vbox.addSpacing( self.bg.fontMetrics().height() ) + + self.cb = range(3) + self.cb[0] = QCheckBox( self.bg ) + self.cb[0].setText( "Read" ) + self.vbox.addWidget( self.cb[0] ) + self.cb[0].setMinimumSize( self.cb[0].sizeHint() ) + self.cb[1] = QCheckBox( self.bg ) + self.cb[1].setText( "Write" ) + self.vbox.addWidget( self.cb[1] ) + self.cb[1].setMinimumSize( self.cb[1].sizeHint() ) + self.cb[2] = QCheckBox( self.bg ) + self.cb[2].setText( "Execute" ) + self.cb[2].setMinimumSize( self.cb[2].sizeHint() ) + self.vbox.addWidget( self.cb[2] ) + self.bg.setMinimumSize( self.bg.childrenRect().size() ) + self.vbox.activate() + + self.connect( self.bg, SIGNAL("clicked(int)"), self.checkBoxClicked ) + + QToolTip.add( self.cb[0], "check box 1" ) + QToolTip.add( self.cb[1], "check box 2" ) + QToolTip.add( self.cb[2], "check box 3" ) + + # Create a group of radio buttons + self.bg = QButtonGroup( self, "radioGroup" ) + self.bg.setTitle( "Radio buttons" ) + + self.grid.addWidget( self.bg, 1, 1 ) + + # Create a layout for the radio buttons + self.vbox = QVBoxLayout( self.bg, 10 ) + + self.vbox.addSpacing( self.bg.fontMetrics().height() ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&AM" ) + self.rb.setChecked( TRUE ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + QToolTip.add( self.rb, "radio button 1" ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&FM" ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + QToolTip.add( self.rb, "radio button 2" ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&Short Wave" ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + self.vbox.activate() + + self.connect( self.bg, SIGNAL("clicked(int)"), self.radioButtonClicked ) + QToolTip.add( self.rb, "radio button 3" ) + + # Create a list box + self.lb = QListBox( self, "listBox" ) + for i in range( 0, 100, 1 ): # fill list box + txt = QString() + txt = "line %d" % i + if i == 42 and self.pix: + self.lb.insertItem( self.pm ) + else: + self.lb.insertItem( txt ) + + self.grid.addMultiCellWidget( self.lb, 2, 4, 0, 0 ) + self.connect( self.lb, SIGNAL("selected(int)"), self.listBoxItemSelected ) + QToolTip.add( self.lb, "list box" ) + + self.vbox = QVBoxLayout( 8 ) + self.grid.addLayout( self.vbox, 2, 1 ) + + # Create a slider + self.sb = QSlider( 0, 300, 1, 100, QSlider.Horizontal, self, "Slider" ) + #self.sb.setTickmarks( QSlider.Below ) + self.sb.setTickmarks( 1 ) + self.sb.setTickInterval( 10 ) + #self.sb.setFocusPolicy( QWidget.TabFocus ) + self.sb.setFocusPolicy( 1 ) + self.sb.setFixedHeight( self.sb.sizeHint().height() ) + self.vbox.addWidget( self.sb ) + + self.connect( self.sb, SIGNAL("valueChanged(int)"), self.sliderValueChanged ) + QToolTip.add( self.sb, "slider" ) + + # Create a combo box + self.combo = QComboBox( FALSE, self, "comboBox" ) + self.combo.insertItem( "darkBlue" ) + self.combo.insertItem( "darkRed" ) + self.combo.insertItem( "darkGreen" ) + self.combo.insertItem( "blue" ) + self.combo.insertItem( "red" ) + self.combo.setFixedHeight( self.combo.sizeHint().height() ) + self.vbox.addWidget( self.combo ) + self.connect( self.combo, SIGNAL("activated(int)"), self.comboBoxItemActivated ) + QToolTip.add( self.combo, "read-only combo box" ) + + # Create an editable combo box + self.edCombo = QComboBox( TRUE, self, "edComboBox" ) + self.edCombo.insertItem( "Permutable" ) + self.edCombo.insertItem( "Malleable" ) + self.edCombo.insertItem( "Adaptable" ) + self.edCombo.insertItem( "Alterable" ) + self.edCombo.insertItem( "Inconstant" ) + self.edCombo.setFixedHeight( self.edCombo.sizeHint().height() ) + self.vbox.addWidget( self.edCombo ) + self.connect( self.edCombo, SIGNAL("activated(const QString &)"), self.edComboBoxItemActivated) + QToolTip.add( self.edCombo, "editable combo box" ) + + self.edCombo.setAutoCompletion( TRUE ) + + self.vbox.addStretch( 1 ) + + self.vbox = QVBoxLayout( 8 ) + self.grid.addLayout( self.vbox, 2, 2 ) + + # Create a spin box + self.spin = QSpinBox( 0, 10, 1, self, "spin" ) + self.spin.setSuffix( " mm" ) + self.spin.setSpecialValueText( "Auto" ) + self.spin.setMinimumSize( self.spin.sizeHint() ) + self.connect( self.spin, SIGNAL( "valueChanged(const QString &)" ), self.spinBoxValueChanged ) + QToolTip.add( self.spin, "spin box" ) + self.vbox.addWidget( self.spin ) + + self.vbox.addStretch( 1 ) + + # Create a multi line edit + self.mle = QMultiLineEdit( self, "multiLineEdit" ) + + self.grid.addMultiCellWidget( self.mle, 3, 3, 1, 2 ) + self.mle.setMinimumHeight( self.mle.fontMetrics().height() * 3 ) + self.mle.setText("This is a QMultiLineEdit widget,\n" + "useful for small multi-line\n" + "input fields.") + QToolTip.add( self.mle, "multi line editor" ) + + # Create a single line edit + self.le = QLineEdit( self, "lineEdit" ) + self.grid.addMultiCellWidget( self.le, 4, 4, 1, 2 ) + self.le.setFixedHeight( self.le.sizeHint().height() ) + self.connect( self.le, SIGNAL("textChanged(const QString &)"), self.lineEditTextChanged ) + QToolTip.add( self.le, "single line editor" ) + + # Create a horizontal line (sort of QFrame) above the message line + self.separator = QFrame( self, "separatorLine" ) + self.separator.setFrameStyle( QFrame.HLine | QFrame.Sunken ) + self.separator.setFixedHeight( self.separator.sizeHint().height() ) + self.grid.addMultiCellWidget( self.separator, 5, 5, 0, 2 ) + QToolTip.add( self.separator, "tool tips on a separator! wow!" ) + + self.grid.setRowStretch( 0, 0 ) + self.grid.setRowStretch( 1, 0 ) + self.grid.setRowStretch( 2, 0 ) + self.grid.setRowStretch( 3, 1 ) + self.grid.setRowStretch( 4, 1 ) + self.grid.setRowStretch( 5, 0 ) + + self.grid.setColStretch( 0, 1 ) + self.grid.setColStretch( 1, 1 ) + self.grid.setColStretch( 2, 1 ) + + # Create an label and a message in a plain widget + # The message is updated when buttons are clicked etc. + + self.hbox = QHBoxLayout() + self.topLayout.addLayout( self.hbox ) + self.msgLabel = QLabel( self, "msgLabel" ) + self.msgLabel.setText( "Message:" ) + self.msgLabel.setAlignment( Qt.AlignHCenter | Qt.AlignVCenter ) + self.msgLabel.setFixedSize( self.msgLabel.sizeHint() ) + self.hbox.addWidget( self.msgLabel ) + QToolTip.add( self.msgLabel, "label 1" ) + + self.msg = QLabel( self, "message" ) + self.msg.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + self.msg.setAlignment( Qt.AlignCenter ) + self.msg.setFont( QFont( "times", 12, QFont.Bold ) ) + self.msg.setText( "Message" ) + self.msg.setFixedHeight( self.msg.sizeHint().height() ) + self.msg.setText( "" ) + self.hbox.addWidget( self.msg, 5 ) + QToolTip.add( self.msg, "label 2" ) + + self.topLayout.activate() + + def setStatus(self, text): + self.msg.setText( text ) + + def movieUpdate( self, r ): + # Uncomment this to test animated icons on your window manager + self.setIcon( self.movie.framePixmap() ) + + def movieStatus( self, s ): + if s == QMovie.SourceEmpty or s == QMovie.UnrecognizedFormat: + pm = QPixmap('tt-logo.png') + self.movielabel.setPixmap(pm) + self.movielabel.setFixedSize(pm.size()) + else: + if ( self.movielabel.movie() ): # for flicker-free animation: + self.movielabel.setBackgroundMode( QWidget.NoBackground ) + + def button1Clicked( self ): + self.msg.setText( "The first push button was clicked" ) + + def checkBoxClicked( self, id ): + txt = QString() + txt = "Check box %s clicked : " % str(id) + chk = ["-","-","-"] + if self.cb[0].isChecked(): + chk[0] = "r" + if self.cb[1].isChecked(): + chk[1] = "w" + if self.cb[2].isChecked(): + chk[2] = "x" + txt = txt + str(chk[0]+chk[1]+chk[2]) + self.msg.setText( txt ) + + def edComboBoxItemActivated( self, text): + txt = QString() + txt = "Editable Combo Box set to %s" % text + self.msg.setText( txt ) + + def radioButtonClicked( self, id ): + txt = QString() + txt = "Radio button #%d clicked" % id + self.msg.setText( txt ) + + def listBoxItemSelected( self, index ): + txt = QString() + txt = "List box item %d selected" % index + self.msg.setText( txt ) + + def sliderValueChanged( self, value ): + txt = QString() + txt = "Movie set to %d%% of normal speed" % value + self.msg.setText( txt ) + self.movie.setSpeed( value ) + + def comboBoxItemActivated( self, index ): + txt = QString() + txt = "Comboxo box item %d activated" % index + self.msg.setText( txt ) + if index == 0: + QApplication.setWinStyleHighlightColor( Qt.darkBlue ) + elif index == 1: + QApplication.setWinStyleHighlightColor( Qt.darkRed ) + elif index == 2: + QApplication.setWinStyleHighlightColor( Qt.darkGreen ) + elif index == 3: + QApplication.setWinStyleHighlightColor( Qt.blue ) + elif index == 4: + QApplication.setWinStyleHighlightColor( Qt.red ) + + def lineEditTextChanged( self, newText ): + self.msg.setText("Line edit text: " + unicode(newText)) + + def spinBoxValueChanged( self, valueText ): + self.msg.setText("Spin box value: " + unicode(valueText)) + + # All application events are passed throught this event filter. + # We're using it to display some information about a clicked + # widget (right mouse button + CTRL). + #def eventFilter( self, event ): + # identify_now = TRUE + # if event.type() == Event_MouseButtonPress and identify_now: + # e = QMouseEvent( event ) + # if (e.button() == Qt.RightButton) and (e.state() & Qt.ControlButton) != 0: + # txt = QString( "The clicked widget is a\n" ) + # txt = txt + QObect.className() + # txt = txt + "\nThe widget's name is\n" + # if QObject.name(): + # txt = txt + QObject.name() + # else: + # txt = txt + "<no name>" + # identify_now = FALSE # don't do it in message box + # QMessageBox.message( "Identify Widget", txt, 0, QObject ) + # identify_now = TRUE; # allow it again + # return FALSE # don't eat event + +################################################################################################ + +#QApplication.setColourSpec( QApplication.CustomColor ) +a = QApplication( sys.argv ) + +w = WidgetView() +a.setMainWidget( w ) +w.show() +a.exec_loop() diff --git a/python/pyqt/examples3/README b/python/pyqt/examples3/README new file mode 100644 index 00000000..4a8f9eb5 --- /dev/null +++ b/python/pyqt/examples3/README @@ -0,0 +1,12 @@ +To run these examples, make sure you have your PYTHONPATH environment variable +set if needed and explicitly set the path to python at the top of each script +if you don't have /usr/bin/env. + +The examples are written for Qt v3.x. + +A much better source of information about using PyQt is Boudewijn Rempt's +book at http://stage.linuxports.com/projects/pyqt/. + + +Phil Thompson +phil@riverbankcomputing.co.uk diff --git a/python/pyqt/examples3/SQL/README b/python/pyqt/examples3/SQL/README new file mode 100644 index 00000000..9dfc5d41 --- /dev/null +++ b/python/pyqt/examples3/SQL/README @@ -0,0 +1,76 @@ +This directory contains some translated sql examples from Qt 3.x. + +runform1.py, form1.ui: + + A simple designer generated QDataTable. Run "pyuic form1.ui -o form1.py". + +runform2.py, form2.ui: + + A simple designer generated QDataBrowser. Run "pyuic form2.ui -o form2.py". + +sqlcustom1.py: + + QSqlForm based form with a simple custom editor forcing all input to + be uppercase + +sqltable4.py: + + Custom QDataTable with reimplemented paintField method, combined with + a QComboBox based custom field editor (StatusPicker), gathering its + items from a different table (status) and a calculated column (monsalary). + Note, that QSqlEditorFactory based field editors are somewhat restricted, + because Qt's Q_PROPERTY feature isn't supported, yet. I've circumvented + this limitation by choosing the status table ids corresponding to the + index in the QComboBox. + +sqlsubclass5.py: + + Similar to the former, and even more deviated from its qt ancestor, + because the sense escaped me. This could be related to the different + database layout needed for MySQL (Trolltech used PostgreSQL sequences, + while we're using the simpler, but less powerful auto_increment here). + If you enter and invalid date (e.g. day: 0) in the Paid column, it is + shown as "not yet", but produces some qt warnings. + +runsqlex.py, sqlex.ui, sqlex.ui.h, connect.ui, connect.ui.h: + + This one is a most advanced example, showing the use of a QSqlCursor + driven by QSqlQuery and iterating through database tables and fields. + Definitely worth a look. + +Unfortunately you will have to make sure that these prerequisites are met +before trying the examples: + + - Install MySQL or PostgreSQL and any development packages + + - Create a database user with sufficient rights + + - Create the testdb database + - For MySQL, run: mysql -u user -p password < testdb_mysql.sql + - For PostgreSQL, run: psql -U user template1 -f testdb_pg.sql + + - Build Qt with the mysql and/or psql modules activated. + +Now you should be ready for the fun part. You can run dbconnect.py from +a command line and try to connect to the database. If all went well, +'ok' should be printed after pressing OK. If you don't want to enter all +your data over and over again, create a file named local_dbpar.py here, +with the following keys (with your own data, of course): + +DB_HOSTNAMES = ["localhost"] +DB_DATABASES = ["testdb"] +DB_USERNAME = "name" +DB_PASSWORD = "pass" + +The dbconnect.py script is generated from dbconnect.ui, which was created +with qt's designer. You can find it also in Boudewijn Rempt's book +"GUI Programming with Python, using the Qt Toolkit". Although you won't find +the SQL widgets discussed there, for the simple reason of the book being +written before they appeared, it is a valuable source for anybody new in +this area. + +Please direct any comments, patches and questions to <pykde@mats.gmd.de>. + +Good luck + +Hans-Peter Jansen <hpj@urpla.net> diff --git a/python/pyqt/examples3/SQL/connect.ui b/python/pyqt/examples3/SQL/connect.ui new file mode 100644 index 00000000..cc419203 --- /dev/null +++ b/python/pyqt/examples3/SQL/connect.ui @@ -0,0 +1,238 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>ConnectDialog</class> +<widget class="QDialog"> + <property name="name"> + <cstring>ConnectDialog</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>303</width> + <height>251</height> + </rect> + </property> + <property name="caption"> + <string>Connect...</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>GroupBox3</cstring> + </property> + <property name="title"> + <string>Connection settings</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>editDatabase</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel3</cstring> + </property> + <property name="text"> + <string>Database Name:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>comboDatabase</cstring> + </property> + </widget> + <widget class="QLineEdit" row="3" column="1"> + <property name="name"> + <cstring>editPassword</cstring> + </property> + <property name="echoMode"> + <enum>Password</enum> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel4</cstring> + </property> + <property name="text"> + <string>&Username:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>editUsername</cstring> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>TextLabel4_2</cstring> + </property> + <property name="text"> + <string>&Password:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>editPassword</cstring> + </property> + </widget> + <widget class="QComboBox" row="0" column="1"> + <property name="name"> + <cstring>comboDriver</cstring> + </property> + </widget> + <widget class="QLineEdit" row="2" column="1"> + <property name="name"> + <cstring>editUsername</cstring> + </property> + </widget> + <widget class="QLineEdit" row="4" column="1"> + <property name="name"> + <cstring>editHostname</cstring> + </property> + </widget> + <widget class="QLabel" row="4" column="0"> + <property name="name"> + <cstring>TextLabel5</cstring> + </property> + <property name="text"> + <string>&Hostname:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>editHostname</cstring> + </property> + </widget> + <widget class="QLabel" row="5" column="0"> + <property name="name"> + <cstring>TextLabel5_2</cstring> + </property> + <property name="text"> + <string>P&ort:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>portSpinBox</cstring> + </property> + </widget> + <widget class="QSpinBox" row="5" column="1"> + <property name="name"> + <cstring>portSpinBox</cstring> + </property> + <property name="specialValueText"> + <string>Default</string> + </property> + <property name="maxValue"> + <number>65535</number> + </property> + <property name="minValue"> + <number>-1</number> + </property> + <property name="value"> + <number>-1</number> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>D&river</string> + </property> + <property name="buddy" stdset="0"> + <cstring>comboDriver</cstring> + </property> + </widget> + </grid> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout25</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton1</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButton2</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>PushButton1</sender> + <signal>clicked()</signal> + <receiver>ConnectDialog</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>PushButton2</sender> + <signal>clicked()</signal> + <receiver>ConnectDialog</receiver> + <slot>reject()</slot> + </connection> +</connections> +<tabstops> + <tabstop>comboDriver</tabstop> + <tabstop>editDatabase</tabstop> + <tabstop>editUsername</tabstop> + <tabstop>editPassword</tabstop> + <tabstop>editHostname</tabstop> + <tabstop>portSpinBox</tabstop> + <tabstop>PushButton1</tabstop> + <tabstop>PushButton2</tabstop> +</tabstops> +<includes> + <include location="local" impldecl="in implementation">connect.ui.h</include> +</includes> +<slots> + <slot>init()</slot> + <slot>destroy()</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/python/pyqt/examples3/SQL/connect.ui.h b/python/pyqt/examples3/SQL/connect.ui.h new file mode 100644 index 00000000..cbeeabdc --- /dev/null +++ b/python/pyqt/examples3/SQL/connect.ui.h @@ -0,0 +1,21 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + + +void ConnectDialog::init() +{ +from qtsql import QSqlDatabase +#qDebug("ConnectDialog init") +self.comboDriver.clear() +self.comboDriver.insertStringList(QSqlDatabase.drivers()) +} + +void ConnectDialog::destroy() +{ + +} diff --git a/python/pyqt/examples3/SQL/dbconnect.py b/python/pyqt/examples3/SQL/dbconnect.py new file mode 100755 index 00000000..fdae7de1 --- /dev/null +++ b/python/pyqt/examples3/SQL/dbconnect.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python + +import sys +from qt import * +from qtsql import * + +from frmconnect import frmConnect +from dbpar import * + +TRUE = 1 +FALSE = 0 + +def createConnection(): + driver = DB_DRIVER + # all qt examples use QSqlDatabase::addDatabase, but + # this never returns NULL in my experience + drivers = map(str, QSqlDatabase.drivers()) + if driver in drivers: + dlg = dbConnect(driver) + #TODO: make connection parameters accessible + return dlg.exec_loop() + else: + QMessageBox.warning(None, "Database Error", + "<%s> database driver not found!\n\n" + "Please make sure, that this database adaptor\n" + "is available in your Qt installation.\n" % + (driver), QMessageBox.Abort | QMessageBox.Escape) + return FALSE + +class dbConnect(frmConnect): + def __init__(self, driver, parent = None): + frmConnect.__init__(self, parent) + self.hostnames = DB_HOSTNAMES + self.hostname = DB_HOSTNAMES[0] + self.databases = DB_DATABASES + self.database = DB_DATABASES[0] + self.username = DB_USERNAME + self.password = DB_PASSWORD + self.dbdriver = driver + + self.txtName.setText(self.username) + self.txtPasswd.setText(self.password) + map(self.cmbServer.insertItem, self.hostnames) + map(self.cmbDatabase.insertItem, self.databases) + self.connect(self.buttonHelp, SIGNAL("clicked()"), + self.buttonHelp_clicked) + + def accept(self): + self.hostname = self.cmbServer.currentText() + self.database = self.cmbDatabase.currentText() + self.username = self.txtName.text() + self.password = self.txtPasswd.text() + db = QSqlDatabase.addDatabase(self.dbdriver) + if db: + db.setHostName(self.hostname) + db.setDatabaseName(self.database) + db.setUserName(self.username) + db.setPassword(self.password) + if db.open(): + frmConnect.accept(self) + else: + QMessageBox.warning(self, "Database Error", + "Cannot open %s database on %s!\n\n%s\n%s\n" % + (self.database, self.hostname, + db.lastError().driverText(), + db.lastError().databaseText()), " Ooops ") + + + def buttonHelp_clicked(self): + QMessageBox.information(self, "About Connecting", + "Here you specify userid, password, host and database\n" + "for the PyQt sql examples. If you encounter any problems,\n" + "please read the README file in this folder before posting.\n\n" + "Thanks,\nHans-Peter Jansen <hpj@urpla.net>\n") + + +if __name__ == "__main__": + app = QApplication(sys.argv) + if createConnection(): + print "ok" + else: + print "cancel" diff --git a/python/pyqt/examples3/SQL/dbpar.py b/python/pyqt/examples3/SQL/dbpar.py new file mode 100644 index 00000000..90e92704 --- /dev/null +++ b/python/pyqt/examples3/SQL/dbpar.py @@ -0,0 +1,22 @@ +# sql examples default database parameter + +# you can create a local_dbpar.py module with definitons +# of your own parameters to overrule these defaults + +#DB_DRIVER = "QPSQL7" +DB_DRIVER = "QMYSQL3" +# list of servers +DB_HOSTNAMES = ["localhost"] +# list of databases +DB_DATABASES = ["testdb"] +# database user id +DB_USERNAME = "" +# database password +DB_PASSWORD = "" + +# remove this in your local_dbpar.py +try: + from local_dbpar import * +except: + pass + diff --git a/python/pyqt/examples3/SQL/form1.ui b/python/pyqt/examples3/SQL/form1.ui new file mode 100644 index 00000000..38b3cb27 --- /dev/null +++ b/python/pyqt/examples3/SQL/form1.ui @@ -0,0 +1,77 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="QDialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>370</height> + </rect> + </property> + <property name="caption"> + <string>Form1</string> + </property> + <widget class="QDataTable"> + <column> + <property name="text"> + <string>Forename</string> + </property> + <property name="field"> + <string>forename</string> + </property> + </column> + <column> + <property name="text"> + <string>Surname</string> + </property> + <property name="field"> + <string>surname</string> + </property> + </column> + <column> + <property name="text"> + <string>Salary</string> + </property> + <property name="field"> + <string>salary</string> + </property> + </column> + <column> + <property name="text"> + <string>Statusid</string> + </property> + <property name="field"> + <string>statusid</string> + </property> + </column> + <property name="name"> + <cstring>DataTable2</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>370</height> + </rect> + </property> + <property name="sorting"> + <bool>true</bool> + </property> + <property name="confirmDelete"> + <bool>true</bool> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + </stringlist> + </property> + </widget> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/python/pyqt/examples3/SQL/form2.ui b/python/pyqt/examples3/SQL/form2.ui new file mode 100644 index 00000000..ffe2beb5 --- /dev/null +++ b/python/pyqt/examples3/SQL/form2.ui @@ -0,0 +1,327 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form2</class> +<widget class="QDialog"> + <property name="name"> + <cstring>Form2</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>367</width> + <height>152</height> + </rect> + </property> + <property name="caption"> + <string>Form2</string> + </property> + <widget class="QDataBrowser"> + <property name="name"> + <cstring>DataBrowser1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>366</width> + <height>150</height> + </rect> + </property> + <property name="sort"> + <stringlist> + <string>surname ASC</string> + <string>forename ASC</string> + </stringlist> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>labelSurname</cstring> + </property> + <property name="text"> + <string>Surname</string> + </property> + </widget> + <widget class="QSpinBox" row="1" column="3"> + <property name="name"> + <cstring>QSpinBoxStatusid</cstring> + </property> + <property name="maxValue"> + <number>2147483647</number> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + <string>statusid</string> + </stringlist> + </property> + </widget> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>QLineEditSurname</cstring> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + <string>surname</string> + </stringlist> + </property> + </widget> + <widget class="QLabel" row="1" column="2"> + <property name="name"> + <cstring>labelStatusid</cstring> + </property> + <property name="text"> + <string>Statusid</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>labelForename</cstring> + </property> + <property name="text"> + <string>Forename</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="3"> + <property name="name"> + <cstring>QLineEditSalary</cstring> + </property> + <property name="alignment"> + <set>AlignRight</set> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + <string>salary</string> + </stringlist> + </property> + </widget> + <widget class="QLabel" row="0" column="2"> + <property name="name"> + <cstring>labelSalary</cstring> + </property> + <property name="text"> + <string>Salary</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>QLineEditForename</cstring> + </property> + <property name="database" stdset="0"> + <stringlist> + <string>(default)</string> + <string>staff</string> + <string>forename</string> + </stringlist> + </property> + </widget> + </grid> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonFirst</cstring> + </property> + <property name="text"> + <string>|< &First</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonPrev</cstring> + </property> + <property name="text"> + <string><< &Prev</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonNext</cstring> + </property> + <property name="text"> + <string>&Next >></string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonLast</cstring> + </property> + <property name="text"> + <string>&Last >|</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget" row="2" column="0"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonInsert</cstring> + </property> + <property name="text"> + <string>&Insert</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonUpdate</cstring> + </property> + <property name="text"> + <string>&Update</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>PushButtonDelete</cstring> + </property> + <property name="text"> + <string>&Delete</string> + </property> + </widget> + </hbox> + </widget> + </grid> + </widget> +</widget> +<connections> + <connection> + <sender>PushButtonFirst</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>first()</slot> + </connection> + <connection> + <sender>DataBrowser1</sender> + <signal>firstRecordAvailable( bool )</signal> + <receiver>PushButtonFirst</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>PushButtonPrev</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>prev()</slot> + </connection> + <connection> + <sender>DataBrowser1</sender> + <signal>prevRecordAvailable( bool )</signal> + <receiver>PushButtonPrev</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>PushButtonNext</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>next()</slot> + </connection> + <connection> + <sender>DataBrowser1</sender> + <signal>nextRecordAvailable( bool )</signal> + <receiver>PushButtonNext</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>PushButtonLast</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>last()</slot> + </connection> + <connection> + <sender>DataBrowser1</sender> + <signal>lastRecordAvailable( bool )</signal> + <receiver>PushButtonLast</receiver> + <slot>setEnabled(bool)</slot> + </connection> + <connection> + <sender>PushButtonInsert</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>insert()</slot> + </connection> + <connection> + <sender>PushButtonUpdate</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>update()</slot> + </connection> + <connection> + <sender>PushButtonDelete</sender> + <signal>clicked()</signal> + <receiver>DataBrowser1</receiver> + <slot>del()</slot> + </connection> +</connections> +<tabstops> + <tabstop>QLineEditForename</tabstop> + <tabstop>QLineEditSurname</tabstop> + <tabstop>QLineEditSalary</tabstop> + <tabstop>QSpinBoxStatusid</tabstop> + <tabstop>PushButtonFirst</tabstop> + <tabstop>PushButtonPrev</tabstop> + <tabstop>PushButtonNext</tabstop> + <tabstop>PushButtonLast</tabstop> + <tabstop>PushButtonInsert</tabstop> + <tabstop>PushButtonUpdate</tabstop> + <tabstop>PushButtonDelete</tabstop> +</tabstops> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/python/pyqt/examples3/SQL/frmconnect.py b/python/pyqt/examples3/SQL/frmconnect.py new file mode 100644 index 00000000..23cd0674 --- /dev/null +++ b/python/pyqt/examples3/SQL/frmconnect.py @@ -0,0 +1,120 @@ +# Form implementation generated from reading ui file 'frmconnect.ui' +# +# Created: Sam Jul 6 12:47:10 2002 +# by: The PyQt User Interface Compiler (pyuic) +# +# WARNING! All changes made in this file will be lost! + + +from qt import * + + +class frmConnect(QDialog): + def __init__(self,parent = None,name = None,modal = 0,fl = 0): + QDialog.__init__(self,parent,name,modal,fl) + + if name == None: + self.setName("frmConnect") + + self.resize(415,154) + self.setCaption(self.trUtf8("Connecting")) + self.setSizeGripEnabled(1) + + frmConnectLayout = QGridLayout(self,1,1,11,6,"frmConnectLayout") + + Layout7 = QVBoxLayout(None,0,6,"Layout7") + + self.buttonOK = QPushButton(self,"buttonOK") + self.buttonOK.setText(self.trUtf8("&OK")) + self.buttonOK.setAutoDefault(1) + self.buttonOK.setDefault(1) + QToolTip.add(self.buttonOK,self.trUtf8("Connect to Database")) + Layout7.addWidget(self.buttonOK) + + self.buttonCancel = QPushButton(self,"buttonCancel") + self.buttonCancel.setText(self.trUtf8("&Cancel")) + QToolTip.add(self.buttonCancel,self.trUtf8("Cancel Connecting")) + Layout7.addWidget(self.buttonCancel) + + self.buttonHelp = QPushButton(self,"buttonHelp") + self.buttonHelp.setText(self.trUtf8("&Help")) + QToolTip.add(self.buttonHelp,self.trUtf8("About Connecting")) + Layout7.addWidget(self.buttonHelp) + spacer = QSpacerItem(0,0,QSizePolicy.Minimum,QSizePolicy.Expanding) + Layout7.addItem(spacer) + + frmConnectLayout.addLayout(Layout7,0,1) + + self.grpConnection = QGroupBox(self,"grpConnection") + self.grpConnection.setTitle(self.trUtf8("")) + self.grpConnection.setColumnLayout(0,Qt.Vertical) + self.grpConnection.layout().setSpacing(6) + self.grpConnection.layout().setMargin(11) + grpConnectionLayout = QGridLayout(self.grpConnection.layout()) + grpConnectionLayout.setAlignment(Qt.AlignTop) + + self.txtName = QLineEdit(self.grpConnection,"txtName") + self.txtName.setMaxLength(16) + QToolTip.add(self.txtName,self.trUtf8("Database User ID")) + + grpConnectionLayout.addWidget(self.txtName,0,1) + + self.lblDatabase = QLabel(self.grpConnection,"lblDatabase") + self.lblDatabase.setText(self.trUtf8("&Database")) + + grpConnectionLayout.addWidget(self.lblDatabase,3,0) + + self.lblServer = QLabel(self.grpConnection,"lblServer") + self.lblServer.setText(self.trUtf8("&Server")) + + grpConnectionLayout.addWidget(self.lblServer,2,0) + + self.lblName = QLabel(self.grpConnection,"lblName") + self.lblName.setText(self.trUtf8("&Name")) + + grpConnectionLayout.addWidget(self.lblName,0,0) + + self.cmbDatabase = QComboBox(0,self.grpConnection,"cmbDatabase") + self.cmbDatabase.setEditable(1) + self.cmbDatabase.setAutoCompletion(1) + self.cmbDatabase.setDuplicatesEnabled(0) + QToolTip.add(self.cmbDatabase,self.trUtf8("Database Name")) + + grpConnectionLayout.addWidget(self.cmbDatabase,3,1) + + self.txtPasswd = QLineEdit(self.grpConnection,"txtPasswd") + self.txtPasswd.setMaxLength(16) + self.txtPasswd.setEchoMode(QLineEdit.Password) + QToolTip.add(self.txtPasswd,self.trUtf8("Database User Password")) + + grpConnectionLayout.addWidget(self.txtPasswd,1,1) + + self.lblPasswd = QLabel(self.grpConnection,"lblPasswd") + self.lblPasswd.setText(self.trUtf8("&Password")) + + grpConnectionLayout.addWidget(self.lblPasswd,1,0) + + self.cmbServer = QComboBox(0,self.grpConnection,"cmbServer") + self.cmbServer.setEditable(1) + self.cmbServer.setAutoCompletion(1) + self.cmbServer.setDuplicatesEnabled(0) + QToolTip.add(self.cmbServer,self.trUtf8("Database Server Address")) + + grpConnectionLayout.addWidget(self.cmbServer,2,1) + + frmConnectLayout.addWidget(self.grpConnection,0,0) + + self.connect(self.buttonOK,SIGNAL("clicked()"),self,SLOT("accept()")) + self.connect(self.buttonCancel,SIGNAL("clicked()"),self,SLOT("reject()")) + + self.setTabOrder(self.txtName,self.txtPasswd) + self.setTabOrder(self.txtPasswd,self.cmbServer) + self.setTabOrder(self.cmbServer,self.cmbDatabase) + self.setTabOrder(self.cmbDatabase,self.buttonOK) + self.setTabOrder(self.buttonOK,self.buttonCancel) + self.setTabOrder(self.buttonCancel,self.buttonHelp) + + self.lblDatabase.setBuddy(self.cmbDatabase) + self.lblServer.setBuddy(self.cmbServer) + self.lblName.setBuddy(self.txtName) + self.lblPasswd.setBuddy(self.txtPasswd) diff --git a/python/pyqt/examples3/SQL/frmconnect.ui b/python/pyqt/examples3/SQL/frmconnect.ui new file mode 100644 index 00000000..a6fc15cc --- /dev/null +++ b/python/pyqt/examples3/SQL/frmconnect.ui @@ -0,0 +1,245 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>frmConnect</class> +<widget class="QDialog"> + <property name="name"> + <cstring>frmConnect</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>415</width> + <height>154</height> + </rect> + </property> + <property name="caption"> + <string>Connecting</string> + </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="1"> + <property name="name"> + <cstring>Layout7</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonOK</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + <property name="toolTip" stdset="0"> + <string>Connect to Database</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonCancel</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + <property name="toolTip" stdset="0"> + <string>Cancel Connecting</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonHelp</cstring> + </property> + <property name="text"> + <string>&Help</string> + </property> + <property name="toolTip" stdset="0"> + <string>About Connecting</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + </vbox> + </widget> + <widget class="QGroupBox" row="0" column="0"> + <property name="name"> + <cstring>grpConnection</cstring> + </property> + <property name="title"> + <string></string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>txtName</cstring> + </property> + <property name="maxLength"> + <number>16</number> + </property> + <property name="toolTip" stdset="0"> + <string>Database User ID</string> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>lblDatabase</cstring> + </property> + <property name="text"> + <string>&Database</string> + </property> + <property name="buddy" stdset="0"> + <cstring>cmbDatabase</cstring> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>lblServer</cstring> + </property> + <property name="text"> + <string>&Server</string> + </property> + <property name="buddy" stdset="0"> + <cstring>cmbServer</cstring> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>lblName</cstring> + </property> + <property name="text"> + <string>&Name</string> + </property> + <property name="buddy" stdset="0"> + <cstring>txtName</cstring> + </property> + </widget> + <widget class="QComboBox" row="3" column="1"> + <property name="name"> + <cstring>cmbDatabase</cstring> + </property> + <property name="editable"> + <bool>true</bool> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + <property name="duplicatesEnabled"> + <bool>false</bool> + </property> + <property name="toolTip" stdset="0"> + <string>Database Name</string> + </property> + </widget> + <widget class="QLineEdit" row="1" column="1"> + <property name="name"> + <cstring>txtPasswd</cstring> + </property> + <property name="maxLength"> + <number>16</number> + </property> + <property name="echoMode"> + <enum>Password</enum> + </property> + <property name="toolTip" stdset="0"> + <string>Database User Password</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>lblPasswd</cstring> + </property> + <property name="text"> + <string>&Password</string> + </property> + <property name="buddy" stdset="0"> + <cstring>txtPasswd</cstring> + </property> + </widget> + <widget class="QComboBox" row="2" column="1"> + <property name="name"> + <cstring>cmbServer</cstring> + </property> + <property name="editable"> + <bool>true</bool> + </property> + <property name="autoCompletion"> + <bool>true</bool> + </property> + <property name="duplicatesEnabled"> + <bool>false</bool> + </property> + <property name="toolTip" stdset="0"> + <string>Database Server Address</string> + </property> + </widget> + </grid> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>buttonOK</sender> + <signal>clicked()</signal> + <receiver>frmConnect</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>buttonCancel</sender> + <signal>clicked()</signal> + <receiver>frmConnect</receiver> + <slot>reject()</slot> + </connection> +</connections> +<tabstops> + <tabstop>txtName</tabstop> + <tabstop>txtPasswd</tabstop> + <tabstop>cmbServer</tabstop> + <tabstop>cmbDatabase</tabstop> + <tabstop>buttonOK</tabstop> + <tabstop>buttonCancel</tabstop> + <tabstop>buttonHelp</tabstop> +</tabstops> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/python/pyqt/examples3/SQL/runform1.py b/python/pyqt/examples3/SQL/runform1.py new file mode 100755 index 00000000..d5760ce1 --- /dev/null +++ b/python/pyqt/examples3/SQL/runform1.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import sys +from qt import * + +from form1 import Form1 +from dbconnect import createConnection + +class mainWindow(Form1): + def __init__(self,parent = None,name = None,fl = 0): + Form1.__init__(self,parent,name,fl) + +if __name__ == "__main__": + a = QApplication(sys.argv) + if createConnection(): + QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + w = mainWindow() + a.setMainWidget(w) + w.show() + a.exec_loop() + diff --git a/python/pyqt/examples3/SQL/runform2.py b/python/pyqt/examples3/SQL/runform2.py new file mode 100755 index 00000000..ba0ca4a5 --- /dev/null +++ b/python/pyqt/examples3/SQL/runform2.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import sys +from qt import * + +from form2 import Form2 +from dbconnect import createConnection + +class mainWindow(Form2): + def __init__(self,parent = None,name = None,fl = 0): + Form2.__init__(self,parent,name,fl) + +if __name__ == "__main__": + a = QApplication(sys.argv) + if createConnection(): + QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + w = mainWindow() + a.setMainWidget(w) + w.show() + a.exec_loop() + diff --git a/python/pyqt/examples3/SQL/runsqlex.py b/python/pyqt/examples3/SQL/runsqlex.py new file mode 100755 index 00000000..7f2afa71 --- /dev/null +++ b/python/pyqt/examples3/SQL/runsqlex.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +import sys +from qt import * +from qtsql import * + +from sqlex import SqlEx +from connect import ConnectDialog + +from dbpar import * + +TRUE = 1 +FALSE = 0 + +def showError(err, parent): + errStr = QString("The database reported an error:\n\n") + if not err.databaseText().isEmpty(): + errStr.append(err.databaseText()) + errStr.append("\n") + if not err.driverText().isEmpty(): + errStr.append(err.driverText()) + errStr.append("\n") + QMessageBox.warning(parent, "Error", errStr) + +class CustomSqlCursor(QSqlCursor): + def __init__(self, query = None, autopopulate = TRUE, db = None): + QSqlCursor.__init__(self, None, autopopulate, db) + self.execQuery(query) + if self.isSelect() and autopopulate: + fields = self.driver().recordInfo(self) + for f in fields: + self.append(f) + self.setMode(QSqlCursor.ReadOnly) + + def select(self, filter, sort = QSqlIndex()): + return self.execQuery(self.lastQuery()) + + def primaryIndex(self, prime = TRUE): + return QSqlIndex() + + def insert(self, invalidate = TRUE): + return FALSE + + def update(self, invalidate = TRUE): + return FALSE + + def delRecords(self, invalidate = TRUE): + return FALSE + + def setName(self, name, autopopulate = TRUE): + return + + +class MainWindow(SqlEx): + def __init__(self,parent = None,name = None,fl = 0): + SqlEx.__init__(self,parent,name,fl) + self.conDiag = ConnectDialog(self, "Connection Dialog", TRUE) + self.firstconn = TRUE + + def dbConnect(self): + if self.firstconn: + self.firstconn = FALSE + self.conDiag.editUsername.setText(DB_USERNAME) + self.conDiag.editPassword.setText(DB_PASSWORD) + self.conDiag.editHostname.setText(DB_HOSTNAMES[0]) + self.conDiag.editDatabase.setText(DB_DATABASES[0]) + for i in range(self.conDiag.comboDriver.count()): + if str(self.conDiag.comboDriver.text(i)) == DB_DRIVER: + self.conDiag.comboDriver.setCurrentItem(i) + break + if self.conDiag.exec_loop() != QDialog.Accepted: + return + if self.dt.sqlCursor(): + self.dt.setSqlCursor() + + # close old connection (if any) + if QSqlDatabase.contains("SqlEx"): + oldDb = QSqlDatabase.database("SqlEx") + oldDb.close() + QSqlDatabase.removeDatabase("SqlEx") + + # open the new connection + db = QSqlDatabase.addDatabase(self.conDiag.comboDriver.currentText(), "SqlEx") + if not db: + QMessageBox.warning(self, "Error", "Could not open database") + return + + db.setHostName(self.conDiag.editHostname.text()) + db.setDatabaseName(self.conDiag.editDatabase.text()) + db.setPort(self.conDiag.portSpinBox.value()) + if not db.open(self.conDiag.editUsername.text(), + self.conDiag.editPassword.text()): + showError(db.lastError(), self) + return + + self.lbl.setText("Double-Click on a table-name to view the contents") + self.lv.clear() + + tables = db.tables() + for t in tables: + lvi = QListViewItem(self.lv, t) + fields = db.recordInfo(t) + for f in fields: + req = "?" + if f.isRequired() > 0: + req = "Yes" + elif f.isRequired() == 0: + req = "No" + fi = QListViewItem(lvi, f.name(), QVariant.typeToName(f.type()), req) + lvi.insertItem(fi) + self.lv.insertItem(lvi) + + self.submitBtn.setEnabled(TRUE) + + def execQuery(self): + cursor = CustomSqlCursor(self.te.text(), TRUE, + QSqlDatabase.database("SqlEx", TRUE)) + if cursor.isSelect(): + self.dt.setSqlCursor(cursor, TRUE, TRUE) + self.dt.refresh() + txt = QString("Query OK") + if cursor.size() >= 0: + txt.append(", returned rows: %s" % cursor.size()) + self.lbl.setText(txt) + else: + if not cursor.isActive(): + # an error occured + showError(cursor.lastError(), self) + else: + self.lbl.setText("Query OK, affected rows: %s" % + cursor.numRowsAffected()) + + def showTable(self, item): + i = item.parent() + if not i: + i = item + cursor = QSqlCursor(i.text(0), TRUE, QSqlDatabase.database("SqlEx", TRUE)) + self.dt.setSqlCursor(cursor, TRUE, TRUE) + self.dt.setSort(cursor.primaryIndex()) + self.dt.refresh(QDataTable.RefreshAll) + self.lbl.setText("Displaying table %s" % i.text(0)) + + +if __name__ == "__main__": + a = QApplication(sys.argv) + QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()")) + w = MainWindow() + a.setMainWidget(w) + w.show() + a.exec_loop() + diff --git a/python/pyqt/examples3/SQL/sqlcustom1.py b/python/pyqt/examples3/SQL/sqlcustom1.py new file mode 100755 index 00000000..46ca5801 --- /dev/null +++ b/python/pyqt/examples3/SQL/sqlcustom1.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * +from qtsql import * + +from dbconnect import createConnection + +TRUE = 1 +FALSE = 0 + +class CustomEdit(QLineEdit): + def __init__(self, parent = None, name = None): + QLineEdit.__init__(self, parent, name) + QObject.connect(self, SIGNAL("textChanged(const QString &)"), + self.changed) + + def changed(self, line): + self.setUpperLine(line) + + def setUpperLine(self, line): + self.upperLineText = line.upper() + self.setText(self.upperLineText) + + +class FormDialog(QDialog): + def __init__(self): + QDialog.__init__(self) + forenameLabel = QLabel("Forename:", self) + forenameEdit = CustomEdit(self) + surnameLabel = QLabel("Surname:", self) + surnameEdit = CustomEdit(self) + salaryLabel = QLabel("Salary:", self) + salaryEdit = QLineEdit(self) + salaryEdit.setAlignment(Qt.AlignRight) + saveButton = QPushButton("&Save", self) + self.connect(saveButton, SIGNAL("clicked()"), self.save) + + grid = QGridLayout(self) + grid.addWidget(forenameLabel, 0, 0) + grid.addWidget(forenameEdit, 0, 1) + grid.addWidget(surnameLabel, 1, 0) + grid.addWidget(surnameEdit, 1, 1) + grid.addWidget(salaryLabel, 2, 0) + grid.addWidget(salaryEdit, 2, 1) + grid.addWidget(saveButton, 3, 0) + grid.activate() + + self.staffCursor = QSqlCursor("staff") + self.staffCursor.setTrimmed("forename", TRUE) + self.staffCursor.setTrimmed("surname", TRUE) + self.idIndex = self.staffCursor.index("id") + self.staffCursor.select(self.idIndex) + self.staffCursor.first() + + self.propMap = QSqlPropertyMap() + self.propMap.insert(forenameEdit.className(), "upperLine") + + self.sqlForm = QSqlForm() + self.sqlForm.setRecord(self.staffCursor.primeUpdate()) + self.sqlForm.installPropertyMap(self.propMap) + self.sqlForm.insert(forenameEdit, "forename") + self.sqlForm.insert(surnameEdit, "surname") + self.sqlForm.insert(salaryEdit, "salary") + self.sqlForm.readFields() + + def save(self): + self.sqlForm.writeFields() + self.staffCursor.update() + self.staffCursor.select(self.idIndex) + self.staffCursor.first() + + +if __name__=='__main__': + app = QApplication( sys.argv ) + + if createConnection(): + formDialog = FormDialog() + formDialog.show() + + app.setMainWidget(formDialog) + app.exec_loop() + + diff --git a/python/pyqt/examples3/SQL/sqlex.ui b/python/pyqt/examples3/SQL/sqlex.ui new file mode 100644 index 00000000..022fed93 --- /dev/null +++ b/python/pyqt/examples3/SQL/sqlex.ui @@ -0,0 +1,303 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>SqlEx</class> +<widget class="QWidget"> + <property name="name"> + <cstring>SqlEx</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>669</width> + <height>438</height> + </rect> + </property> + <property name="caption"> + <string>SQL Browser</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout23</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>lbl</cstring> + </property> + <property name="text"> + <string>Press "Connect" to open a database</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>conBtn</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>&Connect...</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QSplitter" row="0" column="0"> + <property name="name"> + <cstring>vsplit</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <widget class="QSplitter"> + <property name="name"> + <cstring>hsplit</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <widget class="QListView"> + <column> + <property name="text"> + <string>Tables</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Type</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Required</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>lv</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="resizeMode"> + <enum>LastColumn</enum> + </property> + </widget> + <widget class="QDataTable"> + <property name="name"> + <cstring>dt</cstring> + </property> + <property name="frameworkCode" stdset="0"> + <bool>false</bool> + </property> + </widget> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>gb</cstring> + </property> + <property name="title"> + <string>SQL Query</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout22</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QTextEdit"> + <property name="name"> + <cstring>te</cstring> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout21</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>submitBtn</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>&Submit</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>clearBtn</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>80</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>C&lear</string> + </property> + </widget> + </hbox> + </widget> + </vbox> + </widget> + </grid> + </widget> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>clearBtn</sender> + <signal>clicked()</signal> + <receiver>te</receiver> + <slot>clear()</slot> + </connection> + <connection> + <sender>conBtn</sender> + <signal>clicked()</signal> + <receiver>SqlEx</receiver> + <slot>dbConnect()</slot> + </connection> + <connection> + <sender>lv</sender> + <signal>returnPressed(QListViewItem*)</signal> + <receiver>SqlEx</receiver> + <slot>showTable(QListViewItem*)</slot> + </connection> + <connection> + <sender>lv</sender> + <signal>doubleClicked(QListViewItem*)</signal> + <receiver>SqlEx</receiver> + <slot>showTable(QListViewItem*)</slot> + </connection> + <connection> + <sender>submitBtn</sender> + <signal>clicked()</signal> + <receiver>SqlEx</receiver> + <slot>execQuery()</slot> + </connection> +</connections> +<includes> + <include location="local" impldecl="in implementation">sqlex.ui.h</include> +</includes> +<slots> + <slot>init()</slot> + <slot>dbConnect()</slot> + <slot>showTable( QListViewItem * )</slot> + <slot>execQuery()</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/python/pyqt/examples3/SQL/sqlex.ui.h b/python/pyqt/examples3/SQL/sqlex.ui.h new file mode 100644 index 00000000..1acdc5d4 --- /dev/null +++ b/python/pyqt/examples3/SQL/sqlex.ui.h @@ -0,0 +1,35 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename slots use Qt Designer which will +** update this file, preserving your code. Create an init() slot in place of +** a constructor, and a destroy() slot in place of a destructor. +*****************************************************************************/ + + +void SqlEx::init() +{ +self.hsplit.setSizes([250]) +self.hsplit.setResizeMode(self.lv, QSplitter.KeepSize) +self.vsplit.setResizeMode(self.gb, QSplitter.KeepSize) +self.submitBtn.setEnabled(0) +} + + +void SqlEx::dbConnect() +{ + +} + + +void SqlEx::showTable( QListViewItem * ) +{ + +} + + + +void SqlEx::execQuery() +{ + +} diff --git a/python/pyqt/examples3/SQL/sqlsubclass5.py b/python/pyqt/examples3/SQL/sqlsubclass5.py new file mode 100755 index 00000000..a130e78a --- /dev/null +++ b/python/pyqt/examples3/SQL/sqlsubclass5.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * +from qtsql import * + +from dbconnect import createConnection + +TRUE = 1 +FALSE = 0 + +class CustomTable(QDataTable): + def __init__(self, cursor, autoPopulate = FALSE, parent = None, name = None): + QDataTable.__init__(self, cursor, autoPopulate, parent, name) + + def paintField(self, p, field, cr, b): + if not field: + return + fn = str(field.name()) + if fn == "pricesid": + query = QSqlQuery("SELECT name FROM prices WHERE id=%s" % + field.value().toString()) + value = "" + if query.next(): + value = query.value(0).toString() + p.drawText(2, 2, cr.width()-4, cr.height()-4, + self.fieldAlignment(field), value) + elif fn == "quantity": + p.drawText(2, 2, cr.width()-6, cr.height()-4, + Qt.AlignRight|Qt.AlignVCenter, field.value().toString()) + elif fn in ("price", "cost"): + v = field.value().toDouble() + if v < 0: + p.setPen(QColor("red")) + value = QString(u"%.2f \u20ac" % v) + p.drawText(2, 2, cr.width()-6, cr.height()-4, + Qt.AlignRight|Qt.AlignVCenter, value) + elif fn == "paiddate": + if field.value().toDate().isNull(): + v = QString("not yet") + p.setPen(QColor("red")) + else: + v = field.value().toDate().toString(Qt.LocalDate) + p.drawText(2, 2, cr.width()-4, cr.height()-4, + Qt.AlignHCenter|Qt.AlignVCenter, v) + else: + QDataTable.paintField(self, p, field, cr, b) + + +class InvoiceItemCursor(QSqlCursor): + def __init__(self): + QSqlCursor.__init__(self, "invoiceitem") + + productPrice = QSqlFieldInfo("price", QVariant.Double) + self.append(productPrice) + self.setCalculated(productPrice.name(), TRUE) + + productCost = QSqlFieldInfo("cost", QVariant.Double) + self.append(productCost) + self.setCalculated(productCost.name(), TRUE) + + def calculateField(self, name): + fn = str(name) + if fn == "productname": + query = QSqlQuery("SELECT name FROM prices WHERE id=%d;" % + (self.field("pricesid").value().toInt())) + if query.next(): + return query.value(0) + elif fn == "price": + query = QSqlQuery("SELECT price FROM prices WHERE id=%d;" % + (self.field("pricesid").value().toInt())) + if query.next(): + return query.value(0) + elif fn == "cost": + query = QSqlQuery("SELECT price FROM prices WHERE id=%d;" % + (self.field("pricesid").value().toInt())) + if query.next(): + return QVariant(query.value(0).toDouble() * + self.value("quantity").toDouble()) + return QVariant(QString.null) + + def primeInsert(self): + buffer = self.editBuffer() + buffer.setValue("id", QVariant(0)) + buffer.setValue("paiddate", QVariant(QDate.currentDate())) + buffer.setValue("quantity", QVariant(1)) + return buffer + + +class ProductPicker(QComboBox): + def __init__(self, parent = None, name = None): + QComboBox.__init__(self, parent, name) + cur = QSqlCursor("prices") + cur.select(cur.index("id")) + while cur.next(): + self.insertItem(cur.value("name").toString(), cur.value("id").toInt()) + + +class CustomSqlEditorFactory(QSqlEditorFactory): + def __init__(self): + QSqlEditorFactory.__init__(self) + + def createEditor(self, parent, field): + try: + if str(field.name()) == "pricesid": + return ProductPicker(parent) + except AttributeError: + pass + return QSqlEditorFactory.createEditor(self, parent, field) + +class Table(CustomTable): + def __init__(self): + self.invoiceItemCursor = InvoiceItemCursor() + QDataTable.__init__(self, self.invoiceItemCursor) + self.propMap = QSqlPropertyMap() + self.editorFactory = CustomSqlEditorFactory() + self.propMap.insert("ProductPicker", "pricesid") + self.installPropertyMap(self.propMap) + self.installEditorFactory(self.editorFactory) + + for cn, ch in (("pricesid", "Product"), + ("quantity", "Quantity"), + ("price", "Price" ), + ("cost", "Cost"), + ("paiddate", "Paid")): + self.addColumn(cn, ch) + self.setColumnWidth(0 , 150) + self.setColumnWidth(1, 70) + self.resize(600, 250) + self.refresh() + + +if __name__=='__main__': + app = QApplication(sys.argv) + if createConnection(): + t = Table() + app.setMainWidget(t) + t.show() + app.exec_loop() + + diff --git a/python/pyqt/examples3/SQL/sqltable4.py b/python/pyqt/examples3/SQL/sqltable4.py new file mode 100755 index 00000000..4fa6ed06 --- /dev/null +++ b/python/pyqt/examples3/SQL/sqltable4.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * +from qtsql import * + +from dbconnect import createConnection + +TRUE = 1 +FALSE = 0 + +class CustomTable(QDataTable): + def __init__(self, cursor, autoPopulate = FALSE, parent = None, name = None): + QDataTable.__init__(self, cursor, autoPopulate, parent, name) + + def paintField(self, p, field, cr, b): + if not field: + return + fn = str(field.name()) + if fn in ("salary", "monsalary"): + v = field.value().toDouble() + if v < 0: + p.setPen(QColor("red")) + value = QString(u"%.2f \u20ac" % v) + #print unicode(value).encode("iso-8859-15") + p.drawText(2, 2, cr.width()-6, cr.height()-4, + Qt.AlignRight|Qt.AlignVCenter, value) + elif fn == "statusid": + query = QSqlQuery("SELECT name FROM status WHERE id=%s" % + field.value().toString()) + value = "" + if query.next(): + value = query.value(0).toString() + p.drawText(2, 2, cr.width()-4, cr.height()-4, + self.fieldAlignment(field), value) + else: + QDataTable.paintField(self, p, field, cr, b) + + +class StatusPicker(QComboBox): + def __init__(self, parent = None, name = None): + QComboBox.__init__(self, parent, name) + cur = QSqlCursor("status") + cur.select(cur.index("id")) + while cur.next(): + self.insertItem(cur.value("name").toString(), cur.value("id").toInt()) + + +class CustomSqlEditorFactory(QSqlEditorFactory): + def __init__(self): + QSqlEditorFactory.__init__(self) + + def createEditor(self, parent, field): + try: + if str(field.name()) == "statusid": + return StatusPicker(parent) + except AttributeError: + pass + return QSqlEditorFactory.createEditor(self, parent, field) + + +class StaffCursor(QSqlCursor): + def __init__(self): + QSqlCursor.__init__(self, "staff") + monSalary = QSqlFieldInfo("monsalary", QVariant.Double) + self.append(monSalary) + self.setCalculated(monSalary.name(), TRUE) + + def calculateField(self, name): + if str(name) == "monsalary": + return QVariant(self.value("salary").toDouble() / 12) + return QVariant(QString.null) + + +class Table(CustomTable): + def __init__(self): + #self.staffCursor = QSqlCursor("staff") + self.staffCursor = StaffCursor() + QDataTable.__init__(self, self.staffCursor) + self.propMap = QSqlPropertyMap() + self.editorFactory = CustomSqlEditorFactory() + self.propMap.insert("StatusPicker", "statusid") + self.installPropertyMap(self.propMap) + self.installEditorFactory(self.editorFactory) + for cn, ch in (("forename", "Forename"), + ("surname", "Surname" ), + ("salary", "Annual Salary"), + ("monsalary","Monthly Salary"), + ("statusid", "Status")): + self.addColumn(cn, ch) + self.order = QStringList("surname") + self.order.append("forename") + self.setSort(self.order) + self.refresh() + + +if __name__=='__main__': + app = QApplication(sys.argv) + #app.setFont(QFont("Verdana", 11)) + + if createConnection(): + t = Table() + app.setMainWidget(t) + t.resize(600, 250) + t.show() + app.exec_loop() + + diff --git a/python/pyqt/examples3/SQL/testdb_mysql.sql b/python/pyqt/examples3/SQL/testdb_mysql.sql new file mode 100644 index 00000000..144d4c90 --- /dev/null +++ b/python/pyqt/examples3/SQL/testdb_mysql.sql @@ -0,0 +1,57 @@ +drop database testdb; +create database testdb; +use testdb; + +create table people (id integer primary key auto_increment, + name char(40)); + +create table staff (id integer primary key auto_increment, + forename char(40), + surname char(40), + salary float(10,2), + statusid integer); + +create table status (id integer primary key, + name char(30)); + +create table creditors (id integer primary key auto_increment, + forename char(40), + surname char(40), + city char(30)); + +create table prices (id integer primary key, + name char(40), + price float); + +create table invoiceitem (id integer primary key auto_increment, + pricesid integer, + quantity integer, + paiddate date); + +insert into staff (forename, surname, salary, statusid) values + ("Hugo", "Hurtig", 123450.50, 0), + ("Alfred E.", "Neumann", 56780.90, 1), + ("Agate", "Schnell-Fertig", 12340.56, 2), + ("Emil", "Dotterschreck", -5670.23, 3), + ("Eugen", "Nutzlos", -7833.56, 3), + ("Harald", "Schmidt", -150000.0, 3), + ("Urmel", "auf dem Eis", 7778.0, 2); + +insert into status (id, name) values + (0, 'Chief'), + (1, 'Programmer'), + (2, 'Secretary'), + (3, 'Driver'); + +insert into prices (id, name, price) values + (0, "Waschbecken", 150.25), + (1, "Wellensittich", 27.95), + (2, "Roter Papagei", 850.0), + (3, "Spam & Eggs", -7.50), + (4, "Renault Espace", 9000.0), + (5, "Tux, der Pinguin", 65.35), + (6, "Makroskop", 985000.0), + (7, "Regenbaum", 1235.65), + (8, "Bluterguß", 23.95), + (9, "Weltmeisterschaft", 2.95), + (10, "Premiere Dekoder", -185.75); diff --git a/python/pyqt/examples3/SQL/testdb_pg.sql b/python/pyqt/examples3/SQL/testdb_pg.sql new file mode 100644 index 00000000..73a42703 --- /dev/null +++ b/python/pyqt/examples3/SQL/testdb_pg.sql @@ -0,0 +1,232 @@ +-- +-- Selected TOC Entries: +-- +-- +-- TOC Entry ID 1 (OID 0) +-- +-- Name: testdb Type: DATABASE Owner: postgres +-- + +CREATE DATABASE "testdb"; + +\connect testdb postgres +-- +-- TOC Entry ID 16 (OID 17332) +-- +-- Name: people Type: TABLE Owner: postgres +-- + +CREATE TABLE "people" ( + "id" integer DEFAULT nextval('people_id_seq'::text) NOT NULL, + "name" character(40), + Constraint "people_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 17 (OID 17335) +-- +-- Name: staff Type: TABLE Owner: postgres +-- + +CREATE TABLE "staff" ( + "id" integer DEFAULT nextval('staff_id_seq'::text) NOT NULL, + "forename" character(40), + "surname" character(40), + "salary" money, + "statusid" integer, + Constraint "staff_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 18 (OID 17338) +-- +-- Name: status Type: TABLE Owner: postgres +-- + +CREATE TABLE "status" ( + "id" integer NOT NULL, + "name" character(30), + Constraint "status_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 19 (OID 17341) +-- +-- Name: creditors Type: TABLE Owner: postgres +-- + +CREATE TABLE "creditors" ( + "id" integer DEFAULT nextval('creditors_id_seq'::text) NOT NULL, + "forename" character(40), + "surname" character(40), + "city" character(30), + Constraint "creditors_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 20 (OID 17344) +-- +-- Name: prices Type: TABLE Owner: postgres +-- + +CREATE TABLE "prices" ( + "id" integer NOT NULL, + "name" character(40), + "price" real, + Constraint "prices_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 21 (OID 17347) +-- +-- Name: invoiceitem Type: TABLE Owner: postgres +-- + +CREATE TABLE "invoiceitem" ( + "id" integer DEFAULT nextval('invoice_id_seq'::text) NOT NULL, + "pricesid" integer, + "quantity" integer, + "paiddate" date, + Constraint "invoiceitem_pkey" Primary Key ("id") +); + +-- +-- TOC Entry ID 2 (OID 17351) +-- +-- Name: people_id_seq Type: SEQUENCE Owner: postgres +-- + +CREATE SEQUENCE "people_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; + +-- +-- TOC Entry ID 4 (OID 17353) +-- +-- Name: staff_id_seq Type: SEQUENCE Owner: postgres +-- + +CREATE SEQUENCE "staff_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; + +-- +-- TOC Entry ID 6 (OID 17355) +-- +-- Name: creditors_id_seq Type: SEQUENCE Owner: postgres +-- + +CREATE SEQUENCE "creditors_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; + +-- +-- TOC Entry ID 8 (OID 17357) +-- +-- Name: invoice_id_seq Type: SEQUENCE Owner: postgres +-- + +CREATE SEQUENCE "invoice_id_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; + +-- +-- Data for TOC Entry ID 28 (OID 17332) +-- +-- Name: people Type: TABLE DATA Owner: postgres +-- + + +COPY "people" FROM stdin; +\. +-- +-- Data for TOC Entry ID 29 (OID 17335) +-- +-- Name: staff Type: TABLE DATA Owner: postgres +-- + + +COPY "staff" FROM stdin; +1 Hugo Hurtig $123,450.50 0 +2 Alfred E. Neumann $56,780.90 1 +3 Agate Schnell-Fertig $12,340.56 2 +6 Eugen Nutzlos -$7,833.56 3 +7 Harald Schmidt -$150,000.00 3 +4 Urmel auf dem Eis $7,778.00 2 +5 Emil Dotterschreck -$5,670.23 3 +\. +-- +-- Data for TOC Entry ID 30 (OID 17338) +-- +-- Name: status Type: TABLE DATA Owner: postgres +-- + + +COPY "status" FROM stdin; +0 Chief +1 Programmer +2 Secretary +3 Driver +\. +-- +-- Data for TOC Entry ID 31 (OID 17341) +-- +-- Name: creditors Type: TABLE DATA Owner: postgres +-- + + +COPY "creditors" FROM stdin; +\. +-- +-- Data for TOC Entry ID 32 (OID 17344) +-- +-- Name: prices Type: TABLE DATA Owner: postgres +-- + + +COPY "prices" FROM stdin; +0 Waschbecken 150.25 +1 Wellensittich 27.95 +2 Roter Papagei 850 +3 Spam & Eggs -7.5 +4 Renault Espace 9000 +5 Tux, der Pinguin 65.35 +6 Makroskop 985000 +7 Regenbaum 1235.65 +8 Bluterguß 23.95 +9 Weltmeisterschaft 2.95 +10 Premiere Dekoder -185.75 +\. +-- +-- Data for TOC Entry ID 33 (OID 17347) +-- +-- Name: invoiceitem Type: TABLE DATA Owner: postgres +-- + + +COPY "invoiceitem" FROM stdin; +\. +-- +-- TOC Entry ID 3 (OID 17351) +-- +-- Name: people_id_seq Type: SEQUENCE SET Owner: postgres +-- + +SELECT setval ('"people_id_seq"', 1, false); + +-- +-- TOC Entry ID 5 (OID 17353) +-- +-- Name: staff_id_seq Type: SEQUENCE SET Owner: postgres +-- + +SELECT setval ('"staff_id_seq"', 8, true); + +-- +-- TOC Entry ID 7 (OID 17355) +-- +-- Name: creditors_id_seq Type: SEQUENCE SET Owner: postgres +-- + +SELECT setval ('"creditors_id_seq"', 1, false); + +-- +-- TOC Entry ID 9 (OID 17357) +-- +-- Name: invoice_id_seq Type: SEQUENCE SET Owner: postgres +-- + +SELECT setval ('"invoice_id_seq"', 1, false); + diff --git a/python/pyqt/examples3/aclock.py b/python/pyqt/examples3/aclock.py new file mode 100755 index 00000000..38ed36c9 --- /dev/null +++ b/python/pyqt/examples3/aclock.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +import sys +from qt import * + +def QMIN(x, y): + if y > x: return y + return x +class AnalogClock(QWidget): + def __init__(self, *args): + apply(QWidget.__init__,(self,) + args) + self.time = QTime.currentTime() + internalTimer = QTimer(self) + self.connect(internalTimer, SIGNAL("timeout()"), self.timeout) + internalTimer.start(5000) + + def timeout(self): + new_time = QTime.currentTime() + if new_time.minute() != self.time.minute(): + self.update() + + def paintEvent(self, qe): + if not self.isVisible(): + return + self.time = QTime.currentTime() + + pts = QPointArray() + paint = QPainter(self) + paint.setBrush(self.foregroundColor()) + + cp = QPoint(self.rect().center()) + d = QMIN(self.width(), self.height()) + matrix = QWMatrix() + matrix.translate(cp.x(), cp.y()) + matrix.scale(d/1000.0, d/1000.0) + + h_angle = 30*(self.time.hour()%12 - 3) + self.time.minute()/2 + matrix.rotate(h_angle) + paint.setWorldMatrix(matrix) + pts.setPoints([-20,0,0,-20,300,0,0,20]) + paint.drawPolygon(pts) + matrix.rotate(-h_angle) + + m_angle = (self.time.minute()-15)*6 + matrix.rotate(m_angle) + paint.setWorldMatrix(matrix) + pts.setPoints([-10,0,0,-10,400,0,0,10]) + paint.drawPolygon(pts) + matrix.rotate(-m_angle) + + for i in range(0,12): + paint.setWorldMatrix(matrix) + paint.drawLine(450,0, 500,0) + matrix.rotate(30) + +a = QApplication(sys.argv) +clock = AnalogClock() +clock.resize(100,100) +a.setMainWidget(clock) +clock.show() +a.exec_loop() diff --git a/python/pyqt/examples3/addressbook.py b/python/pyqt/examples3/addressbook.py new file mode 100755 index 00000000..d7316e33 --- /dev/null +++ b/python/pyqt/examples3/addressbook.py @@ -0,0 +1,457 @@ +#!/usr/bin/env python + +# A port to PyQt of the application example from Qt v2.x. + + +import sys, string +from qt import * + +TRUE = 1 +FALSE = 0 +fileopen = [ +' 16 13 5 1', +'. c #040404', +'# c #808304', +'a c None', +'b c #f3f704', +'c c #f3f7f3', +'aaaaaaaaa...aaaa', +'aaaaaaaa.aaa.a.a', +'aaaaaaaaaaaaa..a', +'a...aaaaaaaa...a', +'.bcb.......aaaaa', +'.cbcbcbcbc.aaaaa', +'.bcbcbcbcb.aaaaa', +'.cbcb...........', +'.bcb.#########.a', +'.cb.#########.aa', +'.b.#########.aaa', +'..#########.aaaa', +'...........aaaaa' +] + +filesave = [ +' 14 14 4 1', +'. c #040404', +'# c #808304', +'a c #bfc2bf', +'b c None', +'..............', +'.#.aaaaaaaa.a.', +'.#.aaaaaaaa...', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.#.aaaaaaaa.#.', +'.##........##.', +'.############.', +'.##.........#.', +'.##......aa.#.', +'.##......aa.#.', +'.##......aa.#.', +'b.............' +] + +fileprint = [ +' 16 14 6 1', +'. c #000000', +'# c #848284', +'a c #c6c3c6', +'b c #ffff00', +'c c #ffffff', +'d c None', +'ddddd.........dd', +'dddd.cccccccc.dd', +'dddd.c.....c.ddd', +'ddd.cccccccc.ddd', +'ddd.c.....c....d', +'dd.cccccccc.a.a.', +'d..........a.a..', +'.aaaaaaaaaa.a.a.', +'.............aa.', +'.aaaaaa###aa.a.d', +'.aaaaaabbbaa...d', +'.............a.d', +'d.aaaaaaaaa.a.dd', +'dd...........ddd' +] + +class ABCentralWidget( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self, ) + args ) + self.mainGrid = QGridLayout( self, 2, 1, 5, 5 ) + + self.setupTabWidget() + self.setupListView() + + self.mainGrid.setRowStretch( 0, 0 ) + self.mainGrid.setRowStretch( 1, 1 ) + + def save( self, filename ): + if not self.listView.firstChild(): + return + + f = QFile( filename ) + if not f.open( IO_WriteOnly ): + return + + t = QTextStream( f ) + + #it = QListViewItemIterator( self.listView ) + + while not t.eof(): + item = QListViewItem( self.listView ) + for i in range (0, 4): + t << item.text( i ) << '\n' + #for it in it.current(): + #for i in range (0, 4): + #t << it.current().text[ i ] << "\n" + + f.close() + + + def load( self, filename ): + self.listView.clear() + + f = QFile( filename ) + if not f.open( IO_ReadOnly ): + return + + t = QTextStream( f ) + + while not t.eof(): + item = QListViewItem( self.listView ) + for i in range (0, 4): + item.setText( i, t.readLine() ) + + f.close(); + + + def setupTabWidget( self ): + self.tabWidget = QTabWidget( self ) + + self.input = QWidget( self.tabWidget ) + self.grid1 = QGridLayout( self.input, 2, 5, 5, 5 ) + + self.liFirstName = QLabel( 'First &Name', self.input ) + self.liFirstName.resize( self.liFirstName.sizeHint() ) + self.grid1.addWidget( self.liFirstName, 0, 0 ) + + self.liLastName = QLabel( '&Last Name', self.input ) + self.liLastName.resize( self.liLastName.sizeHint() ) + self.grid1.addWidget( self.liLastName, 0, 1 ) + + self.liAddress = QLabel( '&Address', self.input ) + self.liAddress.resize( self.liAddress.sizeHint() ) + self.grid1.addWidget( self.liAddress, 0, 2 ) + + self.liEMail = QLabel( '&E-Mail', self.input ) + self.liEMail.resize( self.liEMail.sizeHint() ) + self.grid1.addWidget( self.liEMail, 0, 3 ) + + self.add = QPushButton( '&Add', self.input ) + self.add.resize( self.add.sizeHint() ) + self.grid1.addWidget( self.add, 0, 4 ) + self.connect( self.add, SIGNAL( 'clicked()' ), self.addEntry ) + + self.iFirstName = QLineEdit( self.input ) + self.iFirstName.resize( self.iFirstName.sizeHint() ) + self.grid1.addWidget( self.iFirstName, 1, 0 ) + self.liFirstName.setBuddy( self.iFirstName ) + + self.iLastName = QLineEdit( self.input ) + self.iLastName.resize( self.iLastName.sizeHint() ) + self.grid1.addWidget( self.iLastName, 1, 1 ) + self.liLastName.setBuddy( self.iLastName ) + + self.iAddress = QLineEdit( self.input ) + self.iAddress.resize( self.iAddress.sizeHint() ) + self.grid1.addWidget( self.iAddress, 1, 2 ) + self.liAddress.setBuddy( self.iAddress ) + + self.iEMail = QLineEdit( self.input ) + self.iEMail.resize( self.iEMail.sizeHint() ) + self.grid1.addWidget( self.iEMail, 1, 3 ) + self.liEMail.setBuddy( self.iEMail ) + + self.change = QPushButton( '&Change', self.input ) + self.change.resize( self.change.sizeHint() ) + self.grid1.addWidget( self.change, 1, 4 ) + self.connect( self.change, SIGNAL( 'clicked()' ), self.changeEntry ) + + self.tabWidget.addTab( self.input, '&Add/Change Entry' ) + + # -------------------------------------- + + self.search = QWidget( self ) + self.grid2 = QGridLayout( self.search, 2, 5, 5, 5 ) + + self.cFirstName = QCheckBox( 'First &Name', self.search ) + self.cFirstName.resize( self.cFirstName.sizeHint() ) + self.grid2.addWidget( self.cFirstName, 0, 0 ) + self.connect( self.cFirstName, SIGNAL( 'clicked()' ), self.toggleFirstName ) + + self.cLastName = QCheckBox( '&Last Name', self.search ) + self.cLastName.resize( self.cLastName.sizeHint() ) + self.grid2.addWidget( self.cLastName, 0, 1 ) + self.connect( self.cLastName, SIGNAL( 'clicked()' ), self.toggleLastName ) + + self.cAddress = QCheckBox( '&Address', self.search ) + self.cAddress.resize( self.cAddress.sizeHint() ) + self.grid2.addWidget( self.cAddress, 0, 2 ) + self.connect( self.cAddress, SIGNAL( 'clicked()' ), self.toggleAddress ) + + self.cEMail = QCheckBox( '&E-Mail', self.search ) + self.cEMail.resize( self.cEMail.sizeHint() ) + self.grid2.addWidget( self.cEMail, 0, 3 ) + self.connect( self.cEMail, SIGNAL( 'clicked()' ), self.toggleEMail ) + + self.sFirstName = QLineEdit( self.search ) + self.sFirstName.resize( self.sFirstName.sizeHint() ) + self.grid2.addWidget( self.sFirstName, 1, 0 ) + + self.sLastName = QLineEdit( self.search ) + self.sLastName.resize( self.sLastName.sizeHint() ) + self.grid2.addWidget( self.sLastName, 1, 1 ) + + self.sAddress = QLineEdit( self.search ) + self.sAddress.resize( self.sAddress.sizeHint() ) + self.grid2.addWidget( self.sAddress, 1, 2 ) + + self.sEMail = QLineEdit( self.search ) + self.sEMail.resize( self.sEMail.sizeHint() ) + self.grid2.addWidget( self.sEMail, 1, 3 ) + + self.find = QPushButton( '&Find', self.search ) + self.find.resize( self.find.sizeHint() ) + self.grid2.addWidget( self.find, 1, 4 ) + self.connect( self.find, SIGNAL( 'clicked()' ), self.findEntries ) + + self.cFirstName.setChecked( TRUE ) + self.sFirstName.setEnabled( TRUE ) + self.sLastName.setEnabled( FALSE ) + self.sAddress.setEnabled( FALSE ) + self.sEMail.setEnabled( FALSE ) + + self.tabWidget.addTab( self.search, "&Search" ) + + self.mainGrid.addWidget( self.tabWidget, 0, 0 ) + + def setupListView( self ): + self.listView = QListView( self ) + self.listView.addColumn( 'First Name' ) + self.listView.addColumn( 'Last Name' ) + self.listView.addColumn( 'Address' ) + self.listView.addColumn( 'E-Mail' ) + + self.listView.setSelectionMode( QListView.Extended ) + + self.connect( self.listView, SIGNAL( 'clicked( QListViewItem* )' ), self.itemSelected ) + + self.mainGrid.addWidget( self.listView, 1, 0 ) + self.listView.setAllColumnsShowFocus( TRUE ) + + + def addEntry( self ): + if not self.iFirstName.text().isEmpty() or not self.iLastName.text().isEmpty() or \ + not self.iAddress.text().isEmpty() or not self.iEMail.text().isEmpty() : + self.item = QListViewItem( self.listView ) + self.item.setText( 0, self.iFirstName.text() ) + self.item.setText( 1, self.iLastName.text() ) + self.item.setText( 2, self.iAddress.text() ) + self.item.setText( 3, self.iEMail.text() ) + + self.iFirstName.setText( '' ) + self.iLastName.setText( '' ) + self.iAddress.setText( '' ) + self.iEMail.setText( '' ) + + def changeEntry( self ): + self.item = self.listView.currentItem() + if self.item and ( not self.iFirstName.text().isEmpty() or not self.iLastName.text().isEmpty() or \ + not self.iAddress.text().isEmpty() or not self.iEMail.text().isEmpty() ) : + self.item.setText( 0, self.iFirstName.text() ) + self.item.setText( 1, self.iLastName.text() ) + self.item.setText( 2, self.iAddress.text() ) + self.item.setText( 3, self.iEMail.text() ) + + def selectionChanged( self ): + self.iFirstName.setText( '' ) + self.iLastName.setText( '' ) + self.iAddress.setText( '' ) + self.iEMail.setText( '' ) + + def itemSelected( self, item ): + self.item.setSelected( TRUE ) + self.item.repaint() + + self.iFirstName.setText( item.text( 0 ) ) + self.iLastName.setText( item.text( 1 ) ) + self.iAddress.setText( item.text( 2 ) ) + self.iEMail.setText( item.text( 3 ) ) + + def toggleFirstName( self ): + self.sFirstName.setText( '' ) + if self.cFirstName.isChecked(): + self.sFirstName.setEnabled( TRUE ) + self.sFirstName.setFocus() + else: + self.sFirstName.setEnabled( FALSE ) + + def toggleLastName( self ): + self.sLastName.setText( '' ) + if self.cLastName.isChecked(): + self.sLastName.setEnabled( TRUE ) + self.sLastName.setFocus() + else: + self.sLastName.setEnabled( FALSE ) + + + def toggleAddress( self ): + self.sAddress.setText( '' ) + if self.cAddress.isChecked(): + self.sAddress.setEnabled( TRUE ) + self.sAddress.setFocus() + else: + self.sAddress.setEnabled( FALSE ) + + + def toggleEMail( self ): + self.sEMail.setText( '' ) + if self.cEMail.isChecked(): + self.sEMail.setEnabled( TRUE ) + self.sEMail.setFocus() + + else: + self.sEMail.setEnabled( FALSE ) + + + def findEntries( self ): + if not self.cFirstName.isChecked() and not self.cLastName.isChecked() and \ + not self.cAddress.isChecked() and not self.cEMail.isChecked(): + self.listView.clearSelection() + return + + it = QListViewItemIterator( self.listView ) + + for it in it.current() : + select = TRUE + + if self.cFirstName.isChecked(): + if select and it.current().text( 0 ).contains( self.sFirstName.text() ): + select = TRUE + else: + select = FALSE + + if self.cLastName.isChecked(): + if select and it.current().text( 1 ).contains( self.sLastName.text() ): + select = TRUE + else: + select = FALSE + + if self.cAddress.isChecked(): + if select and it.current().text( 2 ).contains( self.sAddress.text() ): + select = TRUE + else: + select = FALSE + + if self.cEMail.isChecked(): + if select and it.current().text( 3 ).contains( self.sEMail.text() ): + select = TRUE + else: + select = FALSE + + + if select: + it.current().setSelected( TRUE ) + else: + it.current().setSelected( FALSE ) + it.current().repaint() + + +class ABMainWindow(QMainWindow): + def __init__( self ): + QMainWindow.__init__( self, None, 'example addressbook application' ) + + self.filename = QString.null + self.setupMenuBar() + self.setupFileTools() + self.setupStatusBar() + self.setupCentralWidget() + + def setupMenuBar( self ): + self.file = QPopupMenu( self ) + self.menuBar().insertItem( '&File', self.file ) + + openIcon = QIconSet( QPixmap( fileopen ) ) + self.file.insertItem( 'New', self.fileNew, Qt.CTRL + Qt.Key_N ) + self.file.insertItem( openIcon, 'Open', self.fileOpen, Qt.CTRL + Qt.Key_O ) + self.file.insertSeparator() + saveIcon = QIconSet( QPixmap( filesave ) ) + self.file.insertItem( saveIcon, 'Save', self.fileSave, Qt.CTRL + Qt.Key_S ) + self.file.insertItem( 'Save As...', self.fileSaveAs ) + self.file.insertSeparator() + printIcon = QIconSet( QPixmap( fileprint ) ) + self.file.insertItem( printIcon, 'Print...', self.filePrint, Qt.CTRL + Qt.Key_P ) + self.file.insertSeparator() + #self.file.insertItem( 'Close', self.closeWindow, Qt.CTRL + Qt.Key_W ) + self.file.insertItem('Close', self, SLOT('close()'), Qt.CTRL+Qt.Key_W) + self.file.insertItem( 'Quit', qApp, SLOT( 'quit()' ), Qt.CTRL + Qt.Key_Q ) + + def setupFileTools( self ): + pass + #self.fileTools = QToolBar( self, 'file operations' ) + + def setupStatusBar( self ): + self.statusBar().message( "Ready", 2000 ) + + def setupCentralWidget( self ): + self.view = ABCentralWidget( self ) + #self.view.show() + self.setCentralWidget( self.view ) + + def closeWindow( self ): + close() + + + def fileNew( self ): + pass + + def fileOpen( self ): + fn = QFileDialog.getOpenFileName( QString.null, QString.null, self ) + if not fn.isEmpty(): + self.filename = fn + self.view.load( self.filename ) + + def fileSave( self ): + if self.filename.isEmpty(): + self.fileSaveAs() + return + + self.view.save( self.filename ) + + def fileSaveAs( self ): + fn = QFileDialog.getSaveFileName( QString.null, QString.null, self ) + if not fn.isEmpty(): + self.filename = fn + self.fileSave + + def filePrint( self ): + pass + + +a = QApplication( sys.argv ) + +mw = ABMainWindow() +#mw.setupMenuBar() +#mw.setupFileTools +#mw.setupStatusBar +#mw.setupCentralWidget +#view = ABCentralWidget() +#mw.setCentralWidget( view ) +mw.setCaption( 'Addressbook 1' ) +a.setMainWidget( mw ) +mw.show() + +a.connect( a, SIGNAL( 'lastWindowClosed()' ), a, SLOT( 'quit()' ) ) +a.exec_loop() diff --git a/python/pyqt/examples3/application.py b/python/pyqt/examples3/application.py new file mode 100755 index 00000000..f5c027db --- /dev/null +++ b/python/pyqt/examples3/application.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python + +# A simple application. + + +import sys, string +from qt import * + + +fileopen = [ + '16 13 5 1', + '. c #040404', + '# c #808304', + 'a c None', + 'b c #f3f704', + 'c c #f3f7f3', + 'aaaaaaaaa...aaaa', + 'aaaaaaaa.aaa.a.a', + 'aaaaaaaaaaaaa..a', + 'a...aaaaaaaa...a', + '.bcb.......aaaaa', + '.cbcbcbcbc.aaaaa', + '.bcbcbcbcb.aaaaa', + '.cbcb...........', + '.bcb.#########.a', + '.cb.#########.aa', + '.b.#########.aaa', + '..#########.aaaa', + '...........aaaaa' +] + +filesave = [ + '14 14 4 1', + '. c #040404', + '# c #808304', + 'a c #bfc2bf', + 'b c None', + '..............', + '.#.aaaaaaaa.a.', + '.#.aaaaaaaa...', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.##........##.', + '.############.', + '.##.........#.', + '.##......aa.#.', + '.##......aa.#.', + '.##......aa.#.', + 'b.............' +] + +fileprint = [ + '16 14 6 1', + '. c #000000', + '# c #848284', + 'a c #c6c3c6', + 'b c #ffff00', + 'c c #ffffff', + 'd c None', + 'ddddd.........dd', + 'dddd.cccccccc.dd', + 'dddd.c.....c.ddd', + 'ddd.cccccccc.ddd', + 'ddd.c.....c....d', + 'dd.cccccccc.a.a.', + 'd..........a.a..', + '.aaaaaaaaaa.a.a.', + '.............aa.', + '.aaaaaa###aa.a.d', + '.aaaaaabbbaa...d', + '.............a.d', + 'd.aaaaaaaaa.a.dd', + 'dd...........ddd' +] + + +fileOpenText = \ +'''<img source="fileopen"> +Click this button to open a <em>new file</em>.<br><br> +You can also select the <b>Open</b> command from the <b>File</b> menu.''' + +fileSaveText = \ +'''Click this button to save the file you are editing.<br><br> +You will be prompted for a filename.<br><br> +You can also select the <b>Save</b> command from the <b>File</b> menu.''' + +filePrintText = \ +'''Click this button to print the file you are editing.<br><br> +You can also select the <b>Print</b> command from the <b>File</b> menu.''' + + +editorList = [] + + +class ApplicationWindow(QMainWindow): + def __init__(self): + QMainWindow.__init__(self,None,'example application main window',Qt.WDestructiveClose) + + self.filename = QString.null + self.printer = QPrinter() + + self.fileTools = QToolBar(self,'file operations') + + openIcon = QPixmap(fileopen) + self.fileOpen = QToolButton(QIconSet(openIcon),'Open File',QString.null,self.load,self.fileTools,'open file') + + saveIcon = QPixmap(filesave) + self.fileSave = QToolButton(QIconSet(saveIcon),'Save File',QString.null,self.save,self.fileTools,'save file') + + printIcon = QPixmap(fileprint) + self.filePrint = QToolButton(QIconSet(printIcon),'Print File',QString.null,self.printDoc,self.fileTools,'print file') + + QWhatsThis.whatsThisButton(self.fileTools) + + QWhatsThis.add(self.fileOpen,fileOpenText) + QMimeSourceFactory.defaultFactory().setPixmap('fileopen',openIcon) + QWhatsThis.add(self.fileSave,fileSaveText) + QWhatsThis.add(self.filePrint,filePrintText) + + self.file = QPopupMenu(self) + self.menuBar().insertItem('&File',self.file) + + self.file.insertItem('&New',self.newDoc,Qt.CTRL + Qt.Key_N) + + id = self.file.insertItem(QIconSet(openIcon),'&Open',self.load,Qt.CTRL + Qt.Key_O) + self.file.setWhatsThis(id,fileOpenText) + + id = self.file.insertItem(QIconSet(saveIcon),'&Save',self.save,Qt.CTRL + Qt.Key_S) + self.file.setWhatsThis(id,fileSaveText) + + id = self.file.insertItem('Save &as',self.saveAs) + self.file.setWhatsThis(id,fileSaveText) + + self.file.insertSeparator() + + id = self.file.insertItem(QIconSet(printIcon),'&Print',self.printDoc,Qt.CTRL + Qt.Key_P) + self.file.setWhatsThis(id,filePrintText) + + self.file.insertSeparator() + + self.file.insertItem('&Close',self,SLOT('close()'),Qt.CTRL + Qt.Key_W) + self.file.insertItem('&Quit',qApp,SLOT('closeAllWindows()'),Qt.CTRL + Qt.Key_Q) + + self.help = QPopupMenu(self) + self.menuBar().insertSeparator() + self.menuBar().insertItem('&Help',self.help) + + self.help.insertItem('&About',self.about,Qt.Key_F1) + self.help.insertItem('About &Qt',self.aboutQt) + + self.e = QMultiLineEdit(self,'editor') + self.e.setFocus() + self.setCentralWidget(self.e) + + self.statusBar().message('Ready',2000) + self.resize(450,600) + + def newDoc(self): + ed = ApplicationWindow() + ed.show() + editorList.append(ed) + + def load(self): + fn = QFileDialog.getOpenFileName(QString.null,QString.null,self) + if fn.isEmpty(): + self.statusBar().message('Loading aborted',2000) + return + + fileName = str(fn) + + self.e.setAutoUpdate(0) + self.e.clear() + + try: + f = open(fileName,'r') + except: + return + + for l in f.readlines(): + self.e.append(string.rstrip(l)) + + f.close() + + self.e.setAutoUpdate(1) + self.e.repaint() + self.e.setEdited(0) + self.setCaption(fileName) + self.statusBar().message('Loaded document %s' % (fileName),2000) + + def save(self): + if self.filename.isEmpty(): + self.saveAs() + return + + try: + f = open(str(self.filename),'w+') + except: + self.statusBar().message('Could not write to %s' % (self.filename),2000) + return + + f.write(str(self.e.text())) + f.close() + + self.e.setEdited(0) + self.setCaption(self.filename) + self.statusBar().message('File %s saved' % (self.filename),2000) + + def saveAs(self): + fn = QFileDialog.getSaveFileName(QString.null,QString.null,self) + if not fn.isEmpty(): + self.filename = fn + self.save() + else: + self.statusBar().message('Saving aborted',2000) + + def printDoc(self): + Margin = 10 + pageNo = 1 + + if self.printer.setup(self): + self.statusBar().message('Printing...') + + p = QPainter() + p.begin(self.printer) + p.setFont(self.e.font()) + yPos = 0 + fm = p.fontMetrics() + metrics = QPaintDeviceMetrics(self.printer) + + for i in range(self.e.numLines): + if Margin + yPos > metrics.height() - Margin: + pageNo = pageNo + 1 + self.statusBar().message('Printing (page %d)...' % (pageNo)) + self.printer.newPage() + yPos = 0 + + p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.e.textLine(i)) + yPos = yPos + fm.lineSpacing() + + p.end() + self.statusBar().message('Printing completed',2000) + else: + self.statusBar().message('Printing aborted',2000) + + def closeEvent(self,ce): + if not self.e.edited(): + ce.accept() + return + + rc = QMessageBox.information(self,'Qt Application Example', + 'The document has been changed since the last save.', + 'Save Now','Cancel','Leave Anyway',0,1) + + if rc == 0: + self.save() + ce.accept() + elif rc == 2: + ce.accept() + else: + ce.ignore() + + def about(self): + QMessageBox.about(self,'Qt Application Example', + 'This example demonstrates simple use of QMainWindow,\nQMenuBar and QToolBar.') + + def aboutQt(self): + QMessageBox.aboutQt(self,'Qt Application Example') + + +a = QApplication(sys.argv) +mw = ApplicationWindow() +mw.setCaption('Document 1') +mw.show() +a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()')) +a.exec_loop() diff --git a/python/pyqt/examples3/biff.py b/python/pyqt/examples3/biff.py new file mode 100755 index 00000000..ee5bfe38 --- /dev/null +++ b/python/pyqt/examples3/biff.py @@ -0,0 +1,173 @@ +#!/usr/bin/env python + +import os, sys, string +from qt import * + + +if QT_VERSION < 0x030100: + print "This example requires Qt v3.1.0 or later." + sys.exit(1) + + +FALSE = 0 +TRUE = 1 + +hasmail_bmp_data = [ +"48 48 3 1", +" c None", +". c #000000", +"+ c #FFFFFF", +"................................................", +".............................++++++++++.........", +".............................++++++++++.........", +"........................++++.+++.+.+.++.........", +"......................++++.++++.+.+.+++.........", +".....................+++.....+++.+.+.++.........", +"....................++.......++.+.+.+++.........", +"...................++........++++++++++.........", +"..................++.........++++++++++.........", +".................++..........+++..+.............", +"................++...........+++..+.............", +"...............++............+++.++.............", +"..............+++++++........++++++.............", +".............++++++++++......++++++.............", +"............+++......+++.....++++.+.............", +"...........+++.........++....+++..+.............", +"...........++..........++...++++..+.............", +"..........++............++.+++++..+.............", +"..........++............++++++++..+.............", +".........++....++++++....+++.+++..+.............", +".........++......++......++..+++..+.............", +".........++..............++..+++..+.............", +".........++..............++..+++..+.............", +".........++..............++..++...+.............", +"+++++++..++.+.+..+..+.+..++.......+..+++++++++++", +".........++.+++.+.+.+.+..++.......+.............", +".........++.+.+.+++.+.+..++.......+.............", +".........++.+.+.+.+.+.+..++......++.............", +".........++.+.+.+.+.+.++.++.....++..............", +".........++..............++....++...............", +"..+.+.+..++..............++...++..+.+.+.+.+.+.+.", +".+.+.+.+.++..............++..++..+.+.+.+.+.+.+..", +"..+.+.+..++..............++.++..+.+.+.+.+.+.+.+.", +".+.+.+.+.++..............+++++.+.+.+.+.+.+.+.+..", +"..+.+.+..+++++++++++++++++++.++.+.+.+.+.+.+.+.+.", +".+.+.+.+..+++++++++++++++++..+.+.+.+.+.+.+.+.+..", +"..+.+.+.+..........+...+.....++.+.+.+.+.+.+.+.+.", +".+.+.+.+.+.+.+.+.+.+...+.....+.+.+.+.+.+.+.+.+..", +"..+.+.+.+.+.+.+.+.++...+.....++.+.+.+.+.+.+.+.+.", +".+.+.+.+.+.+.+.+.+.+...+.....+.+.+.+.+.+.+.+.+..", +"..+.+.+.+.+.+.+.+.++...+.....++.+.+.+.+.+.+.+.+.", +".+.+.+.+.+.+.+.+.+.+...+.....+.+.+.+.+.+.+.+.+..", +"..+.+.+.+.+.+.+.+.++...+....+.+.+.+.+.+.+.+.+.+.", +".+.+.+.+.+.+.+.+.+.+...+...+.+.+.+.+.+.+.+.+.+..", +"..+.+.+.+.+.+.+.+.+.+..+..+.+.+.+.+.+.+.+.+.+.+.", +".+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+..", +"..+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+...", +"................................................" +] + +nomail_bmp_data = [ +"48 48 3 1", +" c None", +". c #FFFFFF", +"+ c #000000", +"................................................", +"................................................", +"................................................", +".........................++++...................", +".......................++++++++.................", +".....................++++....+++................", +"....................+++........++...............", +"...................++...........++..............", +"..................++............++..............", +".................++..............++.......+.....", +"................++...............++......++.....", +"...............++................++.....+++.....", +"..............+++++++...........+++....++++.....", +".............++++++++++........++++...+++++.....", +"............+++......+++......+++.+..++++++.....", +"...........+++.........++....+++..+.+++.+++.....", +"...........++..........++...+++...++++..+++.....", +"..........++............++.+++...++++...++......", +"..........++............+++++...++++............", +".........++....++++++....+++...++++.............", +".........++......++......++...+++.+.............", +".........++..............++...+++.+.............", +".........++..............++...++..+.............", +".........++..............++.......+.............", +"+++++++..++..............++.......+..+++++++++++", +".........++..............++.......+.............", +".........++..............++.......+.............", +".........++..............++......++.............", +".........++..............++.....++..............", +".........++..............++....++...............", +".........++..............++...++................", +".........++..............++..++.................", +".........++..............++.++..................", +".........++..............+++++..................", +".........+++++++++++++++++++.+..................", +"..........+++++++++++++++++..+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"...................+...+.....+..................", +"+++.++++++++++.+.+++...+..+++++++++++.++...+++++", +"+.+++..+++.+.+++++.++..+.++.+++..+..+.++.+.++++.", +".++...+.....++...+...+++++++....+....++++++...+.", +"++++++++++++++++++++++++++++++++++++++++++++++++" +] + +class Biff(QWidget): + def __init__(self): + QWidget.__init__(self, None, "Biff - example application") + + mail = os.getenv("MAIL") + fi = QFileInfo(mail); + if not fi.exists(): + s = "/var/spool/mail/"+os.getenv("USER") + fi.setFile(s) + + if fi.exists(): + self.mailbox = fi.absFilePath() + self.startTimer(1000) + + self.setMinimumSize(48, 48) + self.setMaximumSize(48, 48) + self.resize(48, 48) + + self.hasNewMail = QPixmap(hasmail_bmp_data) + self.noNewMail = QPixmap(nomail_bmp_data) + + self.gotMail = FALSE + self.lastModified = fi.lastModified() + + def timerEvent(self, te): + fi = QFileInfo(self.mailbox) + newState = ( fi.lastModified().toTime_t() != self.lastModified.toTime_t() and fi.lastModified().toTime_t() > fi.lastRead().toTime_t()) + if newState != self.gotMail: + if self.gotMail == TRUE: + self.lastModified = fi.lastModified() + self.gotMail = newState + self.repaint(FALSE) + + def paintEvent(self, pe): + if self.gotMail: + bitBlt(self, 0, 0, self.hasNewMail) + else: + bitBlt(self, 0, 0, self.noNewMail) + + def mousePressEvent(self, me): + fi = QFileInfo(self.mailbox) + lastModified = fi.lastModified() + + +a = QApplication(sys.argv) +b = Biff() +a.setMainWidget(b) +b.show() +a.exec_loop() diff --git a/python/pyqt/examples3/bigtable.py b/python/pyqt/examples3/bigtable.py new file mode 100755 index 00000000..2c0b46a2 --- /dev/null +++ b/python/pyqt/examples3/bigtable.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +import os +from qt import * +from qttable import * + +TRUE = 1 +FALSE = 0 + +numRows = 1000000 +numCols = 1000000 + +class MyTable(QTable): + def __init__(self, r, c): + QTable.__init__(self, r, c) + self.items = {} + self.widgets = {} + self.setCaption("This is a big table with 1.000.000x1.000.000 cells...") + self.setLeftMargin(self.fontMetrics().width("W999999W")) + + def resizeData(self, v): + return + + def item(self, r, c): + try: + return self.items[self.indexOf(r, c)] + except KeyError: + return None + + def setItem(self, r, c, i): + self.items[self.indexOf(r, c)] = i + + def clearCell(self, r, c): + try: + del self.items[self.indexOf(r, c)] + except KeyError: + pass + + def insertWidget(self, r, c, w): + self.widgets[self.indexOf(r, c)] = w + + def cellWidget(self, r, c): + try: + return self.widgets[self.indexOf(r, c)] + except KeyError: + return None + + def clearCellWidget(self, r, c): + try: + del self.widgets[self.indexOf(r, c)] + except KeyError: + pass + + +if __name__ == '__main__': + app = QApplication(sys.argv) + + table = MyTable(numRows, numCols) + app.setMainWidget(table) + table.show() + app.exec_loop() diff --git a/python/pyqt/examples3/buttongroups.py b/python/pyqt/examples3/buttongroups.py new file mode 100755 index 00000000..ed2c6315 --- /dev/null +++ b/python/pyqt/examples3/buttongroups.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python +#/**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +#** +#** This file is part of an example program for Qt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * + +TRUE = 1 +FALSE = 0 + +## +# Creates all child widgets of the ButtonGroups window +## + +class ButtonsGroups( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + + # Create Widgets which allow easy layouting + self.vbox = QVBoxLayout( self, 11, 6 ) + self.box1 = QHBoxLayout( self.vbox ) + self.box2 = QHBoxLayout( self.vbox ) + + # ------- first group + + # Create an exclusive button group + self.grp1 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 1 (exclusive)", self ) + self.box1.addWidget( self.grp1 ) + self.grp1.setExclusive( TRUE ) + + # insert 3 radiobuttons + self.rb11 = QRadioButton( "&Radiobutton 1", self.grp1 ) + self.rb11.setChecked( TRUE ) + QRadioButton( "R&adiobutton 2", self.grp1 ) + QRadioButton( "Ra&diobutton 3", self.grp1 ) + + # ------- second group + + # Create a non-exclusive buttongroup + self.grp2 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 2 (non-exclusive)", self ) + self.box1.addWidget( self.grp2 ) + self.grp2.setExclusive( FALSE ) + + # insert 3 checkboxes + QCheckBox( "&Checkbox 1", self.grp2 ) + self.cb12 = QCheckBox( "C&heckbox 2", self.grp2 ) + self.cb12.setChecked( TRUE ) + self.cb13 = QCheckBox( "Triple &State Button", self.grp2 ) + self.cb13.setTristate( TRUE ) + self.cb13.setChecked( TRUE ) + + # ------------ third group + + # create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons + self.grp3 = QButtonGroup( 1, QGroupBox.Horizontal, "Button Group 3 (Radiobutton-exclusive)", self ) + self.box2.addWidget( self.grp3 ) + self.grp3.setRadioButtonExclusive( TRUE ) + + # insert three radiobuttons + self.rb21 = QRadioButton( "Rad&iobutton 1", self.grp3 ) + self.rb22 = QRadioButton( "Radi&obutton 2", self.grp3 ) + self.rb23 = QRadioButton( "Radio&button 3", self.grp3 ) + self.rb23.setChecked( TRUE ) + + # insert a checkbox... + self.state = QCheckBox( "E&nable Radiobuttons", self.grp3 ) + self.state.setChecked( TRUE ) + # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State() + self.connect( self.state, SIGNAL( "clicked()" ), self.slotChangeGrp3State ) + + # ------------ fourth group + + # create a groupbox which layouts its childs in a columns + self.grp4 = QButtonGroup( 1, QGroupBox.Horizontal, "Groupbox with normal buttons", self ) + self.box2.addWidget( self.grp4 ) + + # insert two pushbuttons... + QPushButton( "&Push Button", self.grp4 ) + self.tb2 = QPushButton( "&Toggle Button", self.grp4 ) + + # ... and make the second one a toggle button + self.tb2.setToggleButton( TRUE ) + self.tb2.setOn( TRUE ) + + # ... and make the third one a flat button + self.tb3 = QPushButton( "&Flat Button", self.grp4 ) + self.tb3.setFlat( TRUE ) + + # .. and the fourth a button with a menu + self.tb4 = QPushButton( "Popup Button", self.grp4 ) + menu = QPopupMenu(self.tb4) + menu.insertItem("Item1", 0) + menu.insertItem("Item2", 0) + menu.insertItem("Item3", 0) + menu.insertItem("Item4", 0) + self.tb4.setPopup(menu) + + # + # SLOT slotChangeGrp3State() + # enables/disables the radiobuttons of the third buttongroup + # + + def slotChangeGrp3State( self ): + self.rb21.setEnabled( self.state.isChecked() ) + self.rb22.setEnabled( self.state.isChecked() ) + self.rb23.setEnabled( self.state.isChecked() ) + + +## main program +a = QApplication( sys.argv ) + +buttonsgroups = ButtonsGroups() +buttonsgroups.resize( 500, 250 ) +buttonsgroups.setCaption( "PyQT Example - Buttons and Groups" ) +a.setMainWidget( buttonsgroups ) +buttonsgroups.show() + +a.exec_loop() diff --git a/python/pyqt/examples3/canvas/butterfly.png b/python/pyqt/examples3/canvas/butterfly.png Binary files differnew file mode 100644 index 00000000..d8912d25 --- /dev/null +++ b/python/pyqt/examples3/canvas/butterfly.png diff --git a/python/pyqt/examples3/canvas/canvas.py b/python/pyqt/examples3/canvas/canvas.py new file mode 100755 index 00000000..178a6e66 --- /dev/null +++ b/python/pyqt/examples3/canvas/canvas.py @@ -0,0 +1,619 @@ +#!/usr/bin/env python + +import sys +from qt import * +from qtcanvas import * +import random + + +True = 1 +False = 0 +butterfly_fn = QString.null +butterflyimg = [] +logo_fn = QString.null +logoimg = [] +bouncy_logo = None +views = [] + + +class ImageItem(QCanvasRectangle): + def __init__(self,img,canvas): + QCanvasRectangle.__init__(self,canvas) + self.imageRTTI=984376 + self.image=img + self.pixmap=QPixmap() + self.setSize(self.image.width(), self.image.height()) + self.pixmap.convertFromImage(self.image, Qt.OrderedAlphaDither); + + def rtti(self): + return self.imageRTTI + + def hit(self,p): + ix = p.x()-self.x() + iy = p.y()-self.y() + if not self.image.valid( ix , iy ): + return False + self.pixel = self.image.pixel( ix, iy ) + return (qAlpha( self.pixel ) != 0) + + def drawShape(self,p): + p.drawPixmap( self.x(), self.y(), self.pixmap ) + + +class NodeItem(QCanvasEllipse): + def __init__(self,canvas): + QCanvasEllipse.__init__(self,6,6,canvas) + self.__inList=[] + self.__outList=[] + self.setPen(QPen(Qt.black)) + self.setBrush(QBrush(Qt.red)) + self.setZ(128) + + def addInEdge(self,edge): + self.__inList.append(edge) + + def addOutEdge(self,edge): + self.__outList.append(edge) + + def moveBy(self,dx,dy): + QCanvasEllipse.moveBy(self,dx,dy) + for each_edge in self.__inList: + each_edge.setToPoint( int(self.x()), int(self.y()) ) + for each_edge in self.__outList: + each_edge.setFromPoint( int(self.x()), int(self.y()) ) + +class EdgeItem(QCanvasLine): + __c=0 + def __init__(self,fromNode, toNode,canvas): + QCanvasLine.__init__(self,canvas) + self.__c=self.__c+1 + self.setPen(QPen(Qt.black)) + self.setBrush(QBrush(Qt.red)) + fromNode.addOutEdge(self) + toNode.addInEdge(self) + self.setPoints(int(fromNode.x()),int(fromNode.y()), int(toNode.x()), int(toNode.y())) + self.setZ(127) + + def setFromPoint(self,x,y): + self.setPoints(x,y,self.endPoint().x(),self.endPoint().y()) + + def setToPoint(self,x,y): + self.setPoints(self.startPoint().x(), self.startPoint().y(),x,y) + + def count(self): + return self.__c + + def moveBy(self,dx,dy): + pass + + +class FigureEditor(QCanvasView): + def __init__(self,c,parent,name,f): + QCanvasView.__init__(self,c,parent,name,f) + self.__moving=0 + self.__moving_start= 0 + + def contentsMousePressEvent(self,e): # QMouseEvent e + point = self.inverseWorldMatrix().map(e.pos()) + ilist = self.canvas().collisions(point) #QCanvasItemList ilist + for each_item in ilist: + if each_item.rtti()==984376: + if not each_item.hit(point): + continue + self.__moving=each_item + self.__moving_start=point + return + self.__moving=0 + + def clear(self): + ilist = self.canvas().allItems() + for each_item in ilist: + if each_item: + each_item.setCanvas(None) + del each_item + self.canvas().update() + + def contentsMouseMoveEvent(self,e): + if self.__moving : + point = self.inverseWorldMatrix().map(e.pos()); + self.__moving.moveBy(point.x() - self.__moving_start.x(),point.y() - self.__moving_start.y()) + self.__moving_start = point + self.canvas().update() + + +class BouncyLogo(QCanvasSprite): + def __init__(self,canvas): + # Make sure the logo exists. + global bouncy_logo + if bouncy_logo is None: + bouncy_logo=QCanvasPixmapArray("qt-trans.xpm") + + QCanvasSprite.__init__(self,None,canvas) + self.setSequence(bouncy_logo) + self.setAnimated(True) + self.initPos() + self.logo_rtti=1234 + + def rtti(self): + return self.logo_rtti + + def initPos(self): + self.initSpeed() + trial=1000 + self.move(random.random()%self.canvas().width(), random.random()%self.canvas().height()) + self.advance(0) + trial=trial-1 + while (trial & (self.xVelocity()==0 )& (self.yVelocity()==0)): + elf.move(random.random()%self.canvas().width(), random.random()%self.canvas().height()) + self.advance(0) + trial=trial-1 + + def initSpeed(self): + speed=4.0 + d=random.random()%1024/1024.0 + self.setVelocity(d*speed*2-speed, (1-d)*speed*2-speed) + + def advance(self,stage): + if stage==0: + vx=self.xVelocity() + vy=self.yVelocity() + if (vx==0.0) & (vy==0.0): + self.initSpeed() + vx=self.xVelocity() + vy=self.yVelocity() + + nx=self.x()+vx + ny=self.y()+vy + + if (nx<0) | (nx >= self.canvas().width()): + vx=-vx + if (ny<0) | (ny >= self.canvas().height()): + vy=-vy + + for bounce in [0,1,2,3]: + l=self.collisions(False) + for hit in l: + if (hit.rtti()==1234) & (hit.collidesWith(self)): + if bounce==0: + vx=-vx + elif bounce==1: + vy=-vy + vx=-vx + elif bounce==2: + vx=-vx + elif bounce==3: + vx=0 + vy=0 + self.setVelocity(vx,vy) + break + + if (self.x()+vx < 0) | (self.x()+vx >= self.canvas().width()): + vx=0 + if (self.y()+vy < 0) | (self.y()+vy >= self.canvas().height()): + vy=0 + + self.setVelocity(vx,vy) + elif stage==1: + QCanvasItem.advance(self,stage) + + +class Main (QMainWindow): + def __init__(self,c,parent,name,f=0): + QMainWindow.__init__(self,parent,name,f) + self.editor=FigureEditor(c,self,name,f) + self.printer=QPrinter() + self.dbf_id=0 + self.canvas=c + self.mainCount=0 + file=QPopupMenu(self.menuBar()) + file.insertItem("&Fill canvas", self.init, Qt.CTRL+Qt.Key_F) + file.insertItem("&Erase canvas", self.clear, Qt.CTRL+Qt.Key_E) + file.insertItem("&New view", self.newView, Qt.CTRL+Qt.Key_N) + file.insertSeparator(); + file.insertItem("&Print", self._print, Qt.CTRL+Qt.Key_P) + file.insertSeparator() + file.insertItem("E&xit", qApp, SLOT("quit()"), Qt.CTRL+Qt.Key_Q) + self.menuBar().insertItem("&File", file) + + edit = QPopupMenu(self.menuBar() ) + edit.insertItem("Add &Circle", self.addCircle, Qt.ALT+Qt.Key_C) + edit.insertItem("Add &Hexagon", self.addHexagon, Qt.ALT+Qt.Key_H) + edit.insertItem("Add &Polygon", self.addPolygon, Qt.ALT+Qt.Key_P) + edit.insertItem("Add Spl&ine", self.addSpline, Qt.ALT+Qt.Key_I) + edit.insertItem("Add &Text", self.addText, Qt.ALT+Qt.Key_T) + edit.insertItem("Add &Line", self.addLine, Qt.ALT+Qt.Key_L) + edit.insertItem("Add &Rectangle", self.addRectangle, Qt.ALT+Qt.Key_R) + edit.insertItem("Add &Sprite", self.addSprite, Qt.ALT+Qt.Key_S) + edit.insertItem("Create &Mesh", self.addMesh, Qt.ALT+Qt.Key_M ) + edit.insertItem("Add &Alpha-blended image", self.addButterfly, Qt.ALT+Qt.Key_A) + self.menuBar().insertItem("&Edit", edit) + + view = QPopupMenu(self.menuBar() ); + view.insertItem("&Enlarge", self.enlarge, Qt.SHIFT+Qt.CTRL+Qt.Key_Plus); + view.insertItem("Shr&ink", self.shrink, Qt.SHIFT+Qt.CTRL+Qt.Key_Minus); + view.insertSeparator(); + view.insertItem("&Rotate clockwise", self.rotateClockwise, Qt.CTRL+Qt.Key_PageDown); + view.insertItem("Rotate &counterclockwise", self.rotateCounterClockwise, Qt.CTRL+Qt.Key_PageUp); + view.insertItem("&Zoom in", self.zoomIn, Qt.CTRL+Qt.Key_Plus); + view.insertItem("Zoom &out", self.zoomOut, Qt.CTRL+Qt.Key_Minus); + view.insertItem("Translate left", self.moveL, Qt.CTRL+Qt.Key_Left); + view.insertItem("Translate right", self.moveR, Qt.CTRL+Qt.Key_Right); + view.insertItem("Translate up", self.moveU, Qt.CTRL+Qt.Key_Up); + view.insertItem("Translate down", self.moveD, Qt.CTRL+Qt.Key_Down); + view.insertItem("&Mirror", self.mirror, Qt.CTRL+Qt.Key_Home); + self.menuBar().insertItem("&View", view) + + self.options = QPopupMenu( self.menuBar() ); + self.dbf_id = self.options.insertItem("Double buffer", self.toggleDoubleBuffer) + self.options.setItemChecked(self.dbf_id, True) + self.menuBar().insertItem("&Options",self.options) + + self.menuBar().insertSeparator(); + + help = QPopupMenu( self.menuBar() ) + help.insertItem("&About", self.help, Qt.Key_F1) + help.insertItem("&About Qt", self.aboutQt, Qt.Key_F2) + help.setItemChecked(self.dbf_id, True) + self.menuBar().insertItem("&Help",help) + + self.statusBar() + + self.setCentralWidget(self.editor) + + self.printer = 0 + self.tb=0 + self.tp=0 + + self.init() + + def init(self): + self.clear() + r=24 + r=r+1 + random.seed(r) + for i in range(self.canvas.width()/56): + self.addButterfly() + for j in range(self.canvas.width()/85): + self.addHexagon() + for k in range(self.canvas.width()/128): + self.addLogo() + + def newView(self): + m=Main(self.canvas,None,"new windiw",Qt.WDestructiveClose) + qApp.setMainWidget(m) + m.show() + qApp.setMainWidget(None) + views.append(m) + + def clear(self): + self.editor.clear() + + def help(self): + QMessageBox.information(None, "PyQt Canvas Example", + "<h3>The PyQt QCanvas classes example</h3><hr>" + "<p>This is the PyQt implementation of " + "Qt canvas example.</p> by Sadi Kose " + "<i>(kose@nuvox.net)</i><hr>" + "<ul>" + "<li> Press ALT-S for some sprites." + "<li> Press ALT-C for some circles." + "<li> Press ALT-L for some lines." + "<li> Drag the objects around." + "<li> Read the code!" + "</ul>","Dismiss") + + def aboutQt(self): + QMessageBox.aboutQt(self,"PyQt Canvas Example") + + def toggleDoubleBuffer(self): + s = not self.options.isItemChecked(self.dbf_id) + self.options.setItemChecked(self.dbf_id,s) + self.canvas.setDoubleBuffering(s) + + def enlarge(self): + self.canvas.resize(self.canvas.width()*4/3, self.canvas.height()*4/3) + + def shrink(self): + self.canvas.resize(self.canvas.width()*3/4, self.canvas.height()*3/4) + + def rotateClockwise(self): + m = self.editor.worldMatrix() + m.rotate( 22.5 ) + self.editor.setWorldMatrix( m ) + + def rotateCounterClockwise(self): + m = self.editor.worldMatrix() + m.rotate( -22.5 ) + self.editor.setWorldMatrix( m ) + + def zoomIn(self): + m = self.editor.worldMatrix() + m.scale( 2.0, 2.0 ) + self.editor.setWorldMatrix( m ) + + def zoomOut(self): + m = self.editor.worldMatrix() + m.scale( 0.5, 0.5 ) + self.editor.setWorldMatrix( m ) + + def mirror(self): + m = self.editor.worldMatrix() + m.scale( -1, 1 ) + self.editor.setWorldMatrix( m ) + + def moveL(self): + m = self.editor.worldMatrix() + m.translate( -16, 0 ) + self.editor.setWorldMatrix( m ) + + def moveR(self): + m = self.editor.worldMatrix() + m.translate( +16, 0 ) + self.editor.setWorldMatrix( m ) + + def moveU(self): + m = self.editor.worldMatrix() + m.translate( 0, -16 ) + self.editor.setWorldMatrix( m ) + + def moveD(self): + m = self.editor.worldMatrix(); + m.translate( 0, +16 ); + self.editor.setWorldMatrix( m ) + + def _print(self): + if not self.printer: + self.printer = QPrinter() + if self.printer.setup(self) : + pp=QPainter(self.printer) + self.canvas.drawArea(QRect(0,0,self.canvas.width(),self.canvas.height()),pp,False) + + def addSprite(self): + i = BouncyLogo(self.canvas) + i.setZ(256*random.random()%256); + i.show(); + + def addButterfly(self): + if butterfly_fn.isEmpty(): + return + if not butterflyimg: + butterflyimg.append(QImage()) + butterflyimg[0].load(butterfly_fn) + butterflyimg.append(QImage()) + butterflyimg[1] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.75), + int(butterflyimg[0].height()*0.75) ) + butterflyimg.append(QImage()) + butterflyimg[2] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.5), + int(butterflyimg[0].height()*0.5) ) + butterflyimg.append(QImage()) + butterflyimg[3] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.25), + int(butterflyimg[0].height()*0.25) ) + + i = ImageItem(butterflyimg[int(4*random.random()%4)],self.canvas) + i.move((self.canvas.width()-butterflyimg[0].width())*random.random()%(self.canvas.width()-butterflyimg[0].width()), + (self.canvas.height()-butterflyimg[0].height())*random.random()%(self.canvas.height()-butterflyimg[0].height())) + i.setZ(256*random.random()%256+250); + i.show() + + def addLogo(self): + if logo_fn.isEmpty(): + return; + if not logoimg: + logoimg.append(QImage()) + logoimg[0].load( logo_fn ) + logoimg.append(QImage()) + logoimg[1] = logoimg[0].smoothScale( int(logoimg[0].width()*0.75), + int(logoimg[0].height()*0.75) ) + logoimg.append(QImage()) + logoimg[2] = logoimg[0].smoothScale( int(logoimg[0].width()*0.5), + int(logoimg[0].height()*0.5) ) + logoimg.append(QImage()) + logoimg[3] = logoimg[0].smoothScale( int(logoimg[0].width()*0.25), + int(logoimg[0].height()*0.25) ); + + i = ImageItem(logoimg[int(4*random.random()%4)],self.canvas) + i.move((self.canvas.width()-logoimg[0].width())*random.random()%(self.canvas.width()-logoimg[0].width()), + (self.canvas.height()-logoimg[0].width())*random.random()%(self.canvas.height()-logoimg[0].width())) + i.setZ(256*random.random()%256+256) + i.show() + + def addCircle(self): + i = QCanvasEllipse(50,50,self.canvas) + i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) + i.setZ(256*random.random()%256) + i.show() + + def addHexagon(self): + i = QCanvasPolygon(self.canvas) + size = canvas.width() / 25 + pa=QPointArray(6) + pa.setPoint(0,QPoint(2*size,0)) + pa.setPoint(1,QPoint(size,-size*173/100)) + pa.setPoint(2,QPoint(-size,-size*173/100)) + pa.setPoint(3,QPoint(-2*size,0)) + pa.setPoint(4,QPoint(-size,size*173/100)) + pa.setPoint(5,QPoint(size,size*173/100)) + i.setPoints(pa) + i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) + i.setZ(256*random.random()%256) + i.show() + + def addPolygon(self): + i = QCanvasPolygon(self.canvas) + size = self.canvas.width()/2 + pa=QPointArray(6) + pa.setPoint(0, QPoint(0,0)) + pa.setPoint(1, QPoint(size,size/5)) + pa.setPoint(2, QPoint(size*4/5,size)) + pa.setPoint(3, QPoint(size/6,size*5/4)) + pa.setPoint(4, QPoint(size*3/4,size*3/4)) + pa.setPoint(5, QPoint(size*3/4,size/4)) + + i.setPoints(pa) + i.setBrush(QBrush( QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8)) ) + i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) + i.setZ(256*random.random()%256) + i.show() + + def addSpline(self): + i = QCanvasSpline(self.canvas) + size = canvas.width()/6 + pa=QPointArray(12) + pa.setPoint(0,QPoint(0,0)) + pa.setPoint(1,QPoint(size/2,0)) + pa.setPoint(2,QPoint(size,size/2)) + pa.setPoint(3,QPoint(size,size)) + pa.setPoint(4,QPoint(size,size*3/2)) + pa.setPoint(5,QPoint(size/2,size*2)) + pa.setPoint(6,QPoint(0,size*2)) + pa.setPoint(7,QPoint(-size/2,size*2)) + pa.setPoint(8,QPoint(size/4,size*3/2)) + pa.setPoint(9,QPoint(0,size)) + pa.setPoint(10,QPoint(-size/4,size/2)) + pa.setPoint(11,QPoint(-size/2,0)) + i.setControlPoints(pa) + i.setBrush( QBrush(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8) )) + i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) + i.setZ(256*random.random()%256) + i.show() + + def addText(self): + i = QCanvasText(self.canvas) + i.setText("QCanvasText") + i.move(self.canvas.width()*random.random()%self.canvas.width(),self.canvas.width()*random.random()%self.canvas.height()) + i.setZ(256*random.random()%256) + i.show() + + def addLine(self): + i = QCanvasLine(self.canvas); + i.setPoints( self.canvas.width()*random.random()%self.canvas.width(), self.canvas.width()*random.random()%self.canvas.height(), + self.canvas.width()*random.random()%self.canvas.width(), self.canvas.width()*random.random()%self.canvas.height() ) + i.setPen( QPen(QColor(256*random.random()%32*8,256*random.random()%32*8,256*random.random()%32*8), 6) ) + i.setZ(256*random.random()%256) + i.show() + + def ternary(self,exp,x,y): + if exp: + return x + else: + return y + + def addMesh(self): + x0 = 0; + y0 = 0; + + if not self.tb: + self.tb = QBrush( Qt.red ) + if not self.tp: + self.tp = QPen( Qt.black ) + + nodecount = 0; + + w = self.canvas.width() + h = self.canvas.height() + + dist = 30 + rows = h / dist + cols = w / dist + + #ifndef QT_NO_PROGRESSDIALOG + #progress=QProgressDialog( "Creating mesh...", "Abort", rows, + # self, "progress", True ); + #endif + + lastRow=[] + for c in range(cols): + lastRow.append(NodeItem(self.canvas)) + for j in range(rows): + n = self.ternary(j%2 , cols-1 , cols) + prev = 0; + for i in range(n): + el = NodeItem( self.canvas ) + nodecount=nodecount+1 + r = 20*20*random.random() + xrand = r %20 + yrand = (r/20) %20 + el.move( xrand + x0 + i*dist + self.ternary(j%2 , dist/2 , 0 ), + yrand + y0 + j*dist ); + + if j > 0 : + if i < cols-1 : + EdgeItem( lastRow[i], el, self.canvas ).show() + if j%2 : + EdgeItem( lastRow[i+1], el, self.canvas ).show() + elif i > 0 : + EdgeItem( lastRow[i-1], el, self.canvas ).show() + if prev: + EdgeItem( prev, el, self.canvas ).show() + + if i > 0 : + lastRow[i-1] = prev + prev = el + el.show() + + lastRow[n-1]=prev + #ifndef QT_NO_PROGRESSDIALOG + #progress.setProgress( j ) + #if progress.wasCancelled() : + # break + #endif + + #ifndef QT_NO_PROGRESSDIALOG + #progress.setProgress( rows ) + #endif + #// qDebug( "%d nodes, %d edges", nodecount, EdgeItem::count() ); + + def addRectangle(self): + i = QCanvasRectangle( self.canvas.width()*random.random()%self.canvas.width(), + self.canvas.width()*random.random()%self.canvas.height(), + self.canvas.width()/5,self.canvas.width()/5,self.canvas) + z = 256*random.random()%256 + i.setBrush( QBrush(QColor(z,z,z) )) + i.setPen( QPen(QColor(self.canvas.width()*random.random()%32*8, + self.canvas.width()*random.random()%32*8, + self.canvas.width()*random.random()%32*8), 6) ) + i.setZ(z) + i.show() + + +if __name__=='__main__': + app=QApplication(sys.argv) + + if len(sys.argv) > 1: + butterfly_fn=QString(sys.argv[1]) + else: + butterfly_fn=QString("butterfly.png") + + if len(sys.argv) > 2: + logo_fn = QString(sys.argv[2]) + else: + logo_fn=QString("qtlogo.png") + + canvas=QCanvas(800,600) + canvas.setAdvancePeriod(30) + m=Main(canvas,None,"pyqt canvas example") + m.resize(m.sizeHint()) + + qApp.setMainWidget(m) + m.setCaption("Qt Canvas Example ported to PyQt") + if QApplication.desktop().width() > m.width() + 10 and QApplication.desktop().height() > m.height() + 30: + m.show() + else: + m.showMaximized() + + m.show(); + #// m.help(); + qApp.setMainWidget(None); + + QObject.connect( qApp, SIGNAL("lastWindowClosed()"), qApp, SLOT("quit()") ) + + app.exec_loop() + + # We need to explicitly delete the canvas now (and, therefore, the main + # window beforehand) to make sure that the sprite logo doesn't get garbage + # collected first. + views = [] + del m + del canvas diff --git a/python/pyqt/examples3/canvas/qt-trans.xpm b/python/pyqt/examples3/canvas/qt-trans.xpm new file mode 100644 index 00000000..225f684f --- /dev/null +++ b/python/pyqt/examples3/canvas/qt-trans.xpm @@ -0,0 +1,54 @@ +/* XPM */ +static char *qtlogo_xpm[] = { +/* width height ncolors chars_per_pixel */ +"54 34 13 1", +/* colors */ +" c #000000", +". c #999999", +"X c #333366", +"o c #6666CC", +"O c #333333", +"@ c #666699", +"# c #000066", +"$ c #666666", +"% c #3333CC", +"& c #000033", +"* c #9999CC", +"= c #333399", +"+ c None", +/* pixels */ +"+++++++++++++++++++.$OOO$.++++++++++++++++++++++++++++", +"+++++++++++++++++$ O.+++++++++++++++++++++++++", +"+++++++++++++++.O $++++++++++++++++++++++++", +"++++++++++++++. $.++.$ O+++++++++++++++++++++++", +"+++++++++++++. O.+++++++$ O++++++++++++++++++++++", +"+++++++++++++O ++++++++++$ $+++++++++++++++++++++", +"++++++++++++$ .+++++++++++O .++++++++++++++++++++", +"+++++++++++. O+++++++++++++ O++++++.+++++++++++++", +"+++++++++++$ .+++++++++++++$ .+++.O +++++++++++++", +"+++++++++++ +++++++++++++++ O+++. +++++++++++++", +"++++++++++. &Xoooo*++++++++++$ +++. +++++++++++++", +"++++++++++@=%%%%%%%%%%*+++++++. .++. +++++++++++++", +"+++++++**oooooo**++*o%%%%o+++++ $++O +++++++++++++", +"+++++*****$OOX@oooo*++*%%%%%*++O $+. OOO$++++++++*", +"++..+.++....$O$+*ooooo*+*o%%%%%O O+$ $$O.++++++**+", +"***+*+++++$$....+++*oooo**+*o%%# O++O ++++++***o*++", +"*+++++++++O $.....++**oooo**+*X &o*O ++++*ooo*++++", +"++++++++++$ O++.....++**oooo*X &%%& ..*o%%*++++++", +"++++++++++$ ++++.....+++**ooO $*o& @oo*+++++++++", +"++++++++++. .++++++.....+++*O Xo*O .++++++++++++", +"+++++++++++ O+++++++++...... .++O +++++++++++++", +"+++++++++++O +++.$$$.++++++. O+++O +++++++++++++", +"+++++++++++. $$OO O.++++O .+++O +++++++++++++", +"++++++++++++O .+++.O $++. O++++O +++++++++++++", +"++++++++++++. O+++++O $+O +++++O +++++++++++++", +"+++++++++++++. O+++++O O .+++++O .++++++++++++", +"++++++++++++++$ .++++O .++++.+$ O+.$.++++++++", +"+++++++++++++++. O$$O .+++++... +++++++++", +"+++++++++++++++++$ O+++++$$+.O O$.+++++++++", +"+++++++++++++++++++$OO O$.O O.++. .++++++++++++++++", +"+++++++++++++++++++++++++++. OO .++++++++++++++++", +"++++++++++++++++++++++++++++. O+++++++++++++++++", +"+++++++++++++++++++++++++++++. .+++++++++++++++++", +"++++++++++++++++++++++++++++++.O O.++++++++++++++++++" +}; diff --git a/python/pyqt/examples3/canvas/qtlogo.png b/python/pyqt/examples3/canvas/qtlogo.png Binary files differnew file mode 100644 index 00000000..a48b1a1a --- /dev/null +++ b/python/pyqt/examples3/canvas/qtlogo.png diff --git a/python/pyqt/examples3/checklists.py b/python/pyqt/examples3/checklists.py new file mode 100755 index 00000000..12a3cdb9 --- /dev/null +++ b/python/pyqt/examples3/checklists.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python + +# vim:tabstop=2:shiftwidth=2:expandtab:cinoptions=(s,U1,m1 +# Copyright (C) 2002 Oleksandr Yakovlyev (yshurik) <yshurik@thekompany.com> + +import sys +from qt import * + +TRUE = 1 +FALSE = 0 + +class CheckLists(QWidget): + def __init__(self, *args): + apply( QWidget.__init__, (self, ) + args ) + + lay = QHBoxLayout(self) + lay.setMargin(5) + + vbox1 = QVBoxLayout(lay) + vbox1.setMargin(5) + + # First child: a Label + vbox1.addWidget(QLabel("Check some items!", self)) + + # Second child: the ListView + self.lv1 = QListView(self) + vbox1.addWidget(self.lv1) + self.lv1.addColumn("Items") + self.lv1.setRootIsDecorated(TRUE) + + # create a list with 4 ListViewItems which will be parent items of other ListViewItems + + parentList = [] + + parentList.append( QListViewItem( self.lv1, "Parent Item 1" ) ) + parentList.append( QListViewItem( self.lv1, "Parent Item 2" ) ) + parentList.append( QListViewItem( self.lv1, "Parent Item 3" ) ) + parentList.append( QListViewItem( self.lv1, "Parent Item 4" ) ) + + num = 0 + + self.childList1 = [] + # go through the list of parent items... + for i in range(4): + it = parentList[i] + it.setOpen( TRUE ) + + # ...and create 5 checkable child ListViewItems for each parent item + for j in range(5): + ci = QCheckListItem( it, QString("%1. Child of Parent %2").arg( j ).arg( i ), QCheckListItem.CheckBox ) + self.childList1.append(ci) + + # Create another widget for layouting + tmp1 = QVBoxLayout( lay ) + tmp1.setMargin( 5 ) + + # create a pushbutton + copy1 = QPushButton( " -> ", self ) + tmp1.addWidget( copy1 ) + copy1.setMaximumWidth( copy1.sizeHint().width() ); + # connect the SIGNAL clicked() of the pushbutton with the SLOT copy1to2() + self.connect( copy1, SIGNAL('clicked()'), self.copy1to2 ) + + # another widget for layouting + vbox2 = QVBoxLayout( lay ) + vbox2.setMargin( 5 ) + + # and another label + vbox2.addWidget( QLabel( "Check one item!", self ) ) + + # create the second listview + self.lv2 = QListView( self ) + vbox2.addWidget( self.lv2 ) + self.lv2.addColumn( "Items" ) + self.lv2.setRootIsDecorated( TRUE ) + + # another widget needed for layouting only + tmp2 = QVBoxLayout( lay ) + tmp2.setMargin( 5 ) + + # create another pushbutton... + copy2 = QPushButton( " -> ", self ) + lay.addWidget( copy2 ) + copy2.setMaximumWidth( copy2.sizeHint().width() ) + # ...and connect its clicked() SIGNAL to the copy2to3() SLOT + self.connect( copy2, SIGNAL('clicked()'), self.copy2to3 ) + + tmp3 = QVBoxLayout( lay ) + tmp3.setMargin( 5 ) + + # and create a label which will be at the right of the window + self.label = QLabel( "No Item yet...", self ) + tmp3.addWidget( self.label ) + + def copy1to2(self): + self.lv2.clear() + + # Insert first a controller Item into the second ListView. Always if Radio-ListViewItems + # are inserted into a Listview, the parent item of these MUST be a controller Item! + item = QCheckListItem( self.lv2, "Controller", QCheckListItem.Controller ) + item.setOpen( TRUE ) + + self.listChild2 = [] + for it in self.childList1: + # ...check state of childs, and... + if it.parent() != None: + # ...if the item is checked... + if it.isOn(): + # ...insert a Radio-ListViewItem with the same text into the second ListView + ri = QCheckListItem(item , it.text(0), QCheckListItem.RadioButton) + self.listChild2.append(ri) + + if item.firstChild() != None: + item.firstChild().setOn(TRUE) + + def copy2to3(self): + self.label.setText( "No Item checked" ) + + # iterate through the second ListView... + for it in self.listChild2: + # ...check state of childs, and... + if it.parent() != None: + # ...if the item is checked... + if it.isOn(): + # ...set the text of the item to the label + self.label.setText( it.text( 0 ) ) + +a = QApplication(sys.argv) + +checkLists = CheckLists() +checkLists.resize(700, 400) +checkLists.setCaption("PyQt example - CheckLists") + +a.setMainWidget(checkLists) +checkLists.show() +a.exec_loop() diff --git a/python/pyqt/examples3/cursor.py b/python/pyqt/examples3/cursor.py new file mode 100755 index 00000000..f530c6a1 --- /dev/null +++ b/python/pyqt/examples3/cursor.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python + +"""$Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +# cb_bits and cm_bits were generated by X bitmap program. + +cb_width = 32 +cb_height = 32 + +# cursor bitmap +cb_bits = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x0f\x00" \ + "\x00\x06\x30\x00\x80\x01\xc0\x00\x40\x00\x00\x01" \ + "\x20\x00\x00\x02\x10\x00\x00\x04\x08\x3e\x3e\x08" \ + "\x08\x03\xe0\x08\xc4\x00\x00\x11\x04\x1e\x78\x10" \ + "\x02\x0c\x30\x20\x02\x40\x00\x20\x02\x40\x00\x20" \ + "\x02\x40\x00\x20\x02\x20\x04\x20\x02\x20\x04\x20" \ + "\x02\x10\x08\x20\x02\x08\x08\x20\x02\xf0\x07\x20" \ + "\x04\x00\x00\x10\x04\x00\x00\x10\x08\x00\xc0\x08" \ + "\x08\x3c\x30\x08\x10\xe6\x19\x04\x20\x00\x0f\x02" \ + "\x40\x00\x00\x01\x80\x01\xc0\x00\x00\x06\x30\x00" \ + "\x00\xf8\x0f\x00\x00\x00\x00\x00" + +cm_width = 32 +cm_height = 32 + +# cursor bitmap mask +cm_bits = "\x00\x00\x00\x00\x00\xf8\x1f\x00\x00\xfe\x3f\x00" \ + "\x80\x07\xf0\x00\xc0\x01\xc0\x01\x60\x00\x00\x03" \ + "\x30\x00\x00\x06\x18\x00\x00\x0c\x0c\x3e\x3e\x18" \ + "\x0e\x03\xe0\x18\xc6\x00\x00\x31\x07\x1e\x78\x30" \ + "\x03\x0c\x30\x60\x03\x40\x00\x60\x03\x40\x00\x60" \ + "\x03\x40\x00\x60\x03\x20\x04\x60\x03\x20\x04\x60" \ + "\x03\x10\x08\x60\x03\x08\x08\x60\x03\xf0\x07\x60" \ + "\x06\x00\x00\x30\x06\x00\x00\x30\x0c\x00\xc0\x18" \ + "\x0c\x3c\x30\x18\x18\xe6\x19\x0c\x30\x00\x0f\x06" \ + "\x60\x00\x00\x03\xc0\x01\xc0\x01\x80\x07\xf0\x00" \ + "\x00\xfe\x3f\x00\x00\xf8\x0f\x00" + +# The CursorView contains many labels with different cursors. +class CursorView( QWidget ): # cursor view + def __init__( self ): + QWidget.__init__( self ) + # Constructs a cursor view. +#enum CursorShape { ArrowCursor, UpArrowCursor, CrossCursor, WaitCursor, IbeamCursor, SizeVerCursor, SizeHorCursor, SizeBDiagCursor, SizeFDiagCursor, SizeAllCursor, BlankCursor, SplitVCursor, SplitHCursor, PointingHandCursor, ForbiddenCursor, WhatsThisCursor, LastCursor = WhatsThisCursor, BitmapCursor = 24 } + + shape = [ + "ArrowCursor", "UpArrowCursor", "CrossCursor", + "WaitCursor", "IbeamCursor", "SizeVerCursor", + "SizeHorCursor", "SizeBDiagCursor", "SizeFDiagCursor", + "SizeAllCursor", "BlankCursor", "SplitVCursor", + "SplitHCursor", "PointingHandCursor", "ForbiddenCursor", + "WhatsThisCursor" + ] + name = [ + "standard arrow cursor", "upwards arrow", + "crosshair", "hourglass/watch", + "ibeam/text entry", "vertical resize", + "horizontal resize", "diagonal resize (/)", + "diagonal resize (\)", "all directions resize", + "blank/invisible cursor", "vertical splitting", + "horziontal splitting", "a pointing hand", + "a slashed circle", "an arrow with a question mark" + ] + + self.setCaption( "CursorView" ) # set window caption + + grid = QGridLayout( self, 5, 4, 20 ) + + i=0 + for y in range( 0, 4, 1 ) : # create the small labels + for x in range( 0, 4, 1 ) : + label = QLabel( self ) + label.setCursor( QCursor(i) ) + label.setText( shape[i] ); + label.setAlignment( self.AlignCenter ) + label.setFrameStyle( QFrame.Box | QFrame.Raised ) + grid.addWidget( label, x, y ) + QToolTip.add( label, name[i] ) + i += 1 + + cb = QBitmap( cb_width, cb_height, cb_bits, True ) + cm = QBitmap( cm_width, cm_height, cm_bits, True ) + custom = QCursor( cb, cm ) # create bitmap cursor + + label = QLabel( self ) # create the big label + label.setCursor( custom ) + label.setText( "Custom bitmap cursor" ) + QToolTip.add( label, "custom bitmap cursor" ) + label.setAlignment( self.AlignCenter ) + label.setFrameStyle( QFrame.Box | QFrame.Sunken ) + grid.addMultiCellWidget( label, 4, 4, 0, 3 ) + +# Create and display a CursorView. +def main( args ): + a = QApplication(sys.argv) # application object + v = CursorView() # cursor view + v.setCaption( "Qt Example - Cursors" ) + a.setMainWidget( v ) + v.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/dclock.py b/python/pyqt/examples3/dclock.py new file mode 100755 index 00000000..5382d4fa --- /dev/null +++ b/python/pyqt/examples3/dclock.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# A port to PyQt of the dclock example from Qt v2.x. + + +import sys, string +from qt import * + + +class DigitalClock(QLCDNumber): + def __init__(self, parent=None, name=None): + QLCDNumber.__init__(self, parent, name) + self.showingColon = 0 + self.setFrameStyle(QFrame.Panel | QFrame.Raised) + self.setLineWidth(2) + self.showTime() + self.normalTimer = self.startTimer(500) + self.showDateTimer = -1 + + def timerEvent(self, e): + if e.timerId() == self.showDateTimer: + self.stopDate() + else: + if self.showDateTimer == -1: + self.showTime() + + def mousePressEvent(self, e): + if e.button() == Qt.LeftButton: + self.showDate() + + def showDate(self): + if self.showDateTimer != -1: + return + d = QDate.currentDate() + self.display('%2d %2d' % (d.month(), d.day())) + self.showDateTimer = self.startTimer(2000) + + def stopDate(self): + self.killTimer(self.showDateTimer) + self.showDateTimer = -1 + self.showTime() + + def showTime(self): + self.showingColon = not self.showingColon + s = list(str(QTime.currentTime().toString())[:5]) #.left(5) + if not self.showingColon: + s[2] = ' ' + if s[0] == '0': + s[0] = ' ' + s = string.join(s,'') + self.display(s) + +a = QApplication(sys.argv) +clock = DigitalClock() +clock.resize(170,80) +a.setMainWidget(clock) +clock.show() +a.exec_loop() diff --git a/python/pyqt/examples3/desktop.py b/python/pyqt/examples3/desktop.py new file mode 100755 index 00000000..7036248d --- /dev/null +++ b/python/pyqt/examples3/desktop.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python + +import sys +from qt import * + +seed = 0.353535353535 +KINDA_RAND_MAX = 32767 + +def kindaRand(): + global seed + seed = seed * 147 + seed = seed - int(seed) + return int(seed*(KINDA_RAND_MAX + 1)) + +velmax = 15 +velmin = 4 + +def velocity(i): + if i == 1 or i == 2: + i = (kindaRand()&0x7fff % velmax)/3 + velmin + else: + i = (kindaRand()&0x7fff % velmax) + velmin + return i + +maxpoints = 5 +maxcurves = 8 + +def poly(): + d = QApplication.desktop() + d.setEraseColor(Qt.white) + xvel = [ 0 ] * maxpoints + yvel = [ 0 ] * maxpoints + head = 0 + tail = -maxcurves + 2 + a = [ QPointArray() ] * maxcurves + r = d.rect() + for i in range(maxcurves): + a[i].resize(maxpoints) + p = a[0] + for i in range(maxpoints): + p.setPoint(i, (kindaRand()&0x7fff) % r.width(), + (kindaRand()&0x7fff) % r.height() ) + xvel[i] = velocity(i) + yvel[i] = velocity(i) + + paint = QPainter() + paint.begin(d) + + for ntimes in range(2000): + paint.setBrush(QColor(kindaRand()%360,180,255, QColor.Hsv)) + paint.drawPolygon(a[head]) + tail = tail + 1 + if tail >= maxcurves: + tail = 0 + minx = r.left() + maxx = r.right() + miny = r.top() + maxy = r.bottom() + p = a[head] + head = head + 1 + if head >= maxcurves: + head = 0 + for i in range(maxpoints): + x, y = p.point(i) + x = x + xvel[i] + y = y + yvel[i] + if x >= maxx: + x = maxx - (x - maxx + 1) + xvel[i] = -velocity(i) + if x <= minx: + x = minx + (minx - x + 1) + xvel[i] = velocity(i) + if y >= maxy: + y = maxy - (y - maxy + 1) + yvel[i] = -velocity(i) + if y <= miny: + y = miny + (miny - y + 1) + yvel[i] = velocity(i) + a[head].setPoint(i, x, y) + paint.end() + +def rotate(): + w = 64 + h = 64 + image = QImage(w, h, 8, 128) + for i in range(128): + image.setColor(i, qRgb(i,0,0)) + for y in range(h): + for x in range(w): + image.setPixel(x,y,(x+y)%128) + + pm = QPixmap() + pm.convertFromImage(image) + pm.setOptimization(QPixmap.BestOptim) + + d = QApplication.desktop() + + for i in range(0,361,2): + m = QWMatrix() + m.rotate(i) + rpm = pm.xForm(m) + d.setErasePixmap(rpm) + d.update() + +def generateStone(pm, c1, c2, c3): + p = QPainter() + p1 = QPen(c1, 0) + p2 = QPen(c2, 0) + p3 = QPen(c3, 0) + + p.begin(pm) + for i in range(pm.width()): + for j in range(pm.height()): + r = kindaRand() + if r < KINDA_RAND_MAX / 3: + p.setPen(p1) + elif r < KINDA_RAND_MAX / 3 * 2: + p.setPen(p2) + else: + p.setPen(p3) + p.drawPoint(i, j) + p.end() + +def drawShadeText(p, x, y, text, topColor, bottomColor, sw=2): + if not p.isActive(): + return + + p.setPen(bottomColor) + p.drawText(x+sw, y+sw, text) + p.setPen(topColor) + p.drawText(x, y, text) + +class DesktopWidget(QWidget): + def __init__(self, s, parent=None, name=''): + QWidget.__init__(self, parent, name, Qt.WType_Desktop | Qt.WPaintDesktop) + self.text = s + self.pm = None + + def paintEvent(self, pe): + c1 = self.eraseColor() + c2 = c1.light(104) + c3 = c1.dark(106) + if not self.pm: + self.pm = QPixmap(64, 64) + generateStone(self.pm, c1, c2, c3) + self.setErasePixmap(self.pm) + self.update() + br = self.fontMetrics().boundingRect(self.text) + offscreen = QPixmap(br.width(), br.height()) + x = self.width()/2 - br.width()/2 + y = self.height()/2 - br.height()/2 + offscreen.fill(self, x, y) + p = QPainter() + p.begin(offscreen) + drawShadeText(p, -br.x(), -br.y(), self.text, c2, c3, 3) + p.end() + bitBlt(self, x, y, offscreen) + +def desktopWidget(s='Trolltech'): + t = DesktopWidget(s) + t.update() + qApp.exec_loop() + +def desktopText(s='Trolltech'): + border = 20 + + c1 = qApp.palette().normal().background() + c2 = c1.light(104) + c3 = c1.dark(106) + + pm = QPixmap(10, 10) + p = QPainter() + p.begin(pm) + r = p.fontMetrics().boundingRect(s) + p.end() + + appWidth = qApp.desktop().width() + appHeight = qApp.desktop().height() + if r.width() > appWidth - border*2: + r.setWidth(appWidth - border*2) + if r.height() > appHeight - border*2: + r.setHeight(appHeight - border*2) + + pm.resize(r.size().width()+border*2,r.size().height()+border*2) + generateStone(pm, c1, c2, c3) + p.begin(pm) + drawShadeText(p, -r.x()+border, -r.y()+border, s, c2, c3) + p.end() + + qApp.desktop().setErasePixmap(pm) + +a = QApplication(sys.argv) +if len(sys.argv) > 1: + f = QFont('charter', 96, QFont.Black) + f.setStyleHint(QFont.Times) + a.setFont(f) + +validOptions = 0 + +if len(sys.argv) == 2: + validOptions = 1 + if sys.argv[1] == '-poly': + poly() + elif sys.argv[1] == '-rotate': + rotate() + elif sys.argv[1] == '-troll': + desktopText() + elif sys.argv[1] == '-trollwidget': + desktopWidget() + else: + validOptions = 0 + +if len(sys.argv) == 3: + validOptions = 1 + if sys.argv[1] == '-shadetext': + desktopText(sys.argv[2]) + elif sys.argv[1] == '-shadewidget': + desktopWidget(sys.argv[2]) + else: + validOptions = 0 + +if not validOptions: + print """Usage: +\tdesktop -poly +\tdesktop -rotate +\tdesktop -troll +\tdesktop -trollwidget +\tdesktop -shadetext <text> +\tdesktop -shadewidget <text>""" + rotate() diff --git a/python/pyqt/examples3/dirview.py b/python/pyqt/examples3/dirview.py new file mode 100755 index 00000000..9a6f37b3 --- /dev/null +++ b/python/pyqt/examples3/dirview.py @@ -0,0 +1,452 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** Some corrections by M. Biermaier (http://www.office-m.at) +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +folder_closed_xpm = [ + "16 16 9 1", + "g c #808080", + "b c #c0c000", + "e c #c0c0c0", + "# c #000000", + "c c #ffff00", + ". c None", + "a c #585858", + "f c #a0a0a4", + "d c #ffffff", + "..###...........", + ".#abc##.........", + ".#daabc#####....", + ".#ddeaabbccc#...", + ".#dedeeabbbba...", + ".#edeeeeaaaab#..", + ".#deeeeeeefe#ba.", + ".#eeeeeeefef#ba.", + ".#eeeeeefeff#ba.", + ".#eeeeefefff#ba.", + ".##geefeffff#ba.", + "...##gefffff#ba.", + ".....##fffff#ba.", + ".......##fff#b##", + ".........##f#b##", + "...........####." +] + +folder_open_xpm = [ + "16 16 11 1", + "# c #000000", + "g c #c0c0c0", + "e c #303030", + "a c #ffa858", + "b c #808080", + "d c #a0a0a4", + "f c #585858", + "c c #ffdca8", + "h c #dcdcdc", + "i c #ffffff", + ". c None", + "....###.........", + "....#ab##.......", + "....#acab####...", + "###.#acccccca#..", + "#ddefaaaccccca#.", + "#bdddbaaaacccab#", + ".eddddbbaaaacab#", + ".#bddggdbbaaaab#", + "..edgdggggbbaab#", + "..#bgggghghdaab#", + "...ebhggghicfab#", + "....#edhhiiidab#", + "......#egiiicfb#", + "........#egiibb#", + "..........#egib#", + "............#ee#" +] + +folder_locked = [ + "16 16 10 1", + "h c #808080", + "b c #ffa858", + "f c #c0c0c0", + "e c #c05800", + "# c #000000", + "c c #ffdca8", + ". c None", + "a c #585858", + "g c #a0a0a4", + "d c #ffffff", + "..#a#...........", + ".#abc####.......", + ".#daa#eee#......", + ".#ddf#e##b#.....", + ".#dfd#e#bcb##...", + ".#fdccc#daaab#..", + ".#dfbbbccgfg#ba.", + ".#ffb#ebbfgg#ba.", + ".#ffbbe#bggg#ba.", + ".#fffbbebggg#ba.", + ".##hf#ebbggg#ba.", + "...###e#gggg#ba.", + ".....#e#gggg#ba.", + "......###ggg#b##", + ".........##g#b##", + "...........####." +] + +pix_file = [ + "16 16 7 1", + "# c #000000", + "b c #ffffff", + "e c #000000", + "d c #404000", + "c c #c0c000", + "a c #ffffc0", + ". c None", + "................", + ".........#......", + "......#.#a##....", + ".....#b#bbba##..", + "....#b#bbbabbb#.", + "...#b#bba##bb#..", + "..#b#abb#bb##...", + ".#a#aab#bbbab##.", + "#a#aaa#bcbbbbbb#", + "#ccdc#bcbbcbbb#.", + ".##c#bcbbcabb#..", + "...#acbacbbbe...", + "..#aaaacaba#....", + "...##aaaaa#.....", + ".....##aa#......", + ".......##......." +] + +folderLocked = None +folderClosed = None +folderOpened = None +fileNormal = None + +class FileItem( QListViewItem ) : + def __init__( self, parent=None, s1=QString.null, s2=QString.null ): + QListViewItem.__init__( self, parent, s1, s2 ) + self.pix = None + + def setPixmap( self, p ) : + self.pix = p + self.setup() + self.widthChanged( 0 ) + self.invalidateHeight() + self.repaint() + + def pixmap( self, i ) : + if i : return None + else : return self.pix; + +# Class Directory +class Directory( QListViewItem ) : + def __init__( self, parent=None, filename=QString.null, col2=QString.null ): + QListViewItem.__init__( self, parent, filename, col2 ) + self.pix = None + global folderLocked, folderClosed, folderOpened, fileNormal + self.showDirsOnly = False + if isinstance(parent, QListView): + self.p = None + self.showDirsOnly = parent.showDirsOnly() + self.f = QFile( QString('/') ) + else: + self.p = parent + self.showDirsOnly = parent.showDirsOnly + self.f = QFile( QString(filename) ) + + self.readable = QDir( self.fullName() ).isReadable() + if not self.readable : self.setPixmap( folderLocked ) + else : self.setPixmap( folderClosed ) + + def setPixmap( self, px ) : + self.pix = px + self.setup() + self.widthChanged( 0 ) + self.invalidateHeight() + self.repaint() + + def pixmap( self, i ) : + if i : return None + else : return self.pix + + def setOpen( self, o ) : + if o : self.setPixmap( folderOpened ) + else : self.setPixmap( folderClosed ) + + if o and not self.childCount() : + s = QString( self.fullName() ) + thisDir = QDir( s ) + if not thisDir.isReadable() : + self.readable = False + self.setExpandable( False ) + return + + self.listView().setUpdatesEnabled( False ) + files = thisDir.entryInfoList() + if files : + fi = QFileInfo() + for it in files: + fi = it + if str(fi.fileName()) == "." or str(fi.fileName()) == ".." : + continue # nothing + elif fi.isSymLink() and not self.showDirsOnly : + item = FileItem( self, fi.fileName(), "Symbolic Link" ) + item.setPixmap( fileNormal ) + elif fi.isDir() : + Directory( self, fi.fileName() ) + elif not self.showDirsOnly : + if fi.isFile() : item = FileItem( self, fi.fileName(), "File" ) + else : item = FileItem( self, fi.fileName(), "Special" ) + item.setPixmap( fileNormal ) + + self.listView().setUpdatesEnabled( True ) + QListViewItem.setOpen( self, o ) + + def setup( self ): + self.setExpandable( True ) + QListViewItem.setup( self ) + + def fullName( self ): + s = QString() + if self.p : + s = self.p.fullName() + s.append( self.f.name() ) + s.append( "/" ) + else : + s = self.f.name() + return s + + def text( self, column ) : + if column == 0 : return self.f.name() + elif self.readable : return "Directory" + else : return "Unreadable Directory" + +# Class DirectoryView + +class DirectoryView( QListView ): + def __init__( self, parent=None, name=None, sdo=False ): + QListView.__init__( self, parent, name ) + self.dirsOnly = sdo + self.oldCurrent = 0 + self.dropItem = 0 + self.presspos = QPoint(0,0) + self.mousePressed = False + global folderLocked, folderClosed, folderOpened, fileNormal #= QPixmap() + self.autoopenTime = 750 + + self.autoopen_timer = QTimer( self ) + if not folderLocked : + folderLocked = QPixmap( folder_locked ) + folderClosed = QPixmap( folder_closed_xpm ) + folderOpened = QPixmap( folder_open_xpm ) + fileNormal = QPixmap( pix_file ) + + self.connect( self, SIGNAL("doubleClicked(QListViewItem *)"), + self.slotFolderSelected ) + self.connect( self, SIGNAL("returnPressed(QListViewItem *)"), + self.slotFolderSelected ) + + self.setAcceptDrops( True ) + self.viewport().setAcceptDrops( True ) + + self.connect( self.autoopen_timer, SIGNAL("timeout()"), self.openFolder ) + + def showDirsOnly( self ): + return self.dirsOnly + + def slotFolderSelected( self, i ): + if not i or not self.showDirsOnly(): + return + dir = i + self.emit( PYSIGNAL("folderSelected(const QString &)"), (dir.fullName(), ) ) + + def openFolder( self ): + self.autoopen_timer.stop() + if self.dropItem and not self.dropItem.isOpen(): + self.dropItem.setOpen( True ) + self.dropItem.repaint() + + def contentsDragEnterEvent( self, e ): + if not QUriDrag.canDecode(e) : + e.ignore() + return + self.oldCurrent = self.currentItem() + i = self.itemAt( self.contentsToViewport(e.pos()) ) + if i : + self.dropItem = i + self.autoopen_timer.start( self.autoopenTime ) + + def contentsDragMoveEvent( self, e ) : + if not QUriDrag.canDecode(e) : + e.ignore() + return + vp = self.contentsToViewport( e.pos() ) + i = self.itemAt( vp ) + if i : + self.setSelected( i, True ) + e.accept() + if i != self.dropItem : + self.autoopen_timer.stop() + self.dropItem = i + self.autoopen_timer.start( self.autoopenTime ) + + if e.action() == QDropEvent.Copy: + pass + elif e.action() == QDropEvent.Move: + e.acceptAction() + elif e.action() == QDropEvent.Link: + e.acceptAction() + else: + pass + else : + e.ignore() + self.autoopen_timer.stop() + self.dropItem = 0 + + def contentsDragLeaveEvent( self, QDragLeaveEvent ) : + self.autoopen_timer.stop() + self.dropItem = 0 + + self.setCurrentItem( self.oldCurrent ) + self.setSelected( self.oldCurrent, True ) + + def contentsDropEvent( self, e ): + self.autoopen_timer.stop() + if not QUriDrag.canDecode(e) : + e.ignore() + return + item = self.itemAt( self.contentsToViewport(e.pos()) ) + if item : + lst = QStringList() + QUriDrag.decodeLocalFiles( e, lst ) + if e.action() == QDropEvent.Copy: + s = QString("Copy") + elif e.action() == QDropEvent.Move: + s = QString("Move") + e.acceptAction() + elif e.action() == QDropEvent.Link: + s = QString("Link") + e.acceptAction() + else: + s = QString("Unknown") + + s += "\n\n" + e.accept() + + for filename in lst: + s += filename + s += "\n" + + s += "\nTo\n\n " + s += self.fullPath(item) + QMessageBox.information( self, "Drop target", s, "Not implemented" ) + else : + e.ignore() + + def fullPath( self, item ): + fullpath = QString( item.text(0) ) + item = item.parent() + while item: + newpath = item.text(0) + + if item.parent(): + newpath += "/" + + newpath += fullpath + fullpath = newpath + item = item.parent() + + return fullpath + + def contentsMousePressEvent( self, e ) : + QListView.contentsMousePressEvent( self, e ) + p = QPoint( self.contentsToViewport( e.pos() ) ) + i = self.itemAt( p ) + if i : + # if the user clicked into the root decoration of the item, don't try to start a drag! + if self.rootIsDecorated(): isdecorated = 1 + else : isdecorated = 0 + if p.x() > self.header().sectionPos( self.header().mapToIndex( 0 )) + self.treeStepSize() * ( i.depth() + isdecorated + self.itemMargin() or + p.x() < self.header().sectionPos( self.header().mapToIndex( 0 ) ) ) : + self.presspos.setX(e.pos().x()) + self.presspos.setY(e.pos().y()) + self.mousePressed = True + + def contentsMouseMoveEvent( self, e ): + offset = QPoint( self.presspos.x() - e.pos().x(), + self.presspos.y() - e.pos().y() ) + if self.mousePressed and (offset).manhattanLength() > QApplication.startDragDistance() : + self.mousePressed = False + item = self.itemAt( self.contentsToViewport(self.presspos) ) + if item : + source = self.fullPath(item) + if QFile.exists(source) : + ud = QUriDrag(self.viewport()) + ud.setFileNames( QStringList (source) ) + if ud.drag() : + QMessageBox.information( self, "Drag source", + QString("Delete ")+source, "Not implemented" ) + + def contentsMouseReleaseEvent( self, QMouseEvent ): + self.mousePressed = False + + def setDir( self, s ): + it = QListViewItem( self ) + it.setOpen(False) + thisDir = QDir( s ) + it = QListViewItem( self ) + it.setOpen(False) + lst = QStringList( QStringList.split( "/", s ) ) + listview2 = [] + listview2.extend( lst ) + + item = self.firstChild() + for it2 in listview2 : + while item : + if item.text( 0 ) == it2 : + item.setOpen( True ) + break + item = item.itemBelow() + if item: + self.setCurrentItem( item ) + +def main( args ): + a = QApplication( args ) + + mw = DirectoryView() + mw.addColumn( "Name" ) + mw.addColumn( "Type" ) + mw.setTreeStepSize( 20 ) + + roots = QDir.drives() + if roots : + for it in roots: + fi = it + root = Directory( mw, fi.filePath() ) + if roots.count(it) <= 1 : + root.setOpen( True ) # be interesting + + mw.resize( 400, 400 ) + mw.setCaption( "Qt Example - Directory Browser" ) + mw.setAllColumnsShowFocus( True ) + a.setMainWidget( mw ) + mw.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/dragdrop.py b/python/pyqt/examples3/dragdrop.py new file mode 100755 index 00000000..4cc8c738 --- /dev/null +++ b/python/pyqt/examples3/dragdrop.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Ported to PyQt by Issac Trotts on Jan 1, 2002 + +import sys +from qt import * + +import dropsite, secret + + +def addStuff( parent, yn_image, yn_secret = 0 ): + tll = QVBoxLayout( parent, 10 ) + d = dropsite.DropSite( parent, 'dropsite' ) + d.setFrameStyle( QFrame.Sunken + QFrame.WinPanel ) + tll.addWidget( d ) + if yn_image: + stuff = QPixmap() + if not stuff.load( "trolltech.bmp" ): + stuff = QPixmap(20,20) + stuff.fill(Qt.green) + d.setPixmap( stuff ) + else: + d.setText("Drag and Drop") + d.setFont(QFont("Helvetica",18)) + if secret: + s = secret.SecretSource( 42, parent ) + tll.addWidget( s ) + + format = QLabel( "\n\n\n\nNone\n\n\n\n", parent ) + tll.addWidget( format ) + tll.activate() + parent.resize( parent.sizeHint() ) + + QObject.connect( d, PYSIGNAL('message(QString &)'), + format, SLOT('setText(QString &)') ) + + +app = QApplication( sys.argv ) + +mw = QWidget() +addStuff( mw, 1 ) +mw.setCaption( "Qt Example - Drag and Drop" ) +mw.show() + +mw2 = QWidget() +addStuff( mw2, 0 ) +mw2.setCaption( "Qt Example - Drag and Drop" ) +mw2.show() + +mw3 = QWidget() +addStuff( mw3, 1, 1 ) +mw3.setCaption( "Qt Example - Drag and Drop" ) +mw3.show() + +QObject.connect(qApp,SIGNAL('lastWindowClosed()'),qApp,SLOT('quit()')) + +app.exec_loop() diff --git a/python/pyqt/examples3/drawlines.py b/python/pyqt/examples3/drawlines.py new file mode 100755 index 00000000..3e21db71 --- /dev/null +++ b/python/pyqt/examples3/drawlines.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python + +import sys, random +from qt import * + +TRUE = 1 +FALSE = 0 + +MAXPOINTS = 2000; # maximum number of points +MAXCOLORS = 40; + +# +# ConnectWidget - draws connected lines +# + +class ConnectWidget(QWidget): + def __init__(self): + QWidget.__init__(self) + self.setEraseColor( Qt.white ) # white background + self.count = 0; + self.down = FALSE + + self.points = [] + self.colors = [] + + for i in range(MAXPOINTS): # init arrays + self.points.append(QPoint()) + for i in range(MAXCOLORS): + self.colors.append(QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) )) + +# +# Handles paint events for the connect widget. +# + def paintEvent(self, pe): + paint = QPainter( self ) + for i in range(self.count-1): # connect all points + for j in range(i+1, self.count): + paint.setPen( self.colors[random.randint(0,MAXCOLORS-1)] ) # set random pen color + paint.drawLine( self.points[i], self.points[j] ) # draw line + +# +# Handles mouse press events for the connect widget. +# + def mousePressEvent(self, me): + self.down = TRUE + self.count = 0 # start recording points + self.erase() # erase widget contents + +# +# Handles mouse release events for the connect widget. +# + def mouseReleaseEvent(self, me ): + self.down = FALSE # done recording points + self.update() # draw the lines + +# +# Handles mouse move events for the connect widget. +# + def mouseMoveEvent(self, me): + if self.down and self.count < MAXPOINTS: + paint = QPainter( self ) + self.points[self.count] = QPoint(me.pos()) # add point + paint.drawPoint( me.pos() ) # plot point + self.count = self.count+1 + +# +# Create and display a ConnectWidget. +# +a = QApplication( sys.argv ) +connect = ConnectWidget() +connect.setCaption( "PyQt Example - Draw lines") +a.setMainWidget( connect ) +connect.show() +a.exec_loop() diff --git a/python/pyqt/examples3/dropsite.py b/python/pyqt/examples3/dropsite.py new file mode 100644 index 00000000..11d97079 --- /dev/null +++ b/python/pyqt/examples3/dropsite.py @@ -0,0 +1,96 @@ +# This is part of the dragdrop example. + + +from qt import * + +import secret + + +class DropSite(QLabel): + def __init__(self, parent=None, name=None): + QLabel.__init__( self, parent, name ) + self.setAcceptDrops(1) + + # this is a normal event + def mousePressEvent( self, e ): + if ( self.pixmap() ) : + drobj = QImageDrag( self.pixmap().convertToImage(), self ) + pm = QPixmap() + pm.convertFromImage(self.pixmap().convertToImage().smoothScale( + self.pixmap().width()/3,self.pixmap().height()/3)) + drobj.setPixmap(pm,QPoint(-5,-7)) + else : + drobj = QTextDrag( self.text(), self ) + drobj.dragCopy() + + def backgroundColorChange( self, qcolor ): + # Reduce flicker by using repaint() rather than update() + self.repaint() + + def dragMoveEvent( self, e ): + # Check if you want the drag at e.pos()... + # Give the user some feedback... + pass + + def dragEnterEvent( self, e ): + # Check if you want the drag... + if (secret.canDecode( e ) or + QTextDrag.canDecode( e ) or + QImageDrag.canDecode( e ) or + QUriDrag.canDecode( e )): + e.accept() + + # Give the user some feedback... + t = '' + i = 0 + while e.format( i ): + if ( t != '' ): + t += "\n" + t += str(e.format( i )) + i += 1 + self.emit(PYSIGNAL('message(QString &)'), (QString(t),)) + self.setEraseColor(Qt.white) + + def dragLeaveEvent( self, QDragLeaveEvent ): + # Give the user some feedback... + self.emit(PYSIGNAL('message(QString &)'), (QString(''),)) + self.setEraseColor(Qt.lightGray) + + def dropEvent( self, e ): + self.setEraseColor(Qt.lightGray) + # Try to decode to the data you understand... + str = QString() + if ( QTextDrag.decode( e, str ) ) : + self.setText( str ) + self.setMinimumSize( self.minimumSize().expandedTo(self.sizeHint()) ) + return + + pm = QPixmap() + if ( QImageDrag.decode( e, pm ) ) : + self.setPixmap( pm ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return + + # QStrList strings + #strings = QStrList() + strings = [] + if ( QUriDrag.decode( e, strings ) ) : + m = QString("Full URLs:\n") + for u in strings: + m = m + " " + u + '\n' + # QStringList files + files = [] + if ( QUriDrag.decodeLocalFiles( e, files ) ) : + m += "Files:\n" + # for (QStringList.Iterator i=files.begin() i!=files.end() ++i) + for i in files: + m = m + " " + i + '\n' + self.setText( m ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return + + str = secret.decode( e ) + if str: + self.setText( str ) + self.setMinimumSize(self.minimumSize().expandedTo(self.sizeHint())) + return diff --git a/python/pyqt/examples3/fileopen.xpm b/python/pyqt/examples3/fileopen.xpm new file mode 100644 index 00000000..880417ee --- /dev/null +++ b/python/pyqt/examples3/fileopen.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char *fileopen[] = { +" 16 13 5 1", +". c #040404", +"# c #808304", +"a c None", +"b c #f3f704", +"c c #f3f7f3", +"aaaaaaaaa...aaaa", +"aaaaaaaa.aaa.a.a", +"aaaaaaaaaaaaa..a", +"a...aaaaaaaa...a", +".bcb.......aaaaa", +".cbcbcbcbc.aaaaa", +".bcbcbcbcb.aaaaa", +".cbcb...........", +".bcb.#########.a", +".cb.#########.aa", +".b.#########.aaa", +"..#########.aaaa", +"...........aaaaa" +}; diff --git a/python/pyqt/examples3/fontdisplayer.py b/python/pyqt/examples3/fontdisplayer.py new file mode 100755 index 00000000..cb8531a4 --- /dev/null +++ b/python/pyqt/examples3/fontdisplayer.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +class FontRowTable( QFrame ): + def __init__( self, parent=None, name=None ): + QFrame.__init__( self, parent, name ) + + self.setBackgroundMode(self.PaletteBase) + self.setFrameStyle(self.Panel|self.Sunken) + self.setMargin(8) + self.setRow(0) + self.row = 0 + self.tablefont = QFont( QApplication.font() ) + + def sizeHint( self ) : + width = 16*self.cellSize().width()+QSize(2,2).width()*(self.margin()+self.frameWidth()) + height = 16*self.cellSize().height()+QSize(2,2).height()*(self.margin()+self.frameWidth()) + return QSize(width,height) + + def cellSize( self ) : + fm = self.fontMetrics() + return QSize( fm.maxWidth(), fm.lineSpacing() + 1 ) + + def paintEvent( self, e ): + QFrame.paintEvent(self, e) + p = QPainter(self) + p.setClipRegion(e.region()) + r = QRect(e.rect()) + fm = self.fontMetrics() + ml = self.frameWidth() + self.margin() + 1 + max(0,-fm.minLeftBearing()) + mt = self.frameWidth() + self.margin() + cell = QSize((self.width()-15-ml)/16,(self.height()-15-mt)/16) + + if not cell.width() or not cell.height() : + return + + mini = r.left() / cell.width() + maxi = (r.right()+cell.width()-1) / cell.width() + minj = r.top() / cell.height() + maxj = (r.bottom()+cell.height()-1) / cell.height() + + h = fm.height() + + body = QColor(255,255,192); + negative = QColor(255,192,192); + positive = QColor(192,192,255); + rnegative = QColor(255,128,128); + rpositive = QColor(128,128,255); + + for j in range(minj, maxj+1, 1) : + for i in range(mini, maxi+1, 1) : + if i < 16 and j < 16 : + x = i*cell.width() + y = j*cell.height() + + ch = QChar(j*16+i) #,self.row) # just accept one argument!!! + + if fm.inFont(ch) : + w = fm.width(ch) + l = fm.leftBearing(ch) + r = fm.rightBearing(ch) + + x += ml + y += mt+h + + p.fillRect(x,y,w,-h,QBrush(body)) + + if w : + if l : + if l < 0: sign = negative + else: sign = positive + if l > 0: lsign = 0 + else: lsign = 1 + p.fillRect(x+lsign, y-h/2, abs(l),-h/2, QBrush(sign)) + if r : + if r < 0: sign = rnegative + else: sign = rpositive + if r > 0: rsign = r + else: rsign = 0 + p.fillRect(x+w-rsign,y+2, abs(r),-h/2, QBrush(sign)) + s = QString( ch ) + p.setPen(QPen(Qt.black)) + p.drawText(x,y,s) + + def setRow( self, r ) : + self.row = r + + fm = self.fontMetrics() + str = " minLB=%d minRB=%d maxW=%d" % (fm.minLeftBearing(), fm.minRightBearing(), fm.maxWidth()) + self.emit( PYSIGNAL("fontInformation"), ( QString(str), ) ) + self.update() + + def chooseFont( self ) : + ok = 0 + oldfont = QFont( self.tablefont ) + self.tablefont, ok = QFontDialog.getFont(oldfont, self) + if ok: + self.setFont(self.tablefont) + else: + self.tablefont = oldfont + +class FontDisplayer( QMainWindow ) : + def __init__( self, parent=None, name=None ): + QMainWindow.__init__( self, parent, name ) + table = FontRowTable(self) + controls = QToolBar(self) + + QLabel(self.tr("Row:"), controls) + self.row = QSpinBox(0,255,1,controls) + controls.addSeparator() + fontbutton = QPushButton(self.tr("Font..."), controls) + status = QStatusBar(self) + + self.connect( self.row, SIGNAL("valueChanged(int)"), table.setRow ) + self.connect( fontbutton, SIGNAL("clicked()"), table.chooseFont ) + self.connect( table, PYSIGNAL("fontInformation"), + status, SLOT("message(const QString&)") ) + table.setRow(0) + self.setCentralWidget(table) + +def main( args ): + # Use an interesting font + QApplication.setFont(QFont("unifont",16)) + app = QApplication(sys.argv) + + m = FontDisplayer() + sh = QSize( m.centralWidget().sizeHint() ) + m.resize(sh.width(), sh.height() + 3 * m.statusBar().height()) + app.setMainWidget(m); + m.setCaption("Qt Example - QFD"); + m.show() + + app.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/fonts.py b/python/pyqt/examples3/fonts.py new file mode 100755 index 00000000..3240ed6b --- /dev/null +++ b/python/pyqt/examples3/fonts.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +class Viewer( QWidget ): + def __init__( self ): + QWidget.__init__( self ) + + self.setFontSubstitutions() + + #greeting_heb = QString.fromUtf8( "\327\251\327\234\327\225\327\235" ) + greeting_heb = unicode( '\327\251\327\234\327\225\327\235','utf8' ) + #greeting_ru = QString.fromUtf8( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" ) + greeting_ru = unicode('\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265','utf8' ) + greeting_en = "Hello" + + self.greetings = QTextView( self, "textview" ) + + self.greetings.setText( greeting_en + "\n" + + greeting_ru + "\n" + + greeting_heb ) + + self.fontInfo = QTextView( self, "fontinfo" ) + + self.setDefault() + + self.defaultButton = QPushButton( "Default", self, "pushbutton1" ) + self.defaultButton.setFont( QFont( "times" ) ) + self.connect( self.defaultButton, SIGNAL("clicked()"), self.setDefault ) + + self.sansSerifButton = QPushButton( "Sans Serif", self, "pushbutton2" ) + self.sansSerifButton.setFont( QFont( "Helvetica", 12 ) ) + self.connect( self.sansSerifButton, SIGNAL("clicked()"), self.setSansSerif ) + + self.italicsButton = QPushButton( "Italics", self, "pushbutton3" ) + self.italicsButton.setFont( QFont( "lucida", 12, QFont.Bold, True ) ) + self.connect( self.italicsButton, SIGNAL("clicked()"), self.setItalics ) + + self.layout() + + def setDefault( self ): + font = QFont( "Bavaria" ) + font.setPointSize( 24 ) + font.setWeight( QFont.Bold ) + font.setUnderline( True ) + + self.greetings.setFont( font ) + + self.showFontInfo( font ) + + def setSansSerif( self ): + font = QFont( "Newyork", 18 ) + font.setStyleHint( QFont.SansSerif ) + + self.greetings.setFont( font ) + + self.showFontInfo( font ) + + def setItalics( self ): + font = QFont( "Tokyo" ) + font.setPointSize( 32 ) + font.setWeight( QFont.Bold ) + font.setItalic( True ) + + self.greetings.setFont( font ) + + self.showFontInfo( font ) + + def showFontInfo( self, font ): + info = QFontInfo( font ) + + messageText = "Font requested: \"" + str(font.family()) + "\" " \ + + str(QString.number( font.pointSize() )) + "pt<BR>" \ + + "Font used: \"" + str(info.family()) + "\" " \ + + str(QString.number( info.pointSize() )) + "pt<P>" + + if not self.substitutes.isEmpty() : + messageText += "The following substitutions exist for " + \ + str(font.family()) + ":<UL>" + for i in self.substitutes : + messageText += "<LI>\"" + str(i) + "\"" + messageText += "</UL>"; + else : + messageText += "No substitutions exist for " + \ + str(font.family()) + "." + + self.fontInfo.setText( messageText ) + + def setFontSubstitutions( self ): + self.substitutes = QStringList() + self.substitutes.append( "Times" ) + self.substitutes.append( "Mincho" ) + self.substitutes.append( "Arabic Newspaper" ) + self.substitutes.append( "crox" ) + #QFont.insertSubstitutions( "Bavaria", self.substitutes ) + QFont.insertSubstitution( "Bavaria", "Times" ) + QFont.insertSubstitution( "Tokyo", "Lucida" ) + + # For those who prefer to use Qt Designer for creating GUIs + # the following function might not be of particular interest: + # all it does is creating the widget layout. + def layout( self ): + textViewContainer = QHBoxLayout() + textViewContainer.addWidget( self.greetings ) + textViewContainer.addWidget( self.fontInfo ) + + buttonContainer = QHBoxLayout() + buttonContainer.addWidget( self.defaultButton ) + buttonContainer.addWidget( self.sansSerifButton ) + buttonContainer.addWidget( self.italicsButton ) + + maxButtonHeight = self.defaultButton.height() + + if self.sansSerifButton.height() > maxButtonHeight : + maxButtonHeight = self.sansSerifButton.height() + if self.italicsButton.height() > maxButtonHeight : + maxButtonHeight = self.italicsButton.height() + + self.defaultButton.setFixedHeight( maxButtonHeight ) + self.sansSerifButton.setFixedHeight( maxButtonHeight ) + self.italicsButton.setFixedHeight( maxButtonHeight ) + + container = QVBoxLayout( self ) + container.addLayout( textViewContainer ) + container.addLayout( buttonContainer ) + + self.resize( 700, 250 ) + +def main( args ): + app = QApplication(sys.argv) # application object + + textViewer = Viewer() + textViewer.setCaption( "Qt Example - Simple QFont Demo" ) + app.setMainWidget( textViewer ) + textViewer.show() + + app.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/gears.py b/python/pyqt/examples3/gears.py new file mode 100755 index 00000000..c89a7a24 --- /dev/null +++ b/python/pyqt/examples3/gears.py @@ -0,0 +1,235 @@ +#!/usr/bin/env python + + +import sys +import math +from qt import * +from qtgl import * +from OpenGL.GL import * + +def gear(inner_radius,outer_radius,width,teeth,tooth_depth): + r0 = inner_radius + r1 = outer_radius - tooth_depth/2.0 + r2 = outer_radius + tooth_depth/2.0 + + da = 2.0*math.pi/teeth/4.0 + + glShadeModel(GL_FLAT) + + glNormal3f(0.0,0.0,1.0) + + # draw front face + + glBegin(GL_QUAD_STRIP) + + for i in range(teeth+1): + angle = i * 2.0*math.pi/teeth + glVertex3f(r0*math.cos(angle), r0*math.sin(angle), width*0.5 ) + glVertex3f(r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f(r0*math.cos(angle), r0*math.sin(angle), width*0.5 ) + glVertex3f(r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + + glEnd() + + # draw front sides of teeth + + da = 2.0*math.pi/teeth/4.0 + + glBegin(GL_QUADS) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + + glEnd() + + + glNormal3f( 0.0, 0.0, -1.0 ) + + # draw back face + + glBegin( GL_QUAD_STRIP ) + + for i in range(teeth+1): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ) + + glEnd() + + # draw back sides of teeth + + da = 2.0*math.pi/teeth/4.0 + + glBegin( GL_QUADS ) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), -width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), -width*0.5 ) + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + + glEnd() + + # draw outward faces of teeth + + glBegin( GL_QUAD_STRIP ) + + for i in range(teeth): + angle = i*2.0*math.pi/teeth + + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), width*0.5 ) + glVertex3f( r1*math.cos(angle), r1*math.sin(angle), -width*0.5 ) + + u = r2*math.cos(angle+da) - r1*math.cos(angle) + v = r2*math.sin(angle+da) - r1*math.sin(angle) + + len = math.sqrt( u*u + v*v ) + u /= len + v /= len + glNormal3f( v, -u, 0.0 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), width*0.5 ) + glVertex3f( r2*math.cos(angle+da), r2*math.sin(angle+da), -width*0.5 ) + glNormal3f( math.cos(angle), math.sin(angle), 0.0 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), width*0.5 ) + glVertex3f( r2*math.cos(angle+2*da), r2*math.sin(angle+2*da), -width*0.5 ) + u = r1*math.cos(angle+3*da) - r2*math.cos(angle+2*da) + v = r1*math.sin(angle+3*da) - r2*math.sin(angle+2*da) + glNormal3f( v, -u, 0.0 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), width*0.5 ) + glVertex3f( r1*math.cos(angle+3*da), r1*math.sin(angle+3*da), -width*0.5 ) + glNormal3f( math.cos(angle), math.sin(angle), 0.0 ) + + glVertex3f( r1*math.cos(0.0), r1*math.sin(0.0), width*0.5 ) + glVertex3f( r1*math.cos(0.0), r1*math.sin(0.0), -width*0.5 ) + + glEnd() + + glShadeModel (GL_SMOOTH) + + # draw inside radius cylinder + + glBegin( GL_QUAD_STRIP ) + + for i in range(teeth+1): + angle = i * 2.0*math.pi / teeth + glNormal3f( -math.cos(angle), -math.sin(angle), 0.0 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), -width*0.5 ) + glVertex3f( r0*math.cos(angle), r0*math.sin(angle), width*0.5 ) + + glEnd() + +############################################################################## +class GearWidget(QGLWidget): + def __init__(self,parent=None,name=None): + QGLWidget.__init__(self,parent,name) + + self.angle=0.0 + self.view_rotx=0.0 + self.view_roty=0.0 + self.view_rotz=0.0 + + self.startTimer(10) + + def timerEvent(self,event): + self.updateGL() + + def paintGL(self): + self.angle = self.angle + 2.0 + self.view_rotx = self.view_rotx + 1.0 + self.view_roty = self.view_roty + 3.0 + self.view_rotz = self.view_rotz + 2.0 + + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ) + + glPushMatrix() + glRotatef( self.view_rotx, 1.0, 0.0, 0.0 ) + glRotatef( self.view_roty, 0.0, 1.0, 0.0 ) + glRotatef( self.view_rotz, 0.0, 0.0, 1.0 ) + + glPushMatrix() + glTranslatef( -3.0, -2.0, 0.0 ) + glRotatef( self.angle, 0.0, 0.0, 1.0 ) + glCallList(self.gear1) + glPopMatrix() + + glPushMatrix() + glTranslatef( 3.1, -2.0, 0.0 ) + glRotatef( -2.0*self.angle-9.0, 0.0, 0.0, 1.0 ) + glCallList(self.gear2) + glPopMatrix() + + glPushMatrix() + glTranslatef( -3.1, 2.2, -1.8 ) + glRotatef( 90.0, 1.0, 0.0, 0.0 ) + glRotatef( 2.0*self.angle-2.0, 0.0, 0.0, 1.0 ) + glCallList(self.gear3) + glPopMatrix() + + glPopMatrix() + + def resizeGL(self,width,height): + w = width / float(height) + h = 1.0 + + glViewport( 0, 0, width, height ) + glMatrixMode(GL_PROJECTION) + glLoadIdentity() + glFrustum( -w, w, -h, h, 5.0, 60.0 ) + glMatrixMode(GL_MODELVIEW) + glLoadIdentity() + glTranslatef( 0.0, 0.0, -40.0 ) + + def initializeGL(self): + pos=(5.0, 5.0, 10.0, 1.0 ) + ared=(0.8, 0.1, 0.0, 1.0 ) + agreen=(0.0, 0.8, 0.2, 1.0 ) + ablue=(0.2, 0.2, 1.0, 1.0 ) + + glLightfv(GL_LIGHT0,GL_POSITION,pos) + glEnable(GL_CULL_FACE) + glEnable(GL_LIGHTING) + glEnable(GL_LIGHT0) + glEnable(GL_DEPTH_TEST) + + self.gear1=glGenLists(1) + glNewList(self.gear1,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,ared) + gear(1.0,4.0,1.0,20,0.7) + glEndList() + + self.gear2=glGenLists(1) + glNewList(self.gear2,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,agreen) + gear(0.5,2.0,2.0,10,0.7) + glEndList() + + self.gear3=glGenLists(1) + glNewList(self.gear3,GL_COMPILE) + glMaterialfv(GL_FRONT,GL_AMBIENT_AND_DIFFUSE,ablue) + gear(1.3,2.0,0.5,10,0.7) + glEndList() + + glEnable(GL_NORMALIZE) + +############################################################################## +if __name__=='__main__': + QApplication.setColorSpec(QApplication.CustomColor) + app=QApplication(sys.argv) + + if not QGLFormat.hasOpenGL(): + raise 'No Qt OpenGL support.' + + widget=GearWidget() + app.setMainWidget(widget) + widget.show() + app.exec_loop() diff --git a/python/pyqt/examples3/i18n/i18n.pro b/python/pyqt/examples3/i18n/i18n.pro new file mode 100644 index 00000000..fc55895e --- /dev/null +++ b/python/pyqt/examples3/i18n/i18n.pro @@ -0,0 +1,15 @@ +SOURCES = mywidget.py \ + i18n.py + +TRANSLATIONS = mywidget_cs.ts \ + mywidget_de.ts \ + mywidget_el.ts \ + mywidget_en.ts \ + mywidget_eo.ts \ + mywidget_fr.ts \ + mywidget_it.ts \ + mywidget_jp.ts \ + mywidget_ko.ts \ + mywidget_no.ts \ + mywidget_ru.ts \ + mywidget_zh.ts diff --git a/python/pyqt/examples3/i18n/i18n.py b/python/pyqt/examples3/i18n/i18n.py new file mode 100755 index 00000000..06cc97f5 --- /dev/null +++ b/python/pyqt/examples3/i18n/i18n.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python + +# Copyright (c) 2002 Detlev Offenbach <detlev@die-offenbachs.de> + +from whrandom import randint +import sys + +from qt import * + +from mywidget import MyWidget + +class QVDialog(QDialog): + def __init__(self, parent=None, name=None, modal=0, flags=0): + QDialog.__init__(self, parent, name, modal, flags) + + self.vb = QVBoxLayout(self, 8) + self.vb.setAutoAdd(1) + + self.hb = None + self.map = {} + #self.sm = QSignalMapper(self) + self.connect(self, PYSIGNAL('mapped(int)'), self.done) + + def addButtons(self, cancel=None, ok=None, mid1=None, mid2=None, mid3=None): + if ok is None: + self.addButton(self.tr("OK"),1) + else: + self.addButton(ok,1) + + if mid1 is not None: + self.addButton(mid1,2) + + if mid2 is not None: + self.addButton(mid2,3) + + if mid3 is not None: + self.addButton(mid3,4) + + if cancel is None: + self.addButton(self.tr('Cancel'),0) + else: + self.addButton(cancel,0) + + def addButton(self, text, result): + if self.hb is None: + self.hb = QHBox(self) + c = QPushButton(text, self.hb) + self.setMapping(c, result) + self.connect(c, SIGNAL('clicked()'), self.mapit) + + def setMapping(self, c, result): + self.map[c] = result + + def mapit(self): + qo = self.sender() + self.emit(PYSIGNAL('mapped(int)'), (self.map[qo],)) + +translator = None +wlist = [] # keep reference to widgets + +def showLang(lang): + global translator + + qApp.setPalette(QPalette(QColor(220-randint(0,64),220-randint(0,64),220-randint(0,64)))) + + language = "mywidget_"+lang+".qm" + fi = QFileInfo(language) + + if not fi.exists(): + QMessageBox.warning(None, "File error", + "Cannot find translation for language: "+lang+\ + "\n(try eg. 'de' or 'en')") + return None + + if translator is not None: + qApp.removeTranslator(translator) + translator = None + + translator = QTranslator(None) + translator.load(language,".") + qApp.installTranslator(translator) + m = MyWidget() + m.setCaption("PyQt Example - i18n - " + unicode(m.caption())) + wlist.append(m) + return m + +def main(argv): + app = QApplication(argv) + + qm = ["cs", "de", "el", "en", "eo", "fr", "it", "jp", "ko", "no", "ru", "zh"] + + lang = None + if len(argv) == 2: + lang = argv[1] + + if (len(argv) != 2) or (lang == "all"): + dlg = QVDialog(None, None, 1) + qmb = [] + r = 0 + if lang == "all": + r=2 + else: + bg = QButtonGroup(4, Qt.Vertical, "Choose Locales", dlg) + loc = QTextCodec.locale() + for i in range(0,len(qm)): + qmb.append(QCheckBox(qm[i], bg)) + qmb[i].setChecked(str(loc) == qm[i]) + dlg.addButtons("Cancel","OK","All") + r = dlg.exec_loop() + + if r: + tight = qApp.desktop().screen().width < 1024 + x = 5 + y = 25 + for i in range(0,len(qm)): + if (r == 2) or (qmb[i].isChecked()): + w = showLang(qm[i]) + + if w == None: + sys.exit(0) + + app.connect(app, SIGNAL('lastWindowClosed()'), qApp, SLOT('quit()')) + w.setGeometry(x,y,197,356) + w.show() + if tight: + x += 8 + y += 8 + else: + x += 205 + if x > 1000: + x = 5 + y += 384 + + else: + sys.exit(0) + + else: + lang = argv[1] + m = showLang(lang) + app.setMainWidget(m) + m.setCaption("PyQt Example - i18n") + m.show() + + return app.exec_loop() + +if __name__ == "__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/i18n/mywidget.py b/python/pyqt/examples3/i18n/mywidget.py new file mode 100644 index 00000000..60e267a4 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget.py @@ -0,0 +1,47 @@ +# Copyright (c) 2002 Detlev Offenbach <detlev@die-offenbachs.de> + +from qt import * + +class MyWidget(QMainWindow): + + def __init__(self, parent=None, name=None): + QMainWindow.__init__(self, parent, name) + + self.central = QVBox(self) + self.central.setMargin(5) + self.central.setSpacing(5) + self.setCentralWidget(self.central) + + self.setCaption(self.trUtf8("""Internationalization Example""")) + + self.file = QPopupMenu(self) + self.file.insertItem(self.trUtf8("E&xit"), qApp, SLOT("quit()"), + QKeySequence(self.trUtf8("Ctrl+Q","File|Quit"))) + self.menuBar().insertItem(self.trUtf8("&File"), self.file) + + self.statusBar().message(self.trUtf8('''Language: English''')) + + self.label = QLabel(self.trUtf8("The Main Window"), self.central) + + self.gbox = QButtonGroup(1, QGroupBox.Horizontal, + self.trUtf8("View"), self.central) + rb = QRadioButton(qApp.translate('MyWidget','Perspective'), self.gbox) + rb = QRadioButton(qApp.translate('MyWidget','Isometric'), self.gbox) + rb = QRadioButton(qApp.translate('MyWidget','Oblique'), self.gbox) + + self.initChoices(self.central) + + choices = [ + QT_TRANSLATE_NOOP("MyWidget", "First"), + QT_TRANSLATE_NOOP("MyWidget", "Second"), + QT_TRANSLATE_NOOP("MyWidget", "Third") + ] + + def initChoices(self, parent): + self.lb = QListBox(parent) + for ch in self.choices: + self.lb.insertItem(self.trUtf8(ch)) + + def closeEvent(self, e): + QWidget.closeEvent(self, e) + self.emit(PYSIGNAL('closed'), ()) diff --git a/python/pyqt/examples3/i18n/mywidget_cs.qm b/python/pyqt/examples3/i18n/mywidget_cs.qm Binary files differnew file mode 100644 index 00000000..f95090d6 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_cs.qm diff --git a/python/pyqt/examples3/i18n/mywidget_cs.ts b/python/pyqt/examples3/i18n/mywidget_cs.ts new file mode 100644 index 00000000..4cf61f15 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_cs.ts @@ -0,0 +1,75 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Pohled</translation> + </message> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">&Soubor</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">&Konec</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">PrvnÃ</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">TÅ™etÃ</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Jayzk: ÄŒeský</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">Hlavnà okno</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+Q</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">NaklonÄ›ný</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Druhý</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isometrický</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">PerspektivnÃ</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Ukázka lokalizace</translation> + </message> +</context> +<context encoding="UTF-8"> + <name>QAccel</name> + <message encoding="UTF-8"> + <source>Ctrl</source> + <translation type="obsolete">Ctrl</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_de.qm b/python/pyqt/examples3/i18n/mywidget_de.qm Binary files differnew file mode 100644 index 00000000..64338556 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_de.qm diff --git a/python/pyqt/examples3/i18n/mywidget_de.ts b/python/pyqt/examples3/i18n/mywidget_de.ts new file mode 100644 index 00000000..d114b8b5 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_de.ts @@ -0,0 +1,69 @@ +<!DOCTYPE TS><TS> +<context> + <name>MyWidget</name> + <message> + <source>First</source> + <translation>Erstens</translation> + </message> + <message> + <source>Second</source> + <translation>Zweitens</translation> + </message> + <message> + <source>Third</source> + <translation>Drittens</translation> + </message> + <message> + <source>Internationalization Example</source> + <translation>Internationalisierungsbeispiel</translation> + </message> + <message> + <source>E&xit</source> + <translation>Be&enden</translation> + </message> + <message> + <source>&File</source> + <translation>&Datei</translation> + </message> + <message> + <source>Language: English</source> + <translation>Sprache: Deutsch</translation> + </message> + <message> + <source>The Main Window</source> + <translation>Das Hauptfenster</translation> + </message> + <message> + <source>View</source> + <translation>Ansicht</translation> + </message> + <message> + <source>Perspective</source> + <translation>Perspektivisch</translation> + </message> + <message> + <source>Isometric</source> + <translation>Isometrisch</translation> + </message> + <message> + <source>Oblique</source> + <translation>Schief</translation> + </message> + <message> + <source>Ctrl+Q</source> + <comment>File|Quit</comment> + <translation>Strg+Q</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation>OK</translation> + </message> + <message> + <source>Cancel</source> + <translation>Abbruch</translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_el.qm b/python/pyqt/examples3/i18n/mywidget_el.qm Binary files differnew file mode 100644 index 00000000..15d76895 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_el.qm diff --git a/python/pyqt/examples3/i18n/mywidget_el.ts b/python/pyqt/examples3/i18n/mywidget_el.ts new file mode 100644 index 00000000..59fb2289 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_el.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">&ΑÏχείο</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+Q</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">Έ&ξοδος</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Î Ïώτο</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">ΠαÏάδειγμα διεθνοποίησης</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">ΙσομετÏική</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Γλώσσα: Ελληνικά</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Πλάγια</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Î Ïοοπτική</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">ΔεÏτεÏο</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">ΚÏÏιο παÏάθυÏο</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">ΤÏίτο</translation> + </message> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Όψη</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_en.qm b/python/pyqt/examples3/i18n/mywidget_en.qm Binary files differnew file mode 100644 index 00000000..6bd22c41 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_en.qm diff --git a/python/pyqt/examples3/i18n/mywidget_en.ts b/python/pyqt/examples3/i18n/mywidget_en.ts new file mode 100644 index 00000000..f231669f --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_en.ts @@ -0,0 +1,69 @@ +<!DOCTYPE TS><TS> +<context> + <name>MyWidget</name> + <message> + <source>First</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Second</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Third</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Internationalization Example</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>E&xit</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>&File</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Language: English</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>The Main Window</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>View</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Perspective</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Isometric</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Oblique</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ctrl+Q</source> + <comment>File|Quit</comment> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_eo.qm b/python/pyqt/examples3/i18n/mywidget_eo.qm Binary files differnew file mode 100644 index 00000000..372cf792 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_eo.qm diff --git a/python/pyqt/examples3/i18n/mywidget_eo.ts b/python/pyqt/examples3/i18n/mywidget_eo.ts new file mode 100644 index 00000000..381870de --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_eo.ts @@ -0,0 +1,72 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">&Dosiero</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+F</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit...</source> + <translation type="obsolete">&Fini...</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Unue</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Ekzemplo pri internaciigo</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isometria</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Lingvo: Esperanto (ĈĜĤĴŜŬĉÄĥĵÅÅ)</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Oblikva</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Perspektiva</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Due</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">La Ĉeffenestro</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">Trie</translation> + </message> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Aspekto</translation> + </message> + <message> + <source>E&xit</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_fr.qm b/python/pyqt/examples3/i18n/mywidget_fr.qm Binary files differnew file mode 100644 index 00000000..12a84640 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_fr.qm diff --git a/python/pyqt/examples3/i18n/mywidget_fr.ts b/python/pyqt/examples3/i18n/mywidget_fr.ts new file mode 100644 index 00000000..a029084a --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_fr.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Vue</translation> + </message> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">&Fichier</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">&Quitter</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Premier</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">Troisième</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Langage : Français</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">La fenêtre principale</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+Q</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Oblique</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Second</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isométrique</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Perspective</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Exemple d'internationalisation</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_it.qm b/python/pyqt/examples3/i18n/mywidget_it.qm Binary files differnew file mode 100644 index 00000000..075bee25 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_it.qm diff --git a/python/pyqt/examples3/i18n/mywidget_it.ts b/python/pyqt/examples3/i18n/mywidget_it.ts new file mode 100644 index 00000000..a450deb4 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_it.ts @@ -0,0 +1,72 @@ +<!DOCTYPE TS><TS> +<context> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>E&xit...</source> + <translation type="obsolete">&Esci...</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Primo</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Esempio di localizzazione</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isometrica</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Lingua: Italiano</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Obliqua</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Prospettica</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Secondo</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">La Finestra Principale</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">Terzo</translation> + </message> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Vista</translation> + </message> + <message> + <source>E&xit</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Ctrl+Q</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>&File</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_jp.qm b/python/pyqt/examples3/i18n/mywidget_jp.qm Binary files differnew file mode 100644 index 00000000..8942dd7c --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_jp.qm diff --git a/python/pyqt/examples3/i18n/mywidget_jp.ts b/python/pyqt/examples3/i18n/mywidget_jp.ts new file mode 100644 index 00000000..2a7345f6 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_jp.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">ファイル(&F)</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+Q</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">終了(&X)</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">第一行</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">国際化(i18n)ã®ä¾‹</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">ç‰è§’投影法</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">言語: 日本語</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">æ–œã‚æŠ•å½±æ³•</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">é 近法</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">第二行</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">メインウィンドウ</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">第三行</translation> + </message> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">表示方å¼</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_ko.qm b/python/pyqt/examples3/i18n/mywidget_ko.qm Binary files differnew file mode 100644 index 00000000..dccc2ba9 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_ko.qm diff --git a/python/pyqt/examples3/i18n/mywidget_ko.ts b/python/pyqt/examples3/i18n/mywidget_ko.ts new file mode 100644 index 00000000..acc8f9b5 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_ko.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">파ì¼&F</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+E</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">종료&X</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">첫번째</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">êµì œí™” ì˜ˆì œ</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isometric</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">언어 : 한êµì–´</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Oblique</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Perspective</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">ë‘번째</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">ë©”ì¸ ìœˆë„ìš°</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">세번째</translation> + </message> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">보기</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_no.qm b/python/pyqt/examples3/i18n/mywidget_no.qm Binary files differnew file mode 100644 index 00000000..2adc1361 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_no.qm diff --git a/python/pyqt/examples3/i18n/mywidget_no.ts b/python/pyqt/examples3/i18n/mywidget_no.ts new file mode 100644 index 00000000..341c6647 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_no.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Visning</translation> + </message> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">&Fil</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">&Slutt</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Første</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">Tredje</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">SprÃ¥k: Norsk</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">Hovedvinduet</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+S</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">Skjev</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Andre</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">Isometrisk</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">Perspektiv</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Internasjonaliseringseksempel</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_ru.qm b/python/pyqt/examples3/i18n/mywidget_ru.qm Binary files differnew file mode 100644 index 00000000..ebc512ec --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_ru.qm diff --git a/python/pyqt/examples3/i18n/mywidget_ru.ts b/python/pyqt/examples3/i18n/mywidget_ru.ts new file mode 100644 index 00000000..07070b03 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_ru.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">Вид</translation> + </message> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">Файл</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">Выход</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">Первый</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">Третий</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">Язык: РуÑÑкий</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">Главное окно</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">КурÑив</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">Второй</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">ИзометричеÑкий</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">ПерÑпектива</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">Пример интернациноализации</translation> + </message> + <message> + <source>Ctrl+Q</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/i18n/mywidget_zh.qm b/python/pyqt/examples3/i18n/mywidget_zh.qm Binary files differnew file mode 100644 index 00000000..a890c096 --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_zh.qm diff --git a/python/pyqt/examples3/i18n/mywidget_zh.ts b/python/pyqt/examples3/i18n/mywidget_zh.ts new file mode 100644 index 00000000..8b015d6d --- /dev/null +++ b/python/pyqt/examples3/i18n/mywidget_zh.ts @@ -0,0 +1,68 @@ +<!DOCTYPE TS><TS> +<context encoding="UTF-8"> + <name>MyWidget</name> + <message encoding="UTF-8"> + <source>View</source> + <translation type="unfinished">视图</translation> + </message> + <message encoding="UTF-8"> + <source>&File</source> + <translation type="unfinished">文件[&F]</translation> + </message> + <message encoding="UTF-8"> + <source>E&xit</source> + <translation type="unfinished">退出[&x]</translation> + </message> + <message encoding="UTF-8"> + <source>First</source> + <translation type="unfinished">第一个</translation> + </message> + <message encoding="UTF-8"> + <source>Third</source> + <translation type="unfinished">第三个</translation> + </message> + <message encoding="UTF-8"> + <source>Language: English</source> + <translation type="unfinished">è¯è¨€: ç®€ä½“ä¸æ–‡</translation> + </message> + <message encoding="UTF-8"> + <source>The Main Window</source> + <translation type="unfinished">主窗å£</translation> + </message> + <message encoding="UTF-8"> + <source>Ctrl+Q</source> + <translation type="unfinished">Ctrl+Q</translation> + </message> + <message encoding="UTF-8"> + <source>Oblique</source> + <translation type="unfinished">斜投影</translation> + </message> + <message encoding="UTF-8"> + <source>Second</source> + <translation type="unfinished">第二个</translation> + </message> + <message encoding="UTF-8"> + <source>Isometric</source> + <translation type="unfinished">ç‰è§’投影</translation> + </message> + <message encoding="UTF-8"> + <source>Perspective</source> + <translation type="unfinished">é€è§†æŠ•å½±</translation> + </message> + <message encoding="UTF-8"> + <source>Internationalization Example</source> + <translation type="unfinished">国际化范例</translation> + </message> +</context> +<context> + <name>QVDialog</name> + <message> + <source>OK</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Cancel</source> + <translation type="unfinished"></translation> + </message> +</context> +</TS> diff --git a/python/pyqt/examples3/lineedits.py b/python/pyqt/examples3/lineedits.py new file mode 100755 index 00000000..631d14be --- /dev/null +++ b/python/pyqt/examples3/lineedits.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * + +TRUE = 1 +FALSE = 0 + +class LineEdits(QGroupBox): + def __init__(self, parent = None, name = None): + QGroupBox.__init__(self, 0, Qt.Horizontal, "Line Edits", parent, name) + + self.setMargin(10) + + box = QVBoxLayout(self.layout()) + + row1 = QHBoxLayout(box) + row1.setMargin(5) + + label = QLabel("Echo Mode: ", self) + row1.addWidget(label) + + combo1 = QComboBox(FALSE, self) + row1.addWidget(combo1) + combo1.insertItem("Normal", -1) + combo1.insertItem("Password", -1) + combo1.insertItem("No Echo", -1) + + self.connect(combo1, SIGNAL("activated(int)"), self.slotEchoChanged) + self.lined1 = QLineEdit(self) + box.addWidget(self.lined1) + + row2 = QHBoxLayout(box) + row2.setMargin(5) + + label = QLabel("Validator: ", self) + row2.addWidget(label) + + combo2 = QComboBox(FALSE, self) + row2.addWidget(combo2) + combo2.insertItem("No Validator", -1) + combo2.insertItem("Integer Validator", -1) + combo2.insertItem("Double Validator", -1) + + self.connect(combo2, SIGNAL("activated(int)"), self.slotValidatorChanged) + + self.lined2 = QLineEdit(self) + box.addWidget(self.lined2) + + row3 = QHBoxLayout(box) + row3.setMargin(5) + + label = QLabel("Alignment: ", self) + row3.addWidget(label) + + combo3 = QComboBox(FALSE, self) + row3.addWidget(combo3) + combo3.insertItem("Left", -1) + combo3.insertItem("Centered", -1) + combo3.insertItem("Right", -1) + + self.connect(combo3, SIGNAL("activated(int)"), self.slotAlignmentChanged) + self.lined3 = QLineEdit(self) + box.addWidget(self.lined3) + + row4 = QHBox(self) + box.addWidget(row4) + row4.setMargin(5) + + QLabel("Read-Only: ", row4) + + combo4 = QComboBox(FALSE, row4) + combo4.insertItem("False", -1) + combo4.insertItem("True", -1) + + self.connect(combo4, SIGNAL("activated(int)"), self.slotReadOnlyChanged) + + self.lined4 = QLineEdit(self) + box.addWidget(self.lined4) + + self.lined1.setFocus() + + def slotEchoChanged(self, i): + if i == 0: + self.lined1.setEchoMode(QLineEdit.Normal) + elif i == 1: + self.lined1.setEchoMode(QLineEdit.Password) + elif i == 2: + self.lined1.setEchoMode(QLineEdit.NoEcho) + + self.lined1.setFocus() + + def slotValidatorChanged(self, i): + if i == 0: + self.lined2.setValidator(None) + elif i == 1: + self.lined2.setValidator(QIntValidator(self.lined2)) + elif i == 2: + self.lined2.setValidator(QDoubleValidator(-999.0, 999.0, 2, self.lined2)) + + self.lined2.setText("") + self.lined2.setFocus() + + def slotAlignmentChanged(self, i): + if i == 0: + self.lined3.setAlignment(QLineEdit.AlignLeft) + elif i == 1: + self.lined3.setAlignment(QLineEdit.AlignCenter) + elif i == 2: + self.lined3.setAlignment(QLineEdit.AlignRight) + + self.lined3.setFocus() + + def slotReadOnlyChanged(self, i): + if i == 0: + self.lined4.setReadOnly(FALSE) + elif i == 1: + self.lined4.setReadOnly(TRUE) + + self.lined4.setFocus() + + +if __name__=='__main__': + app = QApplication( sys.argv ) + + lineedits = LineEdits() + lineedits.setCaption("Lineedits - PyQt Example") + lineedits.show() + app.setMainWidget(lineedits) + app.exec_loop() diff --git a/python/pyqt/examples3/listbox.py b/python/pyqt/examples3/listbox.py new file mode 100755 index 00000000..a149500e --- /dev/null +++ b/python/pyqt/examples3/listbox.py @@ -0,0 +1,176 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +FALSE = 0 +TRUE = 1 + +class ListBoxDemo( QWidget ): + def __init__( self, parent=None, name=None ): + QWidget.__init__( self, parent, name ) + b = FALSE + g = QGridLayout( self, 2, 2, 6 ) + + g.addWidget( QLabel( "<b>Configuration:</b>", self ), 0, 0 ) + g.addWidget( QLabel( "<b>Result:</b>", self ), 0, 1 ) + + self.l = QListBox( self ) + g.addWidget( self.l, 1, 1 ) + self.l.setFocusPolicy( QWidget.StrongFocus ) + + v = QVBoxLayout( ) + g.addLayout( v, 1, 0 ) + + bg = QButtonGroup( self, None ) + + b = QRadioButton( "Fixed number of columns,\n" + "as many rows as needed.", + self ) + bg.insert( b ) + v.addWidget( b ) + b.setChecked( TRUE ) + self.connect( b, SIGNAL("clicked()"), self.setNumCols ) + h = QHBoxLayout() + v.addLayout( h ) + h.addSpacing( 30 ) + h.addSpacing( 100 ) + h.addWidget( QLabel( "Columns:", self ) ) + self.columns = QSpinBox( self ) + h.addWidget( self.columns ) + + v.addSpacing( 12 ) + + b = QRadioButton( "As many columns as fit on-screen,\n" + "as many rows as needed.", + self ) + bg.insert( b ) + v.addWidget( b ) + self.connect( b, SIGNAL("clicked()"), self.setColsByWidth ) + + v.addSpacing( 12 ) + + b = QRadioButton( "Fixed number of rows,\n" + "as many columns as needed.", + self ) + bg.insert( b ) + v.addWidget( b ) + self.connect( b, SIGNAL("clicked()"), self.setNumRows ) + h = QHBoxLayout() + v.addLayout( h ) + h.addSpacing( 30 ) + h.addSpacing( 100 ) + h.addWidget( QLabel( "Rows:", self ) ) + self.rows = QSpinBox( self ) + self.rows.setEnabled( FALSE ) + h.addWidget( self.rows ) + + v.addSpacing( 12 ) + + b = QRadioButton( "As many rows as fit on-screen,\n" + "as many columns as needed.", + self ) + bg.insert( b ) + v.addWidget( b ) + self.connect( b, SIGNAL("clicked()"), self.setRowsByHeight ) + + v.addSpacing( 12 ) + + cb = QCheckBox( "Variable-height rows", self ) + cb.setChecked( TRUE ) + self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableHeight ) + v.addWidget( cb ) + v.addSpacing( 6 ) + + cb = QCheckBox( "Variable-width columns", self ) + self.connect( cb, SIGNAL("toggled(bool)"), self.setVariableWidth ) + v.addWidget( cb ) + + cb = QCheckBox( "Extended-Selection", self ) + self.connect( cb, SIGNAL("toggled(bool)"), self.setMultiSelection ) + v.addWidget( cb ) + + pb = QPushButton( "Sort ascending", self ) + self.connect( pb, SIGNAL("clicked()"), self.sortAscending ) + v.addWidget( pb ) + + pb = QPushButton( "Sort descending", self ) + self.connect( pb, SIGNAL("clicked()"), self.sortDescending ) + v.addWidget( pb ) + + v.addStretch( 100 ) + + i = 0 + while i <= 2560: + i+=1 + self.l.insertItem( str(QString.fromLatin1( "Item " )) + str(QString.number( i )), i ) + self.columns.setRange( 1, 256 ) + self.columns.setValue( 1 ) + self.rows.setRange( 1, 256 ) + self.rows.setValue( 256 ) + + self.connect( self.columns, SIGNAL("valueChanged(int)"), self.setNumCols ) + self.connect( self.rows, SIGNAL("valueChanged(int)"), self.setNumRows ) + + # slots + def setNumCols( self ): + self.columns.setEnabled( TRUE ) + self.rows.setEnabled( FALSE ) + self.l.setColumnMode( self.columns.value() ) + + def setNumRows( self ): + self.columns.setEnabled( FALSE ) + self.rows.setEnabled( TRUE ) + self.l.setRowMode( self.rows.value() ) + + def setRowsByHeight( self ): + self.columns.setEnabled( FALSE ) + self.rows.setEnabled( FALSE ) + self.l.setRowMode( QListBox.FitToHeight ) + + def setColsByWidth( self ): + self.columns.setEnabled( FALSE ) + self.rows.setEnabled( FALSE ) + self.l.setColumnMode( QListBox.FitToWidth ) + + def setVariableWidth( self, b ): + self.l.setVariableWidth( b ) + + def setVariableHeight( self, b ): + self.l.setVariableHeight( b ) + + def setMultiSelection( self, b ): + self.l.clearSelection() + if b : + self.l.setSelectionMode( QListBox.Extended ) + else: + self.l.setSelectionMode( QListBox.Single ) + + def sortAscending( self ): + self.l.sort( TRUE ) + + def sortDescending( self ): + self.l.sort( FALSE ) + + +def main( args ): + a = QApplication( args ) + t = ListBoxDemo() + t.setCaption( "Qt Example - Listbox" ) + a.setMainWidget( t ) + t.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/listboxcombo.py b/python/pyqt/examples3/listboxcombo.py new file mode 100755 index 00000000..4a909861 --- /dev/null +++ b/python/pyqt/examples3/listboxcombo.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +FALSE = 0 +TRUE = 1 + +class ListBoxCombo( QVBox ): + # Constructor + # Creates child widgets of the ListBoxCombo widget + def __init__( self, parent=None, name=None ): + QVBox.__init__( self, parent, name ) + + self.setMargin( 5 ) + self.setSpacing( 5 ) + + i = 0 + row1 = QHBox( self ) + row1.setSpacing( 5 ) + + # Create a multi-selection ListBox... + self.lb1 = QListBox( row1 ) + self.lb1.setSelectionMode( QListBox.Multi ) + + # ...insert a pixmap item... + xpm = QPixmap( "qtlogo.png" ) + txt = QString() + QListBoxPixmap( self.lb1, xpm, txt ) + + # ...and 100 text items + for i in range(0, 100, 1) : + xpm = QPixmap() + txt = QString( "Listbox Item %1" ).arg( i ) + if not i % 4 : + xpm = QPixmap( "fileopen.xpm" ) + QListBoxPixmap( self.lb1, xpm, txt ) + + # Create a pushbutton... + arrow1 = QPushButton( " -> ", row1 ) + # ...and connect the clicked SIGNAL with the SLOT slotLeft2Right + self.connect( arrow1, SIGNAL("clicked()"), self.slotLeft2Right ) + + # create an empty single-selection ListBox + self.lb2 = QListBox( row1 ) + + row2 = QHBox( self ) + row2.setSpacing( 5 ) + + box1 = QVBox( row2 ) + box1.setSpacing( 5 ) + + # Create a non-editable Combobox and a label below... + cb1 = QComboBox( FALSE, box1 ) + self.label1 = QLabel( "Current Item: Combobox Item 0", box1 ) + self.label1.setMaximumHeight( self.label1.sizeHint().height() * 2 ) + self.label1.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + #...and insert 50 items into the Combobox + for i in range( 0, 50, 1 ) : + txt = str( QString( "Combobox Item %1" ).arg( i ) ) + if i % 9 : + cb1.insertItem( txt ) + else : + cb1.listBox().insertItem( MyListBoxItem() ) + + box2 = QVBox( row2 ) + box2.setSpacing( 5 ) + + # Create an editable Combobox and a label below... + cb2 = QComboBox( TRUE, box2 ) + self.label2 = QLabel( "Current Item: Combobox Item 0", box2 ) + self.label2.setMaximumHeight( self.label2.sizeHint().height() * 2 ) + self.label2.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + # ... and insert 50 items into the Combobox + for i in range(0, 50, 1 ) : + txt = str(QString( "Combobox Item %1" ).arg( i )) + if not i % 4 : + cb2.insertItem( QPixmap( "fileopen.xpm" ), txt ) + else : + cb2.insertItem( txt ) + + # Connect the activated SIGNALs of the Comboboxes with SLOTs + self.connect( cb1, SIGNAL("activated( const QString & )"), self.slotCombo1Activated ) + self.connect( cb2, SIGNAL("activated( const QString & )"), self.slotCombo2Activated ) + + """ SLOT slotLeft2Right + * Copies all selected items of the first ListBox into the second ListBox + """ + def slotLeft2Right( self ): + # Go through all items of the first ListBox + for i in range( 0, self.lb1.count(), 1 ) : + item = self.lb1.item( i ) + # if the item is selected... + if self.lb1.isSelected( i ): #item.isSelected() : + # ...and it is a text item... + if item.pixmap() and not(item.text().isEmpty()): + self.lb2.insertItem( item.pixmap(), item.text() ) + elif not( item.pixmap() ): + self.lb2.insertItem( item.text() ) + elif item.text().isEmpty() : + self.lb2.insertItem( item.pixmap() ) + + """ SLOT slotCombo1Activated( const QString &s ) + * Sets the text of the item which the user just selected in the + * first Combobox (and is now the value of s) to the first Label. + """ + def slotCombo1Activated( self, s ) : + self.label1.setText( str(QString( "Current Item: %1" ).arg( s ) ) ) + + """ SLOT slotCombo2Activated( const QString &s ) + * Sets the text of the item which the user just selected in the + * second Combobox (and is now the value of s) to the second Label. + """ + def slotCombo2Activated( self, s ) : + self.label2.setText( str(QString( "Current Item: %1" ).arg( s ) ) ) + + +class MyListBoxItem( QListBoxItem ): + def __init__( self, parent=None, name=None ): + QListBoxItem.__init__( self, parent, name ) + self.setCustomHighlighting( TRUE ) + + def paint( self, painter ): + # evil trick: find out whether we are painted onto our listbox + in_list_box = 0 + if self.listBox() and self.listBox().viewport() == painter.device(): + in_list_box = 1 + r = QRect( 0, 0, self.width( self.listBox() ), self.height( self.listBox() ) ) + brush = QBrush( Qt.red, Qt.SolidPattern ) + if in_list_box and isSelected(): + painter.eraseRect( r ) + painter.fillRect( 5, 5, self.width( self.listBox() ) - 10, self.height( self.listBox() ) - 10, brush ) + if in_list_box and isCurrent(): + self.listBox().style().drawPrimitive( QStyle.PE_FocusRect, painter, r, self.listBox().colorGroup() ) + + def width( self, QListBox ): + return 100 + + def height( self, QListBox ): + return 16 + + +def main( args ): + a = QApplication( args ) + + listboxcombo = ListBoxCombo() + listboxcombo.resize( 400, 270 ) + listboxcombo.setCaption( "Qt Example - Listboxes and Comboboxes" ) + a.setMainWidget( listboxcombo ) + listboxcombo.show(); + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/marble.png b/python/pyqt/examples3/marble.png Binary files differnew file mode 100644 index 00000000..49ea3098 --- /dev/null +++ b/python/pyqt/examples3/marble.png diff --git a/python/pyqt/examples3/mdi.py b/python/pyqt/examples3/mdi.py new file mode 100755 index 00000000..2c1d121c --- /dev/null +++ b/python/pyqt/examples3/mdi.py @@ -0,0 +1,360 @@ +#!/usr/bin/env python + +# A simple application. + + +import sys, string +from qt import * + + +fileopen = [ + '16 13 5 1', + '. c #040404', + '# c #808304', + 'a c None', + 'b c #f3f704', + 'c c #f3f7f3', + 'aaaaaaaaa...aaaa', + 'aaaaaaaa.aaa.a.a', + 'aaaaaaaaaaaaa..a', + 'a...aaaaaaaa...a', + '.bcb.......aaaaa', + '.cbcbcbcbc.aaaaa', + '.bcbcbcbcb.aaaaa', + '.cbcb...........', + '.bcb.#########.a', + '.cb.#########.aa', + '.b.#########.aaa', + '..#########.aaaa', + '...........aaaaa' +] + +filesave = [ + '14 14 4 1', + '. c #040404', + '# c #808304', + 'a c #bfc2bf', + 'b c None', + '..............', + '.#.aaaaaaaa.a.', + '.#.aaaaaaaa...', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.#.aaaaaaaa.#.', + '.##........##.', + '.############.', + '.##.........#.', + '.##......aa.#.', + '.##......aa.#.', + '.##......aa.#.', + 'b.............' +] + +fileprint = [ + '16 14 6 1', + '. c #000000', + '# c #848284', + 'a c #c6c3c6', + 'b c #ffff00', + 'c c #ffffff', + 'd c None', + 'ddddd.........dd', + 'dddd.cccccccc.dd', + 'dddd.c.....c.ddd', + 'ddd.cccccccc.ddd', + 'ddd.c.....c....d', + 'dd.cccccccc.a.a.', + 'd..........a.a..', + '.aaaaaaaaaa.a.a.', + '.............aa.', + '.aaaaaa###aa.a.d', + '.aaaaaabbbaa...d', + '.............a.d', + 'd.aaaaaaaaa.a.dd', + 'dd...........ddd' +] + +document = [ +"12 16 6 1", +" c #040404", +". c None", +"X c white", +"o c #808304", +"O c black", +"+ c #f3f7f3", +" .....", +" XXXXX ....", +" XXXXX X ...", +" XXXXX XX ..", +" XooXX O.", +" X+XXX+XXXO.", +" XXXXXXXXXO.", +" XoooXooXXO.", +" XXXXXXXXXO.", +" XXXXXXXXXO.", +" XoXXoooXXO.", +" XXXXXXXXXO.", +"OXXXXXXXXXO.", +"OXXXXXXXXXO.", +"OOOOOOOOOOO.", +"............" +] + +fileOpenText = \ +'''<img source="fileopen"> +Click this button to open a <em>new file</em>.<br><br> +You can also select the <b>Open</b> command from the <b>File</b> menu.''' + +fileSaveText = \ +'''Click this button to save the file you are editing.<br><br> +You will be prompted for a filename.<br><br> +You can also select the <b>Save</b> command from the <b>File</b> menu.''' + +filePrintText = \ +'''Click this button to print the file you are editing.<br><br> +You can also select the <b>Print</b> command from the <b>File</b> menu.''' + +True=1 +False=0 + +class ApplicationWindow(QMainWindow): + def __init__(self): + QMainWindow.__init__(self,None,'example application main window',Qt.WDestructiveClose) + + self.filename = QString.null + self.printer = QPrinter() + + self.fileTools = QToolBar(self,'file operations') + + openIcon = QPixmap(fileopen) + self.fileOpen = QToolButton(QIconSet(openIcon),'Open File',QString.null,self.load,self.fileTools,'open file') + + saveIcon = QPixmap(filesave) + self.fileSave = QToolButton(QIconSet(saveIcon),'Save File',QString.null,self.save,self.fileTools,'save file') + printIcon = QPixmap(fileprint) + self.filePrint = QToolButton(QIconSet(printIcon),'Print File',QString.null,self.printDoc,self.fileTools,'print file') + + QWhatsThis.whatsThisButton(self.fileTools) + + QWhatsThis.add(self.fileOpen,fileOpenText) + QMimeSourceFactory.defaultFactory().setPixmap('fileopen',openIcon) + QWhatsThis.add(self.fileSave,fileSaveText) + QWhatsThis.add(self.filePrint,filePrintText) + + self.file = QPopupMenu(self) + self.menuBar().insertItem('&File',self.file) + + self.file.insertItem('&New',self.newDoc,Qt.CTRL + Qt.Key_N) + + id = self.file.insertItem(QIconSet(openIcon),'&Open',self.load,Qt.CTRL + Qt.Key_O) + self.file.setWhatsThis(id,fileOpenText) + + id = self.file.insertItem(QIconSet(saveIcon),'&Save',self.save,Qt.CTRL + Qt.Key_S) + self.file.setWhatsThis(id,fileSaveText) + + id = self.file.insertItem('Save &as',self.saveAs) + self.file.setWhatsThis(id,fileSaveText) + + self.file.insertSeparator() + + id = self.file.insertItem(QIconSet(printIcon),'&Print',self.printDoc,Qt.CTRL + Qt.Key_P) + self.file.setWhatsThis(id,filePrintText) + + self.file.insertSeparator() + + self.file.insertItem('&Close',self,SLOT('close()'),Qt.CTRL + Qt.Key_W) + self.file.insertItem('&Quit',qApp,SLOT('closeAllWindows()'),Qt.CTRL + Qt.Key_Q) + + self.menuBar().insertSeparator() + self.windows = QPopupMenu( self ) + self.windows.setCheckable( True ) + self.connect( self.windows, SIGNAL( "aboutToShow()" ), + self.windowsMenuAboutToShow ) + self.menuBar().insertItem( "&Windows", self.windows ) + + self.help = QPopupMenu(self) + self.menuBar().insertSeparator() + self.menuBar().insertItem('&Help',self.help) + + self.help.insertItem('&About',self.about,Qt.Key_F1) + self.help.insertItem('About &Qt',self.aboutQt) + self.help.insertSeparator() + self.help.insertItem( "What's &This", self, SLOT("whatsThis()"), Qt.SHIFT+Qt.Key_F1) + + self.menuBar().insertSeparator() + + self.vb = QVBox( self ) + self.vb.setFrameStyle( QFrame.StyledPanel | QFrame.Sunken ) + self.ws = QWorkspace( self.vb ) + self.ws.setScrollBarsEnabled( True ) + self.setCentralWidget( self.vb ) + + self.statusBar().message('Ready',2000) + #self.resize(450,600) + + def newDoc(self): + w = MDIWindow( self.ws, "", Qt.WDestructiveClose ) + self.connect( w, PYSIGNAL( "message" ), self.statusBar(), SLOT( "message(const QString&, int )") ) + w.setCaption("unnamed document") + w.setIcon( QPixmap(document) ) + # show the very first window in maximized mode + if len(self.ws.windowList())==0: + w.showMaximized() + else: + w.show() + return w + + def load(self): + fn = QFileDialog.getOpenFileName( QString.null, QString.null, self ) + if not fn.isEmpty(): + w = self.newDoc() + w.load( fn ) + else: + self.statusBar().message( "Loading aborted", 2000 ) + + def save(self): + m = self.ws.activeWindow() + if m: + m.save() + + def saveAs(self): + m = self.ws.activeWindow() + if m: + m.saveAs() + + def printDoc(self): + m = self.ws.activeWindow() + if m: + m.printDoc( self.printer ) + + def closeWindow(self): + m = self.ws.activeWindow() + if m: + m.close() + + def about(self): + QMessageBox.about( self, "Qt Application Example", + "This example demonstrates simple use of\n " + "Qt's Multiple Document Interface (MDI).") + + def aboutQt(self): + QMessageBox.aboutQt( self, "Qt Application Example" ) + + def windowsMenuAboutToShow(self): + self.windows.clear() + cascadeId = self.windows.insertItem("&Cascade", self.ws, SLOT("cascade() ") ) + tileId = self.windows.insertItem("&Tile", self.ws, SLOT("tile()" ) ) + if len(self.ws.windowList())==0 : + self.windows.setItemEnabled( cascadeId, False ) + self.windows.setItemEnabled( tileId, False ) + self.windows.insertSeparator() + windows = self.ws.windowList() + cnt=0 + for i in windows: + id =self.windows.insertItem(i.caption(),self.windowsMenuActivated ) + self.windows.setItemParameter( id, cnt ); + self.windows.setItemChecked( id, self.ws.activeWindow() == i ) + cnt=cnt+1 + + def windowsMenuActivated(self,sid ): + w = self.ws.windowList().at( id ) + if w: + w.showNormal() + w.setFocus() + + +class MDIWindow( QMainWindow): + def __init__(self,parent, name, wflags ): + QMainWindow.__init__(self,parent, name, wflags ) + self.mmovie = 0 + self.medit = QMultiLineEdit( self ) + self.setFocusProxy( self.medit ) + self.setCentralWidget( self.medit ); + + + def load(self, fn ): + self.filename = fn + self.f=QFile( self.filename ) + if not self.f.open( IO_ReadOnly ): + return + + if fn.contains(".gif"): + tmp=QWidget(self) + self.setFocusProxy(tmp) + self.setCentralWidget(tmp) + self.medit.hide() + del self.medit + qm=QMovie(fn) + #ifdef Q_WS_QWS // temporary speed-test hack + #qm->setDisplayWidget(tmp); + #endif + tmp.setBackgroundMode(QWidget.NoBackground) + tmp.show() + self.mmovie=qm + else : + self.mmovie = 0 + t=QTextStream(self.f) + s = t.read() + self.medit.setText( s ) + self.f.close() + self.setCaption( self.filename ) + self.emit(PYSIGNAL( "message"),(QString("Loaded document %1").arg(self.filename),2000 )) + + def save(self): + if self.filename.isEmpty(): + self.saveAs() + return + text = self.medit.text() + output=open(str(self.filename),'w') + output.write(str(text)) + #emit message( QString("Could not write to %1").arg(filename), 2000 ); + #return + output.close() + self.setCaption(self.filename) + self.emit(PYSIGNAL( "message"),(QString("File %1 saved").arg(self.filename),2000 )) + + def saveAs(self): + fn = QFileDialog.getSaveFileName( self.filename, QString.null, self ) + if not fn.isEmpty(): + self.filename = fn + self.save() + else : + self.emit(PYSIGNAL( "message"),(QString("Saving aborted"),2000 )) + + def printDoc(self,printer): + Margin = 10 + pageNo = 1 + + if printer.setup(self): + self.emit(PYSIGNAL( "message"),(QString("Printing..."),2000 )) + p = QPainter() + p.begin(printer) + p.setFont(self.medit.font()) + yPos = 0 + fm = p.fontMetrics() + metrics = QPaintDeviceMetrics(printer) + + for i in range(self.medit.numLines()): + if Margin + yPos > metrics.height() - Margin: + pageNo = pageNo + 1 + self.emit(PYSIGNAL( "message"),(QString("Printing (page %1) ...").arg(pageNo),2000 )) + printer.newPage() + yPos = 0 + + p.drawText(Margin,Margin + yPos,metrics.width(),fm.lineSpacing(),Qt.ExpandTabs | Qt.DontClip,self.medit.textLine(i)) + yPos = yPos + fm.lineSpacing() + + p.end() + self.emit(PYSIGNAL( "message"),(QString("Printing completed"),2000 )) + else: + self.emit(PYSIGNAL( "message"),(QString("Printing aborted"),2000 )) + + +if __name__=='__main__': + a = QApplication(sys.argv) + mw = ApplicationWindow() + mw.setCaption("PyQt Example - Multiple Documents Interface (MDI)") + mw.show() + a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()')) + a.exec_loop() diff --git a/python/pyqt/examples3/menu.py b/python/pyqt/examples3/menu.py new file mode 100755 index 00000000..820da942 --- /dev/null +++ b/python/pyqt/examples3/menu.py @@ -0,0 +1,286 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys, string +from qt import * + +TRUE = 1 +FALSE = 0 + +# XPM +p1_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFF0000", +" ", +" ", +" .... ", +" .XXXX. ", +" .............. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .XXXXXXXXXXXX. ", +" .............. ", +" " +] + +# XPM +p2_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFFFFFF", +" ", +" ...... ", +" .XXX.X. ", +" .XXX.XX. ", +" .XXX.XXX. ", +" .XXX..... ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" .XXXXXXX. ", +" ......... ", +" ", +" " +] + +# XPM +p3_xpm = [ +"16 16 3 1", +" c None", +". c #000000000000", +"X c #FFFFFFFFFFFF", +" ", +" ", +" ......... ", +" ........... ", +" ........ .. ", +" ........... ", +" ........... ", +" ........... ", +" ........... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ...XXXXX... ", +" ......... ", +" ", +" " +] + + +# Auxiliary class to provide fancy menu items with different fonts. +# Used for the "bold" and "underline" menu items in the options menu. + +class MyMenuItem( QCustomMenuItem ): + def __init__( self, s, f ): + QCustomMenuItem.__init__( self ) + self.string = s + self.font = f + + def paint( self, p, cg, act, enabled, x, y, w, h ) : + p.setFont ( self.font ) + p.drawText( x, y, w, h, Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, self.string ) + + def sizeHint( self ): + return QFontMetrics( self.font ).size( Qt.AlignLeft | Qt.AlignVCenter | Qt.ShowPrefix | Qt.DontClip, self.string ) + + +# Implementation of MenuExample class + +class MenuExample( QWidget ): + def __init__( self, parent=None, name=None ): + QWidget.__init__( self, parent, name ) + self.p1 = QIconSet( QPixmap ( p1_xpm ) ) + self.p2 = QIconSet( QPixmap ( p2_xpm ) ) + self.p3 = QIconSet( QPixmap ( p3_xpm ) ) + + self.printer = QPopupMenu( self ) + self.printer.insertTearOffHandle() + self.printer.insertItem( "&Print to printer", self.printDoc ) + self.printer.insertItem( "Print to &file", self.printFile ) + self.printer.insertItem( "Print to fa&x", self.fax ) + self.printer.insertSeparator() + self.printer.insertItem( "Printer &Setup", self.printerSetup ) + + self.file = QPopupMenu( self ) + self.file.insertItem( self.p1, "&Open", self.open, Qt.CTRL+Qt.Key_O ) + self.file.insertItem( self.p2, "&New", self.news, Qt.CTRL+Qt.Key_N ) + self.file.insertItem( self.p3, "&Save", self.save, Qt.CTRL+Qt.Key_S ) + self.file.insertItem( "&Close", self.closeDoc, Qt.CTRL+Qt.Key_W ) + self.file.insertSeparator() + self.file.insertItem( "&Print", self.printer, Qt.CTRL+Qt.Key_P ) + self.file.insertSeparator() + self.file.insertItem( "E&xit", qApp, SLOT( "quit()" ), Qt.CTRL+Qt.Key_Q ) + + self.edit = QPopupMenu( self ) + undoID = self.edit.insertItem( "&Undo", self.undo ) + redoID = self.edit.insertItem( "&Redo", self.redo ) + self.edit.setItemEnabled( undoID, FALSE ) + self.edit.setItemEnabled( redoID, FALSE ) + + self.options = QPopupMenu( self ) + self.options.insertTearOffHandle() + self.options.setCaption( "Options" ) + self.options.insertItem( "&Normal Font", self.normal ) + self.options.insertSeparator() + + self.options.polish() # adjust system settings + f = self.options.font() + f.setBold( TRUE ) + self.boldID = self.options.insertItem( MyMenuItem( "Bold", f ) ) + self.options.setAccel( Qt.CTRL+Qt.Key_B, self.boldID ) + self.options.connectItem( self.boldID, self.bold ) + + f = self.options.font() + f.setUnderline( TRUE ) + self.underlineID = self.options.insertItem( MyMenuItem( "Underline", f ) ) + self.options.setAccel( Qt.CTRL+Qt.Key_U, self.underlineID ) + self.options.connectItem( self.underlineID, self.underline ) + + self.isBold = FALSE + self.isUnderline = FALSE + self.options.setCheckable( TRUE ) + + self.help = QPopupMenu( self ) + self.help.insertItem( "&About", self.about, Qt.CTRL+Qt.Key_H ) + self.help.insertItem( "About &Qt", self.aboutQt ) + + self.menu = QMenuBar( self ) + self.menu.insertItem( "&File", self.file ) + self.menu.insertItem( "&Edit", self.edit ) + self.menu.insertItem( "&Options", self.options ) + self.menu.insertSeparator() + self.menu.insertItem( "&Help", self.help ) + self.menu.setSeparator( QMenuBar.InWindowsStyle ) + + msg = QLabel( self ) + msg.setText( "A context menu is available.\n" + "Invoke it by right-clicking or by" + " pressing the 'context' button." ) + msg.setGeometry( 0, self.height() - 60, self.width(), 60 ) + msg.setAlignment( Qt.AlignCenter ) + + self.label = QLabel( self ) + self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 ) + self.label.setFrameStyle( QFrame.Box | QFrame.Raised ) + self.label.setLineWidth( 1 ) + self.label.setAlignment( Qt.AlignCenter ) + + self.connect( self, PYSIGNAL( "explain" ), self.label, SLOT( "setText(const QString &" ) ) + + self.setMinimumSize( 100, 80 ) + self.setFocusPolicy( QWidget.ClickFocus ) + + def contextMenuEvent(self, cmev): + contextMenu = QPopupMenu( self ) + caption = QLabel( "<font color=darkblue><u><b>Context Menu</b></u></font>", self ) + caption.setAlignment( Qt.AlignCenter ) + contextMenu.insertItem( caption ) + contextMenu.insertItem( "&New", self.news, Qt.CTRL+Qt.Key_N ) + contextMenu.insertItem( "&Open...", self.open, Qt.CTRL+Qt.Key_O ) + contextMenu.insertItem( "&Save", self.save, Qt.CTRL+Qt.Key_S ) + submenu = QPopupMenu( self ) + submenu.insertItem( "&Print to printer", self.printDoc ) + submenu.insertItem( "Print to &file", self.printFile ) + submenu.insertItem( "Print to fa&x", self.fax ) + contextMenu.insertItem( "&Print", submenu ) + contextMenu.exec_loop( QCursor.pos() ) + + def open( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Open selected", ) ) + + def news( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/New selected", ) ) + + def save( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Save selected", ) ) + + def closeDoc( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Close selected", ) ) + + def undo( self ): + self.emit( PYSIGNAL( "explain" ), ( "Edit/Undo selected", ) ) + + def redo( self ): + self.emit( PYSIGNAL( "explain" ), ( "Edit/Redo selected", ) ) + + def normal( self ): + self.isBold = FALSE + self.isUnderline = FALSE + font = QFont() + self.label.setFont( font ) + self.options.setItemChecked( self.boldID, self.isBold ) + self.options.setItemChecked( self.underlineID, self.isUnderline ) + self.emit( PYSIGNAL( "explain" ), ( "Options/Normal selected", ) ) + + def bold( self ): + self.isBold = not self.isBold + font = QFont() + font.setBold( self.isBold ) + font.setUnderline( self.isUnderline ) + self.label.setFont( font ) + self.options.setItemChecked( self.boldID, self.isBold ) + self.emit( PYSIGNAL( "explain" ), ( "Options/Bold selected", ) ) + + def underline( self ): + self.isUnderline = not self.isUnderline + font = QFont() + font.setBold( self.isBold ) + font.setUnderline( self.isUnderline ) + self.label.setFont( font ) + self.options.setItemChecked( self.underlineID, self.isUnderline ) + self.emit( PYSIGNAL("explain"), ( "Options/Underline selected", )) + + def about( self ): + QMessageBox.about( self, "Qt Menu Example", + "This example demonstrates simple use of Qt menus.\n" + "You can cut and paste lines from it to your own\n" + "programs." ) + + def aboutQt( self ): + QMessageBox.aboutQt( self, "Qt Menu Example" ) + + def printDoc( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Printer/Print selected", ) ) + + def printFile( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Printer/Print To File selected", ) ) + + def fax( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Printer/Print To Fax selected", ) ) + + def printerSetup( self ): + self.emit( PYSIGNAL( "explain" ), ( "File/Printer/Printer Setup selected", ) ) + + def resizeEvent( self, ev ): + self.label.setGeometry( 20, self.rect().center().y()-20, self.width()-40, 40 ) + + +a = QApplication( sys.argv ) +m = MenuExample() + +m.setCaption( "Qt Examples - Menus" ) +a.setMainWidget( m ) +m.show() +a.exec_loop() diff --git a/python/pyqt/examples3/progress.py b/python/pyqt/examples3/progress.py new file mode 100755 index 00000000..acdbd5aa --- /dev/null +++ b/python/pyqt/examples3/progress.py @@ -0,0 +1,287 @@ +#!/usr/bin/env python + +#/**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +#** +#** This file is part of an example program for Qt. This example +#** program may be used, distributed and modified without limitation. +#** +#** Converted to PyQt3: Hans-Peter Jansen <hpj@urpla.net> +#** +#*****************************************************************************/ + +from qt import * +import sys +from random import random + +TRUE = 1 +FALSE = 0 + +class AnimatedThingy(QLabel): + def __init__(self, parent, s): + QLabel.__init__(self, parent) + self.nqix = 40 + self.step = 0 + self.ox = [] + self.oy = [] + self.px = [] + self.py = [] + for i in range(self.nqix): + self.ox.append(0) + self.oy.append(0) + self.px.append(0) + self.py.append(0) + self.x0, self.y0, self.x1, self.y1 = 0, 0, 0, 0 + self.dx0 = 2 + int(random() * 8) + self.dy0 = 2 + int(random() * 8) + self.dx1 = 2 + int(random() * 8) + self.dy1 = 2 + int(random() * 8) + self.label = QString(s) + self.setEraseColor(Qt.black) + self.label.append("\n... and wasting CPU\nwith this animation!\n") + + def XXXshow(self): + if not self.isVisible(): + print "bla" + self.startTimer(100) + QWidget.show(self) + + def hide(self): + QWidget.hide(self) + self.killTimers() + + def sizeHint(self): + return QSize(120, 100) + + def timerEvent(self, e): + p, pn = self._painter() + pn.setColor(self.eraseColor()) + p.setPen(pn) + self.step = step = (self.step + 1) % self.nqix + # erase line + p.drawLine(self.ox[step], self.oy[step], self.px[step], self.py[step]) + # calc new line coordinates + self.x0, self.dx0 = self._inc(self.x0, self.dx0, self.width()) + self.y0, self.dy0 = self._inc(self.y0, self.dy0, self.height()) + self.x1, self.dx1 = self._inc(self.x1, self.dx1, self.width()) + self.y1, self.dy1 = self._inc(self.y1, self.dy1, self.height()) + self.ox[step] = self.x0 + self.oy[step] = self.y0 + self.px[step] = self.x1 + self.py[step] = self.y1 + self._drawqix(p, pn, step) + self._drawtxt(p) + + def paintEvent(self, e): + p, pn = self._painter() + p.setClipRect(e.rect()) + for i in range(self.nqix): + self._drawqix(p, pn, i) + self._drawtxt(p) + + def _painter(self): + p = QPainter(self) + pn = p.pen() + pn.setWidth(2) + p.setPen(pn) + return p, pn + + def _drawqix(self, p, pn, step): + c = QColor() + # enhanced rainbow effect + i = (step * 511)/self.nqix + if i > 255: + i = 511 - i + c.setHsv(i, 255, 255) + pn.setColor(c) + p.setPen(pn) + p.drawLine(self.ox[step], self.oy[step], self.px[step], self.py[step]) + + def _drawtxt(self, p): + #p.setPen(self.colorGroup().text()) + p.setPen(Qt.white) + p.drawText(self.rect(), Qt.AlignCenter, self.label) + + def _inc(self, x, dx, b): + x += dx + if x < 0: + x = 0 + dx = 2 + int(random() * 8) + elif x >= b: + x = b-1 + dx = -(2 + int(random() * 8)) + return x, dx + + +class CPUWaster(QWidget): + def __init__(self): + QWidget.__init__(self) + self.first_draw_item = 1000 + self.last_draw_item = 1006 + self.rects = 0 + self.timer_driven = 0 + self.default_label = 0 + self.got_stop = 0 + self.pb = None + menubar = QMenuBar(self, "menu") + file = QPopupMenu() + menubar.insertItem("&File", file) + for i in range(self.first_draw_item, self.last_draw_item + 1): + file.insertItem(self.drawItemText(i), i) + self.connect(menubar, SIGNAL("activated(int)"), self.doMenuItem) + file.insertSeparator() + file.insertItem("Quit", qApp, SLOT("quit()")) + options = QPopupMenu() + menubar.insertItem("&Options", options) + self.td_id = options.insertItem("Timer driven", self.timerDriven) + self.ld_id = options.insertItem("Loop driven", self.loopDriven) + options.insertSeparator() + self.dl_id = options.insertItem("Default label", self.defaultLabel) + self.cl_id = options.insertItem("Custom label", self.customLabel) + options.insertSeparator() + self.md_id = options.insertItem("No minimum duration", self.toggleMinimumDuration) + options.setCheckable(TRUE) + self.options = options + self.menubar = menubar + self.file = file + #self.loopDriven() + self.timerDriven() + #self.defaultLabel() + self.customLabel() + self.setFixedSize(400, 300) + self.setEraseColor(Qt.black) + + def drawItemRects(self, id): + n = id - self.first_draw_item + r = 100 + while n: + n -= 1 + f = 5 + if not n % 3: + f = 4 + r *= f + return r + + def drawItemText(self, id): + return QString("%d Rectangles" % self.drawItemRects(id)) + + # slots + def doMenuItem(self, id): + if id >= self.first_draw_item and id <= self.last_draw_item: + self._draw(self.drawItemRects(id)) + + def stopDrawing(self): + self.got_stop = TRUE + + def timerDriven(self): + self.timer_driven = TRUE + self.options.setItemChecked(self.td_id, TRUE) + self.options.setItemChecked(self.ld_id, FALSE) + + def loopDriven(self): + self.timer_driven = FALSE + self.options.setItemChecked(self.ld_id, TRUE) + self.options.setItemChecked(self.td_id, FALSE) + + def defaultLabel(self): + self.default_label = TRUE + self.options.setItemChecked(self.dl_id, TRUE) + self.options.setItemChecked(self.cl_id, FALSE) + + def customLabel(self): + self.default_label = FALSE + self.options.setItemChecked(self.dl_id, FALSE) + self.options.setItemChecked(self.cl_id, TRUE) + + def toggleMinimumDuration(self): + self.options.setItemChecked(self.md_id, not self.options.isItemChecked(self.md_id)) + + def timerEvent(self, e): + self.pb.setProgress(self.pb.totalSteps() - self.rects) + self.rects -= 1 + p = QPainter(self) + ww = self.width() + wh = self.height() + + if ww > 8 and wh > 8: + c = QColor(int(random() * 255), int(random() * 255), int(random() * 255)) + x = int(random() * (ww-8)) + y = int(random() * (wh-8)) + w = int(random() * (ww-x)) + h = int(random() * (wh-y)) + p.fillRect(x, y, w, h, QBrush(c)) + + if not self.rects or self.got_stop: + self.pb.setProgress(self.pb.totalSteps()) + p = QPainter(self) + p.fillRect(0, 0, self.width(), self.height(), QBrush(self.eraseColor())) + self.enableDrawingItems(TRUE) + self.killTimers() + if not self.default_label: + self.pb.killTimers() + self.l.killTimers() + del self.pb + self.pb = None + + def newProgressDialog(self, label, steps, modal): + d = QProgressDialog(label, "Cancel", steps, self, "progress", modal) + if self.options.isItemChecked(self.md_id): + d.setMinimumDuration(0) + if not self.default_label: + self.l = AnimatedThingy(d, label) + d.setLabel(self.l) + self.l.startTimer(100) + return d + + def enableDrawingItems(self, yes): + for i in range(self.first_draw_item, self.last_draw_item): + self.menubar.setItemEnabled(i, yes) + + def _draw(self, n): + if self.timer_driven: + if self.pb: + qWarning("This cannot happen!") + return + + self.rects = n + self.pb = self.newProgressDialog("Drawing rectangles.\nUsing timer event.", n, FALSE) + self.pb.setCaption("Please Wait") + self.connect(self.pb, SIGNAL("cancelled()"), self.stopDrawing) + self.enableDrawingItems(FALSE) + self.startTimer(10) + self.got_stop = FALSE + else: + lpb = self.newProgressDialog("Drawing rectangles.\nUsing loop.", n, TRUE) + lpb.setCaption("Please Wait") + + p = QPainter(self) + for i in range(n): + lpb.setProgress(i) + if lpb.wasCancelled(): + break + c = QColor(int(random() * 255), int(random() * 255), int(random() * 255)) + x = int(random() * (self.width()-8)) + y = int(random() * (self.height()-8)) + w = int(random() * (self.width()-x)) + h = int(random() * (self.height()-y)) + p.fillRect(x, y, w, h, QBrush(c)) + + lpb.cancel() + del lpb + p.fillRect(0, 0, self.width(), self.height(), QBrush(self.eraseColor())) + + +if __name__ == "__main__": + app = QApplication(sys.argv) + try: + n = int(sys.argv[1]) + except: + n = 1 + for i in range(n): + cpuw = CPUWaster() + if i == 0: + app.setMainWidget(cpuw) + cpuw.show() + app.exec_loop() diff --git a/python/pyqt/examples3/progressbar.py b/python/pyqt/examples3/progressbar.py new file mode 100755 index 00000000..9aba9ee5 --- /dev/null +++ b/python/pyqt/examples3/progressbar.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python + +"""*********************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +**************************************************************************""" + +#import pdb +import sys +from qt import * + +FALSE = 0 +TRUE = 1 + +class ProgressBar( QButtonGroup ): + # Constructor + # Creates child widgets of the ProgressBar widget + def __init__( self, parent=None, name=None ): + QButtonGroup.__init__( self, 0, Qt.Horizontal, "Progress Bar", parent, name ) + + self.timer = QTimer() + + self.setMargin( 10 ) + toplayout = QGridLayout( self.layout(), 2, 2, 5) + + self.setRadioButtonExclusive( TRUE ) + + # insert three radiobuttons which the user can use + # to set the speed of the progress and two pushbuttons + # to start/pause/continue and reset the progress + self.slow = QRadioButton( "&Slow", self ) + self.normal = QRadioButton( "&Normal", self ) + self.fast = QRadioButton( "&Fast", self ) + vb1 = QVBoxLayout( ) + toplayout.addLayout( vb1, 0, 0 ) + vb1.addWidget( self.slow ) + vb1.addWidget( self.normal ) + vb1.addWidget( self.fast ) + + # two push buttons, one for start, for for reset. + self.start = QPushButton( "&Start", self ) + self.reset = QPushButton( "&Reset", self ) + + vb2 = QVBoxLayout() + toplayout.addLayout( vb2, 0, 1 ) + vb2.addWidget( self.start ) + vb2.addWidget( self.reset ) + + # Create the progressbar + self.progress = QProgressBar( 100, self ) + #self.progress.setStyle( QMotifStyle() ) + toplayout.addMultiCellWidget( self.progress, 1, 1, 0, 1 ) + + # connect the clicked() SIGNALs of the pushbuttons to SLOTs + self.connect( self.start, SIGNAL("clicked()"), self.slotStart ) + self.connect( self.reset, SIGNAL("clicked()"), self.slotReset ) + + # connect the timeout() SIGNAL of the progress-timer to a SLOT + self.connect( self.timer, SIGNAL("timeout()"), self.slotTimeout ) + # Let's start with normal speed... + self.normal.setChecked( TRUE ) + + # some contraints + self.start.setFixedWidth( 80 ) + self.setMinimumWidth( 300 ) + + # SLOT slotStart + # This SLOT is called if the user clicks start/pause/continue button + def slotStart( self ): + # If the progress bar is at the beginning... + if self.progress.progress() == -1 : + # ...set according to the checked speed-radiobutton the + # the number of steps which are needed to complete the process + if self.slow.isChecked(): + self.progress.setTotalSteps( 10000 ) + elif self.normal.isChecked() : + self.progress.setTotalSteps( 1000 ) + else : + self.progress.setTotalSteps( 50 ) + + # disable the speed-radiobuttons + self.slow.setEnabled( FALSE ) + self.normal.setEnabled( FALSE ) + self.fast.setEnabled( FALSE ) + + # If the progress is not running... + if not self.timer.isActive() : + # ...start the timer (and so the progress) with a interval of 1 ms... + self.timer.start( 1 ) + # ...and rename the start/pause/continue button to Pause + self.start.setText( "&Pause" ) + else : # if the prgress is running... + # ...stop the timer (and so the prgress)... + self.timer.stop() + # ...and rename the start/pause/continue button to Continue + self.start.setText( "&Continue" ) + + # SLOT slotReset + # This SLOT is called when the user clicks the reset button + def slotReset( self ): + # stop the timer and progress + self.timer.stop() + + # rename the start/pause/continue button to Start... + self.start.setText( "&Start" ) + # ...and enable this button + self.start.setEnabled( TRUE ) + + # enable the speed-radiobuttons + self.slow.setEnabled( TRUE ) + self.normal.setEnabled( TRUE ) + self.fast.setEnabled( TRUE ) + + # reset the progressbar + self.progress.reset() + + # SLOT slotTimeout + # This SLOT is called each ms when the timer is + # active (== progress is running) + def slotTimeout( self ): + p = self.progress.progress() + + # If the progress is complete... + if p == self.progress.totalSteps() : + # ...rename the start/pause/continue button to Start... + self.start.setText( "&Start" ) + # ...and disable it... + self.start.setEnabled( FALSE ) + # ...and return + return + + # If the process is not complete increase it + p += 1 + self.progress.setProgress( p ) + + + #QPushButton *start, *pause, *reset; + +def main( args ): + a = QApplication( args ) + + progressbar = ProgressBar() + progressbar.setCaption("Qt Example - ProgressBar") + a.setMainWidget(progressbar) + progressbar.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/qdir.py b/python/pyqt/examples3/qdir.py new file mode 100755 index 00000000..0da10ebe --- /dev/null +++ b/python/pyqt/examples3/qdir.py @@ -0,0 +1,323 @@ +#!/usr/bin/env python +# +# 2005-02-12 initial version hp + +import os +import pickle +from qt import * +from dirview import Directory, DirectoryView + +bookmarks = [ + "22 14 8 1", + "# c #000080", + "a c #585858", + "b c #000000", + "c c #ffffff", + "d c #ffffff", + "e c #ffffff", + "f c #000000", + ". c None", + "...bb.................", + "..bacb....bbb.........", + "..badcb.bbccbab.......", + "..bacccbadccbab.......", + "..baecdbcccdbab.......", + "..bacccbacccbab.......", + "..badcdbcecdfab.......", + "..bacecbacccbab.......", + "..baccdbcccdbab.......", + "...badcbacdbbab.......", + "....bacbcbbccab.......", + ".....babbaaaaab.......", + ".....bbabbbbbbb.......", + "......bb.............." +] + +home = [ + "16 15 4 1", + "# c #000000", + "a c #ffffff", + "b c #c0c0c0", + ". c None", + ".......##.......", + "..#...####......", + "..#..#aabb#.....", + "..#.#aaaabb#....", + "..##aaaaaabb#...", + "..#aaaaaaaabb#..", + ".#aaaaaaaaabbb#.", + "###aaaaaaaabb###", + "..#aaaaaaaabb#..", + "..#aaa###aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#aaa#.#aabb#..", + "..#####.######.." +] + + +class PixmapView(QScrollView): + def __init__(self, parent): + QScrollView.__init__(self, parent) + self.pixmap = None + self.viewport().setBackgroundMode(self.PaletteBase) + + def setPixmap(self, pix): + self.pixmap = pix + self.resizeContents(pix.size().width(), pix.size().height()) + self.viewport().repaint(False) + + def drawContents(self, p, cx, cy, cw, ch): + p.fillRect(cx, cy, cw, ch, self.colorGroup().brush(QColorGroup.Base)) + p.drawPixmap(0, 0, self.pixmap) + + +class Preview(QWidgetStack): + def __init__(self, parent): + QWidgetStack.__init__(self, parent) + self.normalText = QMultiLineEdit(self) + self.normalText.setReadOnly(True) + self.html = QTextView(self) + self.pixmap = PixmapView(self) + self.raiseWidget(self.normalText) + + def showPreview(self, url, size): + if url.isLocalFile(): + path = url.path() + fi = QFileInfo(path) + if fi.isFile() and fi.size() > size * 1000: + self.normalText.setText( + "The File\n%s\nis too large, so I don't show it!" % path) + self.raiseWidget(self.normalText) + return + pix = QPixmap(path) + if pix.isNull(): + if fi.isFile(): + err = False + try: + text = open(path.latin1(), "r").read() + except IOError, msg: + text = QString(str(msg)) + err = True + if not err and fi.extension().lower().contains("htm"): + url = self.html.mimeSourceFactory().makeAbsolute( + path, self.html.context()) + self.html.setText(text, url) + self.raiseWidget(self.html) + return + else: + self.normalText.setText(text) + self.raiseWidget(self.normalText) + return + else: + self.normalText.setText("") + self.raiseWidget(self.normalText) + else: + self.pixmap.setPixmap(pix) + self.raiseWidget(self.pixmap) + else: + self.normalText.setText("I only show local files!") + self.raiseWidget(self.normalText) + + +# We can't instantiate QFilePreview directly because it is abstract. Note that +# the previewUrl() abstract is patched in later to work around the fact that +# you can't multiply inherit from more than one wrapped class. +class FilePreview(QFilePreview): + pass + + +class PreviewWidget(QVBox): + def __init__(self, parent): + QVBox.__init__(self, parent) + self.setSpacing( 5 ) + self.setMargin( 5 ) + row = QHBox(self) + row.setSpacing(5) + QLabel("Only show files smaller than: ", row) + self.sizeSpinBox = QSpinBox(1, 10000, 1, row) + self.sizeSpinBox.setSuffix(" KB") + self.sizeSpinBox.setValue(128) + row.setFixedHeight(10 + self.sizeSpinBox.sizeHint().height()) + self.__preview = Preview(self) + # workaround sip inability of multiple inheritance + # create a local QFilePreview instance and redirect + # the method, which is called on preview, to us + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl + + def previewUrl(self, url): + self.__preview.showPreview(url, self.sizeSpinBox.value()) + + +class CustomFileDialog(QFileDialog): + def __init__(self, preview = False): + QFileDialog.__init__(self, None, None, True) + self.bookmarkFile = ".pybookmarks" + self.bookmarkList = [] + if os.path.exists(self.bookmarkFile): + try: + self.bookmarkList = pickle.loads(open(self.bookmarkFile, "rb").read()) + except IOError, msg: + print msg + self.setDir("/") + self.dirView = DirectoryView(self, None, True) + self.dirView.addColumn("") + self.dirView.header().hide() + root = Directory(self.dirView, "/") + root.setOpen(True) + self.dirView.setFixedWidth(200) + self.addLeftWidget(self.dirView) + p = QPushButton(self) + p.setPixmap(QPixmap(bookmarks)) + QToolTip.add(p, "Bookmarks") + self.bookmarkMenu = QPopupMenu(self) + self.connect(self.bookmarkMenu, SIGNAL("activated(int)"), + self.bookmarkChosen) + self.addId = self.bookmarkMenu.insertItem("Add bookmark") + self.bookmarkMenu.insertSeparator() + for l in self.bookmarkList: + self.bookmarkMenu.insertItem(l) + p.setPopup(self.bookmarkMenu) + self.addToolButton(p, True) + self.connect(self.dirView, PYSIGNAL("folderSelected(const QString &)"), + self.setDir2) + self.connect(self, SIGNAL("dirEntered(const QString &)"), + self.dirView.setDir) + b = QToolButton(self) + QToolTip.add(b, "Go Home!") + b.setPixmap(QPixmap(home)) + self.connect(b, SIGNAL("clicked()"), self.goHome) + self.addToolButton(b) + + if preview: + self.setContentsPreviewEnabled(True) + pw = PreviewWidget(self) + self.setContentsPreview(pw, pw.preview) + self.setViewMode(QFileDialog.List) + self.setPreviewMode(QFileDialog.Contents) + + w = self.width() + h = self.height() + if preview: + self.resize(w + w / 2, h + h / 3) + else: + self.resize(w + w / 3, h + h / 4) + + def done(self, r): + if self.bookmarkList: + try: + open(self.bookmarkFile, "wb").write(pickle.dumps(self.bookmarkList)) + except IOError, msg: + print msg + return QFileDialog.done(self, r) + + def showEvent(self, e): + QFileDialog.showEvent(self, e) + self.dirView.setDir(self.dirPath()) + + def setDir2(self, path): + self.blockSignals(True) + self.setDir(path) + self.blockSignals(False) + + def bookmarkChosen(self, i): + if i == self.addId: + # keep bookmarks pythonic + dp = self.dirPath().latin1() + if dp not in self.bookmarkList: + self.bookmarkList.append(dp) + self.bookmarkMenu.insertItem(dp) + else: + self.setDir(self.bookmarkMenu.text(i)) + + def goHome(self): + if os.getenv("HOME"): + self.setDir(os.getenv("HOME")) + else: + self.setDir("/") + + +if __name__ == '__main__': + import sys + import getopt + + def usage(msg = None): + if msg: + print >> sys.stderr, msg + print >> sys.stderr, """\ +usage: qdir [--any | --dir | --custom] [--preview] [--default f] {--filter f} [caption ...] + --any Get any filename, need not exist. + --dir Return a directory rather than a file. + --custom Opens a customized QFileDialog with + dir browser, bookmark menu, etc. + --preview Show a preview widget. + --default f Start from directory/file f. + --filter f eg. '*.gif' '*.bmp' + caption ... Caption for dialog. +""" + sys.exit(1) + + def main(): + options = ["help", "any", "dir", "custom", "preview", "default=", "filter="] + mode = QFileDialog.ExistingFile + preview = False + custom = False + start = None + filter = QString.null + app = QApplication(sys.argv) + + try: + optlist, args = getopt.getopt(sys.argv[1:], "h", options) + except getopt.error, msg: + usage(msg) + + for opt, par in optlist: + if opt in ("-h", "--help"): + usage() + elif opt == "--any": + mode = QFileDialog.AnyFile + elif opt == "--dir": + mode = QFileDialog.Directory + elif opt == "--default": + start = par + elif opt == "--filter": + filter = par + elif opt == "--preview": + preview = True + elif opt == "--custom": + custom = True + if args: + caption = " ".join(args) + elif mode == QFileDialog.Directory: + caption = "Choose directory..." + else: + caption = "Choose file..." + if not start: + start = QDir.currentDirPath() + if not custom: + fd = QFileDialog(QString.null, filter, None, None, True) + fd.setMode(mode) + if preview: + fd.setContentsPreviewEnabled(True) + pw = PreviewWidget(fd) + fd.setContentsPreview(pw, pw.preview) + fd.setViewMode(QFileDialog.List) + fd.setPreviewMode(QFileDialog.Contents) + w = fd.width() + h = fd.height() + fd.resize(w + w / 3, h + h / 4) + fd.setCaption(caption) + fd.setSelection(start) + if fd.exec_loop() == QDialog.Accepted: + print "%s\n" % fd.selectedFile().latin1() + return 0 + else: + return 1 + else: + fd = CustomFileDialog(preview) + fd.exec_loop() + return 1 + + sys.exit(main()) diff --git a/python/pyqt/examples3/qmag.py b/python/pyqt/examples3/qmag.py new file mode 100755 index 00000000..6a136481 --- /dev/null +++ b/python/pyqt/examples3/qmag.py @@ -0,0 +1,233 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +from qt import * + +TRUE = 1 +FALSE = 0 + +zoomfactors = ["100%","200%","300%","400%","500%","600%","700%","800%","1600%"] + +refreshrates = [ + "No autorefresh", "50 per second", "4 per second", "3 per second", + "2 per second", "Every second", "Every two seconds", "Every three seconds", + "Every five seconds", "Every ten seconds"] + +timer = (0, 20, 250, 333, 500, 1000, 2000, 3000, 5000, 10000) + +class MagWidget(QWidget): + def __init__(self, qApp, parent = None, name = None): + self.qApp = qApp + QWidget.__init__(self, parent, name) + self.pm = QPixmap() # pixmap magnified + self.p = QPixmap() # pixmap + self.image = QImage() # image of pixmap (for RGB) + self.z = 0 # zoom factor + self.r = 0 # autorefresh rate (index into refreshrates) + self.grabbing = FALSE # TRUE if currently grabbing + self.grabx = -1 + self.graby = -1 + + self.zoom = QComboBox(FALSE, self) + self.zoom.insertStrList(zoomfactors, len(zoomfactors)) + self.connect(self.zoom, SIGNAL("activated(int)"), + self.setZoom) + + self.refresh = QComboBox(FALSE, self) + self.refresh.insertStrList(refreshrates, len(refreshrates)) + self.connect(self.refresh, SIGNAL("activated(int)"), + self.setRefresh) + + x = 0 + w = 0 + h = 20 + for s in zoomfactors: + cw = self.zoom.fontMetrics().width(s) + w = max(cw, w) + self.zoom.setGeometry(x, 2, w + 30, h) + + x = w + 34 + w = 0 + for s in refreshrates: + cw = self.refresh.fontMetrics().width(s) + w = max(cw, w) + self.refresh.setGeometry(x, 2, w + 30, h) + + self.saveButton = QPushButton(self) + self.connect(self.saveButton, SIGNAL("clicked()"), self.save) + self.saveButton.setText("Save") + self.saveButton.setGeometry(x + w + 30 + 2, 2, + 10 + self.saveButton.fontMetrics().width("Save"), h) + + self.quitButton = QPushButton(self) + self.connect(self.quitButton, SIGNAL("clicked()"), self.qApp, SLOT("quit()")) + self.quitButton.setText("Quit") + self.quitButton.setGeometry(self.saveButton.geometry().right() + 2, 2, + 10 + self.quitButton.fontMetrics().width("Quit"), h) + + self.rgb = QLabel(self) + self.rgb.setText("") + self.rgb.setAlignment(Qt.AlignVCenter) + self.rgb.resize(self.width(), self.rgb.fontMetrics().height() + 4) + + self.yoffset = self.zoom.height() + 4 + self.rgb.height() + self.setMinimumSize(self.quitButton.geometry().topRight().x() + 2, + self.yoffset + 20) + w = self.quitButton.geometry().topRight().x() + 2 + self.resize(w, w) + + self.setMouseTracking(TRUE) + self.grabx = self.qApp.desktop().width() / 2 + self.graby = self.qApp.desktop().height() / 2 + self.grabAround(QPoint(self.grabx, self.graby)) + + #self.zoom.setCurrentItem(1) # grabAround sets zoom factor + #self.setZoom(1) + self.refresh.setCurrentItem(5) + self.setRefresh(5) + + def setZoom(self, index): + if index == 8: + self.z = 16 + else: + self.z = index + 1 + self.grab() + + def setRefresh(self, index): + self.r = index + self.killTimers() + if index and not self.grabbing: + #print "st:", timer[index] + self.startTimer(timer[index]) + + def save(self): + if not self.p.isNull(): + self.killTimers() + fn = QFileDialog.getSaveFileName() + if not fn.isEmpty(): + self.p.save(fn, "BMP") + if self.r: + self.startTimer(timer[self.r]) + + def grab(self): + if not self.isVisible() or self.grabx < 0 or self.graby < 0: + return + + w = (self.width() + self.z - 1) / self.z + h = (self.height() + self.z - 1 - self.yoffset) / self.z + + if w < 1 or h < 1: + return + + x = self.grabx - w / 2 + y = self.graby - h / 2 + + if x + w > QApplication.desktop().width(): + x = QApplication.desktop().width() - w + elif x < 0: + x = 0 + + if y + h > QApplication.desktop().height(): + y = QApplication.desktop().height() - h + elif y < 0: + y = 0 + + self.p = QPixmap.grabWindow(QApplication.desktop().winId(), x, y, w, h) + self.image = self.p.convertToImage() + m = QWMatrix() + #print "z:", self.z + m.scale(float(self.z), float(self.z)) + self.pm = self.p.xForm(m) + self.repaint(FALSE) + + def paintEvent(self, e): + if not self.pm.isNull(): + paint = QPainter(self) + paint.drawPixmap(0, self.zoom.height() + 4, self.pm, + 0, 0, self.width(), self.height() - self.yoffset) + + def mousePressEvent(self, e): + if not self.grabbing: + self.grabbing = TRUE + self.killTimers() + self.grabMouse(Qt.crossCursor) + self.grabx = -1 + self.graby = -1 + else: + self.grabx = self.mapToGlobal(e.pos()).x() + self.graby = self.mapToGlobal(e.pos()).y() + + def mouseReleaseEvent(self, e): + if self.grabbing and self.grabx >= 0 and self.graby >= 0: + self.grabbing = FALSE + self.grabAround(e.pos()) + self.releaseMouse() + + def grabAround(self, pos): + rx = self.mapToGlobal(pos).x() + ry = self.mapToGlobal(pos).y() + w = abs(rx - self.grabx) + h = abs(ry - self.graby) + if w > 10 and h > 10: + pz = 1 + while w*pz*h*pz < self.width()*(self.height()-self.yoffset) and \ + w*pz < QApplication.desktop().width() and \ + h*pz < QApplication.desktop().height(): + pz += 1 + if (w*pz*h*pz - self.width()*(self.height()-self.yoffset)) > \ + (self.width()*(self.height()-self.yoffset) - w*(pz-1)*h*(pz-1)): + pz -= 1 + if pz < 1: + pz = 1 + elif pz > 8: + pz = 8 + self.zoom.setCurrentItem(pz-1) + self.z = pz + self.grabx = min(rx, self.grabx) + w / 2 + self.graby = min(ry, self.graby) + h / 2 + #self.resize(w*self.z, h*self.z*self.yoffset) + self.grab() + + def mouseMoveEvent(self, e): + if self.grabbing or self.pm.isNull() or \ + e.pos().y() > self.height() - self.zoom.fontMetrics().height() - 4 or \ + e.pos().y() < self.zoom.height() + 4: + self.rgb.setText("") + else: + x = e.pos().x() / self.z + y = (e.pos().y() - self.zoom.height() - 4) / self.z + pixelinfo = "" + if self.image.valid(x, y): + px = self.image.pixel(x, y) + pixelinfo = "%3d,%3d,%3d #%02x%02x%02x" % ( + qRed(px), qGreen(px), qBlue(px), + qRed(px), qGreen(px), qBlue(px)) + self.rgb.setText("x=%d, y=%d %s" % \ + (x + self.grabx, y + self.graby, pixelinfo)) + + def focusOutEvent(self, e): + self.rgb.setText("") + + def timerEvent(self, e): + self.grab() + + def resizeEvent(self, e): + self.rgb.setGeometry(0, self.height() - self.rgb.height(), + self.width(), self.rgb.height()) + +if __name__=='__main__': + app = QApplication( sys.argv ) + m = MagWidget(app) + app.setMainWidget(m) + m.show() + app.exec_loop() diff --git a/python/pyqt/examples3/qt.png b/python/pyqt/examples3/qt.png Binary files differnew file mode 100644 index 00000000..ca630a56 --- /dev/null +++ b/python/pyqt/examples3/qt.png diff --git a/python/pyqt/examples3/qtlogo.png b/python/pyqt/examples3/qtlogo.png Binary files differnew file mode 100644 index 00000000..0dc05a0e --- /dev/null +++ b/python/pyqt/examples3/qtlogo.png diff --git a/python/pyqt/examples3/rangecontrols.py b/python/pyqt/examples3/rangecontrols.py new file mode 100755 index 00000000..4b6b347a --- /dev/null +++ b/python/pyqt/examples3/rangecontrols.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +INT_MAX = sys.maxint + +class RangeControls( QVBox ): + def __init__( self, parent=None, name=None ): + QVBox.__init__( self, parent, name ) + + row1 = QHBox( self ) + cell2 = QVBox( row1 ) + cell2.setMargin( 10 ) + cell2.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) + + QWidget( cell2 ) + + label1 = QLabel( QString( "Enter a value between\n%1 and %2:" ).arg( -INT_MAX ).arg( INT_MAX ), cell2 ) + label1.setMaximumHeight( label1.sizeHint().height() ) + sb1 = QSpinBox( -INT_MAX, INT_MAX, 1, cell2 ) + sb1.setValue( 0 ) + + label2 = QLabel( "Enter a zoom value:", cell2 ) + label2.setMaximumHeight( label2.sizeHint().height() ) + sb2 = QSpinBox( 0, 1000, 10, cell2 ) + sb2.setSuffix( " %" ) + sb2.setSpecialValueText( "Automatic" ) + + label3 = QLabel( "Enter a price:", cell2 ) + label3.setMaximumHeight( label3.sizeHint().height() ) + sb3 = QSpinBox( 0, INT_MAX, 1, cell2 ) + sb3.setPrefix( "$" ) + sb3.setValue( 355 ) + + QWidget( cell2 ) + + row2 = QHBox( self ) + + cell3 = QVBox( row2 ) + cell3.setMargin( 10 ) + cell3.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) + hslider = QSlider( 0, 64, 1, 33, Qt.Horizontal, cell3 ) + lcd2 = QLCDNumber( 2, cell3 ) + lcd2.display( 33 ) + lcd2.setSegmentStyle( QLCDNumber.Filled ) + self.connect( hslider, SIGNAL("valueChanged( int )"), lcd2, SLOT("display( int )") ) + + cell4 = QHBox( row2 ) + cell4.setFrameStyle( QFrame.WinPanel | QFrame.Sunken ) + cell4.setMargin( 10 ) + vslider = QSlider( 0, 64, 1, 8, Qt.Vertical, cell4 ) + lcd3 = QLCDNumber( 3, cell4 ) + lcd3.display( 8 ) + self.connect( vslider, SIGNAL("valueChanged( int )"), lcd3, SLOT("display( int )") ) + +def main( args ): + a = QApplication( args ) + + rangecontrols = RangeControls() + rangecontrols.resize( 500, 300 ) + rangecontrols.setCaption( "Qt Example - Range Control Widgets" ); + a.setMainWidget( rangecontrols ) + rangecontrols.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/richtext.py b/python/pyqt/examples3/richtext.py new file mode 100755 index 00000000..8ec4b0b4 --- /dev/null +++ b/python/pyqt/examples3/richtext.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +sayings = [ + "<b>Saying 1:</b><br>" + "<hr><br><br>" + "<big>Evil is that which one believes of others. It is a sin to believe evil " + "of others, but it is seldom a mistake.</big><br><br>" + "<center><i>-- H.L. Mencken</i></center>", + + "<b>Saying 2:</b><br>" + "<hr><br><br>" + "<big>A well-used door needs no oil on its hinges.<br>" + "A swift-flowing steam does not grow stagnant.<br>" + "Neither sound nor thoughts can travel through a vacuum.<br>" + "Software rots if not used.<br><br>" + "These are great mysteries.</big><br><br>" + "<center><i>-- Geoffrey James, \"The Tao of Programming\"</i></center>", + + "<b>Saying 3:</b><br>" + "<hr><br><br>" + "<big>Show business is just like high school, except you get paid.</big><br><br>" + "<center><i>-- Martin Mull</i></center>", + + "<b>Saying 4:</b><br>" + "<hr><br><br>" + "<big><b>The Least Successful Executions</b><br>" + "<twocolumn><p> History has furnished us with two executioners worthy of attention. " + "The first performed in Sydney in Australia. In 1803 three attempts were " + "made to hang a Mr. Joseph Samuels. On the first two of these the rope " + "snapped, while on the third Mr. Samuels just hung there peacefully until he " + "and everyone else got bored. Since he had proved unsusceptible to capital " + "punishment, he was reprieved.</p>" + "<p> The most important British executioner was Mr. James Berry who " + "tried three times in 1885 to hang Mr. John Lee at Exeter Jail, but on each " + "occasion failed to get the trap door open.<!p>" + "<p> In recognition of this achievement, the Home Secretary commuted " + "Lee's sentence to \"life\" imprisonment. He was released in 1917, emigrated " + "to America and lived until 1933.</p></twocolumn></big><br><br>" + "<center><i>-- Stephen Pile, \"The Book of Heroic Failures\"</i></center>", + + "<b>Saying 5:</b><br>" + "<hr><br><br>" + "<big>If you can, help others. If you can't, at least don't hurt others.</big><br><br>" + "<center><i>-- the Dalai Lama</i></center>", + + "<b>Saying 6:</b><br>" + "<hr><br><br>" + "<big>Television has brought back murder into the home -- where it belongs.</big><br><br>" + "<center><i>-- Alfred Hitchcock</i></center>", + + "<b>Saying 7:</b><br>" + "<hr><br><br>" + "<big>I don't know who my grandfather was; I am much more concerned to know " + "what his grandson will be.</big><br><br>" + "<center><i>-- Abraham Lincoln</i></center>", + + 0 +] + +class MyRichText( QVBox ): + def __init__( self, parent = None, name = None ): + QVBox.__init__( self, parent, name ) + + self.setMargin( 5 ) + + self.view = QTextView( self ) + #self.view.setText( "This is a <b>Test</b> with <i>italic</i> <u>stuff</u>" ) + paper = QBrush() + paper.setPixmap( QPixmap( "marble.png" ) ) + if paper.pixmap() != 0 : + self.view.setPaper( paper ) + else : + self.view.setPaper( white ) + + self.view.setText( sayings[0] ) + self.view.setMinimumSize( 450, 250 ) + + buttons = QHBox( self ) + buttons.setMargin( 5 ) + + self.bClose = QPushButton( "&Close", buttons ) + self.bPrev = QPushButton( "<< &Prev", buttons ) + self.bNext = QPushButton( "&Next >>", buttons ) + + self.bPrev.setEnabled( False ) + + self.connect( self.bClose, SIGNAL("clicked()"), qApp, SLOT("quit()") ) + self.connect( self.bPrev, SIGNAL("clicked()"), self.prev ) + self.connect( self.bNext, SIGNAL("clicked()"), self.next ) + + self.num = 0 + + def prev( self ): + if self.num <= 0 : + return + self.num -= 1 + self.view.setText( sayings[self.num] ) + if self.num == 0 : + self.bPrev.setEnabled( False ) + self.bNext.setEnabled( True ) + + def next( self ): + self.num += 1 + if not sayings[self.num]: + return + self.view.setText( sayings[self.num] ) + if not sayings[self.num + 1]: + self.bNext.setEnabled( False ) + self.bPrev.setEnabled( True ) + +def main( args ): + a = QApplication(sys.argv) # application object + + richtext = MyRichText() + richtext.resize( 450, 350 ); + richtext.setCaption( "Qt Example - Richtext" ) + a.setMainWidget( richtext ) + richtext.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/secret.py b/python/pyqt/examples3/secret.py new file mode 100644 index 00000000..d6d2b6d0 --- /dev/null +++ b/python/pyqt/examples3/secret.py @@ -0,0 +1,65 @@ +# This is part of the dragdrop example. + + +from qt import * + + +def canDecode(e): + return e.provides( "secret/magic" ) + + +def decode(e): + payload = str(e.data( "secret/magic" )) + if ( str(payload) != '' ): + e.accept() + return QString("The secret number is "+str(ord(payload)) ) + + return None + + +class SecretDrag(QStoredDrag): + def __init__(self, secret, parent=None, name=None): + QStoredDrag.__init__(self, 'secret/magic', parent, name) + data = QByteArray(chr(secret)) + self.setEncodedData( data ) + + +# XPM +picture_xpm = [ + "16 16 3 1", + " c None", + ". c #000000", + "X c #FFFF00", + " ..... ", + " ..XXXXX.. ", + " .XXXXXXXXX. ", + " .XXXXXXXXXXX. ", + " .XX..XXX..XX. ", + ".XXXXXXXXXXXXX. ", + ".XX...XXX...XX. ", + ".XXX..XXX..XXX. ", + ".XXXXXXXXXXXXX. ", + ".XXXXXX.XXXXXX. ", + " .XX.XX.XX.XX. ", + " .XXX..X..XXX. ", + " .XXXXXXXXX. ", + " ..XXXXX.. ", + " ..... ", + " " +] + + +class SecretSource(QLabel): + def __init__(self, secret, parent=None, name=None): + QLabel.__init__(self, "Secret", parent, name) + self.setEraseColor( Qt.blue.light() ) + self.setFrameStyle( QLabel.Box | QLabel.Sunken ) + self.setMinimumHeight( self.sizeHint().height()*2 ) + self.setAlignment( QLabel.AlignCenter ) + self.mySecret = secret + + def mousePressEvent(self, e): + sd = SecretDrag( self.mySecret, self ) + sd.setPixmap(QPixmap(picture_xpm),QPoint(8,8)) + sd.dragCopy() + self.mySecret = self.mySecret + 1 diff --git a/python/pyqt/examples3/semaphore.py b/python/pyqt/examples3/semaphore.py new file mode 100755 index 00000000..ac8b231b --- /dev/null +++ b/python/pyqt/examples3/semaphore.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python +# +# A port of the semaphore example from Qt. + + +import sys + +# Check if thread support was enabled. +try: + from qt import QThread +except: + print "Thread support not enabled" + sys.exit(1) + +from qt import * + + +# The semaphore instances. +yellowSem = None +greenSem = None + + +class YellowThread(QThread): + def __init__(self,o): + QThread.__init__(self) + + self.receiver = o + self.stopped = 0 + self.mutex = QMutex() + + def run(self): + global yellowSem, greenSem + + for i in range(20): + yellowSem += 1 + + event = QCustomEvent(12345) + event.setData(QString("Yellow!")) + QThread.postEvent(self.receiver,event) + self.msleep(200); + + greenSem -= 1 + + self.mutex.lock() + if self.stopped: + self.stopped = 0 + self.mutex.unlock() + break + + self.mutex.unlock() + + yellowSem += 1 + + event = QCustomEvent(12346) + event.setData(QString("Yellow!")) + QThread.postEvent(self.receiver,event) + + greenSem -= 1 + + def stop(self): + self.mutex.lock() + self.stopped = 1 + self.mutex.unlock() + + +class GreenThread(QThread): + def __init__(self,o): + QThread.__init__(self) + + self.receiver = o + self.stopped = 0 + self.mutex = QMutex() + + def run(self): + global yellowSem, greenSem + + for i in range(20): + greenSem += 1 + + event = QCustomEvent(12345) + event.setData(QString("Green!")) + QThread.postEvent(self.receiver,event) + self.msleep(200) + + yellowSem -= 1 + + self.mutex.lock() + if self.stopped: + self.stopped = 0 + self.mutex.unlock() + break + + self.mutex.unlock() + + greenSem += 1 + + event = QCustomEvent(12346) + event.setData(QString("Green!")) + QThread.postEvent(self.receiver,event) + self.msleep(10) + + yellowSem -= 1 + + def stop(self): + self.mutex.lock() + self.stopped = 1 + self.mutex.unlock() + + +class SemaphoreExample(QWidget): + def __init__(self): + QWidget.__init__(self) + + self.yellowThread = YellowThread(self) + self.greenThread = GreenThread(self) + + global yellowSem, greenSem + yellowSem = QSemaphore(1) + greenSem = QSemaphore(1) + + self.button = QPushButton("&Ignition!",self) + self.connect(self.button,SIGNAL("clicked()"),self.startExample) + + self.mlineedit = QMultiLineEdit(self) + self.label = QLabel(self) + + vbox = QVBoxLayout(self,5) + vbox.addWidget(self.button) + vbox.addWidget(self.mlineedit) + vbox.addWidget(self.label) + + def __del__(self): + stopYellow = self.yellowThread.running() + stopGreen = self.greenThread.running() + + if stopYellow: + self.yellowThread.stop() + + if self.greenThread.running(): + self.greenThread.stop() + + if stopYellow: + self.yellowThread.wait() + + if stopGreen: + self.greenThread.wait() + + global yellowSem, greenSem + yellowSem = None + greenSem = None + + def startExample(self): + if self.yellowThread.running() or self.greenThread.running(): + QMessageBox.information(self,"Sorry", + "The threads have not completed yet, and must finish before " + "they can be started again.") + + return + + self.mlineedit.clear() + + global yellowSem + + while yellowSem.available() < yellowSem.total(): + yellowSem -= 1 + + yellowSem += 1 + + self.yellowThread.start() + self.greenThread.start() + + def customEvent(self,event): + if event.type() == 12345: + s = event.data() + + self.mlineedit.append(s) + + if s.latin1() == "Green!": + self.label.setEraseColor(Qt.green) + else: + self.label.setEraseColor(Qt.yellow) + + self.label.setText(s) + + del s + elif event.type() == 12346: + s = event.data() + + QMessageBox.information(self,s.latin1() + " - Finished", + "The thread creating the \"" + s.latin1() + + "\" events has finished.") + + del s + else: + print "Unknown custom event type:", event.type() + + +app = QApplication(sys.argv) +se = SemaphoreExample() +app.setMainWidget(se) +se.show() + +sys.exit(app.exec_loop()) diff --git a/python/pyqt/examples3/smalltable.py b/python/pyqt/examples3/smalltable.py new file mode 100755 index 00000000..54f54c88 --- /dev/null +++ b/python/pyqt/examples3/smalltable.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +import os +from qt import * +from qttable import * + +TRUE = 1 +FALSE = 0 + +numRows = 30 +numCols = 10 + +if __name__ == '__main__': + app = QApplication(sys.argv) + + table = QTable(numRows, numCols) + + header = table.horizontalHeader() + + header.setLabel(0, "Tiny", 40) + header.setLabel(1, "Checkboxes") + header.setLabel(5, "Combos") + header.setMovingEnabled(TRUE) + + img = QImage("trolltech.bmp") + pix = QPixmap(img.scaleHeight(table.rowHeight(3))) + table.setPixmap(3, 2, pix) + table.setText(3, 2, "A Pixmap") + + comboEntries = QStringList("one") + comboEntries.append("two") + comboEntries.append("three") + comboEntries.append("four") + + for i in range(numRows): + item = QComboTableItem(table, comboEntries, FALSE) + item.setCurrentItem(i % 4) + table.setItem(i, 5, item) + + for i in range(numRows): + table.setItem(i, 1, QCheckTableItem(table, "Check me")) + + table.setCaption("Small table example") + table.show() + app.setMainWidget(table) + app.exec_loop() diff --git a/python/pyqt/examples3/splitter.py b/python/pyqt/examples3/splitter.py new file mode 100755 index 00000000..3cee9cf1 --- /dev/null +++ b/python/pyqt/examples3/splitter.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +import sys +from qt import * + +class Test(QWidget): + def __init__(self, parent=None, name='Test', f=0): + QWidget.__init__(self, parent, name, f) + + def paintEvent(self, e): + p = QPainter(self) + p.setClipRect(e.rect()) + d = 1000 + x1 = 0 + x2 = self.width() - 1 + y1 = 0 + y2 = self.height() - 1 + + x = (x1+x2)/2 + p.drawLine(x, y1, x+d, y1+d) + p.drawLine(x, y1, x-d, y1+d) + p.drawLine(x, y2, x+d, y2-d) + p.drawLine(x, y2, x-d, y2-d) + + y = (y1+y2)/2 + p.drawLine(x1, y, x1+d, y+d) + p.drawLine(x1, y, x1+d, y-d) + p.drawLine(x2, y, x2-d, y+d) + p.drawLine(x2, y, x2-d, y-d) + + +if __name__=="__main__": + a = QApplication(sys.argv) + + s1 = QSplitter(Qt.Vertical, None, "main") + s2 = QSplitter(Qt.Horizontal, s1, "top") + + t1 = Test(s2) + t1.setEraseColor(Qt.blue.light(180)) + t1.setMinimumSize(50,0) + + t2 = Test(s2) + t2.setEraseColor(Qt.green.light(180)) + s2.setResizeMode(t2, QSplitter.KeepSize) + s2.moveToFirst(t2) + + s3 = QSplitter(Qt.Horizontal, s1, "bottom") + + t3 = Test(s3) + t3.setEraseColor(Qt.red) + t4 = Test(s3) + t4.setEraseColor(Qt.white) + + t5 = Test(s3) + t5.setMaximumHeight(250) + t5.setMinimumSize(80,50) + t5.setEraseColor(Qt.yellow) + + s1.setOpaqueResize(1) + s2.setOpaqueResize(1) + s3.setOpaqueResize(1) + + a.setMainWidget(s1) + s1.show() + a.exec_loop() diff --git a/python/pyqt/examples3/tabdialog.py b/python/pyqt/examples3/tabdialog.py new file mode 100755 index 00000000..81f61480 --- /dev/null +++ b/python/pyqt/examples3/tabdialog.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * + +class TabDialog( QTabDialog ): + def __init__( self, parent=None, name=None, filename=None ): + QTabDialog.__init__( self, parent, name ) + self.filename = QString( filename ) + self.fileinfo = QFileInfo( filename ) + self.setupTab1() + self.setupTab2() + self.setupTab3() + self.connect( self, SIGNAL("applyButtonPressed()"), qApp, SLOT("quit()" ) ) + + def setupTab1( self ): + tab1 = QVBox( self ) + tab1.setMargin( 5 ) + + QLabel( "Filename:", tab1 ) + fname = QLineEdit( self.filename, tab1 ) + fname.setFocus() + + QLabel( "Path:", tab1 ) + path = QLabel( self.fileinfo.dirPath( True ), tab1 ) + path.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + QLabel( "Size:", tab1 ) + size = QLabel( QString( "%1 KB" ).arg( self.fileinfo.size() ), tab1 ) + size.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + QLabel( "Last Read:", tab1 ) + lread = QLabel( self.fileinfo.lastRead().toString(), tab1 ) + lread.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + QLabel( "Last Modified:", tab1 ) + lmodif = QLabel( self.fileinfo.lastModified().toString(), tab1 ) + lmodif.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + self.addTab( tab1, "General" ) + + def setupTab2( self ): + tab2 = QVBox( self ) + tab2.setMargin( 5 ) + + bg = QButtonGroup( 1, QGroupBox.Horizontal, "Permissions", tab2 ) + + readable = QCheckBox( "Readable", bg ) + if self.fileinfo.isReadable() : + readable.setChecked( True ) + + writable = QCheckBox( "Writeable", bg ) + if self.fileinfo.isWritable() : + writable.setChecked( True ) + + executable = QCheckBox( "Executable", bg ) + if self.fileinfo.isExecutable() : + executable.setChecked( True ) + + bg2 = QButtonGroup( 2, QGroupBox.Horizontal, "Owner", tab2 ) + + QLabel( "Owner", bg2 ) + owner = QLabel( self.fileinfo.owner(), bg2 ) + owner.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + QLabel( "Group", bg2 ) + group = QLabel( self.fileinfo.group(), bg2 ) + group.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + + self.addTab( tab2, "Permissions" ) + + def setupTab3( self ): + tab3 = QVBox( self ) + tab3.setMargin( 5 ) + tab3.setSpacing( 5 ) + + QLabel( QString( "Open %1 with:" ).arg( self.filename ), tab3 ) + + prgs = QListBox( tab3 ) + for i in range( 0, 30, 1 ) : + prg = QString( "Application %1" ).arg( i ) + prgs.insertItem( prg ) + prgs.setCurrentItem( 3 ) + + QCheckBox( QString( "Open files with the extension '%1' always with this application" ).arg( self.fileinfo.extension() ), tab3 ) + + self.addTab( tab3, "Applications" ) + +def main( args ): + a = QApplication(sys.argv) + #sys.argv.append("tabdialog.py") # to test uncomment this line + if len(sys.argv) < 2: + filename = QString(".") + else: + filename = QString(sys.argv[1]) + + tabdialog = TabDialog( None, "tabdialog", filename ) + tabdialog.resize( 450, 350 ); + tabdialog.setCaption( "Qt Example - Tabbed Dialog" ) + a.setMainWidget( tabdialog ) + tabdialog.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/tablestatistics.py b/python/pyqt/examples3/tablestatistics.py new file mode 100755 index 00000000..59c71117 --- /dev/null +++ b/python/pyqt/examples3/tablestatistics.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python + +#**************************************************************************** +#** $Id$ +#** +#** Copyright (C) 1992-1998 Troll Tech AS. All rights reserved. +#** +#** This file is part of an example program for PyQt. This example +#** program may be used, distributed and modified without limitation. +#** +#*****************************************************************************/ + +import sys +import os +from qt import * +from qttable import * + +TRUE = 1 +FALSE = 0 + +# column constants +TB_FILE = 0 +TB_SIZE = 1 +TB_FLAG = 2 +TB_COLS = 3 + +dirs = ( + "kernel", + "tools", + "widgets", + "dialogs", + "xml", + "table", + "network", + "opengl", + "canvas", +) + +class Table(QTable): + def __init__(self): + QTable.__init__(self, 0, TB_COLS) + self.setSorting(TRUE) + self.horizontalHeader().setLabel(TB_FILE, self.tr("File")) + self.horizontalHeader().setLabel(TB_SIZE, self.tr("Size (bytes)")) + self.horizontalHeader().setLabel(TB_FLAG, self.tr("Use in Sum")) + self.initTable() + self.adjustColumn(TB_FILE) + + # if the user edited something we might need to recalculate the sum + self.connect(self, SIGNAL("valueChanged(int, int)"), self.recalcSum) + + def initTable(self): + # read all the Qt source and header files into a list + all = [] + qtdir = os.getenv("QTDIR") + for i in dirs: + dir = QDir(os.path.join(qtdir, "src", i)) + lst = QStringList(dir.entryList("*.cpp; *.h")) + for f in lst: + if f.contains("moc"): + continue + all.append(os.path.join(i, str(f))) + + # set the number of rows we'll need for the table + self.setNumRows(len(all) + 1) + + i = 0 + sum = 0L + # insert the data into the table + for it in all: + self.setText(i, TB_FILE, it) + f = QFile(os.path.join(qtdir, "src", str(it))) + self.setText(i, TB_SIZE, str(f.size())) + ci = ComboItem(self, QTableItem.WhenCurrent) + self.setItem(i, TB_FLAG, ci) + i = i + 1 + sum += f.size() + self.displaySum(sum) + + def recalcSum(self, dummy, col): + # only recalc if a value in the second or third column changed + if col < TB_SIZE or col > TB_FLAG: + return + + sum = 0L + for i in range(self.numRows()-1): + if str(self.text(i, TB_FLAG)) == "No": + continue + sum += long(str(self.text(i, TB_SIZE))) + self.displaySum(sum) + + def displaySum(self, sum): + # insert calculated data + i1 = TableItem(self, QTableItem.Never, self.tr("Sum")) + self.setItem(self.numRows()-1, TB_FILE, i1) + i2 = TableItem(self, QTableItem.Never, str(sum)) + self.setItem(self.numRows()-1, TB_SIZE, i2) + + def sortColumn(self, col, ascending, wholeRows): + # sum row should not be sorted, so get rid of it for now + self.clearCell(self.numRows()-1, TB_FILE) + self.clearCell(self.numRows()-1, TB_SIZE) + # do sort + QTable.sortColumn(self, col, ascending, TRUE) + # re-insert sum row + self.recalcSum(0, TB_SIZE) + + +class TableItem(QTableItem): + def __init__(self, *args): + apply(QTableItem.__init__, (self,) + args) + + def paint(self, p, cg, cr, selected): + g = QColorGroup(cg) + # last row is the sum row - we want to make it more visible by + # using a red background + if self.row() == self.table().numRows()-1: + g.setColor(QColorGroup.Base, QColor("red")) + QTableItem.paint(self, p, g, cr, selected) + + +class ComboItem(QTableItem): + def __init__(self, t, et): + QTableItem.__init__(self, t, et, "Yes") + self.cb = None + # we do not want this item to be replaced + self.setReplaceable(FALSE) + + def createEditor(self): + # create an editor - a combobox in our case + self.cb = QComboBox(self.table().viewport()) + QObject.connect(self.cb, SIGNAL("activated(int)"), + self.table(), SLOT("doValueChanged()")) + self.cb.insertItem("Yes") + self.cb.insertItem("No") + # and initialize it + if str(self.text()) == "No": + self.cb.setCurrentItem(1) + else: + self.cb.setCurrentItem(0) + return self.cb + + def setContentFromEditor(self, w): + # the user changed the value of the combobox, so synchronize the + # value of the item (its text), with the value of the combobox + if w.inherits("QComboBox"): + self.setText(w.currentText()) + else: + QTableItem.setContentFromEditor(self, w) + + def setText(self, s): + # initialize the combobox from the text + if self.cb: + if str(s) == "No": + self.cb.setCurrentItem(1) + else: + self.cb.setCurrentItem(0) + QTableItem.setText(self, s) + + +if __name__ == '__main__': + app = QApplication(sys.argv) + + t = Table() + t.setCaption("Statistics") + t.show() + app.setMainWidget(t) + app.exec_loop() diff --git a/python/pyqt/examples3/tooltip.py b/python/pyqt/examples3/tooltip.py new file mode 100755 index 00000000..69de776c --- /dev/null +++ b/python/pyqt/examples3/tooltip.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +"""************************************************************************** +** $Id$ +** +** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. +** +** This file is part of an example program for Qt. This example +** program may be used, distributed and modified without limitation. +** +***************************************************************************""" + +import sys +from qt import * +from random import random + +class DynamicTip( QToolTip ): + def __init__( self, parent ): + QToolTip.__init__( self, parent ) + + def maybeTip( self, pos ): + #if not self.parent.inherits( "TellMe" ): + if QToolTip(self).parentWidget().inherits( "TellMe" ) : + return + r = QRect( QToolTip(self).parentWidget().tip(pos) ) + if not r.isValid(): + return + + s = QString( "position: %d,%d" % (r.center().x(), r.center().y()) ) + QToolTip(self).tip( r, s ) + + +class TellMe( QWidget ): + def __init__( self, parent=None, name=None ): + QWidget.__init__( self, parent, name ) + + self.setMinimumSize( 30, 30 ) + self.r1 = self.randomRect() + self.r2 = self.randomRect() + self.r3 = self.randomRect() + + self.t = DynamicTip( self ) + + QToolTip.add( self, self.r3, "this color is called red" ) # <- helpful + + def paintEvent( self, e ): + + p = QPainter( self ) + + # I try to be efficient here, and repaint only what's needed + if e.rect().intersects( self.r1 ): + p.setBrush( Qt.blue ) + p.drawRect( self.r1 ) + + if e.rect().intersects( self.r2 ): + p.setBrush( Qt.blue ) + p.drawRect( self.r2 ) + + if e.rect().intersects( self.r3 ): + p.setBrush( Qt.red ) + p.drawRect( self.r3 ) + + def mousePressEvent( self, e ): + + if self.r1.contains( e.pos() ): + self.r1 = self.randomRect() + if self.r2.contains( e.pos() ): + self.r2 = self.randomRect() + self.repaint() + + def resizeEvent( self, e ): + + if not self.rect().contains( self.r1 ): + self.r1 = self.randomRect() + if not self.rect().contains( self.r2 ): + self.r2 = self.randomRect() + + def randomRect( self ): + return QRect( random() * (self.width() - 20), random() * (self.height() - 20), 20, 20 ) + + def tip( self, p ): + + if self.r1.contains( p ): + return self.r1 + elif self.r2.contains( p ): + return self.r2 + else: + return QRect( 0,0, -1,-1 ) + + def __del__( self ): + del self.t + self.t = None + +def main( args ): + a = QApplication( args ) + + mw = TellMe() + mw.setCaption( "Qt Example - Dynamic Tool Tips" ) + a.setMainWidget( mw ) + mw.show() + + a.exec_loop() + +if __name__=="__main__": + main(sys.argv) diff --git a/python/pyqt/examples3/trolltech.bmp b/python/pyqt/examples3/trolltech.bmp Binary files differnew file mode 100644 index 00000000..220861e2 --- /dev/null +++ b/python/pyqt/examples3/trolltech.bmp diff --git a/python/pyqt/examples3/trolltech.gif b/python/pyqt/examples3/trolltech.gif Binary files differnew file mode 100644 index 00000000..f674369e --- /dev/null +++ b/python/pyqt/examples3/trolltech.gif diff --git a/python/pyqt/examples3/tt-logo.png b/python/pyqt/examples3/tt-logo.png Binary files differnew file mode 100644 index 00000000..a0d9e340 --- /dev/null +++ b/python/pyqt/examples3/tt-logo.png diff --git a/python/pyqt/examples3/tut1.py b/python/pyqt/examples3/tut1.py new file mode 100755 index 00000000..982e984c --- /dev/null +++ b/python/pyqt/examples3/tut1.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +# Qt 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()) diff --git a/python/pyqt/examples3/tut10.py b/python/pyqt/examples3/tut10.py new file mode 100755 index 00000000..182d04df --- /dev/null +++ b/python/pyqt/examples3/tut10.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python + +# Qt tutorial 10. + +import sys +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + self.slider.setRange(minVal, maxVal) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.f = 0 + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(), 0) + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def force(self): + return self.f + + def setForce(self, newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + + def paintEvent(self, ev): + if not ev.rect().intersects(self.cannonRect()): + return + + cr = self.cannonRect() + pix = qt.QPixmap(cr.size()) + pix.fill(self, cr.topLeft()) + + p = qt.QPainter(pix) + + p.setBrush(qt.Qt.blue) + p.setPen(qt.Qt.NoPen) + + p.translate(0, pix.height() - 1) + p.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + p.rotate(-self.ang) + p.drawRect(qt.QRect(33, -4, 15, 8)) + p.end() + + p.begin(self) + p.drawPixmap(cr.topLeft(), pix) + + def cannonRect(self): + r = qt.QRect(0, 0, 50, 50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange(self, "angle") + self.angle.setRange(5, 70) + + self.force = LCDRange(self, "force") + self.force.setRange(10, 50) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + + grid = qt.QGridLayout(self, 2, 2, 10) + + grid.addWidget(quit, 0, 0) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + leftBox = qt.QVBoxLayout() + + grid.addLayout(leftBox, 1, 0) + + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 500, 355) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut11.py b/python/pyqt/examples3/tut11.py new file mode 100755 index 00000000..95d50663 --- /dev/null +++ b/python/pyqt/examples3/tut11.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python + +# Qt tutorial 11. + +import sys +import math +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + self.slider.setRange(minVal, maxVal) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = qt.QTimer(self, "movement handler") + self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + self.barrelRect = qt.QRect(33, -4, 15, 8) + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(), 0) + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def force(self): + return self.f + + def setForce(self, newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + + def shoot(self): + if self.autoShootTimer.isActive(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + + def moveShot(self): + r = qt.QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + else: + r = r.unite(qt.QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self, ev): + updateR = ev.rect() + p = qt.QPainter(self) + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.autoShootTimer.isActive() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + def paintShot(self, p): + p.setBrush(qt.Qt.black) + p.setPen(qt.Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintCannon(self, p): + cr = self.cannonRect() + pix = qt.QPixmap(cr.size()) + pix.fill(self, cr.topLeft()) + + tmp = qt.QPainter(pix) + tmp.setBrush(qt.Qt.blue) + tmp.setPen(qt.Qt.NoPen) + + tmp.translate(0, pix.height() - 1) + tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(), pix) + + def cannonRect(self): + r = qt.QRect(0, 0, 50, 50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = qt.QRect(0, 0, 6, 6) + r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + return r + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange(self, "angle") + self.angle.setRange(5, 70) + + self.force = LCDRange(self, "force") + self.force.setRange(10, 50) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + + shoot = qt.QPushButton("&Shoot", self, "shoot") + shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) + + grid = qt.QGridLayout(self, 2, 2, 10) + + grid.addWidget(quit, 0, 0) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + leftBox = qt.QVBoxLayout() + grid.addLayout(leftBox, 1, 0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = qt.QHBoxLayout() + grid.addLayout(topBox, 0, 1) + topBox.addWidget(shoot) + topBox.addStretch(1) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 500, 355) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut12.py b/python/pyqt/examples3/tut12.py new file mode 100755 index 00000000..818afd39 --- /dev/null +++ b/python/pyqt/examples3/tut12.py @@ -0,0 +1,253 @@ +#!/usr/bin/env python + +# Qt tutorial 12. + +import sys +import math +import random +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, s=None, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + + self.label = qt.QLabel(" ", self, "label") + self.label.setAlignment(qt.Qt.AlignCenter) + + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + + self.slider.setRange(minVal, maxVal) + + def text(self): + return self.label.text() + + def setText(self, s): + self.label.setText(s) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = qt.QTimer(self, "movement handler") + self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = qt.QPoint(0, 0) + + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + self.barrelRect = qt.QRect(33, -4, 15, 8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(), 0) + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def force(self): + return self.f + + def setForce(self, newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + + def shoot(self): + if self.autoShootTimer.isActive(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + + def newTarget(self): + r = qt.QRegion(self.targetRect()) + self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.QRegion(self.targetRect()))) + + def moveShot(self): + r = qt.QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("hit()"), ()) + elif shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("missed()"), ()) + else: + r = r.unite(qt.QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self, ev): + updateR = ev.rect() + p = qt.QPainter(self) + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.autoShootTimer.isActive() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self, p): + p.setBrush(qt.Qt.black) + p.setPen(qt.Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self, p): + p.setBrush(qt.Qt.red) + p.setPen(qt.Qt.black) + p.drawRect(self.targetRect()) + + def paintCannon(self, p): + cr = self.cannonRect() + pix = qt.QPixmap(cr.size()) + pix.fill(self, cr.topLeft()) + + tmp = qt.QPainter(pix) + tmp.setBrush(qt.Qt.blue) + tmp.setPen(qt.Qt.NoPen) + + tmp.translate(0, pix.height() - 1) + tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(), pix) + + def cannonRect(self): + r = qt.QRect(0, 0, 50, 50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = qt.QRect(0, 0, 6, 6) + r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + return r + + def targetRect(self): + r = qt.QRect(0, 0, 20, 10) + r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + return r + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange("ANGLE", self, "angle") + self.angle.setRange(5, 70) + + self.force = LCDRange("FORCE", self, "force") + self.force.setRange(10, 50) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + + shoot = qt.QPushButton("&Shoot", self, "shoot") + shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(shoot, qt.SIGNAL("clicked()"), self.cannonField.shoot) + + grid = qt.QGridLayout(self, 2, 2, 10) + + grid.addWidget(quit, 0, 0) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + leftBox = qt.QVBoxLayout() + grid.addLayout(leftBox, 1, 0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = qt.QHBoxLayout() + grid.addLayout(topBox, 0, 1) + topBox.addWidget(shoot) + topBox.addStretch(1) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 500, 355) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut13.py b/python/pyqt/examples3/tut13.py new file mode 100755 index 00000000..a973ea70 --- /dev/null +++ b/python/pyqt/examples3/tut13.py @@ -0,0 +1,330 @@ +#!/usr/bin/env python + +# Qt tutorial 13. + +import sys +import math +import random +import qt + + +class LCDRange(qt.QWidget): + def __init__(self, s=None, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + + self.label = qt.QLabel(" ", self, "label") + self.label.setAlignment(qt.Qt.AlignCenter) + + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + l = qt.QVBoxLayout(self) + l.addWidget(lcd, 1) + l.addWidget(self.slider) + l.addWidget(self.label) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + + self.slider.setRange(minVal, maxVal) + + def text(self): + return self.label.text() + + def setText(self, s): + self.label.setText(s) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = qt.QTimer(self, "movement handler") + self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = qt.QPoint(0, 0) + self.gameEnded = 0 + + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + self.barrelRect = qt.QRect(33, -4, 15, 8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(), 0) + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def force(self): + return self.f + + def setForce(self, newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + + def shoot(self): + if self.isShooting(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) + + def newTarget(self): + r = qt.QRegion(self.targetRect()) + self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.QRegion(self.targetRect()))) + + def gameOver(self): + return self.gameEnded + + def setGameOver(self): + if self.gameEnded: + return + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 1 + self.repaint() + + def restartGame(self): + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 0 + self.repaint() + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + + def moveShot(self): + r = qt.QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("hit()"), ()) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + elif shotR.x() > self.width() or shotR.y() > self.height(): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("missed()"), ()) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + else: + r = r.unite(qt.QRegion(shotR)) + + self.repaint(r) + + def paintEvent(self, ev): + updateR = ev.rect() + p = qt.QPainter(self) + + if self.gameEnded: + p.setPen(qt.Qt.black) + p.setFont(qt.QFont("Courier", 48, qt.QFont.Bold)) + p.drawText(self.rect(), qt.Qt.AlignCenter, "Game Over") + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if self.isShooting() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if not self.gameEnded and updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self, p): + p.setBrush(qt.Qt.black) + p.setPen(qt.Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self, p): + p.setBrush(qt.Qt.red) + p.setPen(qt.Qt.black) + p.drawRect(self.targetRect()) + + def paintCannon(self, p): + cr = self.cannonRect() + pix = qt.QPixmap(cr.size()) + pix.fill(self, cr.topLeft()) + + tmp = qt.QPainter(pix) + tmp.setBrush(qt.Qt.blue) + tmp.setPen(qt.Qt.NoPen) + + tmp.translate(0, pix.height() - 1) + tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(), pix) + + def cannonRect(self): + r = qt.QRect(0, 0, 50, 50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * 3.14159265 / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = qt.QRect(0, 0, 6, 6) + r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + return r + + def targetRect(self): + r = qt.QRect(0, 0, 20, 10) + r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + return r + + def isShooting(self): + return self.autoShootTimer.isActive() + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class GameBoard(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange("ANGLE", self, "angle") + self.angle.setRange(5, 70) + + self.force = LCDRange("FORCE", self, "force") + self.force.setRange(10, 50) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + + self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) + self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) + + self.shoot = qt.QPushButton("&Shoot", self, "shoot") + self.shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) + self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) + + restart = qt.QPushButton("&New Game", self, "newgame") + restart.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) + + self.hits = qt.QLCDNumber(2, self, "hits") + self.shotsLeft = qt.QLCDNumber(2, self, "shotsleft") + hitsL = qt.QLabel("HITS", self, "hitsLabel") + shotsLeftL = qt.QLabel("SHOTS LEFT", self, "shotsleftLabel") + + grid = qt.QGridLayout(self, 2, 2, 10) + grid.addWidget(quit, 0, 0) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + leftBox = qt.QVBoxLayout() + grid.addLayout(leftBox, 1, 0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = qt.QHBoxLayout() + grid.addLayout(topBox, 0, 1) + topBox.addWidget(self.shoot) + topBox.addWidget(self.hits) + topBox.addWidget(hitsL) + topBox.addWidget(self.shotsLeft) + topBox.addWidget(shotsLeftL) + topBox.addStretch(1) + topBox.addWidget(restart) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + self.newGame() + + def fire(self): + if self.cannonField.gameOver() or self.cannonField.isShooting(): + return + self.shotsLeft.display(self.shotsLeft.intValue() - 1) + self.cannonField.shoot() + + def hit(self): + self.hits.display(self.hits.intValue() + 1) + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + else: + self.cannonField.newTarget() + + def missed(self): + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + + def newGame(self): + self.shotsLeft.display(15) + self.hits.display(0) + self.cannonField.restartGame() + self.cannonField.newTarget() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +gb = GameBoard() +gb.setGeometry(100, 100, 500, 355) +a.setMainWidget(gb) +gb.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut14.py b/python/pyqt/examples3/tut14.py new file mode 100755 index 00000000..f046757d --- /dev/null +++ b/python/pyqt/examples3/tut14.py @@ -0,0 +1,378 @@ +#!/usr/bin/env python + +# Qt tutorial 14. + +import sys +import math +import random +import qt + + +class LCDRange(qt.QWidget): + def __init__(self, s=None, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + + self.label = qt.QLabel(" ", self, "label") + self.label.setAlignment(qt.Qt.AlignCenter) + + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + l = qt.QVBoxLayout(self) + l.addWidget(lcd, 1) + l.addWidget(self.slider) + l.addWidget(self.label) + + if s is not None: + self.setText(s) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + + self.slider.setRange(minVal, maxVal) + + def text(self): + return self.label.text() + + def setText(self, s): + self.label.setText(s) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.f = 0 + self.timerCount = 0 + + self.autoShootTimer = qt.QTimer(self, "movement handler") + self.connect(self.autoShootTimer, qt.SIGNAL("timeout()"), self.moveShot) + + self.shoot_ang = 0 + self.shoot_f = 0 + self.target = qt.QPoint(0, 0) + self.gameEnded = 0 + self.barrelPressed = 0 + + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + self.barrelRect = qt.QRect(33, -4, 15, 8) + + self.newTarget() + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint(self.cannonRect(), 0) + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def force(self): + return self.f + + def setForce(self, newton): + if newton < 0: + newton = 0 + if self.f == newton: + return + self.f = newton + self.emit(qt.PYSIGNAL("forceChanged(int)"), (self.f, )) + + def shoot(self): + if self.isShooting(): + return + + self.timerCount = 0 + self.shoot_ang = self.ang + self.shoot_f = self.f + self.autoShootTimer.start(50) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (0, )) + + def newTarget(self): + r = qt.QRegion(self.targetRect()) + self.target = qt.QPoint(random.randint(200, 390), random.randint(10, 265)) + self.repaint(r.unite(qt.QRegion(self.targetRect()))) + + def gameOver(self): + return self.gameEnded + + def setGameOver(self): + if self.gameEnded: + return + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 1 + self.repaint() + + def restartGame(self): + if self.isShooting(): + self.autoShootTime.stop() + self.gameEnded = 0 + self.repaint() + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + + def moveShot(self): + r = qt.QRegion(self.shotRect()) + self.timerCount = self.timerCount + 1 + + shotR = self.shotRect() + + if shotR.intersects(self.targetRect()): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("hit()"), ()) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + elif shotR.x() > self.width() or shotR.y() > self.height() or shotR.intersects(self.barrierRect()): + self.autoShootTimer.stop() + self.emit(qt.PYSIGNAL("missed()"), ()) + self.emit(qt.PYSIGNAL("canShoot(bool)"), (1, )) + else: + r = r.unite(qt.QRegion(shotR)) + + self.repaint(r) + + def mousePressEvent(self, ev): + if ev.button() != qt.Qt.LeftButton: + return + if self.barrelHit(ev.pos()): + self.barrelPressed = 1 + + def mouseMoveEvent(self, ev): + if not self.barrelPressed: + return + pnt = ev.pos() + if pnt.x() <= 0: + pnt.setX(1) + if pnt.y() >= self.height(): + pnt.setY(self.height() - 1) + rad = math.atan(float(self.rect().bottom() - pnt.y()) / pnt.x()) + self.setAngle(int(round(rad * 180 / math.pi))) + + def mouseReleaseEvent(self, ev): + if ev.button() == qt.Qt.LeftButton: + self.barrelPressed = 0 + + def paintEvent(self, ev): + updateR = ev.rect() + p = qt.QPainter(self) + + if self.gameEnded: + p.setPen(qt.Qt.black) + p.setFont(qt.QFont("Courier", 48, qt.QFont.Bold)) + p.drawText(self.rect(), qt.Qt.AlignCenter, "Game Over") + + if updateR.intersects(self.cannonRect()): + self.paintCannon(p) + + if updateR.intersects(self.barrierRect()): + self.paintBarrier(p) + + if self.isShooting() and updateR.intersects(self.shotRect()): + self.paintShot(p) + + if not self.gameEnded and updateR.intersects(self.targetRect()): + self.paintTarget(p) + + def paintShot(self, p): + p.setBrush(qt.Qt.black) + p.setPen(qt.Qt.NoPen) + p.drawRect(self.shotRect()) + + def paintTarget(self, p): + p.setBrush(qt.Qt.red) + p.setPen(qt.Qt.black) + p.drawRect(self.targetRect()) + + def paintBarrier(self, p): + p.setBrush(qt.Qt.yellow) + p.setPen(qt.Qt.black) + p.drawRect(self.barrierRect()) + + def paintCannon(self, p): + cr = self.cannonRect() + pix = qt.QPixmap(cr.size()) + pix.fill(self, cr.topLeft()) + + tmp = qt.QPainter(pix) + tmp.setBrush(qt.Qt.blue) + tmp.setPen(qt.Qt.NoPen) + + tmp.translate(0, pix.height() - 1) + tmp.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + tmp.rotate(-self.ang) + tmp.drawRect(self.barrelRect) + tmp.end() + + p.drawPixmap(cr.topLeft(), pix) + + def cannonRect(self): + r = qt.QRect(0, 0, 50, 50) + r.moveBottomLeft(self.rect().bottomLeft()) + return r + + def shotRect(self): + gravity = 4.0 + + time = self.timerCount / 4.0 + velocity = self.shoot_f + radians = self.shoot_ang * math.pi / 180 + + velx = velocity * math.cos(radians) + vely = velocity * math.sin(radians) + x0 = (self.barrelRect.right() + 5) * math.cos(radians) + y0 = (self.barrelRect.right() + 5) * math.sin(radians) + x = x0 + velx * time + y = y0 + vely * time - 0.5 * gravity * time * time + + r = qt.QRect(0, 0, 6, 6) + r.moveCenter(qt.QPoint(x, self.height() - 1 - y)) + return r + + def targetRect(self): + r = qt.QRect(0, 0, 20, 10) + r.moveCenter(qt.QPoint(self.target.x(), self.height() - 1 - self.target.y())) + return r + + def barrierRect(self): + return qt.QRect(145, self.height() - 100, 15, 100) + + def barrelHit(self, p): + mtx = qt.QWMatrix() + mtx.translate(0, self.height() - 1) + mtx.rotate(-self.ang) + (mtx, invertable) = mtx.invert() + return self.barrelRect.contains(mtx.map(p)) + + def isShooting(self): + return self.autoShootTimer.isActive() + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class GameBoard(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange("ANGLE", self, "angle") + self.angle.setRange(5, 70) + + self.force = LCDRange("FORCE", self, "force") + self.force.setRange(10, 50) + + box = qt.QVBox(self, "cannonFrame") + box.setFrameStyle(qt.QFrame.WinPanel | qt.QFrame.Sunken) + + self.cannonField = CannonField(box, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce) + self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue) + + self.connect(self.cannonField, qt.PYSIGNAL("hit()"), self.hit) + self.connect(self.cannonField, qt.PYSIGNAL("missed()"), self.missed) + + self.shoot = qt.QPushButton("&Shoot", self, "shoot") + self.shoot.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(self.shoot, qt.SIGNAL("clicked()"), self.fire) + self.connect(self.cannonField, qt.PYSIGNAL("canShoot(bool)"), self.shoot, qt.SLOT("setEnabled(bool)")) + + restart = qt.QPushButton("&New Game", self, "newgame") + restart.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(restart, qt.SIGNAL("clicked()"), self.newGame) + + self.hits = qt.QLCDNumber(2, self, "hits") + self.shotsLeft = qt.QLCDNumber(2, self, "shotsleft") + hitsL = qt.QLabel("HITS", self, "hitsLabel") + shotsLeftL = qt.QLabel("SHOTS LEFT", self, "shotsleftLabel") + + accel = qt.QAccel(self) + accel.connectItem(accel.insertItem(qt.Qt.Key_Enter), self.fire) + accel.connectItem(accel.insertItem(qt.Qt.Key_Return), self.fire) + accel.connectItem(accel.insertItem(qt.Qt.CTRL + qt.Qt.Key_Q), qt.qApp, qt.SLOT("quit()")) + + grid = qt.QGridLayout(self, 2, 2, 10) + grid.addWidget(quit, 0, 0) + grid.addWidget(box, 1, 1) + grid.setColStretch(1, 10) + + leftBox = qt.QVBoxLayout() + grid.addLayout(leftBox, 1, 0) + leftBox.addWidget(self.angle) + leftBox.addWidget(self.force) + + topBox = qt.QHBoxLayout() + grid.addLayout(topBox, 0, 1) + topBox.addWidget(self.shoot) + topBox.addWidget(self.hits) + topBox.addWidget(hitsL) + topBox.addWidget(self.shotsLeft) + topBox.addWidget(shotsLeftL) + topBox.addStretch(1) + topBox.addWidget(restart) + + self.angle.setValue(60) + self.force.setValue(25) + self.angle.setFocus() + + self.newGame() + + def fire(self): + if self.cannonField.gameOver() or self.cannonField.isShooting(): + return + self.shotsLeft.display(self.shotsLeft.intValue() - 1) + self.cannonField.shoot() + + def hit(self): + self.hits.display(self.hits.intValue() + 1) + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + else: + self.cannonField.newTarget() + + def missed(self): + if self.shotsLeft.intValue() == 0: + self.cannonField.setGameOver() + + def newGame(self): + self.shotsLeft.display(15) + self.hits.display(0) + self.cannonField.restartGame() + self.cannonField.newTarget() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +gb = GameBoard() +gb.setGeometry(100, 100, 500, 355) +a.setMainWidget(gb) +gb.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut2.py b/python/pyqt/examples3/tut2.py new file mode 100755 index 00000000..8b6a0768 --- /dev/null +++ b/python/pyqt/examples3/tut2.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# Qt tutorial 2. + +import sys +import qt + + +a = qt.QApplication(sys.argv) + +quit = qt.QPushButton("Quit", None) +quit.resize(75, 30) +quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + +qt.QObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) + +a.setMainWidget(quit) +quit.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut3.py b/python/pyqt/examples3/tut3.py new file mode 100755 index 00000000..9b739548 --- /dev/null +++ b/python/pyqt/examples3/tut3.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +# Qt tutorial 3. + +import sys +import qt + + +a = qt.QApplication(sys.argv) + +box = qt.QVBox() +box.resize(200, 120) + +quit = qt.QPushButton("Quit", box) +quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + +qt.QObject.connect(quit, qt.SIGNAL("clicked()"), a, qt.SLOT("quit()")) + +a.setMainWidget(box) +box.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut4.py b/python/pyqt/examples3/tut4.py new file mode 100755 index 00000000..9ad05c7d --- /dev/null +++ b/python/pyqt/examples3/tut4.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Qt tutorial 4. + +import sys +import qt + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.setMinimumSize(200, 120) + self.setMaximumSize(200, 120) + + quit = qt.QPushButton("Quit", self, "quit") + quit.setGeometry(62, 40, 75, 30) + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 200, 120) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut5.py b/python/pyqt/examples3/tut5.py new file mode 100755 index 00000000..88a24475 --- /dev/null +++ b/python/pyqt/examples3/tut5.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +# Qt tutorial 5. + +import sys +import qt + + +class MyWidget(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + quit = qt.QPushButton("Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + lcd = qt.QLCDNumber(2, self, "lcd") + + slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + slider.setRange(0, 99) + slider.setValue(0) + + self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + + +a = qt.QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut6.py b/python/pyqt/examples3/tut6.py new file mode 100755 index 00000000..785edfe4 --- /dev/null +++ b/python/pyqt/examples3/tut6.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python + +# Qt tutorial 6. + +import sys +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + slider.setRange(0, 99) + slider.setValue(0) + self.connect(slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + + +class MyWidget(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + quit = qt.QPushButton("Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + grid = qt.QGrid(4, self) + + for c in range(4): + for r in range(4): + LCDRange(grid) + + +a = qt.QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut7.py b/python/pyqt/examples3/tut7.py new file mode 100755 index 00000000..400505ea --- /dev/null +++ b/python/pyqt/examples3/tut7.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +# Qt tutorial 7. + +import sys +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + +class MyWidget(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + quit = qt.QPushButton("Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + grid = qt.QGrid(4, self) + + self.lcdlist = [] + previous = None + + for r in range(4): + for c in range(4): + lr = LCDRange(grid) + + if previous: + self.connect(lr, qt.PYSIGNAL("valueChanged(int)"), previous.setValue) + + previous = lr + self.lcdlist.append(lr) + + +a = qt.QApplication(sys.argv) + +w = MyWidget() +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut8.py b/python/pyqt/examples3/tut8.py new file mode 100755 index 00000000..f7dd1567 --- /dev/null +++ b/python/pyqt/examples3/tut8.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python + +# Qt tutorial 8. + +import sys +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + + self.slider.setRange(minVal, maxVal) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint() + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def paintEvent(self, ev): + p = qt.QPainter(self) + p.drawText(200, 200, "Angle = %d" % (self.ang)) + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange(self, "angle") + self.angle.setRange(5, 70) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + grid = qt.QGridLayout(self, 2, 2, 10) + + grid.addWidget(quit, 0, 0) + grid.addWidget(self.angle, 1, 0, qt.Qt.AlignTop) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + self.angle.setValue(60) + self.angle.setFocus() + + +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 500, 355) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/tut9.py b/python/pyqt/examples3/tut9.py new file mode 100755 index 00000000..aba7ddc1 --- /dev/null +++ b/python/pyqt/examples3/tut9.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python + +# Qt tutorial 9. + +import sys +import qt + + +class LCDRange(qt.QVBox): + def __init__(self, parent=None, name=None): + qt.QVBox.__init__(self, parent, name) + + lcd = qt.QLCDNumber(2, self, "lcd") + self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider") + self.slider.setRange(0, 99) + self.slider.setValue(0) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)")) + self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), self, qt.PYSIGNAL("valueChanged(int)")) + + self.setFocusProxy(self.slider) + + def value(self): + return self.slider.value() + + def setValue(self, value): + self.slider.setValue(value) + + def setRange(self, minVal, maxVal): + if minVal < 0 or maxVal > 99 or minVal > maxVal: + raise ValueError, "LCDRange.setRange(): invalid range" + self.slider.setRange(minVal, maxVal) + + +class CannonField(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + self.ang = 45 + self.setPalette(qt.QPalette(qt.QColor(250, 250, 200))) + + def angle(self): + return self.ang + + def setAngle(self, degrees): + if degrees < 5: + degrees = 5 + if degrees > 70: + degrees = 70 + if self.ang == degrees: + return + self.ang = degrees + self.repaint() + self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, )) + + def paintEvent(self, ev): + p = qt.QPainter(self) + + p.setBrush(qt.Qt.blue) + p.setPen(qt.Qt.NoPen) + + p.translate(0, self.rect().bottom()) + p.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16) + p.rotate(-self.ang) + p.drawRect(qt.QRect(33, -4, 15, 8)) + + def sizePolicy(self): + return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding) + + +class MyWidget(qt.QWidget): + def __init__(self, parent=None, name=None): + qt.QWidget.__init__(self, parent, name) + + quit = qt.QPushButton("&Quit", self, "quit") + quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold)) + self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()")) + + self.angle = LCDRange(self, "angle") + self.angle.setRange(5, 70) + + self.cannonField = CannonField(self, "cannonField") + + self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle) + self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue) + + grid = qt.QGridLayout(self, 2, 2, 10) + + grid.addWidget(quit, 0, 0) + grid.addWidget(self.angle, 1, 0, qt.Qt.AlignTop) + grid.addWidget(self.cannonField, 1, 1) + grid.setColStretch(1, 10) + + self.angle.setValue(60) + self.angle.setFocus() + + +qt.QApplication.setColorSpec(qt.QApplication.CustomColor) +a = qt.QApplication(sys.argv) + +w = MyWidget() +w.setGeometry(100, 100, 500, 355) +a.setMainWidget(w) +w.show() +sys.exit(a.exec_loop()) diff --git a/python/pyqt/examples3/webbrowser/mainwindow.py b/python/pyqt/examples3/webbrowser/mainwindow.py new file mode 100644 index 00000000..6afdfc8b --- /dev/null +++ b/python/pyqt/examples3/webbrowser/mainwindow.py @@ -0,0 +1,1097 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'mainwindow.ui' +# +# Created: Sun Dec 5 14:50:47 2004 +# by: The PyQt User Interface Compiler (pyuic) snapshot-20041203 +# +# WARNING! All changes made in this file will be lost! + + +from qt import * +from qtaxcontainer import QAxWidget + +image0_data = [ +"32 32 3 1", +". c None", +"a c #000080", +"# c #808080", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +".......#aaaaaaaaa...............", +"......#aaaaaaaaaaa.........a....", +".....#aaa.......aaa.......aa....", +"....#aaa.........aaaa....aaa....", +"....aaa...........aaaa..aaaa....", +"....aa..............aaaaaaaa....", +"....aa...............aaaaaaa....", +"....aa...............aaaaaaa....", +"....aa..............aaaaaaaa....", +"....aa.............aaaaaaaaa....", +"....#aa...........aaaaaaaaaa....", +".....#aa.........aaaaaaaaaaa....", +"......aa#.......................", +".......aa#......................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................" +] +image1_data = [ +"32 32 142 2", +"Qt c None", +"#O c #0010f7", +"#P c #0021ef", +"#R c #0021f7", +"#S c #0021ff", +"#T c #0029ff", +"ah c #0031ff", +"#N c #0829f7", +"#x c #0831ff", +"#C c #0839ff", +"#E c #1029e7", +"#r c #1039ff", +"#o c #1042ff", +"#Q c #1831de", +"ak c #1831e7", +"#k c #1842ff", +"#H c #184aff", +"aj c #2139e7", +"#s c #2142de", +"#G c #214aff", +".9 c #2152ff", +"#2 c #2939c6", +"ag c #2939d6", +"a# c #2942ce", +"#p c #2942de", +"#U c #2952ff", +"ae c #295aff", +"#y c #3152de", +".2 c #3152e7", +"#I c #315aff", +"#z c #3163ff", +"#1 c #394abd", +"#L c #394ade", +"#B c #3963ff", +"#w c #396bff", +"#V c #4252d6", +"#l c #4252de", +"#W c #4263ef", +"#q c #426bff", +".1 c #4273ff", +"#5 c #4a5ad6", +"#J c #4a73ff", +"#K c #4a7bff", +"ac c #4a84ff", +"ab c #5263c6", +".T c #5263ce", +".M c #5273d6", +".c c #5273e7", +".U c #527bde", +"#t c #527bf7", +"#A c #5284ff", +"#X c #5a63ad", +".V c #5a84ef", +"#F c #5a84ff", +"#v c #5a8cff", +"ad c #636bbd", +".e c #637bc6", +".W c #637bce", +".3 c #637bd6", +".Q c #6384de", +".5 c #638cef", +"#b c #638cff", +"#j c #6394ff", +"af c #6b73bd", +"#0 c #6b73c6", +".S c #6b84ce", +"#u c #6b94ff", +".C c #6b9cff", +"ai c #737bce", +".z c #7384b5", +".j c #7384c6", +"#6 c #738cce", +".4 c #738cd6", +".b c #739ce7", +".I c #73a5ff", +"#n c #73adff", +"#Z c #7b84b5", +".R c #7b8cbd", +".J c #7b94bd", +".n c #7ba5e7", +".P c #7badff", +"#c c #7bb5ff", +"#M c #84849c", +"#3 c #8484ad", +".i c #848cc6", +"al c #8494bd", +"aa c #849cc6", +".y c #84adff", +".O c #84b5ff", +"#a c #84bdff", +".t c #8c94ad", +".a c #8c94b5", +".D c #8c9cbd", +".m c #8c9cce", +".A c #8ca5ef", +".f c #8cadf7", +".H c #8cbdff", +"#D c #9494a5", +"#8 c #9494bd", +"#9 c #9494c6", +"a. c #949cbd", +".r c #94c6ff", +"#d c #94ceff", +"#4 c #9ca5ad", +"#7 c #9ca5b5", +".u c #9cbdf7", +".6 c #9cc6ff", +".0 c #9cceff", +".x c #9cd6ff", +".L c #a5a5b5", +"#Y c #a5a5bd", +"#e c #a5ceff", +"## c #a5d6ff", +".X c #adadb5", +".k c #adc6ff", +"#i c #add6ff", +".E c #b5b5b5", +".d c #b5b5bd", +".K c #b5bdc6", +".F c #b5ceff", +".N c #b5d6ff", +".B c #b5deff", +".s c #bdbdbd", +".# c #bdbdc6", +"#. c #bdd6ff", +".G c #bde7ff", +"#h c #c6e7ff", +"#f c #c6efff", +".w c #c6f7ff", +".h c #ced6ff", +".Y c #cee7ff", +".q c #ceefff", +".Z c #cef7ff", +".l c #d6efff", +".8 c #d6f7ff", +".o c #deefff", +".7 c #def7ff", +"#m c #deffff", +"#g c #e7ffff", +".v c #efffff", +".p c #f7ffff", +".g c #ffffff", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQt.#.a.b.c.aQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQt.d.e.f.g.h.iQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.d.j.k.g.g.l.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQt.a.n.o.g.p.q.r.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQt.s.t.u.g.g.v.w.x.y.mQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQt.z.A.g.g.v.B.x.r.C.DQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQt.E.a.F.g.g.v.G.r.H.H.I.JQtQtQtQtQtQtQtQtQtQt.s.s.K.K.KQtQt", +"QtQt.L.M.N.g.g.q.x.H.O.y.P.P.Q.LQtQtQt.s.s.K.a.R.S.T.U.V.V.Q.W.X", +"Qt.#.Q.Y.g.g.Z.0.O.y.P.P.P.P.1.2.3.4.S.e.c.5.f.6.N.l.7.8.Z.0.9.T", +".s.W#..g.p.Z###a.O.P.P.I.I.P#b#c#d#e.B#f#g.7.8.8.q#h#i.r.H#j#k#l", +".e#e.g#m.G#d.O.y.P.I.I.I.I.I.I.H.6####.0.r.H#a.O#c.I#n.I#j.1#o#p", +".5.p#f.x.0.O.y.P.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.I.C.C.C#b#q#r#s", +"#t##.r.H.O#c.P.I.I.I.I.I.I.C.I.C.C.I.C.I.C.C.C.C#u.C#j#j#v#w#x#p", +"#y#z#j.I.I.P.I.I.C.C.C.I.I.C.C#j#b#v#v#b#j#j#j#b#j#v#b#v#A#B#C#p", +"#D#E#k#q#A#j.C.I.C.I.C.C.C.I#F#G#k#k#H#G#I#B.1.1#J#K#K.1#q#z#x#L", +".s#M#N#r#z#K#b#u.C#u.C.C.I.I#B#O#P#Q#E#P#R#S#T#x#r#r#H.9#U#G#T#V", +"QtQt.z#N#r#I.1#v#j#u#j.C#u.I#W#X#D.s#Y#D#Z#0#1#2#Q#P#P#N#N#T#E#3", +"QtQt.s#4#5#x#H#B#K#v#j#j#j#j#6QtQtQtQtQtQtQt.s.s.d.X#7#8#9a..X.s", +"QtQtQtQt.da##S#k#z#J#v#b#j#vaaQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQt.Eab#x#o#I#K#v#vac.iQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQt.sad#E#rae#q#K#wafQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQt.#.Lagah#k#U#kafQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQt#4#Q#T#xahaiQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQt#4adajakalQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +] +image2_data = [ +"32 32 142 2", +"Qt c None", +"#Y c #0018e7", +"aa c #0018ef", +"#E c #0018ff", +"#Q c #0021ef", +"#K c #0021ff", +"a# c #0029ff", +"a. c #0829ff", +"#P c #0831ff", +"#4 c #1021d6", +"#R c #1021de", +"#L c #1029d6", +"#V c #1029e7", +"#n c #1039f7", +"#W c #1039ff", +"#O c #1042ff", +"ah c #1831ce", +"#y c #1842ff", +"aj c #2131c6", +"#S c #2131ce", +"#z c #2139de", +".0 c #2142de", +"ai c #2142e7", +".t c #214aef", +"#D c #214aff", +".x c #2152ff", +"al c #2939de", +"#d c #294ae7", +"#I c #2952ff", +"#J c #295aff", +"#T c #3142bd", +"#N c #315aff", +"#s c #3163ff", +"#F c #394ac6", +"#G c #3952d6", +"ag c #395ae7", +".B c #3963f7", +"ae c #3963ff", +".g c #396bff", +"#U c #424ab5", +"#2 c #4252b5", +".J c #425ace", +"#A c #4263de", +".b c #426be7", +"#p c #426bef", +"#x c #426bff", +".n c #4273ff", +".o c #4a63ce", +"#t c #4a6be7", +".Q c #4a73de", +"#3 c #4a73ff", +"#C c #4a7bff", +"#Z c #525abd", +".1 c #526bbd", +".W c #526bc6", +".R c #526bce", +".P c #527be7", +"#w c #5284ff", +"#m c #528cff", +"ac c #5a63bd", +"ak c #5a6bbd", +".O c #5a7bf7", +"#H c #5a84ff", +"#9 c #5a8cff", +"af c #636bb5", +".h c #636bbd", +"ab c #6384ef", +"#v c #638cff", +".w c #6394ff", +".s c #639cff", +"#M c #6b73b5", +".C c #6b73bd", +"#u c #6b9cff", +".c c #737bb5", +".S c #7384ce", +".N c #738ce7", +".a c #7394de", +".8 c #7394ef", +"#8 c #739cf7", +"#B c #739cff", +".A c #73a5ff", +"#0 c #7b84b5", +".T c #7b8cbd", +".9 c #7b94c6", +"#. c #7b94d6", +".7 c #7ba5ff", +".X c #7badff", +".I c #7bb5ff", +"#5 c #848ca5", +".y c #848cad", +".M c #8494b5", +"## c #849cd6", +"#c c #84adff", +".G c #84b5ff", +".Z c #84bdff", +"#o c #8c8cad", +"#a c #8ca5ce", +".Y c #8cb5ff", +".H c #8cbdff", +"#1 c #9494a5", +".U c #9494ad", +"#7 c #949cad", +"#b c #94ade7", +".z c #94c6ff", +".v c #94ceff", +".j c #9c9cad", +".u c #9ca5ad", +"#r c #9cc6ff", +".m c #9cceff", +".d c #a5a5a5", +"#6 c #a5a5ad", +".V c #a5a5b5", +".K c #a5adb5", +".2 c #a5ceff", +".r c #a5d6ff", +".L c #adadad", +".i c #adadb5", +".p c #adadbd", +".q c #addeff", +"#e c #ade7ff", +"#X c #b5b5b5", +".D c #b5b5bd", +".E c #b5b5c6", +".F c #b5bdc6", +".f c #b5deff", +"#q c #b5efff", +".# c #bdbdbd", +"ad c #bdbdc6", +".6 c #bddeff", +"#i c #bde7ff", +"#h c #bdefff", +"#g c #c6f7ff", +"#l c #cee7ff", +"#j c #cef7ff", +"#f c #ceffff", +".k c #d6efff", +"#k c #d6f7ff", +".l c #d6ffff", +".e c #deefff", +".5 c #e7ffff", +".4 c #efffff", +".3 c #f7ffff", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.a.b.c.#QtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.d.e.f.g.h.iQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.j.k.l.m.n.o.pQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.d.f.q.r.m.s.t.cQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.u.q.v.m.r.m.w.x.y.#QtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.u.z.z.z.z.m.m.A.B.C.DQtQtQtQt", +"QtQt.#.E.F.#.#QtQtQtQtQtQtQtQtQtQt.j.G.H.z.H.z.m.m.I.n.J.KQtQtQt", +".L.M.N.O.P.Q.R.S.T.U.E.#.#QtQtQt.V.W.X.H.Y.H.H.z.z.z.Z.g.0.VQtQt", +".1.2.3.4.5.k.6.2.Y.7.8.a.9#.###a#b.Y.G.G.G.G.Y.G.Y.H.z#c.n#d.u.#", +".b#e#f#g#h#i.f#h#g#g#j#k#k#k.e.4.4#l#c.X.G.G.G.G.G.G.G.H.H#m#n#o", +"#p.m#q.r.m.m.m.z#r.m.z.m.r.q.q.q.m.H.G.G.X#c.G.G.G.X.X.X.X.7#s.J", +"#t.v.q.m.z.H.H.H.H.H.Z.Y.G.G.G.G.G.G.G.X#c.I#c.X.X.X.A.A#u#u.n#d", +"#t.H.r.z.Y.G#c.X.X.X.7.X.X.X.X.X.X.X.X.X.X.X.X.X.7.A#u#v#w#x#y#z", +"#A.I.m.H.X.X.X.A.A#B.A#B#u#u#u#u#B.X#c.X.X.X.X.A.A#u.w#C.g#D#E#F", +"#G.s.G.A.w#v#H#w#C.n#x#s#I#y#y#y#J#H.X.7.X.X.7.A#u.w#w#J#y#K#L.U", +"#M.x.n#N#D#O#P#K#K#Q#Q#R#S#T#U#U#V#W.A.X.A.A#B#u.w.n#D#P#E#L.VQt", +"#X.h#V#Q#Y#R#S#U#Z#0#1.p.#.#.#.#.V#2.s.7.A#u#u.w#3#D#P#E#4#5QtQt", +"QtQt#6#1#7.D.#.#QtQtQtQtQtQtQtQtQt#6#8#B#u.w#9#s#ya.#E#F.V.#QtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.8#9#H#w#s#Wa#aa#2#XQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ab#w#C#N#W#K#Eac.#QtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtad.Pae#J#Wa##Vaf#XQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ag#W#P#Eah#6QtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#ai#K#Eaj.jQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#akalak.iQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +] +image3_data = [ +"25 25 2 1", +"# c #000000", +". c #ffffff", +".........................", +".........................", +".........................", +".........######..........", +".......##########........", +"......####....####.......", +".....###........###......", +"....#####........###.....", +"....##.###........##.....", +"...###..###.......###....", +"...##....###.......##....", +"...##.....###......##....", +"...##......###.....##....", +"...##.......###....##....", +"...###.......###..###....", +"....##........###.##.....", +"....###........#####.....", +".....###........###......", +"......####....####.......", +".......##########........", +".........######..........", +".........................", +".........................", +".........................", +"........................." +] +image4_data = [ +"32 32 3 1", +". c None", +"# c #000080", +"a c #808080", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"...............#########a.......", +"....#.........###########a......", +"....##.......###.......###a.....", +"....###....####.........###a....", +"....####..####...........###....", +"....########..............##....", +"....#######...............##....", +"....#######...............##....", +"....########..............##....", +"....#########.............##....", +"....##########...........##a....", +"....###########.........##a.....", +".......................a##......", +"......................a##.......", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................", +"................................" +] +image5_data = [ +"32 32 211 2", +"Qt c None", +"aJ c #000000", +"#W c #080800", +"#N c #100800", +"#V c #101000", +"#E c #101008", +"#M c #181000", +"#L c #181800", +"#D c #181808", +"#F c #181810", +"as c #211800", +"#K c #211808", +"#J c #212110", +"#G c #212118", +"#q c #212121", +"an c #292100", +"#I c #292110", +"aN c #292910", +"#H c #292918", +"#y c #292921", +"aF c #312900", +"#C c #312918", +"#i c #312929", +".0 c #313131", +"#7 c #393100", +"#U c #393108", +"aG c #393931", +".M c #393939", +"#u c #423939", +"#c c #424a42", +"aE c #4a4200", +"aY c #4a4210", +".V c #4a4239", +"#B c #4a4a39", +".m c #4a4a42", +"aP c #4a5218", +".G c #4a5252", +".z c #4a5a52", +"aO c #524200", +"am c #524a00", +"#T c #524a08", +"#p c #524a4a", +".s c #525252", +"#a c #525a52", +".7 c #52635a", +"#b c #526363", +"az c #5a4a00", +"#6 c #5a5208", +"aw c #5a5210", +".Z c #5a524a", +".L c #5a5a52", +".y c #5a5a5a", +".F c #5a635a", +"#S c #635208", +"ax c #635a10", +".U c #635a52", +".r c #635a5a", +"aZ c #636321", +"## c #63635a", +".A c #636363", +"#h c #636b6b", +"aL c #637329", +"af c #6b5a00", +".6 c #6b635a", +"#o c #6b6363", +".E c #6b6b63", +"a4 c #6b7321", +"aS c #6b7329", +"aR c #6b7331", +"aX c #736300", +"al c #736308", +"#R c #736b10", +".T c #736b63", +"a5 c #737329", +".i c #73736b", +".K c #737373", +"a7 c #737b29", +"#g c #737b73", +"a9 c #7b7318", +"#A c #7b7373", +"a8 c #7b7b21", +"aV c #7b7b29", +"aQ c #7b7b5a", +".J c #7b7b73", +".1 c #7b7b7b", +"b# c #7b8431", +"a3 c #7b844a", +".8 c #7b847b", +"ay c #847308", +"#5 c #847310", +"aT c #847b21", +"b. c #847b29", +".S c #847b73", +".d c #847b7b", +"aW c #848421", +"a1 c #848429", +"a0 c #848431", +"bq c #84844a", +".H c #848484", +"ae c #8c7b08", +"ak c #8c7b10", +"#j c #8c8484", +"ba c #8c8c63", +"a2 c #8c8c7b", +".x c #8c8c84", +".2 c #8c948c", +".9 c #8cada5", +"aC c #947b08", +".Y c #947b73", +"aK c #948c10", +"#Q c #948c18", +"a6 c #948c29", +"#m c #948c84", +"bp c #949442", +"aH c #949484", +".D c #94948c", +".n c #949494", +"bn c #949c4a", +"bl c #949c5a", +"bj c #949c63", +".u c #949c94", +".v c #94a59c", +"aI c #9c8c10", +"#4 c #9c8c18", +"#O c #9c8c29", +"aM c #9c9418", +"#r c #9c948c", +"bo c #9c9c4a", +"bm c #9c9c52", +"bk c #9c9c5a", +"bh c #9c9c6b", +".k c #9c9c94", +".a c #9c9c9c", +"bi c #9ca56b", +"bf c #9ca573", +".h c #9ca59c", +"#f c #9ca5a5", +".B c #9cbdb5", +"#P c #a59400", +"aB c #a59418", +"#k c #a5948c", +"ar c #a59c29", +".N c #a59c8c", +".P c #a59c94", +".W c #a59c9c", +"bg c #a5a573", +"bd c #a5a584", +".q c #a5a59c", +".c c #a5a5a5", +"be c #a5ad7b", +".o c #a5ada5", +".C c #a5adad", +".I c #a5b5ad", +"#d c #a5bdb5", +".w c #a5c6bd", +"ad c #ad9c10", +"aj c #ad9c18", +"#w c #ad9c94", +".f c #ada59c", +"bc c #adad7b", +"bb c #adad84", +".# c #adada5", +".t c #adadad", +".4 c #adb5ad", +"ai c #b5a518", +"aq c #b5a529", +"aD c #b5a542", +"ao c #b5a54a", +".O c #b5a594", +"#v c #b5a59c", +"at c #b5ad52", +"#z c #b5ad9c", +".5 c #b5ada5", +".j c #b5b5ad", +".e c #b5b5b5", +".3 c #b5bdb5", +".Q c #b5bdbd", +"#e c #b5cec6", +"#8 c #bda539", +"#x c #bda59c", +"#3 c #bdad29", +"#X c #bdad31", +"ag c #bdad42", +"#n c #bdb5ad", +".b c #bdbdbd", +".X c #bdcec6", +"aU c #c6b510", +"#. c #c6c6bd", +".p c #c6cece", +".g c #c6ded6", +"ac c #cebd31", +"#l c #ced6ce", +"#s c #ced6d6", +"#t c #cedede", +"#9 c #d6c610", +"#2 c #d6c631", +"ap c #dec608", +"ah c #dece10", +"ab c #dece31", +".l c #deefe7", +".R c #deefef", +"au c #e7ce08", +"a. c #e7d621", +"a# c #e7d631", +"aa c #e7d639", +"#1 c #e7de39", +"#Y c #efde10", +"av c #efde21", +"aA c #efde29", +"#Z c #f7e729", +"#0 c #f7e739", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQt.#.aQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.b.c.d.eQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQt.f.g.h.i.bQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQt.j.k.l.e.m.nQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQt.b.a.o.p.q.r.s.tQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQt.u.v.w.k.x.y.z.A.bQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQt.t.k.B.C.k.D.E.F.G.HQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQt.b.#.#.o.I.b.c.J.K.L.M.tQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQt.a.N.O.P.Q.R.o.S.T.U.V.s.bQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQt.t.N.P.W.k.X.R.P.Y.i.A.Z.0.1QtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.b.x.2.w.3.4.I.j.#.5.6.L.F.7.0.cQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.n.8.9.p#..o.4.x.x.x##.s#a#b.s#c.bQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQt.t.D.##d#e.h#f.o.P.2.2#g###h.A.z#i.KQtQtQtQtQtQtQt", +"QtQtQtQtQtQt.b#j.P.f.P#k.q.4.X#l#m#n.n#o.J.6#p#i#q.cQtQtQtQtQtQt", +"QtQtQtQtQtQt.W#m#k.O#m#r.5.k#s#t#m.q#r.U.E.T#p#u#i.M.eQtQtQtQtQt", +"QtQtQtQtQt.b.x#r.o.t#v.f.o.4.l#l#w#x.f.i#o.E###a.m#y.nQtQtQtQtQt", +"QtQtQtQtQt.b.e.c#d.o#z.u.q#f.I.q.#.#.2#A.U.m#B#h.h.j.bQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.b#C#D#E#F#G#G#G#H#I#J#K#L#M#N.iQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.b#O#P#Q#R#S#T#U#L#M#V#W#N#V#V.iQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.b#X#Y#Z#0#0#1#2#3#4#5#6#7#M#V#AQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.b#8#9a.a#aaaaabac#3adaeaf#7#M.JQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.bagaha.a##1aaaa#2aiajakalaman#AQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtaoapa.a#aaaqaraq#3aj#5afamas.JQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtatauava#aw#V#W#Max#4ayafazan.JQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtatahaAaB#W#N#M#V#V#RaCalazas.JQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.baDap#Z#Q#N#M#V#M#N#6akafaEaFaG.E#h.JQtQtQtQtQt", +"QtQtQtQtQtQtQtQtaHaIahaAaB#W#W#N#WaJ#6aKalamaF#WaJaJ#yQtQtQtQtQt", +"QtQtQtQtQtQtQt.qaLaIahavaM#WaJ#W#DaN#RaealaOan#NaNaPaQQtQtQtQtQt", +"QtQtQtQtQtQt.jaRaSaTaUavaB#WaNaPaLaVaWaeaX#6aYaZa0a1a2QtQtQtQtQt", +"QtQtQtQtQt.ba3a4a5a5aVa6a1aZa7aSaSa5a8a9a4a5b.b#a5a5.kQtQtQtQtQt", +"QtQtQtQtQtbaa7a7aVa0b.b#a7b#a0a7a7a7aSaSa7b.aVa0aVaR.#QtQtQtQtQt", +"QtQtQtQtQtbbbcbdbebebfbgbhbhbibjbjbkbkblbmbmbnbobpbq.bQtQtQtQtQt" +] +image6_data = [ +"22 22 165 2", +"Qt c None", +".h c #000000", +".o c #010101", +"aF c #030303", +"#n c #060606", +".H c #080808", +".r c #0c0c0c", +".q c #121212", +"#V c #124e7f", +"#m c #131313", +".G c #161615", +"aI c #172cac", +".6 c #181818", +"aH c #1841b2", +".p c #191919", +"#8 c #1928ba", +"#W c #1929ba", +"aj c #192aba", +"av c #1a31c2", +"aE c #1b1b1b", +"aD c #1b2bc8", +"at c #1c79d2", +"ah c #1c7dd4", +"aA c #1d1d1d", +"aC c #1d7ad7", +"#6 c #1d7eda", +".5 c #1e1e1e", +"#7 c #1e8ae0", +"ai c #1e8de0", +"au c #1e90e0", +".g c #242424", +"#5 c #313b6c", +"aB c #343d8d", +"#3 c #393939", +".f c #3d3d3d", +"ak c #433967", +"#C c #434442", +"aw c #443c6e", +"#l c #454643", +"as c #454fa3", +".4 c #474845", +"#R c #474846", +".e c #484848", +"aG c #4856a0", +".d c #4a4a4a", +"#9 c #4c416a", +".c c #4c4c4c", +"ag c #4c5cae", +"#X c #4d4669", +"#z c #4dc2b2", +"#P c #4e445a", +"#G c #53504e", +".l c #545454", +".b c #555555", +"#Q c #595274", +"#i c #62b2a2", +".a c #676767", +"#j c #69b6a3", +".F c #6f6f6a", +".K c #6f8b89", +"ax c #747474", +"#a c #76a1a0", +".# c #797979", +"#A c #7bd7e8", +"ay c #7d7d7d", +"#U c #7e7d73", +".I c #808080", +".O c #81a3b8", +"az c #828282", +"#y c #82d1c0", +"#S c #848484", +"#O c #857e7c", +"#F c #86add2", +"#k c #86cdda", +"#N c #89b1bd", +"#h c #8acec3", +"#o c #8c8c8c", +"#L c #8cbbca", +"al c #8d8d8d", +".s c #8f8f8f", +"#H c #909090", +"#K c #90bac9", +"#M c #91c4cf", +"#t c #929292", +".X c #94c2cf", +".N c #94c2d0", +".W c #959595", +"#B c #96b9cb", +".3 c #97bede", +".L c #98c2ce", +".P c #9b9b9b", +"a. c #9c9c9c", +"am c #9d9d9d", +"#s c #9dbdc4", +"#b c #9e9e9e", +"#Y c #a0a0a0", +"an c #a6a6a6", +"#v c #a6d1d6", +".Z c #a7a1a1", +"#I c #a7a7a7", +"#D c #a7edde", +".M c #a8d8e5", +"#u c #aeaeae", +"ac c #b1b1b1", +"a# c #b2b2b2", +".2 c #b5cbd6", +".V c #b6b6b6", +"ar c #b7b7b7", +"#Z c #b8b8b8", +"#2 c #bababa", +".Q c #babbb9", +"aq c #bbbbbb", +"#c c #bcbcbc", +".8 c #bfbfbf", +"ap c #c0c0c0", +".1 c #c1d9d2", +"aa c #c8c8c8", +"ab c #cacaca", +"ao c #cbcbcb", +".Y c #ccf8f1", +"#J c #cdcdcd", +".R c #cecece", +"#p c #d1f9f4", +"#4 c #d5d5d5", +"#w c #d5ece4", +".9 c #d5f6f5", +"#0 c #d6d6d6", +".U c #d7d7d7", +"af c #d8d8d8", +".x c #dadada", +".y c #dbdbdb", +".w c #dcdcdc", +"#e c #dcf7f4", +"#1 c #dddddd", +"ae c #dedede", +".E c #dfdfdf", +".z c #e0e0e0", +"#g c #e0ebe4", +"#q c #e1edea", +"#d c #e2e2e2", +"#x c #e2ebe2", +".0 c #e2eee5", +".v c #e3e3e3", +"## c #e3e7d5", +"#r c #e4ebd9", +"#E c #e4f2ec", +".u c #e5e5e5", +".S c #e7e7e7", +".k c #e9e9e9", +".A c #ebebeb", +".D c #ededed", +".t c #f0f0f0", +"#T c #f4f4f4", +".n c #f6f6f6", +".C c #f7f7f7", +"#f c #f8f5f2", +".m c #f8f8f8", +".7 c #f9f9f9", +"ad c #fafafa", +"#. c #fbf0eb", +".J c #fbfbfb", +".T c #fcfcfc", +".B c #fdfdfd", +".j c #fefefe", +".i c #ffffff", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQt.#.a.b.c.d.d.e.f.g.hQtQtQtQtQtQtQt", +"QtQtQtQt.#.i.i.i.i.i.i.i.i.i.h.hQtQtQtQtQtQt", +"QtQtQtQt.a.j.j.j.j.j.j.i.i.i.h.k.hQtQtQtQtQt", +"QtQtQtQt.l.m.n.o.p.q.r.s.j.i.h.t.u.hQtQtQtQt", +"QtQtQtQt.e.v.w.x.y.z.A.n.B.B.h.C.D.E.hQtQtQt", +"QtQtQt.h.h.h.h.h.F.G.H.I.n.J.h.h.h.h.h.hQtQt", +"QtQt.h.K.L.M.N.O.h.P.Q.R.S.n.T.j.U.V.W.hQtQt", +"Qt.h.X.Y.Z.0.1.2.3.h.4.5.6.q.r.s.7.v.8.hQtQt", +"Qt.h.9#..###.F.F.F#a.h#b#c#d.m.j.7.v#c.hQtQt", +"Qt.h#e#f.a#g#h#i#j#k.h#l#m.r#n#o.7.v#c.hQtQt", +"Qt.h#p#q.a#r.F.F.F#s.h#t#u.x.n.j.7.v#c.hQtQt", +"Qt.h#v#w.##x#y#z#A#B.h#C#m#m.q#o.7.v#c.hQtQt", +"QtQt.h#D.Z#E.F.F#F.h#G#H#I#J.A.7.m.v#c.hQtQt", +"QtQtQt.h#K#L#M#N.h#O#P#Q#R#m.q#S#T#d#c.hQtQt", +"QtQtQtQt.h.h.h.h.Z#U#V#W#X#Y#Z#0.S#1#2.hQtQt", +"QtQtQtQt#3.t.v.x#4#5#6#7#8#9a.a#aaabac.hQtQt", +"QtQtQtQt.6ad.kae.yafagahaiajakalamana..oQtQt", +"QtQtQtQt.haeaoapaqaqarasatauavawaxayaz.oQtQt", +"QtQtQtQtQt.h.h.h.h.haA.oaBaCaiaD.HaEaFQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtaGaHaIQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt" +] + +class MainWindow(QMainWindow): + def __init__(self,parent = None,name = None,fl = 0): + QMainWindow.__init__(self,parent,name,fl) + self.statusBar() + + self.image0 = QPixmap(image0_data) + self.image1 = QPixmap(image1_data) + self.image2 = QPixmap(image2_data) + self.image3 = QPixmap(image3_data) + self.image4 = QPixmap(image4_data) + self.image5 = QPixmap(image5_data) + self.image6 = QPixmap(image6_data) + + if not name: + self.setName("MainWindow") + + + self.setCentralWidget(QWidget(self,"qt_central_widget")) + MainWindowLayout = QHBoxLayout(self.centralWidget(),0,6,"MainWindowLayout") + + self.Frame3 = QFrame(self.centralWidget(),"Frame3") + self.Frame3.setFrameShape(QFrame.StyledPanel) + self.Frame3.setFrameShadow(QFrame.Sunken) + Frame3Layout = QVBoxLayout(self.Frame3,1,0,"Frame3Layout") + + self.WebBrowser = QAxWidget(self.Frame3,"WebBrowser") + self.WebBrowser.setControl("{8856F961-340A-11D0-A96B-00C04FD705A2}") + self.WebBrowser.setFocusPolicy(QAxWidget.StrongFocus) + Frame3Layout.addWidget(self.WebBrowser) + MainWindowLayout.addWidget(self.Frame3) + + self.actionGo = QAction(self,"actionGo") + self.actionGo.setIconSet(QIconSet(self.image0)) + self.actionBack = QAction(self,"actionBack") + self.actionBack.setIconSet(QIconSet(self.image1)) + self.actionForward = QAction(self,"actionForward") + self.actionForward.setIconSet(QIconSet(self.image2)) + self.actionStop = QAction(self,"actionStop") + self.actionStop.setIconSet(QIconSet(self.image3)) + self.actionRefresh = QAction(self,"actionRefresh") + self.actionRefresh.setIconSet(QIconSet(self.image4)) + self.actionHome = QAction(self,"actionHome") + self.actionHome.setIconSet(QIconSet(self.image5)) + self.actionFileClose = QAction(self,"actionFileClose") + self.FileNewGroup = QActionGroup(self,"FileNewGroup") + self.FileNewGroup.setUsesDropDown(1) + self.actionNewWindow = QAction(self.FileNewGroup,"actionNewWindow") + self.actionSearch = QAction(self,"actionSearch") + self.actionSearch.setIconSet(QIconSet(self.image6)) + self.actionAbout = QAction(self,"actionAbout") + self.actionAboutQt = QAction(self,"actionAboutQt") + + + self.Toolbar = QToolBar(QString(""),self,Qt.DockTop) + + self.actionBack.addTo(self.Toolbar) + self.actionForward.addTo(self.Toolbar) + self.actionStop.addTo(self.Toolbar) + self.actionRefresh.addTo(self.Toolbar) + self.actionHome.addTo(self.Toolbar) + self.Toolbar.addSeparator() + self.actionSearch.addTo(self.Toolbar) + self.Toolbar_2 = QToolBar(QString(""),self,Qt.DockTop) + + self.Toolbar_2.setHorizontallyStretchable(1) + + self.lblAddress = QLabel(self.Toolbar_2,"lblAddress") + + self.addressEdit = QLineEdit(self.Toolbar_2,"addressEdit") + self.actionGo.addTo(self.Toolbar_2) + + + self.menubar = QMenuBar(self,"menubar") + + + self.PopupMenu = QPopupMenu(self) + self.FileNewGroup_2 = QPopupMenu(self) + self.PopupMenu.setAccel(QString.null,self.PopupMenu.insertItem(self.FileNewGroup.iconSet(),self.__tr("New"),self.FileNewGroup_2)) + self.actionNewWindow.addTo(self.FileNewGroup_2) + self.PopupMenu.insertSeparator() + self.actionFileClose.addTo(self.PopupMenu) + self.menubar.insertItem(QString(""),self.PopupMenu,1) + + self.unnamed = QPopupMenu(self) + self.actionAbout.addTo(self.unnamed) + self.actionAboutQt.addTo(self.unnamed) + self.menubar.insertItem(QString(""),self.unnamed,2) + + + self.languageChange() + + self.resize(QSize(812,605).expandedTo(self.minimumSizeHint())) + self.clearWState(Qt.WState_Polished) + + self.connect(self.actionHome,SIGNAL("activated()"),self.WebBrowser,SLOT("GoHome()")) + self.connect(self.actionRefresh,SIGNAL("activated()"),self.WebBrowser,SLOT("Refresh()")) + self.connect(self.actionStop,SIGNAL("activated()"),self.WebBrowser,SLOT("Stop()")) + self.connect(self.actionForward,SIGNAL("activated()"),self.WebBrowser,SLOT("GoForward()")) + self.connect(self.actionBack,SIGNAL("activated()"),self.WebBrowser,SLOT("GoBack()")) + self.connect(self.actionGo,SIGNAL("activated()"),self.go) + self.connect(self.actionFileClose,SIGNAL("activated()"),self.close) + self.connect(self.actionSearch,SIGNAL("activated()"),self.WebBrowser,SLOT("GoSearch()")) + self.connect(self.addressEdit,SIGNAL("returnPressed()"),self.go) + self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const QString&)"),self.addressEdit.setText) + self.connect(self.WebBrowser,SIGNAL("TitleChange(const QString&)"),self.setTitle) + self.connect(self.WebBrowser,SIGNAL("NavigateComplete(const QString&)"),self.navigateComplete) + self.connect(self.WebBrowser,SIGNAL("CommandStateChange(int,bool)"),self.setCommandState) + self.connect(self.WebBrowser,SIGNAL("BeforeNavigate(const QString&,int,const QString&,const QVariant&,const QString&,bool&)"),self.navigateBegin) + self.connect(self.actionStop,SIGNAL("activated()"),self.navigateComplete) + self.connect(self.actionNewWindow,SIGNAL("activated()"),self.newWindow) + self.connect(self.actionAbout,SIGNAL("activated()"),self.aboutSlot) + self.connect(self.actionAboutQt,SIGNAL("activated()"),self.aboutQtSlot) + + self.init() + + + def languageChange(self): + self.setCaption(self.__tr("Qt WebBrowser")) + self.WebBrowser.setControl(self.__tr("{8856F961-340A-11D0-A96B-00C04FD705A2}")) + self.actionGo.setText(self.__tr("Go")) + self.actionGo.setMenuText(self.__tr("Go")) + self.actionBack.setText(self.__tr("Back")) + self.actionBack.setAccel(self.__tr("Backspace")) + self.actionBack.setMenuText(self.__tr("Back")) + self.actionForward.setText(self.__tr("Forward")) + self.actionForward.setMenuText(self.__tr("Forward")) + self.actionStop.setText(self.__tr("Stop")) + self.actionStop.setMenuText(self.__tr("Stop")) + self.actionRefresh.setText(self.__tr("Refresh")) + self.actionRefresh.setMenuText(self.__tr("Refresh")) + self.actionHome.setText(self.__tr("Home")) + self.actionHome.setMenuText(self.__tr("Home")) + self.actionFileClose.setText(self.__tr("Close")) + self.actionFileClose.setMenuText(self.__tr("C&lose")) + self.FileNewGroup.setText(self.__tr("New")) + self.actionNewWindow.setText(self.__tr("Window")) + self.actionNewWindow.setAccel(self.__tr("Ctrl+N")) + self.actionNewWindow.setMenuText(self.__tr("Window")) + self.FileNewGroup.setMenuText(self.__tr("New")) + self.actionSearch.setText(self.__tr("Search")) + self.actionSearch.setMenuText(self.__tr("Search")) + self.actionAbout.setText(self.__tr("About")) + self.actionAbout.setMenuText(self.__tr("About")) + self.actionAboutQt.setText(self.__tr("About Qt")) + self.actionAboutQt.setMenuText(self.__tr("About Qt")) + self.Toolbar.setLabel(self.__tr("Toolbar")) + self.Toolbar_2.setLabel(self.__tr("Toolbar_2")) + self.lblAddress.setText(self.__tr("Address")) + self.PopupMenu.changeItem(self.PopupMenu.idAt(0),self.__tr("New")) + if self.menubar.findItem(1): + self.menubar.findItem(1).setText(self.__tr("&File")) + if self.menubar.findItem(2): + self.menubar.findItem(2).setText(self.__tr("&Help")) + + + def go(self): + print "MainWindow.go(): Not implemented yet" + + def newWindow(self): + print "MainWindow.newWindow(): Not implemented yet" + + def setProgress(self,a0,a1): + print "MainWindow.setProgress(int,int): Not implemented yet" + + def init(self): + pass + + def setTitle(self,a0): + print "MainWindow.setTitle(const QString&): Not implemented yet" + + def setCommandState(self,a0,a1): + print "MainWindow.setCommandState(int,bool): Not implemented yet" + + def navigateComplete(self): + print "MainWindow.navigateComplete(): Not implemented yet" + + def navigateBegin(self): + print "MainWindow.navigateBegin(): Not implemented yet" + + def aboutSlot(self): + print "MainWindow.aboutSlot(): Not implemented yet" + + def aboutQtSlot(self): + print "MainWindow.aboutQtSlot(): Not implemented yet" + + def __tr(self,s,c = None): + return qApp.translate("MainWindow",s,c) diff --git a/python/pyqt/examples3/webbrowser/mainwindow.ui b/python/pyqt/examples3/webbrowser/mainwindow.ui new file mode 100644 index 00000000..1689e8ad --- /dev/null +++ b/python/pyqt/examples3/webbrowser/mainwindow.ui @@ -0,0 +1,410 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<class>MainWindow</class>
+<widget class="QMainWindow">
+ <property name="name">
+ <cstring>MainWindow</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>812</width>
+ <height>605</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Qt WebBrowser</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>Frame3</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>1</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QAxWidget">
+ <property name="name">
+ <cstring>WebBrowser</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>StrongFocus</enum>
+ </property>
+ <property name="control">
+ <string>{8856F961-340A-11D0-A96B-00C04FD705A2}</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+</widget>
+<menubar>
+ <property name="name">
+ <cstring>menubar</cstring>
+ </property>
+ <item text="&File" name="PopupMenu">
+ <action name="FileNewGroup"/>
+ <item text="New" name="FileNewGroup_2" accel="">
+ <action name="actionNewWindow"/>
+ </item>
+ <separator/>
+ <action name="actionFileClose"/>
+ </item>
+ <item text="&Help" name="unnamed">
+ <action name="actionAbout"/>
+ <action name="actionAboutQt"/>
+ </item>
+</menubar>
+<toolbars>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>Toolbar</cstring>
+ </property>
+ <property name="label">
+ <string>Toolbar</string>
+ </property>
+ <action name="actionBack"/>
+ <action name="actionForward"/>
+ <action name="actionStop"/>
+ <action name="actionRefresh"/>
+ <action name="actionHome"/>
+ <separator/>
+ <action name="actionSearch"/>
+ </toolbar>
+ <toolbar dock="2">
+ <property name="name">
+ <cstring>Toolbar_2</cstring>
+ </property>
+ <property name="horizontallyStretchable">
+ <bool>true</bool>
+ </property>
+ <property name="label">
+ <string>Toolbar_2</string>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lblAddress</cstring>
+ </property>
+ <property name="text">
+ <string>Address</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>addressEdit</cstring>
+ </property>
+ </widget>
+ <action name="actionGo"/>
+ </toolbar>
+</toolbars>
+<customwidgets>
+</customwidgets>
+<actions>
+ <action>
+ <property name="name">
+ <cstring>actionGo</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image0</iconset>
+ </property>
+ <property name="text">
+ <string>Go</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionBack</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image1</iconset>
+ </property>
+ <property name="text">
+ <string>Back</string>
+ </property>
+ <property name="accel">
+ <string>Backspace</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionForward</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image2</iconset>
+ </property>
+ <property name="text">
+ <string>Forward</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionStop</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image3</iconset>
+ </property>
+ <property name="text">
+ <string>Stop</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionRefresh</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image4</iconset>
+ </property>
+ <property name="text">
+ <string>Refresh</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionHome</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image5</iconset>
+ </property>
+ <property name="text">
+ <string>Home</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionFileClose</cstring>
+ </property>
+ <property name="text">
+ <string>Close</string>
+ </property>
+ <property name="menuText">
+ <string>C&lose</string>
+ </property>
+ </action>
+ <actiongroup>
+ <property name="name">
+ <cstring>FileNewGroup</cstring>
+ </property>
+ <property name="text">
+ <string>New</string>
+ </property>
+ <property name="usesDropDown">
+ <bool>true</bool>
+ </property>
+ <action>
+ <property name="name">
+ <cstring>actionNewWindow</cstring>
+ </property>
+ <property name="text">
+ <string>Window</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+N</string>
+ </property>
+ </action>
+ </actiongroup>
+ <action>
+ <property name="name">
+ <cstring>actionSearch</cstring>
+ </property>
+ <property name="iconSet">
+ <iconset>image6</iconset>
+ </property>
+ <property name="text">
+ <string>Search</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionAbout</cstring>
+ </property>
+ <property name="text">
+ <string>About</string>
+ </property>
+ </action>
+ <action>
+ <property name="name">
+ <cstring>actionAboutQt</cstring>
+ </property>
+ <property name="text">
+ <string>About Qt</string>
+ </property>
+ </action>
+</actions>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="1241">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232365200210543251d2e253d856405bffcbc54103b11c8563600020b03105719c4b530b08072f50880513560a09c080338d5209420294a4451a38c90426621ab5146d10de524a2aa417505445122861a547722bb0c971a3d2aa921c2ae446c6a9431fc85a9064551220e354009653dec00294e712a1ac4e97078a9a9b5e6020013b3f563</data>
+ </image>
+ <image name="image1">
+ <data format="XPM.GZ" length="4494">789ce596497332470c86effe15947573a5f4c1cc30cc542a07ef60bc808dd7540e3d9b6df006186c93ca7f8fba2535ce57be98dc9292313c487a2575f7ccf063a376d53baa6dfc589bbe9ad7fbbc96df99496da3983d3e7efcfec76f7faead87418dfe1a51500bd67f595befbfd6f2daf1f35369014e08a05e6fd4ab96e31e73d0282bc7a7cae23ff3ccfe8170ca6cee9843f51f3b4ec8cff9efccdebf2d2cf9b06bb9417a25c74f98bdff99390a84fb8e49af70f39891b2e40bfbf8b6b0917e87968346a8f5a6cc51c07ab02f2cf1983237552f709c86691e3bbd5be5821998a32067bd1765d13f67563d530a4b3df8b01c523d8ec74059faed086bfc82390e851b8ed3c86485e34365a9bfc5ece3df8433e10bcb5140f5dd3cf0e099f32f99e350cecb5858f2b1c1dc52fda663d334a277c0ecfd5d61c9373973120967969b548fd71b079e797d8e985b21eb63aecceb85e7c299f4ffaa2ce7739359ebc195631387c6ad1f5e302791ccbba72cf173e15cfa2d2cc7619cf1fa63c9dccaa4ff4bcfdc7fa82cfdf7999348f6bf299c4bfd4c59ea0f99535dafca71d60a65ffebca52ff8c3989e47cce98351fb785759e7bcbad65bf0be624ca9a8e87caac0fb1702ef191b2cc9731a7b9ec4f87d934659e27e142f8c671e6eb9d0ae7b2be07cc6924ccf999698a7e4f58f572e64cebb9f393444994e68e4365d9ff7be15caef70766ad678cb0f8f18359ebe109b3af27f199fadd794cf254eb196599774758e77d5496f5dd64a67959af122ef87c639b59eb81d34ba97fe3f4215196f3922acbbc28acf527cc792c7a857029ecf63bcded05efb8a52cf3cc9833ed2f66563dac0b8b1ebe3317ea77f73352173db8f6ccf54a66df0f30fb7c777d9bc214d2cf88d9cf73cfece3ddf3296b66da7fe199d7a32b5cc8feef31fbfe8f99bdde96b0faddf3272bac390665b99e90d9e7ef33972de9d73d7ff3d873255c49fc1b73257ee4f8d2eb5d336b3e8e8535ff86d9e7bbf35f2cf51366ef77cfeb6299df62563f3c0a8b1fdcf3d3569778773f756e66f7fcac967e175f797ffff5dfd9ff4103010d6698a35955030b2cb1c25bbcc3fbd5344861882352b8c5077c5c45836678c267ca7fc1314ebeaf81537cc599eb608e6ff88e1f2b682c705314b6486182dbb8f31d0ddca529f644619ff2db641d3cf82a8bfa9d62d7da670d3cc4233c760a63eaa08d2734478fac8f87ffc833788a6738c073bc20ebe3255eb1069d863e5e3b851bacfb7c6b0d0c30c488f24a3a2d4ddaf1986a3d600b13179be280ef597809e876e206000c69d8ec0e590f32c8a18012b7a0825b9799e018eee0de4e0b4318c103ff2ea2985b78c47d28a487ce276b634cca40356d1655801c3bf044af2136e0195ef8b711be4045ab50ff42e16bdbb6463d8e610253fe3d4855ec3ed80abd9f62397ef9c9e6cee835249bc31bbc731ff0010beacbcdbfaca29f2836a3e839fd1f3acb5cb6fd6e13b6605b34766097d6664cdf0d7faad9813dd827df08daf4de812ddaa7061c4017baf43ea6daef70c8fb0247704c932dc897b94e67da09553a811ef4a94a0f4ee10c069435216b630ae7a43b800b7fc6164ea543ea73ea75663b22a50e5cc215ec50956beaf606ead08080147b64c76403d20ebdc6142268528d3655ee3a1db6f88b535ee015b42081d4205ee1f4f335878501ea7644331dc81acecdb7ef63b86b32eae59956cff63237f92af7319c9a82669c989256bd0b6fa6fabe86bbfe0ecdadb9a399ce61b49a86355adfbedd45736756bc27b30afd161a9a9179585de33bf69fd2f8ebd7b5bf014644b906</data>
+ </image>
+ <image name="image2">
+ <data format="XPM.GZ" length="4494">789ce5965b4f23471085dff915d6d6db2aaac5e3b92aca037703cbc55c8c21ca43cf8c8d0dd85c6c307694ff9eeaaed3bd68771f968d14298a0a109fabebd4e99a9ef17cfad8e81d1f343e7e5a99cecc6c5435aaa1796a7cac9fc7e3c5ef7ffcf6e7ca8756d4909f661c35a20fbfac7ce8cc1a55e3f07ed2b7409702b4badaccfb996563020f5c7ecbf340b9a31c3591dff7ac7943e002cc8e73cf74acdcc27a8a2d37a5be4e1d9f04567f9fc105f25dcfea9726caad62a07c1158f58f94e3087e868ea57fa5fa0be590bfb11c3525affd4e03ebfa25b8507fbcaa1c47ca66e459fdf10c6c30af4dcfda8f5f9513dfffce71e1f5a956967adddfaeb25f4f7b60e8d199e596f42f6bc787ca213f554e5be06dc7a28ffdee282791cedb5c83d19fd795a55ecf4b3fb0ee07ebd312fae796e3283665e238524e2265de031bcc774d396d61be25b8c4fe1f02abfeab67f49f2867decfbd6393b6a03f03438f3bca19fa51cb33fc6f80fd7eae2c27e257e7cb4de5b4045f78d679f24960ddcfb172e6f73357ce63e88fc115ce43e558fcabbeb905fb7e47cae24ff5daca41af007bbd81e5b425f53aff6160d52f95f318f37d01a39ee7ca05f4790a469e0e1c97590bfa1b81f53c3e2bfbf5ecf697b532efe754398f31af437085eb65948b18e723f70cbf9e2bcc633db0f65b533609fcbafb372bf318fdcfc015e65b281731ee0ff6acf70767ca5e8f7be01abcab5cfa7e89e53cce2ba3fd1681b5df8172013f44e00acfbf4a39e8ef287b7dbe02234feefce795d727a36c12ccf75239d4b7c1bede9def42fcc0ef7960d5cbc05ebf543635aed752b94aa1ff02ee83ddf3b6a87c3d3f2b9b047a4fcaa17e0cf6f5eef928ab13f5476960d5eb7ac6f5dd07d7e04839e83d29d7be9ffbfe31b50dc723cfa87f08acf947e51a7ad457ee6760773ecaa4f47e36036bfd96673c3fb6c13578a01cf41f9505d5af3b2f655dc28fa93da33e550ef523e5e06f08861eb9e7b94cdfe7ddf753d50feb6f94437e00f67edcf3aa4e831ed8afe73bb05fefe655f7c37edcfd62bb81ddfb82935776cfeb41c87766ff2cfe7f1a4c6cb8e48ae91f68d4dce7015ff390473fad71c3b77cc7639ef03d3ffcb48f013ff293a84c79c6d54f693c8bc28b28589539bff2e2ed647e586389184bacf13a6ff0e6d71a32f92dde96bfdf9dbccc6387dba2d086caae4c668ff7bf68f0673ee0433ee263eef0099ff2199f8b62d0e32e5f704fea2fe5b70d3f57729556b91b349a1c718b634e64faa9fc7fc919e772220a91213254ca273b884bf72b4a54f1846ad925e93b1af56940d734a4110fe4efb5c40dddda907311734c7752d10b3a1ae289c634a17b7dafe331e995b3b124fbdfd25d85471763596fab7aa2a4f53d444653ded3773bb96e8faeae1de2ea8dff9da0b0ebfcd858e3357aa667bb1f68b4a5e7d256853559e8f56d64aefe85e6f44a0b5aea3bac5c2bebf74b8775fb6bfbb858771e7a6f1df09c36f89a36698bb6f53d5c4ef08ee4e6a2dd269b9d488729ed4a171b7bd40ece3228cce5d305edd3673ed7773139bd133a14d5233a96cff7a9237142a77446e7125dba900e70681564f5a6acdc1285ae9e0feaf150d675e8d2d59dd315ad52931fec2973d1a5489c6698e29c5a508829797bd629a52665bcf9fdd32ed95c1d50217b5c18b67390f34befb8e78873a9b6b39ad285216328a2de3bef5b32a59db5ccec42a6b565aaf7dffba6e663d3972b211ea86b065f3cbccbc7b53890399a21a55f677f5863e4f670c337df667f58e3d6dc99dbef3dd5ff6bdf73ff82c65fbfaefc0d4fb5b868</data>
+ </image>
+ <image name="image3">
+ <data format="XPM.GZ" length="802">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232325500210543251d2e25658564056503300071f540dc3430007371012a492a830156496538c094848922c9c2259134c099304914e3604c8424aa5e6449b0044216ca824ba2da8b4512218b4d122e8b55520fee5974072164511da487ea490c7f22cba249e20d3efc018f3fcae0d2702eb5d2106992b5d65c00b9a48974</data>
+ </image>
+ <image name="image4">
+ <data format="XPM.GZ" length="1241">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade65232365200210543251d2e253d856405bffcbc54105b19c8563600020b03103711c4b530b08072f50880513524ab518681443435ca984ae08ae06a94114a10ac443435ca3043904d4c4453a38ca604ae11590d9a0ab80bd0d46078914c35c4d885a608871a547f61f81d5d117a1862018930e5b8d5c0950c741a1b1e6a6aadb90086a9d853</data>
+ </image>
+ <image name="image5">
+ <data format="XPM.GZ" length="5598">789ca5985973db480ec7dff3295cc15b6a0b2351a428d6d63ef83e255bbe647b6a1fd02465dd872d9f53f3dd076c005dc926ce6a32eed8553f37fadf7fa0c1a69cdfbe6cdc9cb537befcf6e97145ab61be910fe861e34bf1349dbefdfedffffcf1e97323dae07f51bdbe117dfed7a7cfddd546bed199cfca0ae888016afeab62e8796ef110ee545caf05be16ae5bfc6ee096e7b6e756983f51b6f53b81257ecfb8eee7e9b162f66af1c78125fe48987f23f3fb81657e691cd5bddecc7316d555efd058f7eb2867aa771058f4de8c55cffb6dd4a34cf5b68d357e681c6515634db81a7e3ef59c35cccf5560bf9ef6953389c77660af074f15c751e05c38a6d81f2ef9f3a848f4e9d658f2c36b635dbfa54cc2383556bd33e12492fc70df38f1f3f8ae4cc2745a711285fda7caa4f95e06967a2d8c63f27a8fc2a60fa4acfa980a371b898f0767dc6cf8fdbc9f84c27e4de124d2fabe186b3dee8c75ff1365dbef2db0ccef0987fd2f2a6632fd576552fd2b63d57b08ecd7d39d70b321fd0560acfb6d1a4b7e3050764de7d79f08a70de937ea7b7689e68f4de1e0776e2c7ab8abecb47eb170aa7ee822b0e89f1b4b7fd24dc529abe9794f02cbf99e2b3badc7a5b1ee97089b3e0e8d253f3c364e253e5576120ff7c63a9f7966d2e771d358e75bca4ef3bb0e2cf9758db5fe47c6b21eeb81bd3f07c2ad58ebd130d67e6a194b3cf97e62b2fa24c67a1f5d2aab3f8781a53e17c6eaa7082cfa3de156acf9d5034b7e3563f1eb96c6eaf7c0b815fbf8d2739e3aedefb1b1de9723618b77a49cebf946c6e20f5f8d251e753e8b5bb9e74c980a4afc7a7fbf66b1ed8fb7c67a9ec7c2ad5cfd74038bdfa6b1f6cbd458fd2e84b358efbb0363f5b71358fccd8c33596f9c4bfddcc458fac78d8cf5797b3296f5f82c4c49e6f5c9bf9fb23ce41307967e3935d6f36c0b67b1ce3f188b5f3757367f5363b98fdc38b0cc0f8cf5f90bf3ea97028bfe50981289777d63edcf81b1c4439897f3c52d615738cfe0df371c1deb7db265acf98d8d253f7a50d67a60c758cfcbf4cc7f2fb0f8bf1736bfae30d6f35f1a4b3ce6c6e2df95ca85f6f7dc58f3db0e5c783e14e6ebc533e87e963fbe0873f9fd3cc97c91693fd028b0d4e3c558f3eb0b9b5f972bab3fe78c353f3056bfabc0e2371636bfe4cf9b29d1e76b69acfdb863accfd33cb0dc2fa7c6e2179e03cb79ae940b7dffbf1b6bfd1363f53b12367f581a6b3d1bca56df6e60a9bfc6e765def4ecef6bc7eafaf9e8d558fbb7a15ce87d7263acf7ffbdb1e40f33e1e0cf29ebfea8eb6d7ff29f17f8f4137dfe51d8fa0117ca65ee3fbfe3bd705116b2de9f775e3af50313e1a229f1f0682cf1b052e6e1d9dfbf1cddd4fd2363cdcfef5fb05b7d1f0c944bed4f67ac9f5f27c265bf4c3d9f07eefb787f1f96695eaa1e0a174d7d7f81b1ee4f81a5fe75e552d9bf1fca7e617e9e8d556f33b0c4fbcf5ffdb44c956bc6a2d75dfd6c2020fd3ce2ff69a0c31c0b2cff91461fef71804374bfaa81231ce3044b9ce2ecd734380fc2392e70890ff888bfa6f184cff8c24e5ef10ddf71f3a37c3ed6c015afdec26dfeb983bbb887fb78f0f734380fe031c7437f3247788c27d8fe713e1f6a1076f014cfb08be7ac7481977885d75c951fe4f3630dcea3c3eb7b9cc70d6b9ce12d9fee26de610debeb69b0fb578cb89a0d8c399711e794609373d9c39455f2b53466d8c20c17809c45cc7a3c00f011081cffccff379fef35388f1d0428a0c401f459e58c3d45700f0003cee71d8678fc730d7430e2557d3c8331f7568c37308129cc7006733e9d262c6008cb6ff3f94ea3c72bc678ca3f1fb80a637884154c71c974c55d72c91a4feca4fdf553f8ad46554d8e9ee30a9eb1efab31611f2ff0ca346427bb9c11e114debe7e7ebed328318702e7f0ce9dbee47a1c724655b745b0c94ea6b0c55519f059b98f73d19a6cc30eecc21eecfb7100877004c770026de8e070bdfe805338832e9cc3055cc2955f7b0d3de8f0cfebb5356ee016eea0c6a30e11342086049a907aadcd35355a90111250f5e5288706bfdb4bea572a78b49e06ddd3a0d2807a2502110d6944639ad09466ebf9e8ae684e0bf5b1a4075ab28f11ffa1df678dc7f57cb0c68a9ee899355e7c2ddbf40a31bdb1c63bcdfe86c6803669cb9f4555c76b38a76dcee57d5d1f5c8f1d5af0b9745581bb029a5c8f3eedd21eed73b70ebe56fa91061dd061f05139e9d1116b1cfb9aee55c4fcf6330d5cd289d778a6b65fdd831dea702e256b9cf2b974a84367d4fd580347744e17744957acc13e7cfc095d538f356ed8cd2ddd518dea147da4c1956890ffcf295ed5e4c83b4a59f182b9455935e3b801ab791c7fa4e188d7a4bcbee66353feaef9df8852ca2f3e9ee3ef73840f359cabfec22979f4ddbd1bf018ba118f318f899bf298b9b95bb8e537cffe9ffffef4171c39a0bf</data>
+ </image>
+ <image name="image6">
+ <data format="XPM.GZ" length="3742">789c8d96c9521c490c86ef3c458775734cc8ddd5b5c6c41c303b180cc60b66620eaacc2c9aa5599b7562de7da45fc5180c8e98fa39f091522e4a49c9bbb783bdedcdc1db77735733991d864198c8e5e06dbc9e4eeffffceb8fbfe7de64d9407f466531c8defc36f76667360883adb3d364c013051ae2039f8147266359068f4dc6740a2e4db05f05d726f0253898c017c6a3cc04ffafce79aa3af0143c36c17e055caa0aacbf06aeb2203e5f09ae4d185f75ce472de6e7737063c2fcb57356b702fed673e32c473d4bcf3760198f02e69325706b022f3a676df0f567e05035d1ed273dc79883e7c1d1045e70ae2456d84fd9738a589f0b703261bc72ae25e17ee4b0e7d8f3b5733374e603e32c37c11ff36970db12f193f7e07c1c6bec87c6e0c604ff0e1c4db03f36cec7e3a6f4fd2e38e779eee7bd05e7e350fa7e4fc0455ee6b84fb9eab913bfdf1c5ce5758efba54fffb1e75302d726f8af3817a5f8f922584cf06fc0211f951ebfd0b30afe07ce4510dfdf1e38e665e9f9f1e01c32cf1fda06a73c2f7c7eac5f8c8b61eef582f315b909dc82f1c17e07dc1459e5f1c77d953abb787e0ab832611cf957366dd9c707f556762a3fcf8673ddd6d8afdc1957b909fe98af2a65d4c787c08d09e3c8bfaad504f378de83a309e35fc049d9d747bda19c7dbe8f602d88d6fd11af3a33c1ffde398e02ec69178c0b04bb7fa12be03e08e7ab4b895e2f74ec1ca2e73f6d811b2d37df1feaa9969082f71ff4a73a98c01f9cdb3678fde27eea58f7f9cdc8bfba33c11efda2199ac01bcead048fd72678a4e9e3f6a86f6d172acc87fc69f290f9386f3d72f478a1bf348509fea8b7a66c9b80fec1a8b7a66a53f47cc2fe9b5ae77346fe35ad09e761703081d12f9b68c2fc57ce6d0c1e6fe463934ce0efc63234c11ffd5b4a13c66f9cb53d79fded832bcd27f47f5aeb59055e744eb1df3fe2251aeee4e7453f9264c27aa847b44f7f4f909fda3efb7ae30c5c84b65f1fef435b9a608ff7a4ad4c981ffb6b6b13d8fda5edfb37eff4dcb65e2f787f5a7cb0f7fd0413ecf13eb49d09f6783ff07cf97d8ec0a3f8d8df516f483faf07c45b1f27e9f30ff989e9fdbe11ff1034fd3c9eebe068c238fa9f6677f2fb27ac1f475dd3f97da25fc6c204be755673ef3f8db3360c1f1f824b13c651df2877c44fd0df511efe5ea39f44318151cf9a4e2ab0af870d63fee4dc55fdfe109f880ff3fb788a8ff98df733762630fa471aa6febda2839e5b3f0fe1bef4f18bc9fb01fa7dca4ce0bb9e5b671ef69c3cff18f99cc626d853cf551f3fe453ca531bbdde979cbb2c793e207f536102a39fa5ca0446bf4279f97b89feaabb5181511f38bedf2ffa47373461bdcfe0dc8471d46387860fc6fbaad155c11ef7a5d953747ede69cf2a30fe3fd06c5121fe88572726f8a37f68720ffbfdadf7ac02fb7e82098c7e85ebf2fde37dea92098cf7acc367bc33fbff7a6ecfc4c22d078eaac41d1ff0e4d7f66a7df84293e71ecfec858f9ee8d1fef8a9c733fb139ef2299ff1395ff0255fc167c233befee1f1cc3ef10ddff21ddff303cfabe77bd584177891971e3d7ed8db4e7b2df30aaff29a7aac3ff9ebe4a9bdf2067fe04ddee28ffafb36eff027de558fcfbaab2ffc95bf3db5578b3dfecefb3ce411673c56ceb9e0b23f47a5fbac7fb26f889988742f2a129e504b81a246e0c8ec293cb7a7441d0b1dd0840ee9883486744253bea4533a7bd5fe9c2ed4feb29fff4aff32a36b8dd5e92fe6bfa15bddcf1dddd303cd93c6911668aa2b5cbc363f3c16799f9630fbb2d20aadd21aadeb3d547a8617f6f0d8a00fb4495bfadb47daa61dfa84f977e933c597f64f6e6c9fbed057fa467bf49df669c8bb34a2eca53d8d35576ef88e722aa8a48a6a6a448320a20fd36bf3eb7f407c2c89efb5500f6422877224c77222533915e6b397fbd117f54ccee54275295732936bb9915bb9937b797869ff34e7649ecfe4bd2ce81a8bbc2a4bb2fc5a3dfe2c59915559fb75fdfe8f7affe7f7b97f011cdd9635</data>
+ </image>
+</images>
+<connections>
+ <connection>
+ <sender>actionHome</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>GoHome()</slot>
+ </connection>
+ <connection>
+ <sender>actionRefresh</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>Refresh()</slot>
+ </connection>
+ <connection>
+ <sender>actionStop</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>Stop()</slot>
+ </connection>
+ <connection>
+ <sender>actionForward</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>GoForward()</slot>
+ </connection>
+ <connection>
+ <sender>actionBack</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>GoBack()</slot>
+ </connection>
+ <connection>
+ <sender>actionGo</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>go()</slot>
+ </connection>
+ <connection>
+ <sender>actionFileClose</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>close()</slot>
+ </connection>
+ <connection>
+ <sender>actionSearch</sender>
+ <signal>activated()</signal>
+ <receiver>WebBrowser</receiver>
+ <slot>GoSearch()</slot>
+ </connection>
+ <connection>
+ <sender>addressEdit</sender>
+ <signal>returnPressed()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>go()</slot>
+ </connection>
+ <connection>
+ <sender>WebBrowser</sender>
+ <signal>NavigateComplete(const QString&)</signal>
+ <receiver>addressEdit</receiver>
+ <slot>setText(const QString&)</slot>
+ </connection>
+ <connection>
+ <sender>WebBrowser</sender>
+ <signal>TitleChange(const QString&)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>setTitle(const QString&)</slot>
+ </connection>
+ <connection>
+ <sender>WebBrowser</sender>
+ <signal>NavigateComplete(const QString&)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>navigateComplete()</slot>
+ </connection>
+ <connection>
+ <sender>WebBrowser</sender>
+ <signal>CommandStateChange(int,bool)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>setCommandState(int,bool)</slot>
+ </connection>
+ <connection>
+ <sender>WebBrowser</sender>
+ <signal>BeforeNavigate(const QString&,int,const QString&,const QVariant&,const QString&,bool&)</signal>
+ <receiver>MainWindow</receiver>
+ <slot>navigateBegin()</slot>
+ </connection>
+ <connection>
+ <sender>actionStop</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>navigateComplete()</slot>
+ </connection>
+ <connection>
+ <sender>actionNewWindow</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>newWindow()</slot>
+ </connection>
+ <connection>
+ <sender>actionAbout</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>aboutSlot()</slot>
+ </connection>
+ <connection>
+ <sender>actionAboutQt</sender>
+ <signal>activated()</signal>
+ <receiver>MainWindow</receiver>
+ <slot>aboutQtSlot()</slot>
+ </connection>
+</connections>
+<forwards>
+ <forward>class QProgressBar</forward>
+</forwards>
+<variables>
+ <variable>QProgressBar *pb;</variable>
+</variables>
+<slots>
+ <slot>go()</slot>
+ <slot>newWindow()</slot>
+ <slot>setProgress( int a, int b )</slot>
+ <slot>init()</slot>
+ <slot>setTitle( const QString & title )</slot>
+ <slot>setCommandState( int cmd, bool on )</slot>
+ <slot>navigateComplete()</slot>
+ <slot>navigateBegin()</slot>
+ <slot>aboutSlot()</slot>
+ <slot>aboutQtSlot()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>qaxwidget.h</includehint>
+</includehints>
+</UI>
diff --git a/python/pyqt/examples3/webbrowser/webbrowser.py b/python/pyqt/examples3/webbrowser/webbrowser.py new file mode 100644 index 00000000..bd1462e5 --- /dev/null +++ b/python/pyqt/examples3/webbrowser/webbrowser.py @@ -0,0 +1,91 @@ +# Copyright (C) 2001-2002 Trolltech AS. All rights reserved. +# Copyright (C) 2004 Riverbank Computing Ltd. All rights reserved. +# +# This file is part of an example program for the ActiveQt integration. +# This example program may be used, distributed and modified without +# limitation. + + +import sys +import qt +import qtaxcontainer + +import mainwindow + + +class MainWindowImpl(mainwindow.MainWindow): + def init(self): + self.pb = qt.QProgressBar(self.statusBar()) + self.pb.setPercentageVisible(False) + self.pb.hide() + self.statusBar().addWidget(self.pb, 0, True) + + self.connect(self.WebBrowser, qt.SIGNAL("ProgressChange(int,int)"), self.setProgress) + self.connect(self.WebBrowser, qt.SIGNAL("StatusTextChange(const QString&)"), self.statusBar(), qt.SLOT("message(const QString&)")) + + self.WebBrowser.dynamicCall("GoHome()"); + + self.subwindows = [] + + def go(self): + self.actionStop.setEnabled(True) + self.WebBrowser.dynamicCall("Navigate(const QString&)", qt.QVariant(self.addressEdit.text())) + + def setTitle(self, title): + self.setCaption("Qt WebBrowser - " + title.latin1()) + + def setProgress(self, a, b): + if a <= 0 or b <= 0: + self.pb.hide() + return + + self.pb.show() + self.pb.setTotalSteps(b) + self.pb.setProgress(a) + + def setCommandState(self, cmd, on): + if cmd == 1: + self.actionForward.setEnabled(on) + elif cmd == 2: + self.actionBack.setEnabled(on) + + def navigateBegin(self): + self.actionStop.setEnabled(True) + + def navigateComplete(self): + self.actionStop.setEnabled(False) + + def newWindow(self): + window = MainWindowImpl() + window.show() + + if self.addressEdit.text().isEmpty(): + return + + window.addressEdit.setText(self.addressEdit.text()) + window.actionStop.setEnabled(True) + window.go() + + self.subwindows += window + + def aboutSlot(self): + qt.QMessageBox.about(self, self.tr("About WebBrowser"), self.tr( +"""This Example has been created using the ActiveQt integration into Qt Designer. +It demonstrates the use of QAxWidget to embed the Internet Explorer ActiveX +control into a Qt application.""")) + + def aboutQtSlot(self): + qt.QMessageBox.aboutQt(self, self.tr("About Qt")) + + +def main(args): + a = qt.QApplication(args) + w = MainWindowImpl() + a.setMainWidget(w) + w.show() + + return a.exec_loop() + + +if __name__ == "__main__": + sys.exit(main(sys.argv)) diff --git a/python/pyqt/examples3/widgets.py b/python/pyqt/examples3/widgets.py new file mode 100755 index 00000000..470f24ec --- /dev/null +++ b/python/pyqt/examples3/widgets.py @@ -0,0 +1,500 @@ +#!/usr/bin/env python + + +import sys, string +from qt import * + +# +## Constructs an analog clock widget that uses an internal QTimer. +# +def QMIN( x, y ): + if y > x: + return y + return x + +# +## Constructs an analog clock widget that uses an internal QTimer. +# + +class AnalogClock( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + self.time = QTime.currentTime() # get current time + internalTimer = QTimer( self ) # create internal timer + self.connect( internalTimer, SIGNAL("timeout()"), self.timeout ) + internalTimer.start( 5000 ) # emit signal every 5 seconds + +# +## The QTimer::timeout() signal is received by this slot. +# + + def timeout( self ): + new_time = QTime.currentTime() # get the current time + if new_time.minute() != self.time.minute(): # minute has changed + self.update() + +# +## The clock is painted using a 1000x1000 square coordinate system. +# + def paintEvent( self, qe ): # paint clock + if not self.isVisible(): # is is invisible + return + self.time = QTime.currentTime() # save current time + + pts = QPointArray() + paint = QPainter( self ) + paint.setBrush( self.foregroundColor() ) # fill with foreground color + + cp = QPoint( self.rect().center() ) # widget center point + d = QMIN( self.width(), self.height() ) # we want a circular clock + + matrix = QWMatrix() # setup transformation matrix + matrix.translate( cp.x(), cp.y() ) # origin at widget center + matrix.scale( d / 1000.0, d / 1000.0 ) # scale coordinate system + + h_angle = 30 * ( self.time.hour() % 12 - 3 ) + self.time.minute() / 2 + matrix.rotate( h_angle ) # rotate to draw hour hand + paint.setWorldMatrix( matrix ) + pts.setPoints( [ -20,0, 0,-20, 300,0, 0,20 ] ) + paint.drawPolygon( pts ) # draw hour hand + matrix.rotate( -h_angle ) # rotate back to zero + + m_angle = ( self.time.minute() - 15 ) * 6 + matrix.rotate( m_angle ) # rotate to draw minute hand + paint.setWorldMatrix( matrix ) + pts.setPoints( [ -10,0, 0,-10, 400,0, 0,10 ] ) + paint.drawPolygon( pts ) # draw minute hand + matrix.rotate( -m_angle ) # rotate back to zero + + for i in range( 0, 12 ): # draw hour lines + paint.setWorldMatrix( matrix ) + paint.drawLine( 450,0, 500,0 ) + matrix.rotate( 30 ) + + +class DigitalClock( QLCDNumber ): + def __init__( self, *args ): + apply( QLCDNumber.__init__,(self,) + args ) + self.showingColon = 0 + self.setFrameStyle(QFrame.Panel | QFrame.Raised) + self.setLineWidth( 2 ) + self.showTime() + self.normalTimer = self.startTimer( 500 ) + self.showDateTimer = -1 + + def timerEvent( self, e ): + if e.timerId() == self.showDateTimer: + self.stopDate() + else: + if self.showDateTimer == -1: + self.showTime() + + def mousePressEvent( self, e ): + if e.button() == Qt.LeftButton: + self.showDate() + + def showDate( self ): + if self.showDateTimer != -1: + return + d = QDate.currentDate() + self.display('%2d %2d' % (d.month(), d.day())) + self.showDateTimer = self.startTimer(2000) + + def stopDate( self ): + self.killTimer(self.showDateTimer) + self.showDateTimer = -1 + self.showTime() + + def showTime( self ): + self.showingColon = not self.showingColon + s = list(str(QTime.currentTime().toString())[:5]) #.left(5) + if not self.showingColon: + s[2] = ' ' + if s[0] == '0': + s[0] = ' ' + s = string.join(s,'') + self.display( s ) + + def QMIN( x, y ): + if y > x: + return y + return x + +TRUE = 1 +FALSE = 0 +MOVIEFILENAME = "trolltech.gif" + +# +# WidgetView contains lots of Qt widgets. +# + +class WidgetView ( QWidget ): + def __init__( self, *args ): + apply( QWidget.__init__, (self,) + args ) + + # Set the window caption/title + self.setCaption( "Qt Widgets Demo Application" ) + + # Install an application-global event filter + qApp.installEventFilter( self ) + + # Create a layout to position the widgets + self.topLayout = QVBoxLayout( self, 10 ) + + # Create a grid layout to hold most of the widgets + self.grid = QGridLayout( 6, 3 ) + + # This layout will get all of the stretch + self.topLayout.addLayout( self.grid, 10 ) + + # Create a menubar + self.menubar = QMenuBar( self ) + self.menubar.setSeparator( QMenuBar.InWindowsStyle ) + + # Create an easter egg + QToolTip.add( self.menubar, QRect( 0, 0, 2, 2 ), "easter egg" ) + + self.popup = QPopupMenu() + self.id = self.popup.insertItem( "&New" ) + self.popup.setItemEnabled( self.id, FALSE ) + self.id = self.popup.insertItem( "&Open" ) + self.popup.setItemEnabled( self.id, FALSE ) + self.popup.insertSeparator() + self.popup.insertItem( "&Quit", qApp, SLOT("quit()"), Qt.CTRL+Qt.Key_Q ) + + self.menubar.insertItem( "&File", self.popup ) + + # Must tell the layout about a menubar in a widget + self.topLayout.setMenuBar( self.menubar ) + + # Create an analog and a digital clock + self.aclock = AnalogClock( self ) + self.aclock.resize( 50, 50 ) + self.dclock = DigitalClock( self ) + self.dclock.setMaximumWidth( 200 ) + self.grid.addWidget( self.aclock, 0, 2 ) + self.grid.addWidget( self.dclock, 1, 2 ) + + # Give the dclock widget a blue palette + col = QColor() + col.setRgb( 0xaa, 0xbe, 0xff ) + self.dclock.setPalette( QPalette( col ) ) + + # make tool tips for both of them + QToolTip.add( self.aclock, "custom widget: analog clock" ) + QToolTip.add( self.dclock, "custom widget: digital clock" ) + + # Create a push button. + self.pb = QPushButton( self, "button1" ) # create button 1 + self.pb.setText( "Push button 1" ) + self.pb.setFixedHeight( self.pb.sizeHint().height() ) + self.grid.addWidget( self.pb, 0, 0, Qt.AlignVCenter ) + self.connect( self.pb, SIGNAL("clicked()"), self.button1Clicked ) + QToolTip.add( self.pb, "push button 1" ) + self.pm = QPixmap() + self.pix = self.pm.load( "qt.png" ) # load pixmap for button 2 + if not self.pix: + QMessageBox.information( None, "Qt Widgets Example", + "Could not load the file \"qt.png\", which\n" + "contains an icon used...\n\n" + "The text \"line 42\" will be substituted.", + QMessageBox.Ok + QMessageBox.Default ) + + # Create a label containing a QMovie + self.movielabel = QLabel( self, "label0" ) + self.movie = QMovie( MOVIEFILENAME ) + self.movie.connectStatus( self.movieStatus ) + self.movie.connectUpdate( self.movieUpdate ) + self.movielabel.setFrameStyle( QFrame.Box | QFrame.Plain ) + self.movielabel.setMovie( self.movie ) + self.movielabel.setMargin( 0 ) + self.movielabel.setFixedSize( 128 + self.movielabel.frameWidth() * 2, + 64 + self.movielabel.frameWidth() * 2 ) + self.grid.addWidget( self.movielabel, 0, 1, Qt.AlignCenter ) + QToolTip.add( self.movielabel, "movie" ) + + # Create a group of check boxes + self.bg = QButtonGroup( self, "checkGroup" ) + self.bg.setTitle( "Check Boxes" ) + self.grid.addWidget( self.bg, 1, 0 ) + + # Create a layout for the check boxes + self.vbox = QVBoxLayout(self.bg, 10) + + self.vbox.addSpacing( self.bg.fontMetrics().height() ) + + self.cb = range(3) + self.cb[0] = QCheckBox( self.bg ) + self.cb[0].setText( "Read" ) + self.vbox.addWidget( self.cb[0] ) + self.cb[0].setMinimumSize( self.cb[0].sizeHint() ) + self.cb[1] = QCheckBox( self.bg ) + self.cb[1].setText( "Write" ) + self.vbox.addWidget( self.cb[1] ) + self.cb[1].setMinimumSize( self.cb[1].sizeHint() ) + self.cb[2] = QCheckBox( self.bg ) + self.cb[2].setText( "Execute" ) + self.cb[2].setMinimumSize( self.cb[2].sizeHint() ) + self.vbox.addWidget( self.cb[2] ) + self.bg.setMinimumSize( self.bg.childrenRect().size() ) + self.vbox.activate() + + self.connect( self.bg, SIGNAL("clicked(int)"), self.checkBoxClicked ) + + QToolTip.add( self.cb[0], "check box 1" ) + QToolTip.add( self.cb[1], "check box 2" ) + QToolTip.add( self.cb[2], "check box 3" ) + + # Create a group of radio buttons + self.bg = QButtonGroup( self, "radioGroup" ) + self.bg.setTitle( "Radio buttons" ) + + self.grid.addWidget( self.bg, 1, 1 ) + + # Create a layout for the radio buttons + self.vbox = QVBoxLayout( self.bg, 10 ) + + self.vbox.addSpacing( self.bg.fontMetrics().height() ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&AM" ) + self.rb.setChecked( TRUE ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + QToolTip.add( self.rb, "radio button 1" ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&FM" ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + QToolTip.add( self.rb, "radio button 2" ) + self.rb = QRadioButton( self.bg ) + self.rb.setText( "&Short Wave" ) + self.vbox.addWidget( self.rb ) + self.rb.setMinimumSize( self.rb.sizeHint() ) + self.vbox.activate() + + self.connect( self.bg, SIGNAL("clicked(int)"), self.radioButtonClicked ) + QToolTip.add( self.rb, "radio button 3" ) + + # Create a list box + self.lb = QListBox( self, "listBox" ) + for i in range( 0, 100, 1 ): # fill list box + txt = QString() + txt = "line %d" % i + if i == 42 and self.pix: + self.lb.insertItem( self.pm ) + else: + self.lb.insertItem( txt ) + + self.grid.addMultiCellWidget( self.lb, 2, 4, 0, 0 ) + self.connect( self.lb, SIGNAL("selected(int)"), self.listBoxItemSelected ) + QToolTip.add( self.lb, "list box" ) + + self.vbox = QVBoxLayout( 8 ) + self.grid.addLayout( self.vbox, 2, 1 ) + + # Create a slider + self.sb = QSlider( 0, 300, 1, 100, QSlider.Horizontal, self, "Slider" ) + self.sb.setTickmarks( QSlider.Below ) + self.sb.setTickInterval( 10 ) + self.sb.setFocusPolicy( QWidget.TabFocus ) + self.sb.setFixedHeight( self.sb.sizeHint().height() ) + self.vbox.addWidget( self.sb ) + + self.connect( self.sb, SIGNAL("valueChanged(int)"), self.sliderValueChanged ) + QToolTip.add( self.sb, "slider" ) + + # Create a combo box + self.combo = QComboBox( FALSE, self, "comboBox" ) + self.combo.insertItem( "darkBlue" ) + self.combo.insertItem( "darkRed" ) + self.combo.insertItem( "darkGreen" ) + self.combo.insertItem( "blue" ) + self.combo.insertItem( "red" ) + self.combo.setFixedHeight( self.combo.sizeHint().height() ) + self.vbox.addWidget( self.combo ) + self.connect( self.combo, SIGNAL("activated(int)"), self.comboBoxItemActivated ) + QToolTip.add( self.combo, "read-only combo box" ) + + # Create an editable combo box + self.edCombo = QComboBox( TRUE, self, "edComboBox" ) + self.edCombo.insertItem( "Permutable" ) + self.edCombo.insertItem( "Malleable" ) + self.edCombo.insertItem( "Adaptable" ) + self.edCombo.insertItem( "Alterable" ) + self.edCombo.insertItem( "Inconstant" ) + self.edCombo.setFixedHeight( self.edCombo.sizeHint().height() ) + self.vbox.addWidget( self.edCombo ) + self.connect( self.edCombo, SIGNAL("activated(const QString &)"), self.edComboBoxItemActivated) + QToolTip.add( self.edCombo, "editable combo box" ) + + self.edCombo.setAutoCompletion( TRUE ) + + self.vbox.addStretch( 1 ) + + self.vbox = QVBoxLayout( 8 ) + self.grid.addLayout( self.vbox, 2, 2 ) + + # Create a spin box + self.spin = QSpinBox( 0, 10, 1, self, "spin" ) + self.spin.setSuffix( " mm" ) + self.spin.setSpecialValueText( "Auto" ) + self.spin.setMinimumSize( self.spin.sizeHint() ) + self.connect( self.spin, SIGNAL( "valueChanged(const QString &)" ), self.spinBoxValueChanged ) + QToolTip.add( self.spin, "spin box" ) + self.vbox.addWidget( self.spin ) + + self.vbox.addStretch( 1 ) + + # Create a multi line edit + self.mle = QMultiLineEdit( self, "multiLineEdit" ) + + self.grid.addMultiCellWidget( self.mle, 3, 3, 1, 2 ) + self.mle.setMinimumHeight( self.mle.fontMetrics().height() * 3 ) + self.mle.setText("This is a QMultiLineEdit widget,\n" + "useful for small multi-line\n" + "input fields.") + QToolTip.add( self.mle, "multi line editor" ) + + # Create a single line edit + self.le = QLineEdit( self, "lineEdit" ) + self.grid.addMultiCellWidget( self.le, 4, 4, 1, 2 ) + self.le.setFixedHeight( self.le.sizeHint().height() ) + self.connect( self.le, SIGNAL("textChanged(const QString &)"), self.lineEditTextChanged ) + QToolTip.add( self.le, "single line editor" ) + + # Create a horizontal line (sort of QFrame) above the message line + self.separator = QFrame( self, "separatorLine" ) + self.separator.setFrameStyle( QFrame.HLine | QFrame.Sunken ) + self.separator.setFixedHeight( self.separator.sizeHint().height() ) + self.grid.addMultiCellWidget( self.separator, 5, 5, 0, 2 ) + QToolTip.add( self.separator, "tool tips on a separator! wow!" ) + + self.grid.setRowStretch( 0, 0 ) + self.grid.setRowStretch( 1, 0 ) + self.grid.setRowStretch( 2, 0 ) + self.grid.setRowStretch( 3, 1 ) + self.grid.setRowStretch( 4, 1 ) + self.grid.setRowStretch( 5, 0 ) + + self.grid.setColStretch( 0, 1 ) + self.grid.setColStretch( 1, 1 ) + self.grid.setColStretch( 2, 1 ) + + # Create an label and a message in a plain widget + # The message is updated when buttons are clicked etc. + + self.hbox = QHBoxLayout() + self.topLayout.addLayout( self.hbox ) + self.msgLabel = QLabel( self, "msgLabel" ) + self.msgLabel.setText( "Message:" ) + self.msgLabel.setAlignment( Qt.AlignHCenter | Qt.AlignVCenter ) + self.msgLabel.setFixedSize( self.msgLabel.sizeHint() ) + self.hbox.addWidget( self.msgLabel ) + QToolTip.add( self.msgLabel, "label 1" ) + + self.msg = QLabel( self, "message" ) + self.msg.setFrameStyle( QFrame.Panel | QFrame.Sunken ) + self.msg.setAlignment( Qt.AlignCenter ) + self.msg.setFont( QFont( "times", 12, QFont.Bold ) ) + self.msg.setText( "Message" ) + self.msg.setFixedHeight( self.msg.sizeHint().height() ) + self.msg.setText( "" ) + self.hbox.addWidget( self.msg, 5 ) + QToolTip.add( self.msg, "label 2" ) + + self.topLayout.activate() + + def setStatus(self, text): + self.msg.setText( text ) + + def movieUpdate( self, r ): + # Uncomment this to test animated icons on your window manager + self.setIcon( self.movie.framePixmap() ) + + def movieStatus( self, s ): + if s == QMovie.SourceEmpty or s == QMovie.UnrecognizedFormat: + pm = QPixmap('tt-logo.png') + self.movielabel.setPixmap(pm) + self.movielabel.setFixedSize(pm.size()) + else: + if ( self.movielabel.movie() ): # for flicker-free animation: + self.movielabel.setBackgroundMode( QWidget.NoBackground ) + + def button1Clicked( self ): + self.msg.setText( "The first push button was clicked" ) + + def checkBoxClicked( self, id ): + txt = "Check box %s clicked : " % str(id) + chk = ["-","-","-"] + if self.cb[0].isChecked(): + chk[0] = "r" + if self.cb[1].isChecked(): + chk[1] = "w" + if self.cb[2].isChecked(): + chk[2] = "x" + txt = txt + str(chk[0]+chk[1]+chk[2]) + self.msg.setText( txt ) + + def edComboBoxItemActivated( self, text): + self.msg.setText( "Editable Combo Box set to %s" % text ) + + def radioButtonClicked( self, id ): + self.msg.setText( "Radio button #%d clicked" % id ) + + def listBoxItemSelected( self, index ): + self.msg.setText( "List box item %d selected" % index ) + + def sliderValueChanged( self, value ): + self.msg.setText( "Movie set to %d%% of normal speed" % value ) + self.movie.setSpeed( value ) + + def comboBoxItemActivated( self, index ): + self.msg.setText( "Combo box item %d activated" % index ) + p = QApplication.palette() + if index == 0: + p.setColor( QColorGroup.Highlight, Qt.darkBlue ) + elif index == 1: + p.setColor( QColorGroup.Highlight, Qt.darkRed ) + elif index == 2: + p.setColor( QColorGroup.Highlight, Qt.darkGreen ) + elif index == 3: + p.setColor( QColorGroup.Highlight, Qt.blue ) + elif index == 4: + p.setColor( QColorGroup.Highlight, Qt.red ) + QApplication.setPalette( p, TRUE ) + + def lineEditTextChanged( self, newText ): + self.msg.setText("Line edit text: " + unicode(newText)) + + def spinBoxValueChanged( self, valueText ): + self.msg.setText("Spin box value: " + unicode(valueText)) + + # All application events are passed throught this event filter. + # We're using it to display some information about a clicked + # widget (right mouse button + CTRL). + #def eventFilter( self, event ): + # identify_now = TRUE + # if event.type() == Event_MouseButtonPress and identify_now: + # e = QMouseEvent( event ) + # if (e.button() == Qt.RightButton) and (e.state() & Qt.ControlButton) != 0: + # txt = QString( "The clicked widget is a\n" ) + # txt = txt + QObect.className() + # txt = txt + "\nThe widget's name is\n" + # if QObject.name(): + # txt = txt + QObject.name() + # else: + # txt = txt + "<no name>" + # identify_now = FALSE # don't do it in message box + # QMessageBox.message( "Identify Widget", txt, 0, QObject ) + # identify_now = TRUE; # allow it again + # return FALSE # don't eat event + +################################################################################################ + +#QApplication.setColourSpec( QApplication.CustomColor ) +a = QApplication( sys.argv ) + +w = WidgetView() +a.setMainWidget( w ) +w.show() +a.exec_loop() diff --git a/python/pyqt/pylupdate3/LICENSE.GPL b/python/pyqt/pylupdate3/LICENSE.GPL new file mode 100644 index 00000000..c7aea189 --- /dev/null +++ b/python/pyqt/pylupdate3/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + 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. + + Preamble + + 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 +rights. + + 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. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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 +circumstances. + +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 +Foundation. + + 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. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/python/pyqt/pylupdate3/fetchtr.cpp b/python/pyqt/pylupdate3/fetchtr.cpp new file mode 100644 index 00000000..609dbc18 --- /dev/null +++ b/python/pyqt/pylupdate3/fetchtr.cpp @@ -0,0 +1,455 @@ +/********************************************************************** +** Copyright (C) 2002 Detlev Offenbach <detlev@die-offenbachs.de> +** +** This is a modified version of lupdate. The original is part of Qt-Linguist. +** The copyright of the original file can be found below. +** +** This version is modified to handle python sources. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + + +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** fetchtr.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qfile.h> +#include <qregexp.h> +#include <qstring.h> +#include <qtextstream.h> + +#include <ctype.h> +#include <errno.h> +#include <metatranslator.h> +#include <stdio.h> +#include <string.h> +/*#include <qxml.h>*/ + + +static const char MagicComment[] = "TRANSLATOR "; + +static QMap<QCString, int> needs_Q_OBJECT; +static QMap<QCString, int> lacks_Q_OBJECT; + +/* + The first part of this source file is the python tokenizer. We skip + most of python; the only tokens that interest us are defined here. +*/ + +enum { Tok_Eof, Tok_class, Tok_return, Tok_tr, + Tok_trUtf8, Tok_translate, Tok_Ident, + Tok_Comment, Tok_Dot, Tok_String, + Tok_LeftParen, Tok_RightParen, + Tok_Comma}; + +/* + The tokenizer maintains the following global variables. The names + should be self-explanatory. +*/ +static QCString yyFileName; +static int yyCh; +static char yyIdent[128]; +static size_t yyIdentLen; +static char yyComment[65536]; +static size_t yyCommentLen; +static char yyString[16384]; +static size_t yyStringLen; +static int yyParenDepth; +static int yyLineNo; +static int yyCurLineNo; + +// the file to read from (if reading from a file) +static FILE *yyInFile; + +// the string to read from and current position in the string (otherwise) +static QString yyInStr; +static int yyInPos; +static int buf; + +static int (*getChar)(); +static int (*peekChar)(); + +static int getCharFromFile() +{ + int c; + + if ( buf < 0 ) + c = getc( yyInFile ); + else { + c = buf; + buf = -1; + } + if ( c == '\n' ) + yyCurLineNo++; + return c; +} + +static int peekCharFromFile() +{ + int c = getc( yyInFile ); + buf = c; + return c; +} + +static void startTokenizer( const char *fileName, int (*getCharFunc)(), + int (*peekCharFunc)() ) +{ + yyInPos = 0; + buf = -1; + getChar = getCharFunc; + peekChar = peekCharFunc; + + yyFileName = fileName; + yyCh = getChar(); + yyParenDepth = 0; + yyCurLineNo = 1; +} + +static int getToken() +{ + const char tab[] = "abfnrtv"; + const char backTab[] = "\a\b\f\n\r\t\v"; + uint n; + + yyIdentLen = 0; + yyCommentLen = 0; + yyStringLen = 0; + + while ( yyCh != EOF ) { + yyLineNo = yyCurLineNo; + + if ( isalpha(yyCh) || yyCh == '_' ) { + do { + if ( yyIdentLen < sizeof(yyIdent) - 1 ) + yyIdent[yyIdentLen++] = (char) yyCh; + yyCh = getChar(); + } while ( isalnum(yyCh) || yyCh == '_' ); + yyIdent[yyIdentLen] = '\0'; + + switch ( yyIdent[0] ) { + case 'Q': + if ( strcmp(yyIdent + 1, "T_TR_NOOP") == 0 ) { + return Tok_tr; + } else if ( strcmp(yyIdent + 1, "T_TRANSLATE_NOOP") == 0 ) { + return Tok_translate; + } + break; + case 'c': + if ( strcmp(yyIdent + 1, "lass") == 0 ) + return Tok_class; + break; + case 'r': + if ( strcmp(yyIdent + 1, "eturn") == 0 ) + return Tok_return; + break; + case 't': + if ( strcmp(yyIdent + 1, "r") == 0 ) + return Tok_tr; + else if ( strcmp(yyIdent + 1, "rUtf8") == 0 ) + return Tok_trUtf8; + else if ( strcmp(yyIdent + 1, "ranslate") == 0 ) + return Tok_translate; + case '_': + if ( strcmp(yyIdent + 1, "_tr") == 0 ) + return Tok_tr; + else if ( strcmp(yyIdent + 1, "_trUtf8") == 0 ) + return Tok_trUtf8; + } + return Tok_Ident; + } else { + switch ( yyCh ) { + case '#': + yyCh = getChar(); + do { + yyCh = getChar(); + } while ( yyCh != EOF && yyCh != '\n' ); + break; + case '"': + case '\'': + int quoteChar; + int trippelQuote, singleQuote; + int in; + + quoteChar = yyCh; + trippelQuote = 0; + singleQuote = 1; + in = 0; + yyCh = getChar(); + + while ( yyCh != EOF ) { + if ( singleQuote && (yyCh == '\n' || (in && yyCh == quoteChar)) ) + break; + + if ( yyCh == quoteChar ) { + if (peekChar() == quoteChar) { + yyCh = getChar(); + if (!trippelQuote) { + trippelQuote = 1; + singleQuote = 0; + in = 1; + yyCh = getChar(); + } else { + yyCh = getChar(); + if (yyCh == quoteChar) { + trippelQuote = 0; + break; + } + } + } else if (trippelQuote) { + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) yyCh; + yyCh = getChar(); + continue; + } else + break; + } else + in = 1; + + if ( yyCh == '\\' ) { + yyCh = getChar(); + + if ( yyCh == 'x' ) { + QCString hex = "0"; + + yyCh = getChar(); + while ( isxdigit(yyCh) ) { + hex += (char) yyCh; + yyCh = getChar(); + } + sscanf( hex, "%x", &n ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) n; + } else if ( yyCh >= '0' && yyCh < '8' ) { + QCString oct = ""; + + do { + oct += (char) yyCh; + yyCh = getChar(); + } while ( yyCh >= '0' && yyCh < '8' ); + sscanf( oct, "%o", &n ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) n; + } else { + const char *p = strchr( tab, yyCh ); + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = ( p == 0 ) ? + (char) yyCh : backTab[p - tab]; + yyCh = getChar(); + } + } else { + if ( yyStringLen < sizeof(yyString) - 1 ) + yyString[yyStringLen++] = (char) yyCh; + yyCh = getChar(); + } + } + yyString[yyStringLen] = '\0'; + + if ( yyCh != quoteChar ) { + printf("%c\n", yyCh); + qWarning( "%s:%d: Unterminated string", + (const char *) yyFileName, yyLineNo ); + } + + if ( yyCh == EOF ) { + return Tok_Eof; + } else { + yyCh = getChar(); + return Tok_String; + } + break; + case '(': + yyParenDepth++; + yyCh = getChar(); + return Tok_LeftParen; + case ')': + yyParenDepth--; + yyCh = getChar(); + return Tok_RightParen; + case ',': + yyCh = getChar(); + return Tok_Comma; + case '.': + yyCh = getChar(); + return Tok_Dot; + default: + yyCh = getChar(); + } + } + } + return Tok_Eof; +} + +/* + The second part of this source file is the parser. It accomplishes + a very easy task: It finds all strings inside a tr() or translate() + call, and possibly finds out the context of the call. It supports + three cases: + (1) the context is specified, as in FunnyDialog.tr("Hello") or + translate("FunnyDialog", "Hello"); + (2) the call appears within an inlined function; + (3) the call appears within a function defined outside the class definition. +*/ + +static int yyTok; + +static bool match( int t ) +{ + bool matches = ( yyTok == t ); + if ( matches ) + yyTok = getToken(); + return matches; +} + +static bool matchString( QCString *s ) +{ + bool matches = ( yyTok == Tok_String ); + *s = ""; + while ( yyTok == Tok_String ) { + *s += yyString; + yyTok = getToken(); + } + return matches; +} + +static bool matchEncoding( bool *utf8 ) +{ + if ( yyTok == Tok_Ident ) { + if ( strcmp(yyIdent, "QApplication") == 0 ) { + yyTok = getToken(); + } + *utf8 = QString( yyIdent ).endsWith( QString("UTF8") ); + yyTok = getToken(); + return TRUE; + } else { + return FALSE; + } +} + +static void parse( MetaTranslator *tor, const char *initialContext, + const char *defaultContext ) +{ + QMap<QCString, QCString> qualifiedContexts; + QCString context; + QCString text; + QCString com; + QCString functionContext = initialContext; + QCString prefix; + bool utf8 = FALSE; + + yyTok = getToken(); + while ( yyTok != Tok_Eof ) { + switch ( yyTok ) { + case Tok_class: + yyTok = getToken(); + functionContext = yyIdent; + yyTok = getToken(); + break; + case Tok_tr: + case Tok_trUtf8: + utf8 = ( yyTok == Tok_trUtf8 ); + yyTok = getToken(); + if ( match(Tok_LeftParen) && matchString(&text) ) { + com = ""; + if ( match(Tok_RightParen) || (match(Tok_Comma) && + matchString(&com) && match(Tok_RightParen)) ) { + if ( prefix.isNull() ) { + context = defaultContext; + } else if ( qstrcmp(prefix, "self") == 0 ) { + context = functionContext; + } else { + context = prefix; + } + prefix = (const char *) 0; + + if ( qualifiedContexts.contains(context) ) + context = qualifiedContexts[context]; + tor->insert( MetaTranslatorMessage(context, text, com, + QString::null, utf8) ); + } + } + break; + case Tok_translate: + utf8 = FALSE; + yyTok = getToken(); + if ( match(Tok_LeftParen) && + matchString(&context) && + match(Tok_Comma) && + matchString(&text) ) { + com = ""; + if ( match(Tok_RightParen) || + (match(Tok_Comma) && + matchString(&com) && + (match(Tok_RightParen) || + match(Tok_Comma) && + matchEncoding(&utf8) && + match(Tok_RightParen))) ) + tor->insert( MetaTranslatorMessage(context, text, com, + QString::null, utf8) ); + } + break; + case Tok_Ident: + if ( !prefix.isNull() ) + prefix += "."; + prefix += yyIdent; + yyTok = getToken(); + if ( yyTok != Tok_Dot ) + prefix = (const char *) 0; + break; + case Tok_Comment: + com = yyComment; + com = com.simplifyWhiteSpace(); + if ( com.left(sizeof(MagicComment) - 1) == MagicComment ) { + com.remove( 0, sizeof(MagicComment) - 1 ); + int k = com.find( ' ' ); + if ( k == -1 ) { + context = com; + } else { + context = com.left( k ); + com.remove( 0, k + 1 ); + tor->insert( MetaTranslatorMessage(context, "", com, + QString::null, FALSE) ); + } + } + yyTok = getToken(); + break; + default: + yyTok = getToken(); + } + } + + if ( yyParenDepth != 0 ) + qWarning( "%s: Unbalanced parentheses in Python code", + (const char *) yyFileName ); +} + +void fetchtr_py( const char *fileName, MetaTranslator *tor, + const char *defaultContext, bool mustExist ) +{ + yyInFile = fopen( fileName, "r" ); + if ( yyInFile == 0 ) { + if ( mustExist ) + qWarning( "pylupdate error: cannot open Python source file '%s': %s", + fileName, strerror(errno) ); + return; + } + + startTokenizer( fileName, getCharFromFile, peekCharFromFile ); + parse( tor, 0, defaultContext ); + fclose( yyInFile ); +} diff --git a/python/pyqt/pylupdate3/main.cpp b/python/pyqt/pylupdate3/main.cpp new file mode 100644 index 00000000..427fed51 --- /dev/null +++ b/python/pyqt/pylupdate3/main.cpp @@ -0,0 +1,155 @@ +/********************************************************************** +** Copyright (C) 2002 Detlev Offenbach <detlev@die-offenbachs.de> +** +** This is a modified version of lupdate. The original is part of Qt-Linguist. +** The copyright of the original file can be found below. +** +** This version is modified to handle python sources. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + + +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** main.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qfile.h> +#include <qstring.h> +#include <qstringlist.h> +#include <qtextstream.h> + +#include <errno.h> +#include <metatranslator.h> +#include <proparser.h> +#include <string.h> + +// defined in fetchtr.cpp +extern void fetchtr_py( const char *fileName, MetaTranslator *tor, + const char *defaultContext, bool mustExist ); + +// defined in merge.cpp +extern void merge( MetaTranslator *tor, const MetaTranslator *virginTor, + bool verbose ); + +typedef QValueList<MetaTranslatorMessage> TML; + +static void printUsage() +{ + qWarning( "Usage: pylupdate [options] file.pro...\n" + "Options:\n" + " -help Display this information and exits\n" + " -noobsolete\n" + " Drop all obsolete strings\n" + " -verbose\n" + " Explain what is being done\n" + " -version\n" + " Display the version of pylupdate and exits" ); +} + +int main( int argc, char **argv ) +{ + bool verbose = FALSE; + bool noObsolete = FALSE; + bool metSomething = FALSE; + int numProFiles = 0; + + for ( int i = 1; i < argc; i++ ) { + if ( qstrcmp(argv[i], "-help") == 0 ) { + printUsage(); + return 0; + } else if ( qstrcmp(argv[i], "-noobsolete") == 0 ) { + noObsolete = TRUE; + continue; + } else if ( qstrcmp(argv[i], "-verbose") == 0 ) { + verbose = TRUE; + continue; + } else if ( qstrcmp(argv[i], "-version") == 0 ) { + qWarning( "pylupdate version %s", QT_VERSION_STR ); + return 0; + } + + numProFiles++; + QFile f( argv[i] ); + if ( !f.open(IO_ReadOnly) ) { + qWarning( "pylupdate error: Cannot open project file '%s': %s", + argv[i], strerror(errno) ); + return 1; + } + + QTextStream t( &f ); + QString fullText = t.read(); + f.close(); + + MetaTranslator fetchedTor; + QString defaultContext = "@default"; + QCString codec; + QStringList translatorFiles; + QStringList::Iterator tf; + + QMap<QString, QString> tagMap = proFileTagMap( fullText ); + QMap<QString, QString>::Iterator it; + + for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { + QStringList toks = QStringList::split( QChar(' '), it.data() ); + QStringList::Iterator t; + + for ( t = toks.begin(); t != toks.end(); ++t ) { + if ( it.key() == QString("SOURCES") ) { + fetchtr_py( *t, &fetchedTor, + defaultContext, TRUE ); + metSomething = TRUE; + } else if ( it.key() == QString("TRANSLATIONS") ) { + translatorFiles.append( *t ); + metSomething = TRUE; + } else if ( it.key() == QString("CODEC") ) { + codec = (*t).latin1(); + } + } + } + + for ( tf = translatorFiles.begin(); tf != translatorFiles.end(); ++tf ) { + MetaTranslator tor; + tor.load( *tf ); + if ( !codec.isEmpty() ) + tor.setCodec( codec ); + if ( verbose ) + qWarning( "Updating '%s'...", (*tf).latin1() ); + merge( &tor, &fetchedTor, verbose ); + if ( noObsolete ) + tor.stripObsoleteMessages(); + tor.stripEmptyContexts(); + if ( !tor.save(*tf) ) + qWarning( "pylupdate error: Cannot save '%s': %s", (*tf).latin1(), + strerror(errno) ); + } + if ( !metSomething ) { + qWarning( "pylupdate warning: File '%s' does not look like a project" + " file", argv[i] ); + } else if ( translatorFiles.isEmpty() ) { + qWarning( "pylupdate warning: Met no 'TRANSLATIONS' entry in project" + " file '%s'", argv[i] ); + } + } + + if ( numProFiles == 0 ) { + printUsage(); + return 1; + } + return 0; +} diff --git a/python/pyqt/pylupdate3/merge.cpp b/python/pyqt/pylupdate3/merge.cpp new file mode 100644 index 00000000..c569c938 --- /dev/null +++ b/python/pyqt/pylupdate3/merge.cpp @@ -0,0 +1,110 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** merge.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <metatranslator.h> + +// defined in numberh.cpp +extern void applyNumberHeuristic( MetaTranslator *tor, bool verbose ); +// defined in sametexth.cpp +extern void applySameTextHeuristic( MetaTranslator *tor, bool verbose ); + +typedef QValueList<MetaTranslatorMessage> TML; + +/* + Merges two MetaTranslator objects into the first one. The first one is a set + of source texts and translations for a previous version of the + internationalized program; the second one is a set of fresh source text newly + extracted from the source code, without any translation yet. +*/ + +void merge( MetaTranslator *tor, const MetaTranslator *virginTor, bool verbose ) +{ + int known = 0; + int neww = 0; + int obsoleted = 0; + TML all = tor->messages(); + TML::Iterator it; + + /* + The types of all the messages from the vernacular translator are updated + according to the virgin translator. + */ + for ( it = all.begin(); it != all.end(); ++it ) { + MetaTranslatorMessage::Type newType = MetaTranslatorMessage::Unfinished; + MetaTranslatorMessage m = *it; + + // skip context comment + if ( !QCString((*it).sourceText()).isEmpty() ) { + if ( !virginTor->contains((*it).context(), (*it).sourceText(), + (*it).comment()) ) { + newType = MetaTranslatorMessage::Obsolete; + if ( m.type() != MetaTranslatorMessage::Obsolete ) + obsoleted++; + } else { + switch ( m.type() ) { + case MetaTranslatorMessage::Finished: + newType = MetaTranslatorMessage::Finished; + known++; + break; + case MetaTranslatorMessage::Unfinished: + newType = MetaTranslatorMessage::Unfinished; + known++; + break; + case MetaTranslatorMessage::Obsolete: + newType = MetaTranslatorMessage::Unfinished; + neww++; + } + } + + if ( newType != m.type() ) { + m.setType( newType ); + tor->insert( m ); + } + } + } + + /* + Messages found only in the virgin translator are added to the + vernacular translator. Among these are all the context comments. + */ + all = virginTor->messages(); + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( !tor->contains((*it).context(), (*it).sourceText(), + (*it).comment()) ) { + tor->insert( *it ); + if ( !QCString((*it).sourceText()).isEmpty() ) + neww++; + } + } + + /* + The same-text heuristic handles cases where a message has an + obsolete counterpart with a different context or comment. + */ + applySameTextHeuristic( tor, verbose ); + + /* + The number heuristic handles cases where a message has an + obsolete counterpart with mostly numbers differing in the + source text. + */ + applyNumberHeuristic( tor, verbose ); + + if ( verbose ) + qWarning( " %d known, %d new and %d obsoleted messages", + known, neww, obsoleted ); +} diff --git a/python/pyqt/pylupdate3/metatranslator.cpp b/python/pyqt/pylupdate3/metatranslator.cpp new file mode 100644 index 00000000..c3d06738 --- /dev/null +++ b/python/pyqt/pylupdate3/metatranslator.cpp @@ -0,0 +1,557 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** metatranslator.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qapplication.h> +#include <qcstring.h> +#include <qfile.h> +#include <qmessagebox.h> +#include <qregexp.h> +#include <qtextcodec.h> +#include <qtextstream.h> +#include <qxml.h> + +#include "metatranslator.h" + +static bool encodingIsUtf8( const QXmlAttributes& atts ) +{ + for ( int i = 0; i < atts.length(); i++ ) { + // utf8="true" is a pre-3.0 syntax + if ( atts.qName(i) == QString("utf8") ) { + return ( atts.value(i) == QString("true") ); + } else if ( atts.qName(i) == QString("encoding") ) { + return ( atts.value(i) == QString("UTF-8") ); + } + } + return FALSE; +} + +class TsHandler : public QXmlDefaultHandler +{ +public: + TsHandler( MetaTranslator *translator ) + : tor( translator ), type( MetaTranslatorMessage::Finished ), + inMessage( FALSE ), ferrorCount( 0 ), contextIsUtf8( FALSE ), + messageIsUtf8( FALSE ) { } + + virtual bool startElement( const QString& namespaceURI, + const QString& localName, const QString& qName, + const QXmlAttributes& atts ); + virtual bool endElement( const QString& namespaceURI, + const QString& localName, const QString& qName ); + virtual bool characters( const QString& ch ); + virtual bool fatalError( const QXmlParseException& exception ); + +private: + MetaTranslator *tor; + MetaTranslatorMessage::Type type; + bool inMessage; + QString context; + QString source; + QString comment; + QString translation; + + QString accum; + int ferrorCount; + bool contextIsUtf8; + bool messageIsUtf8; +}; + +bool TsHandler::startElement( const QString& /* namespaceURI */, + const QString& /* localName */, + const QString& qName, + const QXmlAttributes& atts ) +{ + if ( qName == QString("byte") ) { + for ( int i = 0; i < atts.length(); i++ ) { + if ( atts.qName(i) == QString("value") ) { + QString value = atts.value( i ); + int base = 10; + if ( value.startsWith("x") ) { + base = 16; + value = value.mid( 1 ); + } + int n = value.toUInt( 0, base ); + if ( n != 0 ) + accum += QChar( n ); + } + } + } else { + if ( qName == QString("context") ) { + context.truncate( 0 ); + source.truncate( 0 ); + comment.truncate( 0 ); + translation.truncate( 0 ); + contextIsUtf8 = encodingIsUtf8( atts ); + } else if ( qName == QString("message") ) { + inMessage = TRUE; + type = MetaTranslatorMessage::Finished; + source.truncate( 0 ); + comment.truncate( 0 ); + translation.truncate( 0 ); + messageIsUtf8 = encodingIsUtf8( atts ); + } else if ( qName == QString("translation") ) { + for ( int i = 0; i < atts.length(); i++ ) { + if ( atts.qName(i) == QString("type") ) { + if ( atts.value(i) == QString("unfinished") ) + type = MetaTranslatorMessage::Unfinished; + else if ( atts.value(i) == QString("obsolete") ) + type = MetaTranslatorMessage::Obsolete; + else + type = MetaTranslatorMessage::Finished; + } + } + } + accum.truncate( 0 ); + } + return TRUE; +} + +bool TsHandler::endElement( const QString& /* namespaceURI */, + const QString& /* localName */, + const QString& qName ) +{ + if ( qName == QString("codec") || qName == QString("defaultcodec") ) { + // "codec" is a pre-3.0 syntax + tor->setCodec( accum ); + } else if ( qName == QString("name") ) { + context = accum; + } else if ( qName == QString("source") ) { + source = accum; + } else if ( qName == QString("comment") ) { + if ( inMessage ) { + comment = accum; + } else { + if ( contextIsUtf8 ) + tor->insert( MetaTranslatorMessage(context.utf8(), "", + accum.utf8(), QString::null, TRUE, + MetaTranslatorMessage::Unfinished) ); + else + tor->insert( MetaTranslatorMessage(context.ascii(), "", + accum.ascii(), QString::null, FALSE, + MetaTranslatorMessage::Unfinished) ); + } + } else if ( qName == QString("translation") ) { + translation = accum; + } else if ( qName == QString("message") ) { + if ( messageIsUtf8 ) + tor->insert( MetaTranslatorMessage(context.utf8(), source.utf8(), + comment.utf8(), translation, + TRUE, type) ); + else + tor->insert( MetaTranslatorMessage(context.ascii(), source.ascii(), + comment.ascii(), translation, + FALSE, type) ); + inMessage = FALSE; + } + return TRUE; +} + +bool TsHandler::characters( const QString& ch ) +{ + QString t = ch; + t.replace( QRegExp(QChar('\r')), "" ); + accum += t; + return TRUE; +} + +bool TsHandler::fatalError( const QXmlParseException& exception ) +{ + if ( ferrorCount++ == 0 ) { + QString msg; + msg.sprintf( "Parse error at line %d, column %d (%s).", + exception.lineNumber(), exception.columnNumber(), + exception.message().latin1() ); + if ( qApp == 0 ) + qWarning( "XML error: %s", msg.latin1() ); + else + QMessageBox::information( qApp->mainWidget(), + QObject::tr("Qt Linguist"), msg ); + } + return FALSE; +} + +static QString numericEntity( int ch ) +{ + return QString( ch <= 0x20 ? "<byte value=\"x%1\"/>" : "&#x%1;" ) + .arg( ch, 0, 16 ); +} + +static QString protect( const QCString& str ) +{ + QString result; + int len = (int) str.length(); + for ( int k = 0; k < len; k++ ) { + switch( str[k] ) { + case '\"': + result += QString( """ ); + break; + case '&': + result += QString( "&" ); + break; + case '>': + result += QString( ">" ); + break; + case '<': + result += QString( "<" ); + break; + case '\'': + result += QString( "'" ); + break; + default: + if ( (uchar) str[k] < 0x20 && str[k] != '\n' ) + result += numericEntity( (uchar) str[k] ); + else + result += str[k]; + } + } + return result; +} + +static QString evilBytes( const QCString& str, bool utf8 ) +{ + if ( utf8 ) { + return protect( str ); + } else { + QString result; + QCString t = protect( str ).latin1(); + int len = (int) t.length(); + for ( int k = 0; k < len; k++ ) { + if ( (uchar) t[k] >= 0x7f ) + result += numericEntity( (uchar) t[k] ); + else + result += QChar( t[k] ); + } + return result; + } +} + +MetaTranslatorMessage::MetaTranslatorMessage() + : utfeight( FALSE ), ty( Unfinished ) +{ +} + +MetaTranslatorMessage::MetaTranslatorMessage( const char *context, + const char *sourceText, + const char *comment, + const QString& translation, + bool utf8, Type type ) + : QTranslatorMessage( context, sourceText, comment, translation ), + utfeight( FALSE ), ty( type ) +{ + /* + Don't use UTF-8 if it makes no difference. UTF-8 should be + reserved for the real problematic case: non-ASCII (possibly + non-Latin-1) characters in .ui files. + */ + if ( utf8 ) { + if ( sourceText != 0 ) { + int i = 0; + while ( sourceText[i] != '\0' ) { + if ( (uchar) sourceText[i] >= 0x80 ) { + utfeight = TRUE; + break; + } + i++; + } + } + if ( !utfeight && comment != 0 ) { + int i = 0; + while ( comment[i] != '\0' ) { + if ( (uchar) comment[i] >= 0x80 ) { + utfeight = TRUE; + break; + } + i++; + } + } + } +} + +MetaTranslatorMessage::MetaTranslatorMessage( const MetaTranslatorMessage& m ) + : QTranslatorMessage( m ), utfeight( m.utfeight ), ty( m.ty ) +{ +} + +MetaTranslatorMessage& MetaTranslatorMessage::operator=( + const MetaTranslatorMessage& m ) +{ + QTranslatorMessage::operator=( m ); + utfeight = m.utfeight; + ty = m.ty; + return *this; +} + +bool MetaTranslatorMessage::operator==( const MetaTranslatorMessage& m ) const +{ + return qstrcmp( context(), m.context() ) == 0 && + qstrcmp( sourceText(), m.sourceText() ) == 0 && + qstrcmp( comment(), m.comment() ) == 0; +} + +bool MetaTranslatorMessage::operator<( const MetaTranslatorMessage& m ) const +{ + int delta = qstrcmp( context(), m.context() ); + if ( delta == 0 ) + delta = qstrcmp( sourceText(), m.sourceText() ); + if ( delta == 0 ) + delta = qstrcmp( comment(), m.comment() ); + return delta < 0; +} + +MetaTranslator::MetaTranslator() + : codecName( "ISO-8859-1" ), codec( 0 ) +{ +} + +MetaTranslator::MetaTranslator( const MetaTranslator& tor ) + : mm( tor.mm ), codecName( tor.codecName ), codec( tor.codec ) +{ + +} + +MetaTranslator& MetaTranslator::operator=( const MetaTranslator& tor ) +{ + mm = tor.mm; + codecName = tor.codecName; + codec = tor.codec; + return *this; +} + +bool MetaTranslator::load( const QString& filename ) +{ + mm.clear(); + + QFile f( filename ); + if ( !f.open(IO_ReadOnly) ) + return FALSE; + + QTextStream t( &f ); + QXmlInputSource in( t ); + QXmlSimpleReader reader; + // don't click on these! + reader.setFeature( "http://xml.org/sax/features/namespaces", FALSE ); + reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", TRUE ); + reader.setFeature( "http://trolltech.com/xml/features/report-whitespace" + "-only-CharData", FALSE ); + QXmlDefaultHandler *hand = new TsHandler( this ); + reader.setContentHandler( hand ); + reader.setErrorHandler( hand ); + + bool ok = reader.parse( in ); + reader.setContentHandler( 0 ); + reader.setErrorHandler( 0 ); + delete hand; + f.close(); + if ( !ok ) + mm.clear(); + return ok; +} + +bool MetaTranslator::save( const QString& filename ) const +{ + QFile f( filename ); + if ( !f.open(IO_WriteOnly) ) + return FALSE; + + QTextStream t( &f ); + t.setCodec( QTextCodec::codecForName("ISO-8859-1") ); + + t << "<!DOCTYPE TS><TS>\n"; + if ( codecName != "ISO-8859-1" ) + t << "<defaultcodec>" << codecName << "</defaultcodec>\n"; + TMM::ConstIterator m = mm.begin(); + while ( m != mm.end() ) { + TMMInv inv; + TMMInv::Iterator i; + bool contextIsUtf8 = m.key().utf8(); + QCString context = m.key().context(); + QCString comment = ""; + + do { + if ( QCString(m.key().sourceText()).isEmpty() ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { + contextIsUtf8 = m.key().utf8(); + comment = QCString( m.key().comment() ); + } + } else { + inv.insert( *m, m.key() ); + } + } while ( ++m != mm.end() && QCString(m.key().context()) == context ); + + t << "<context"; + if ( contextIsUtf8 ) + t << " encoding=\"UTF-8\""; + t << ">\n"; + t << " <name>" << evilBytes( context, contextIsUtf8 ) + << "</name>\n"; + if ( !comment.isEmpty() ) + t << " <comment>" << evilBytes( comment, contextIsUtf8 ) + << "</comment>\n"; + + for ( i = inv.begin(); i != inv.end(); ++i ) { + t << " <message"; + if ( (*i).utf8() ) + t << " encoding=\"UTF-8\""; + t << ">\n" + << " <source>" << evilBytes( (*i).sourceText(), + (*i).utf8() ) + << "</source>\n"; + if ( !QCString((*i).comment()).isEmpty() ) + t << " <comment>" << evilBytes( (*i).comment(), + (*i).utf8() ) + << "</comment>\n"; + t << " <translation"; + if ( (*i).type() == MetaTranslatorMessage::Unfinished ) + t << " type=\"unfinished\""; + else if ( (*i).type() == MetaTranslatorMessage::Obsolete ) + t << " type=\"obsolete\""; + t << ">" << protect( (*i).translation().utf8() ) + << "</translation>\n"; + t << " </message>\n"; + } + t << "</context>\n"; + } + t << "</TS>\n"; + f.close(); + return TRUE; +} + +bool MetaTranslator::release( const QString& filename, bool verbose ) const +{ + QTranslator tor( 0 ); + int finished = 0; + int unfinished = 0; + int untranslated = 0; + TMM::ConstIterator m; + + for ( m = mm.begin(); m != mm.end(); ++m ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) { + if ( m.key().translation().isEmpty() ) { + untranslated++; + } else { + if ( m.key().type() == MetaTranslatorMessage::Unfinished ) + unfinished++; + else + finished++; + tor.insert( m.key() ); + } + } + } + + bool saved = tor.save( filename, QTranslator::Stripped ); + if ( saved && verbose ) + qWarning( " %d finished, %d unfinished and %d untranslated messages", + finished, unfinished, untranslated ); + + return saved; +} + +bool MetaTranslator::contains( const char *context, const char *sourceText, + const char *comment ) const +{ + return mm.find( MetaTranslatorMessage(context, sourceText, comment) ) != + mm.end(); +} + +void MetaTranslator::insert( const MetaTranslatorMessage& m ) +{ + int pos = mm.count(); + TMM::Iterator n = mm.find( m ); + if ( n != mm.end() ) + pos = *n; + mm.replace( m, pos ); +} + +void MetaTranslator::stripObsoleteMessages() +{ + TMM newmm; + + TMM::Iterator m = mm.begin(); + while ( m != mm.end() ) { + if ( m.key().type() != MetaTranslatorMessage::Obsolete ) + newmm.insert( m.key(), *m ); + ++m; + } + mm = newmm; +} + +void MetaTranslator::stripEmptyContexts() +{ + TMM newmm; + + TMM::Iterator m = mm.begin(); + while ( m != mm.end() ) { + if ( QCString(m.key().sourceText()).isEmpty() ) { + TMM::Iterator n = m; + ++n; + // the context comment is followed by other messages + if ( n != newmm.end() && + qstrcmp(m.key().context(), n.key().context()) == 0 ) + newmm.insert( m.key(), *m ); + } else { + newmm.insert( m.key(), *m ); + } + ++m; + } + mm = newmm; +} + +void MetaTranslator::setCodec( const char *name ) +{ + const int latin1 = 4; + + codecName = name; + codec = QTextCodec::codecForName( name ); + if ( codec == 0 || codec->mibEnum() == latin1 ) + codec = 0; +} + +QString MetaTranslator::toUnicode( const char *str, bool utf8 ) const +{ + if ( utf8 ) + return QString::fromUtf8( str ); + else if ( codec == 0 ) + return QString( str ); + else + return codec->toUnicode( str ); +} + +QValueList<MetaTranslatorMessage> MetaTranslator::messages() const +{ + int n = mm.count(); + TMM::ConstIterator *t = new TMM::ConstIterator[n + 1]; + TMM::ConstIterator m; + for ( m = mm.begin(); m != mm.end(); ++m ) + t[*m] = m; + + QValueList<MetaTranslatorMessage> val; + for ( int i = 0; i < n; i++ ) + val.append( t[i].key() ); + + delete[] t; + return val; +} + +QValueList<MetaTranslatorMessage> MetaTranslator::translatedMessages() const +{ + QValueList<MetaTranslatorMessage> val; + TMM::ConstIterator m; + for ( m = mm.begin(); m != mm.end(); ++m ) { + if ( m.key().type() == MetaTranslatorMessage::Finished ) + val.append( m.key() ); + } + return val; +} diff --git a/python/pyqt/pylupdate3/metatranslator.h b/python/pyqt/pylupdate3/metatranslator.h new file mode 100644 index 00000000..a071207e --- /dev/null +++ b/python/pyqt/pylupdate3/metatranslator.h @@ -0,0 +1,95 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** metatranslator.h +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef METATRANSLATOR_H +#define METATRANSLATOR_H + +#include <qmap.h> +#include <qstring.h> +#include <qtranslator.h> +#include <qvaluelist.h> + +class QTextCodec; + +class MetaTranslatorMessage : public QTranslatorMessage +{ +public: + enum Type { Unfinished, Finished, Obsolete }; + + MetaTranslatorMessage(); + MetaTranslatorMessage( const char *context, const char *sourceText, + const char *comment, + const QString& translation = QString::null, + bool utf8 = FALSE, Type type = Unfinished ); + MetaTranslatorMessage( const MetaTranslatorMessage& m ); + + MetaTranslatorMessage& operator=( const MetaTranslatorMessage& m ); + + void setType( Type nt ) { ty = nt; } + Type type() const { return ty; } + bool utf8() const { return utfeight; } + + bool operator==( const MetaTranslatorMessage& m ) const; + bool operator!=( const MetaTranslatorMessage& m ) const + { return !operator==( m ); } + bool operator<( const MetaTranslatorMessage& m ) const; + bool operator<=( const MetaTranslatorMessage& m ) + { return !operator>( m ); } + bool operator>( const MetaTranslatorMessage& m ) const + { return this->operator<( m ); } + bool operator>=( const MetaTranslatorMessage& m ) const + { return !operator<( m ); } + +private: + bool utfeight; + Type ty; +}; + +class MetaTranslator +{ +public: + MetaTranslator(); + MetaTranslator( const MetaTranslator& tor ); + + MetaTranslator& operator=( const MetaTranslator& tor ); + + bool load( const QString& filename ); + bool save( const QString& filename ) const; + bool release( const QString& filename, bool verbose = FALSE ) const; + + bool contains( const char *context, const char *sourceText, + const char *comment ) const; + void insert( const MetaTranslatorMessage& m ); + + void stripObsoleteMessages(); + void stripEmptyContexts(); + + void setCodec( const char *name ); + QString toUnicode( const char *str, bool utf8 ) const; + + QValueList<MetaTranslatorMessage> messages() const; + QValueList<MetaTranslatorMessage> translatedMessages() const; + +private: + typedef QMap<MetaTranslatorMessage, int> TMM; + typedef QMap<int, MetaTranslatorMessage> TMMInv; + + TMM mm; + QCString codecName; + QTextCodec *codec; +}; + +#endif diff --git a/python/pyqt/pylupdate3/numberh.cpp b/python/pyqt/pylupdate3/numberh.cpp new file mode 100644 index 00000000..67048031 --- /dev/null +++ b/python/pyqt/pylupdate3/numberh.cpp @@ -0,0 +1,230 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** numberh.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qmemarray.h> +#include <qcstring.h> +#include <qmap.h> +#include <qstringlist.h> + +#include <ctype.h> +#include <metatranslator.h> + +typedef QMap<QCString, MetaTranslatorMessage> TMM; +typedef QValueList<MetaTranslatorMessage> TML; + +static bool isDigitFriendly( int c ) +{ + return ispunct( c ) || isspace( c ); +} + +static int numberLength( const char *s ) +{ + int i = 0; + + if ( isdigit(s[0]) ) { + do { + i++; + } while ( isdigit(s[i]) || + (isDigitFriendly(s[i]) && + (isdigit(s[i + 1]) || + (isDigitFriendly(s[i + 1]) && isdigit(s[i + 2])))) ); + } + return i; +} + +/* + Returns a version of 'key' where all numbers have been replaced by zeroes. If + there were none, returns "". +*/ +static QCString zeroKey( const char *key ) +{ + QCString zeroed( strlen(key) + 1 ); + char *z = zeroed.data(); + int i = 0, j = 0; + int len; + bool metSomething = FALSE; + + while ( key[i] != '\0' ) { + len = numberLength( key + i ); + if ( len > 0 ) { + i += len; + z[j++] = '0'; + metSomething = TRUE; + } else { + z[j++] = key[i++]; + } + } + z[j] = '\0'; + + if ( metSomething ) + return zeroed; + else + return ""; +} + +static QString translationAttempt( const QString& oldTranslation, + const char *oldSource, + const char *newSource ) +{ + int p = zeroKey( oldSource ).contains( '0' ); + int oldSourceLen = qstrlen( oldSource ); + QString attempt; + QStringList oldNumbers; + QStringList newNumbers; + QMemArray<bool> met( p ); + QMemArray<int> matchedYet( p ); + int i, j; + int k = 0, ell, best; + int m, n; + int pass; + + /* + This algorithm is hard to follow, so we'll consider an example + all along: oldTranslation is "XeT 3.0", oldSource is "TeX 3.0" + and newSource is "XeT 3.1". + + First, we set up two tables: oldNumbers and newNumbers. In our + example, oldNumber[0] is "3.0" and newNumber[0] is "3.1". + */ + for ( i = 0, j = 0; i < oldSourceLen; i++, j++ ) { + m = numberLength( oldSource + i ); + n = numberLength( newSource + j ); + if ( m > 0 ) { + oldNumbers.append( QCString(oldSource + i, m + 1) ); + newNumbers.append( QCString(newSource + j, n + 1) ); + i += m; + j += n; + met[k] = FALSE; + matchedYet[k] = 0; + k++; + } + } + + /* + We now go over the old translation, "XeT 3.0", one letter at a + time, looking for numbers found in oldNumbers. Whenever such a + number is met, it is replaced with its newNumber equivalent. In + our example, the "3.0" of "XeT 3.0" becomes "3.1". + */ + for ( i = 0; i < (int) oldTranslation.length(); i++ ) { + attempt += oldTranslation[i]; + for ( k = 0; k < p; k++ ) { + if ( oldTranslation[i] == oldNumbers[k][matchedYet[k]] ) + matchedYet[k]++; + else + matchedYet[k] = 0; + } + + /* + Let's find out if the last character ended a match. We make + two passes over the data. In the first pass, we try to + match only numbers that weren't matched yet; if that fails, + the second pass does the trick. This is useful in some + suspicious cases, flagged below. + */ + for ( pass = 0; pass < 2; pass++ ) { + best = p; // an impossible value + for ( k = 0; k < p; k++ ) { + if ( (!met[k] || pass > 0) && + matchedYet[k] == (int) oldNumbers[k].length() && + numberLength(oldTranslation.latin1() + (i + 1) - + matchedYet[k]) == matchedYet[k] ) { + // the longer the better + if ( best == p || matchedYet[k] > matchedYet[best] ) + best = k; + } + } + if ( best != p ) { + attempt.truncate( attempt.length() - matchedYet[best] ); + attempt += newNumbers[best]; + met[best] = TRUE; + for ( k = 0; k < p; k++ ) + matchedYet[k] = 0; + break; + } + } + } + + /* + We flag two kinds of suspicious cases. They are identified as + such with comments such as "{2000?}" at the end. + + Example of the first kind: old source text "TeX 3.0" translated + as "XeT 2.0" is flagged "TeX 2.0 {3.0?}", no matter what the + new text is. + */ + for ( k = 0; k < p; k++ ) { + if ( !met[k] ) + attempt += QString( " {" ) + newNumbers[k] + QString( "?}" ); + } + + /* + Example of the second kind: "1 of 1" translated as "1 af 1", + with new source text "1 of 2", generates "1 af 2 {1 or 2?}" + because it's not clear which of "1 af 2" and "2 af 1" is right. + */ + for ( k = 0; k < p; k++ ) { + for ( ell = 0; ell < p; ell++ ) { + if ( k != ell && oldNumbers[k] == oldNumbers[ell] && + newNumbers[k] < newNumbers[ell] ) + attempt += QString( " {" ) + newNumbers[k] + QString( " or " ) + + newNumbers[ell] + QString( "?}" ); + } + } + return attempt; +} + +/* + Augments a MetaTranslator with translations easily derived from + similar existing (probably obsolete) translations. + + For example, if "TeX 3.0" is translated as "XeT 3.0" and "TeX 3.1" + has no translation, "XeT 3.1" is added to the translator and is + marked Unfinished. +*/ +void applyNumberHeuristic( MetaTranslator *tor, bool verbose ) +{ + TMM translated, untranslated; + TMM::Iterator t, u; + TML all = tor->messages(); + TML::Iterator it; + int inserted = 0; + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { + if ( (*it).translation().isEmpty() ) + untranslated.insert( zeroKey((*it).sourceText()), *it ); + } else if ( !(*it).translation().isEmpty() ) { + translated.insert( zeroKey((*it).sourceText()), *it ); + } + } + + for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { + t = translated.find( u.key() ); + if ( t != translated.end() && !t.key().isEmpty() && + qstrcmp((*t).sourceText(), (*u).sourceText()) != 0 ) { + MetaTranslatorMessage m( *u ); + m.setTranslation( translationAttempt((*t).translation(), + (*t).sourceText(), + (*u).sourceText()) ); + tor->insert( m ); + inserted++; + } + } + if ( verbose && inserted != 0 ) + qWarning( " number heuristic provided %d translation%s", + inserted, inserted == 1 ? "" : "s" ); +} diff --git a/python/pyqt/pylupdate3/proparser.cpp b/python/pyqt/pylupdate3/proparser.cpp new file mode 100644 index 00000000..f018b4c3 --- /dev/null +++ b/python/pyqt/pylupdate3/proparser.cpp @@ -0,0 +1,78 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** proparser.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qregexp.h> +#include <qstringlist.h> + +#include "proparser.h" + +QMap<QString, QString> proFileTagMap( const QString& text ) +{ + QString t = text; + + /* + Strip comments, merge lines ending with backslash, add + spaces around '=' and '+=', replace '\n' with ';', and + simplify white spaces. + */ + t.replace( QRegExp(QString("#[^\n]$")), QString(" ") ); + t.replace( QRegExp(QString("\\\\\\s*\n")), QString(" ") ); + t.replace( QRegExp(QString("=")), QString(" = ") ); + t.replace( QRegExp(QString("\\+ =")), QString(" += ") ); + t.replace( QRegExp(QString("\n")), QString(";") ); + t = t.simplifyWhiteSpace(); + + QMap<QString, QString> tagMap; + + QStringList lines = QStringList::split( QChar(';'), t ); + QStringList::Iterator line; + for ( line = lines.begin(); line != lines.end(); ++line ) { + QStringList toks = QStringList::split( QChar(' '), *line ); + + if ( toks.count() >= 3 && + (toks[1] == QString("=") || toks[1] == QString("+=")) ) { + QString tag = toks.first(); + int k = tag.findRev( QChar(':') ); // as in 'unix:' + if ( k != -1 ) + tag = tag.mid( k + 1 ); + toks.remove( toks.begin() ); + + QString action = toks.first(); + toks.remove( toks.begin() ); + + if ( tagMap.contains(tag) ) { + if ( action == QString("=") ) + tagMap.replace( tag, toks.join(QChar(' ')) ); + else + tagMap[tag] += QChar( ' ' ) + toks.join( QChar(' ') ); + } else { + tagMap[tag] = toks.join( QChar(' ') ); + } + } + } + + QRegExp var( "\\$\\$[a-zA-Z0-9_]+" ); + QMap<QString, QString>::Iterator it; + for ( it = tagMap.begin(); it != tagMap.end(); ++it ) { + int i = 0; + + while ( (i = var.search(it.data(), i)) != -1 ) { + int len = var.matchedLength(); + (*it).replace( i, len, tagMap[(*it).mid(i + 2, len - 2)] ); + } + } + return tagMap; +} diff --git a/python/pyqt/pylupdate3/proparser.h b/python/pyqt/pylupdate3/proparser.h new file mode 100644 index 00000000..2a66c8ab --- /dev/null +++ b/python/pyqt/pylupdate3/proparser.h @@ -0,0 +1,25 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** proparser.h +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef PROPARSER_H +#define PROPARSER_H + +#include <qmap.h> +#include <qstring.h> + +QMap<QString, QString> proFileTagMap( const QString& text ); + +#endif diff --git a/python/pyqt/pylupdate3/pylupdate-prof.sbf b/python/pyqt/pylupdate3/pylupdate-prof.sbf new file mode 100644 index 00000000..7a4c3c4a --- /dev/null +++ b/python/pyqt/pylupdate3/pylupdate-prof.sbf @@ -0,0 +1,24 @@ +# This is the build file for pylupdate for Qt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + +target = pylupdate +sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp qxml.cpp +headers = metatranslator.h proparser.h diff --git a/python/pyqt/pylupdate3/pylupdate.pro.in b/python/pyqt/pylupdate3/pylupdate.pro.in new file mode 100644 index 00000000..c21725c6 --- /dev/null +++ b/python/pyqt/pylupdate3/pylupdate.pro.in @@ -0,0 +1,29 @@ +# Copyright (c) 2002 +# Detlev Offenbach <detlev@die-offenbachs.de> +# +# The project file pylupdate for Qt v3. + + +TEMPLATE = app +CONFIG += qt warn_on console release @PYQT_RBPROF@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = QT_INTERNAL_XML @BLX_DEFINES@ + +DESTDIR = @PYQT_BINDIR@ +TARGET = pylupdate + +HEADERS = metatranslator.h \ + proparser.h + +SOURCES = fetchtr.cpp \ + main.cpp \ + merge.cpp \ + numberh.cpp \ + sametexth.cpp \ + metatranslator.cpp \ + proparser.cpp + +rbprof:exists($(QTDIR)/src/qt_professional.pri) { + QT_SOURCE_TREE = $(QTDIR) + include($(QTDIR)/src/qt_professional.pri) +} diff --git a/python/pyqt/pylupdate3/pylupdate.sbf b/python/pyqt/pylupdate3/pylupdate.sbf new file mode 100644 index 00000000..ec501ab7 --- /dev/null +++ b/python/pyqt/pylupdate3/pylupdate.sbf @@ -0,0 +1,24 @@ +# This is the build file for pylupdate for Qt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + +target = pylupdate +sources = fetchtr.cpp main.cpp merge.cpp numberh.cpp sametexth.cpp metatranslator.cpp proparser.cpp +headers = metatranslator.h proparser.h diff --git a/python/pyqt/pylupdate3/sametexth.cpp b/python/pyqt/pylupdate3/sametexth.cpp new file mode 100644 index 00000000..1ee869f2 --- /dev/null +++ b/python/pyqt/pylupdate3/sametexth.cpp @@ -0,0 +1,78 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** sametexth.cpp +** +** This file is part of Qt Linguist. +** +** See the file LICENSE included in the distribution for the usage +** and distribution terms. +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include <qcstring.h> +#include <qmap.h> + +#include <metatranslator.h> + +typedef QMap<QCString, MetaTranslatorMessage> TMM; +typedef QValueList<MetaTranslatorMessage> TML; + +/* + Augments a MetaTranslator with trivially derived translations. + + For example, if "Enabled:" is consistendly translated as "Eingeschaltet:" no + matter the context or the comment, "Eingeschaltet:" is added as the + translation of any untranslated "Enabled:" text and is marked Unfinished. +*/ + +void applySameTextHeuristic( MetaTranslator *tor, bool verbose ) +{ + TMM translated, avoid; + TMM::Iterator t; + TML untranslated; + TML::Iterator u; + TML all = tor->messages(); + TML::Iterator it; + int inserted = 0; + + for ( it = all.begin(); it != all.end(); ++it ) { + if ( (*it).type() == MetaTranslatorMessage::Unfinished ) { + if ( (*it).translation().isEmpty() ) + untranslated.append( *it ); + } else { + QCString key = (*it).sourceText(); + t = translated.find( key ); + if ( t != translated.end() ) { + /* + The same source text is translated at least two + different ways. Do nothing then. + */ + if ( (*t).translation() != (*it).translation() ) { + translated.remove( key ); + avoid.insert( key, *it ); + } + } else if ( !avoid.contains(key) ) { + translated.insert( key, *it ); + } + } + } + + for ( u = untranslated.begin(); u != untranslated.end(); ++u ) { + QCString key = (*u).sourceText(); + t = translated.find( key ); + if ( t != translated.end() ) { + MetaTranslatorMessage m( *u ); + m.setTranslation( (*t).translation() ); + tor->insert( m ); + inserted++; + } + } + if ( verbose && inserted != 0 ) + qWarning( " same-text heuristic provided %d translation%s", + inserted, inserted == 1 ? "" : "s" ); +} diff --git a/python/pyqt/pyqtconfig.py.in b/python/pyqt/pyqtconfig.py.in new file mode 100644 index 00000000..8a6558d2 --- /dev/null +++ b/python/pyqt/pyqtconfig.py.in @@ -0,0 +1,187 @@ +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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 module is intended to be used by the configuration scripts of extension +# modules that %Import PyQt modules. + + +import sipconfig + + +# These are installation specific values created when PyQt was configured. +# @SIP_CONFIGURATION@ + + +class Configuration(sipconfig.Configuration): + """The class that represents PyQt configuration values. + """ + def __init__(self, sub_cfg=None): + """Initialise an instance of the class. + + sub_cfg is the list of sub-class configurations. It should be None + when called normally. + """ + if sub_cfg: + cfg = sub_cfg + else: + cfg = [] + + cfg.append(_pkg_config) + + sipconfig.Configuration.__init__(self, cfg) + + +class QtModuleMakefile(sipconfig.SIPModuleMakefile): + """The Makefile class for modules that %Import qt. + """ + def __init__(self, *args, **kw): + """Initialise an instance of a module Makefile. + """ + kw["qt"] = 1 + apply(sipconfig.SIPModuleMakefile.__init__, (self, ) + args, kw) + + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + # Note that we don't use self.extra_lib_dirs because we don't want + # it to be added to the rpath. + self.LIBDIR.append(self.config.pyqt_mod_dir) + self.extra_libs.append(self.module_as_lib("qt")) + + sipconfig.SIPModuleMakefile.finalise(self) + + +class QtAxContainerModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtaxcontainer. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtaxcontainer")) + + QtModuleMakefile.finalise(self) + + +class QtCanvasModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtcanvas. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtcanvas")) + + QtModuleMakefile.finalise(self) + + +class QtExtModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtext. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtext")) + + self.extra_defines.extend(self.config._pyqt_qscintilla_defines) + self.extra_include_dirs.append(self.config._pyqt_qscintilla_inc_dir) + self.extra_lib_dirs.append(self.config._pyqt_qscintilla_lib_dir) + self.extra_libs.append("qscintilla") + + QtModuleMakefile.finalise(self) + + +class QtGLModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtgl. + """ + def __init__(self, *args, **kw): + """Initialise an instance of a module Makefile. + """ + kw["opengl"] = 1 + apply(QtModuleMakefile.__init__, (self, ) + args, kw) + + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtgl")) + + QtModuleMakefile.finalise(self) + + +class QtNetworkModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtnetwork. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtnetwork")) + + QtModuleMakefile.finalise(self) + + +class QtTableModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qttable. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qttable")) + + QtModuleMakefile.finalise(self) + + +class QtSQLModuleMakefile(QtTableModuleMakefile): + """The Makefile class for modules that %Import qtsql. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtsql")) + + QtTableModuleMakefile.finalise(self) + + +class QtUIModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtui. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtui")) + + QtModuleMakefile.finalise(self) + + +class QtXMLModuleMakefile(QtModuleMakefile): + """The Makefile class for modules that %Import qtxml. + """ + def finalise(self): + """Finalise the macros. + """ + if self.config.sip_version < 0x040000: + self.extra_libs.append(self.module_as_lib("qtxml")) + + QtModuleMakefile.finalise(self) diff --git a/python/pyqt/pyuic2/COPYING b/python/pyqt/pyuic2/COPYING new file mode 100644 index 00000000..c7aea189 --- /dev/null +++ b/python/pyqt/pyuic2/COPYING @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + 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. + + Preamble + + 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 +rights. + + 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. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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 +circumstances. + +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 +Foundation. + + 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. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/python/pyqt/pyuic2/domtool.cpp b/python/pyqt/pyuic2/domtool.cpp new file mode 100644 index 00000000..2b14ee6c --- /dev/null +++ b/python/pyqt/pyuic2/domtool.cpp @@ -0,0 +1,260 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (C) 2000, 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "domtool.h" + +#include <qsizepolicy.h> +#include <qpalette.h> +#include <qcursor.h> +#include <qrect.h> +#include <qsize.h> +#include <qfont.h> + + +/*! + \class DomTool domtool.h + \brief Tools for the dom + + A collection of static functions used by Resource (part of the + designer) and Uic. + +*/ + + +/*! + Returns the contents of property \a name of object \a e as + variant or the variant passed as \a defValue if the property does + not exist. + + \sa hasProperty() + */ +QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + if ( prop == name ) + return elementToVariant( n2.nextSibling().toElement(), defValue ); + } + } + } + return defValue; +} + +/*! + Returns wheter object \a e defines property \a name or not. + + \sa readProperty() + */ +bool DomTool::hasProperty( const QDomElement& e, const QString& name ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + if ( prop == name ) + return TRUE; + } + } + } + return FALSE; +} + +QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue ) +{ + QString dummy; + return elementToVariant( e, defValue, dummy ); +} + +/*! + Interprets element \a e as variant and returns the result of the interpretation. + */ +QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ) +{ + QVariant v; + if ( e.tagName() == "rect" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QRect( x, y, w, h ) ); + } else if ( e.tagName() == "point" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QPoint( x, y ) ); + } else if ( e.tagName() == "size" ) { + QDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QSize( w, h ) ); + } else if ( e.tagName() == "color" ) { + v = QVariant( readColor( e ) ); + } else if ( e.tagName() == "font" ) { + QDomElement n3 = e.firstChild().toElement(); + QFont f( defValue.toFont() ); + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + f.setFamily( n3.firstChild().toText().data() ); + else if ( n3.tagName() == "pointsize" ) + f.setPointSize( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "bold" ) + f.setBold( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "italic" ) + f.setItalic( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "underline" ) + f.setUnderline( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "strikeout" ) + f.setStrikeOut( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( f ); + } else if ( e.tagName() == "string" ) { + v = QVariant( e.firstChild().toText().data() ); + QDomElement n = e; + n = n.nextSibling().toElement(); + if ( n.tagName() == "comment" ) + comment = n.firstChild().toText().data(); + } else if ( e.tagName() == "cstring" ) { + v = QVariant( QCString( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "number" ) { + v = QVariant( e.firstChild().toText().data().toInt() ); + } else if ( e.tagName() == "bool" ) { + QString t = e.firstChild().toText().data(); + v = QVariant( t == "true" || t == "1", 0 ); + } else if ( e.tagName() == "pixmap" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "iconset" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "image" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "enum" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "set" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "sizepolicy" ) { + QDomElement n3 = e.firstChild().toElement(); + QSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( sp ); + } else if ( e.tagName() == "cursor" ) { + v = QVariant( QCursor( e.firstChild().toText().data().toInt() ) ); + } + + return v; +} + + +/*! Returns the color which is returned in the dom element \a e. + */ + +QColor DomTool::readColor( const QDomElement &e ) +{ + QDomElement n = e.firstChild().toElement(); + int r= 0, g = 0, b = 0; + while ( !n.isNull() ) { + if ( n.tagName() == "red" ) + r = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "green" ) + g = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "blue" ) + b = n.firstChild().toText().data().toInt(); + n = n.nextSibling().toElement(); + } + + return QColor( r, g, b ); +} + +/*! + Returns the contents of attribute \a name of object \a e as + variant or the variant passed as \a defValue if the attribute does + not exist. + + \sa hasAttribute() + */ +QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + if ( prop == name ) + return elementToVariant( n2.nextSibling().toElement(), defValue ); + } + } + } + return defValue; +} + +/*! + Returns wheter object \a e defines attribute \a name or not. + + \sa readAttribute() + */ +bool DomTool::hasAttribute( const QDomElement& e, const QString& name ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + if ( prop == name ) + return TRUE; + } + } + } + return FALSE; +} diff --git a/python/pyqt/pyuic2/domtool.h b/python/pyqt/pyuic2/domtool.h new file mode 100644 index 00000000..7230bce8 --- /dev/null +++ b/python/pyqt/pyuic2/domtool.h @@ -0,0 +1,41 @@ +/********************************************************************** +** Copyright (C) 2000 Troll Tech AS. All rights reserved. +** Copyright (C) 2000, 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** +** This file is part of Qt GUI Designer. +** +** This file may be distributed under the terms of the GNU General +** Public License version 2 as published by the Free Software +** Foundation and appearing in the file COPYING included in the +** packaging of this file. If you did not get the file, send email +** to info@trolltech.com +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef DOMTOOL_H +#define DOMTOOL_H + +#include <qnamespace.h> +#include <qvariant.h> +#include <qdom.h> + + +class DomTool : public Qt +{ +public: + static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); + static bool hasProperty( const QDomElement& e, const QString& name ); + static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue ); + static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ); + static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ); + static bool hasAttribute( const QDomElement& e, const QString& name ); + static QColor readColor( const QDomElement &e ); + +}; + + +#endif // DOMTOOL_H diff --git a/python/pyqt/pyuic2/globaldefs.h b/python/pyqt/pyuic2/globaldefs.h new file mode 100644 index 00000000..700f7d20 --- /dev/null +++ b/python/pyqt/pyuic2/globaldefs.h @@ -0,0 +1,33 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef GLOBALDEFS_H +#define GLOBALDEFS_H + +#include <qcolor.h> + +#define BOXLAYOUT_DEFAULT_MARGIN 11 +#define BOXLAYOUT_DEFAULT_SPACING 6 + +static QColor backColor1( 226, 244, 216 ); +static QColor backColor2( 235, 235, 235 ); +static QColor selectedBack( 192, 192, 192 ); + +#endif diff --git a/python/pyqt/pyuic2/pyuic.pro.in b/python/pyqt/pyuic2/pyuic.pro.in new file mode 100644 index 00000000..8df15136 --- /dev/null +++ b/python/pyqt/pyuic2/pyuic.pro.in @@ -0,0 +1,24 @@ +# Copyright (c) 2000, 2001 +# Phil Thompson <phil@river-bank.demon.co.uk> +# Copyright (c) 2002, 2003 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# The project file for pyuic for Qt v2. + + +TEMPLATE = app +CONFIG = qt console warn_on release +INCLUDEPATH = @BLX_INCLUDEPATH@ $(QTDIR)/src/3rdparty/zlib +DEFINES = UIC @BLX_DEFINES@ + +DESTDIR = @PYQT_BINDIR@ +TARGET = pyuic + +HEADERS = domtool.h \ + globaldefs.h \ + uic.h \ + widgetdatabase.h + +SOURCES = domtool.cpp \ + uic.cpp \ + widgetdatabase.cpp diff --git a/python/pyqt/pyuic2/pyuic.sbf b/python/pyqt/pyuic2/pyuic.sbf new file mode 100644 index 00000000..5d480ec6 --- /dev/null +++ b/python/pyqt/pyuic2/pyuic.sbf @@ -0,0 +1,24 @@ +# This is the build file for pyuic for Qt v2. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + +target = pyuic +sources = uic.cpp widgetdatabase.cpp domtool.cpp +headers = uic.h widgetdatabase.h domtool.h globaldefs.h diff --git a/python/pyqt/pyuic2/uic.cpp b/python/pyqt/pyuic2/uic.cpp new file mode 100644 index 00000000..19fb0794 --- /dev/null +++ b/python/pyqt/pyuic2/uic.cpp @@ -0,0 +1,1601 @@ +// Copyright (c) 2000 - 2001 Phil Thompson <phil@river-bank.demon.co.uk> + +/********************************************************************** +** Copyright (C) 2000 Troll Tech AS. All rights reserved. +** +** This file is part of Qt GUI Designer. +** +** This file may be distributed under the terms of the GNU General +** Public License version 2 as published by the Free Software +** Foundation and appearing in the file COPYING included in the +** packaging of this file. If you did not get the file, send email +** to info@trolltech.com +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#include "uic.h" +#include <qapplication.h> +#include <qfile.h> +#include <qfileinfo.h> +#include <stdio.h> +#include <stdlib.h> +#include <qstringlist.h> +#include <qstrlist.h> +#include <qdatetime.h> +#include <widgetdatabase.h> +#include <domtool.h> +#include <globaldefs.h> +#include <qregexp.h> +#include <zlib.h> + +static QString mkBool( bool b ) +{ + return b? "1" : "0"; +} + +static QString mkBool( const QString& s ) +{ + return mkBool( s == "true" || s == "1" ); +} + +static bool toBool( const QString& s ) +{ + return s == "true" || s.toInt() != 0; +} + + +// fixString is only used in conjunction with tr(). We need to write out the +// string in utf8 and make sure it's converted from utf8 when created. +static QString fixString( const QString &str ) +{ + QString s( str ); + s.replace( QRegExp( "\\\\" ), "\\\\" ); + s.replace( QRegExp( "\"" ), "\\\"" ); + s.replace( QRegExp( "\n" ), "\\n\"\n\"" ); + s.replace( QRegExp( "\r" ), "\\r" ); + + bool onlyAscii = TRUE; + unsigned int i; + for ( i = 0; i < s.length(); i++ ) { + if ( s.at(i).unicode() >= 0x80 ) { + onlyAscii = FALSE; + break; + } + } + if ( onlyAscii ) + s = "\"" + s + "\""; + else + s = "QString.fromUtf8(\"" + s + "\")"; + return s; +} + +static QString mkStdSet( const QString& prop ) +{ + return QString( "set" ) + prop[0].upper() + prop.mid(1); +} + + +/*! + \class Uic uic.h + \brief User Interface Compiler + + The class Uic encapsulates the user interface compiler (uic). + */ + +static QString className; + +Uic::Uic( QTextStream &outStream, QDomDocument doc, const QString &trm ) + : out( outStream ), trmacro( trm ) +{ + item_used = cg_used = pal_used = 0; + + initIndent(); + + layouts << "hbox" << "vbox" << "grid"; + tags = layouts; + tags << "widget"; + + nameOfClass = getClassName( doc.firstChild().toElement() ); + + QDomElement firstWidget = doc.firstChild().firstChild().toElement(); + while ( firstWidget.tagName() != "widget" ) + firstWidget = firstWidget.nextSibling().toElement(); + + if ( nameOfClass.isEmpty() ) + nameOfClass = getObjectName( firstWidget ); + + // This is a hack. + className = nameOfClass; + + createFormImpl( firstWidget ); +} + + +/*! Extracts a class name from \a e + */ +QString Uic::getClassName( const QDomElement& e ) +{ + QDomElement n; + QString cn; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "class" ) { + QString s = n.firstChild().toText().data(); + int i; + while ( ( i = s.find(' ' )) != -1 ) + s[i] = '_'; + cn = s; + } else if ( n.tagName() == "pixmapfunction" ) { + pixmapLoaderFunction = n.firstChild().toText().data(); + } + } + return cn; +} + +/*! Extracts an object name from \a e. It's stored in the 'name' + property. + */ +QString Uic::getObjectName( const QDomElement& e ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" && n2.firstChild().toText().data() == "name" ) { + return n2.nextSibling().toElement().firstChild().toText().data(); + } + } + } + return QString::null; +} + +/*! Extracts an layout name from \a e. It's stored in the 'name' + property of the preceeding sibling (the first child of a QLayoutWidget). + */ +QString Uic::getLayoutName( const QDomElement& e ) +{ + QDomElement p = e.parentNode().toElement(); + QString tail = QString::null; + + if (getClassName(p) != "QLayoutWidget") + tail = "Layout"; + + QDomElement n; + for ( n = p.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" && n2.firstChild().toText().data() == "name" ) { + return n2.nextSibling().toElement().firstChild().toText().data() + tail; + } + } + } + return e.tagName(); +} + +QByteArray unzipXPM( QString data, ulong& length ) +{ + char *ba = new char[ data.length() / 2 ]; + for ( int i = 0; i < (int)data.length() / 2; ++i ) { + char h = data[ 2 * i ].latin1(); + char l = data[ 2 * i + 1 ].latin1(); + uchar r = 0; + if ( h <= '9' ) + r += h - '0'; + else + r += h - 'a' + 10; + r = r << 4; + if ( l <= '9' ) + r += l - '0'; + else + r += l - 'a' + 10; + ba[ i ] = r; + } + if ( length < data.length() * 5 ) + length = data.length() * 5; + QByteArray baunzip( length ); + ::uncompress( (uchar*) baunzip.data(), &length, (uchar*) ba, data.length()/2 ); + return baunzip; +} + + +/*! + Creates an implementation ( cpp-file ) for the form given in \a e + + \sa createFormDecl(), createObjectImpl() + */ +void Uic::createFormImpl( const QDomElement &e ) +{ + QStringList::Iterator it; + QDomElement n; + QDomNodeList nl; + int i; + QString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + QString objName = getObjectName( e ); + + // Handle custom widgets. + for (n = e; !n.isNull(); n = n.nextSibling().toElement()) + { + if (n.tagName() != "customwidgets") + continue; + + QDomElement n2 = n.firstChild().toElement(); + + while (!n2.isNull()) + { + if (n2.tagName() == "customwidget") + { + QDomElement n3 = n2.firstChild().toElement(); + QString cname, header; + + while (!n3.isNull()) + { + if (n3.tagName() == "class") + cname = n3.firstChild().toText().data(); + else if (n3.tagName() == "header") + header = n3.firstChild().toText().data(); + + n3 = n3.nextSibling().toElement(); + } + + if (cname.isEmpty()) + cname = "UnnamedCustomClass"; + + int ext = header.findRev('.'); + + if (ext >= 0) + header.truncate(ext); + + if (header.isEmpty()) + header = cname.lower(); + + out << "from " << header << " import " << cname << endl; + } + + n2 = n2.nextSibling().toElement(); + } + } + + // find out what images are required + QStringList requiredImages; + nl = e.elementsByTagName( "pixmap" ); + for ( int j = 0; j < (int) nl.length(); j++ ) { + requiredImages += nl.item(j).firstChild().toText().data(); + } + + QStringList images; + QStringList xpmImages; + if ( pixmapLoaderFunction.isEmpty() ) { + // create images + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "images" ) { + nl = n.elementsByTagName( "image" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QDomElement tmp = nl.item(i).firstChild().toElement(); + QString img = registerObject( tmp.firstChild().toText().data() ); + if ( !requiredImages.contains( img ) ) + continue; + tmp = tmp.nextSibling().toElement(); + QString format = tmp.attribute("format", "PNG" ); + QString data = tmp.firstChild().toText().data(); + + out << endl; + out << endl; + + if ( format == "XPM.GZ" ) { + xpmImages += img; + ulong length = tmp.attribute("length").toULong(); + QByteArray baunzip = unzipXPM( data, length ); + int a = 0; + out << indent << img << "_data = [" << endl; + while ( baunzip[a] != '\"' ) + a++; + for ( ; a < (int) length; a++ ) + { + char ch; + + if ((ch = baunzip[a]) == '}') + { + out << endl << "]" << endl; + break; + } + + if (ch == '\"') + ch = '\''; + + out << ch; + } + } else { + images += img; + out << indent << img << "_data = \\" << endl; + pushIndent(); + out << indent << "'"; + int a ; + for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { + out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]); + if ( a % 12 == 11 ) + out << "' \\" << endl << indent << "'"; + } + out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]) << "'" << endl; + popIndent(); + } + } + } + } + } + + // register the object and unify its name + objName = registerObject( objName ); + + + // constructor + + out << endl; + out << endl; + out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; + pushIndent(); + + if ( objClass == "QDialog" || objClass == "QWizard" ) { + out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; + pushIndent(); + out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; + } else if ( objClass == "QWidget" ) { // standard QWidget + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + pushIndent(); + out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; + } else { + out << indent << "def __init__(self,parent = None,name = None):" << endl; + pushIndent(); + out << indent << objClass << ".__init__(self,parent,name)" << endl; + } + + out << endl; + + // create pixmaps for all images + if ( !images.isEmpty() ) { + QStringList::Iterator it; + for ( it = images.begin(); it != images.end(); ++it ) { + out << indent << (*it) << " = QPixmap()" << endl; + out << indent << (*it) << ".loadFromData(" << (*it) << "_data,'PNG')" << endl; + } + + out << endl; + } + // create pixmaps for all images + if ( !xpmImages.isEmpty() ) { + for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) { + out << indent << (*it) << " = QPixmap(" << (*it) << "_data)" << endl; + } + + out << endl; + } + + + // set the properties + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = toBool( n.attribute( "stdset" ) ); + QDomElement n2 = n.firstChild().toElement(); + + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + QString value = setObjectProperty( objClass, QString::null, prop, n2.nextSibling().toElement(), stdset ); + + if ( value.isEmpty() ) + continue; + + if ( prop == "name" ) { + out << indent << "if name == None:" << endl; + pushIndent(); + } + + out << indent; + + if ( prop == "geometry" && n2.nextSibling().toElement().tagName() == "rect") { + QDomElement n3 = n2.nextSibling().toElement().firstChild().toElement(); + int w = 0, h = 0; + + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + + out << "self.resize(" << w << "," << h << ")" << endl; + } else { + if ( stdset ) + out << "self." << mkStdSet(prop) << "(" << value << ")" << endl; + else + out << "self.setProperty('" << prop << "',QVariant(" << value << "))" << endl; + } + + if (prop == "name") { + popIndent(); + out << endl; + } + } + } + } + + + // create all children, some forms have special requirements + + if ( objClass == "QWizard" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, "self" ); + QString label = DomTool::readAttribute( n, "title", "" ).toString(); + out << indent << "self.addPage(" << page << ","<< trmacro << "(" << fixString( label ) << "))" << endl; + QVariant def( FALSE, 0 ); + if ( DomTool::hasAttribute( n, "backEnabled" ) ) + out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "nextEnabled" ) ) + out << indent << "self.setNextEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "nextEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finishEnabled" ) ) + out << indent << "self.setFinishEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "finishEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "helpEnabled" ) ) + out << indent << "self.setHelpEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "helpEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finish" ) ) + out << indent << "self.setFinish(" << page << "," << mkBool( DomTool::readAttribute( n, "finish", def).toBool() ) << ")" << endl; + } + } + } else { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objName, "self" ); + } + } + + // Get the list of any user defined slots. + + QStringList userSlots; + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "connections" ) { + for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "slot" ) { + userSlots += n2.firstChild().toText().data(); + } + } + } + } + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "connections" ) { + // setup signals and slots connections + out << endl; + nl = n.elementsByTagName( "connection" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QString sender, receiver, signal, slot; + for ( QDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "sender" ) + sender = n2.firstChild().toText().data(); + else if ( n2.tagName() == "receiver" ) + receiver = n2.firstChild().toText().data(); + else if ( n2.tagName() == "signal" ) + signal = n2.firstChild().toText().data(); + else if ( n2.tagName() == "slot" ) + slot = n2.firstChild().toText().data(); + } + if ( sender.isEmpty() || receiver.isEmpty() || signal.isEmpty() || slot.isEmpty() ) + continue; + + sender = registeredName( sender ); + receiver = registeredName( receiver ); + + // translate formwindow name to "self" + if ( sender == objName ) + sender = "self"; + else + sender = "self." + sender; + if ( receiver == objName ) + receiver = "self"; + else + receiver = "self." + receiver; + + // Note that we never use the SLOT() macro in case we have + // custom widgets implemented in Python. + out << indent << "self.connect(" << sender + << ",SIGNAL('" << signal << "'),self." + << slot.left(slot.find('(')) << ")" << endl; + } + } else if ( n.tagName() == "tabstops" ) { + // setup tab order + out << endl; + QString lastName; + QDomElement n2 = n.firstChild().toElement(); + while ( !n2.isNull() ) { + if ( n2.tagName() == "tabstop" ) { + QString name = n2.firstChild().toText().data(); + name = registeredName( name ); + if ( !lastName.isEmpty() ) + out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; + lastName = name; + } + n2 = n2.nextSibling().toElement(); + } + } + } + + + // buddies + bool firstBuddy = TRUE; + for ( QValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + if ( isObjectRegistered( (*buddy).buddy ) ) { + if ( firstBuddy ) { + out << endl; + } + out << indent << "self." << (*buddy).key << ".setBuddy(self." << registeredName( (*buddy).buddy ) << ")" << endl; + firstBuddy = FALSE; + } + + } + + // end of constructor + popIndent(); + + // handle application font changes if required + nl = e.elementsByTagName( "widget" ); + bool needEventHandler = FALSE; + for ( i = 0; i < (int) nl.length(); i++ ) { + if ( DomTool::hasProperty( nl.item(i).toElement() , "font" ) ) { + needEventHandler = TRUE; + break; + } + } + if ( needEventHandler ) { + out << endl; + out << indent << "def event(self,ev):" << endl; + pushIndent(); + out << indent << "ret = " << objClass << ".event(self,ev)" << endl; + out << endl; + out << indent << "if ev.type() == QEvent.ApplicationFontChange:" << endl; + pushIndent(); + + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( DomTool::hasProperty( n, "font" ) ) + createExclusiveProperty( n, "font" ); + } + + out << endl; + popIndent(); + out << indent << "return ret" << endl; + popIndent(); + } + + + // Generate user defined slot hooks. + + for (it = userSlots.begin(); it != userSlots.end(); ++it) { + int astart = (*it).find('('); + + out << endl; + out << indent << "def " << (*it).left(astart) << "(self"; + + // We don't reproduce the argument names (if any) because we would have + // to remove the types - too complicated for the moment, so we just + // count them and give them names based on their position. + + QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); + + if (!args.isEmpty()) { + int nrargs = args.contains(',') + 1; + + for (int i = 0; i < nrargs; ++i) + out << ",a" << i; + } + + out << "):" << endl; + pushIndent(); + out << indent << "print '" << nameOfClass << "." << *it << ": not implemented yet'" << endl; + popIndent(); + } + + popIndent(); +} + + +/*! + Creates an implementation for the object given in \a e. + + Traverses recursively over all children. + + Returns the name of the generated child object. + + \sa createObjectDecl() + */ +QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout ) +{ + + QDomElement n; + QString objClass, objName, fullObjName; + + if ( layouts.contains( e.tagName() ) ) + return createLayoutImpl( e, parentClass, parent, layout ); + + objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return objName; + objName = getObjectName( e ); + + QString definedName = objName; + bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget"; + if ( isTmpObject ) { + if ( objClass[0] == 'Q' ) + objName = objClass.mid(1); + else + objName = objClass.lower(); + } + + bool isLine = objClass == "Line"; + if ( isLine ) + objClass = "QFrame"; + + out << endl; + if ( objClass == "QLayoutWidget" ) { + if ( layout.isEmpty() ) { + // register the object and unify its name + objName = registerObject( objName ); + out << indent << objName << " = QWidget(" << parent << ",'" << definedName << "')" << endl; + } else { + // the layout widget is not necessary, hide it by creating its child in the parent + QString result; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if (tags.contains( n.tagName() ) ) + result = createObjectImpl( n, parentClass, parent, layout ); + } + return result; + } + + // Layouts don't go into the class instance dictionary. + fullObjName = objName; + } else { + // register the object and unify its name + objName = registerObject( objName ); + + // Temporary objects don't go into the class instance dictionary. + fullObjName = isTmpObject ? objName : "self." + objName; + + out << indent << fullObjName << " = " << createObjectInstance( objClass, parent, objName ) << endl; + } + + lastItem = "None"; + // set the properties and insert items + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = toBool( n.attribute( "stdset" ) ); + QDomElement n2 = n.firstChild().toElement(); + + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); + + if ( value.isEmpty() ) + continue; + if ( prop == "name" ) + continue; + if ( prop == "buddy" && value[0] == '\'' && value[(int)value.length()-1] == '\'' ) { + buddies << Buddy( objName, value.mid(1, value.length() - 2 ) ); + continue; + } + if ( isLine && prop == "orientation" ) { + prop = "frameStyle"; + if ( value.right(10) == "Horizontal" ) + value = "QFrame.HLine | QFrame.Sunken"; + else + value = "QFrame.VLine | QFrame.Sunken"; + } + if ( prop == "buttonGroupId" ) { + if ( parentClass == "QButtonGroup" ) + out << indent << parent << ".insert(" << fullObjName << "," << value << ")" << endl; + continue; + } + if ( prop == "geometry") { + out << indent << fullObjName << ".setGeometry(" << value << ")" << endl; + } else { + if ( stdset ) + out << indent << fullObjName << "." << mkStdSet(prop) << "(" << value << ")" << endl; + else + out << indent << fullObjName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl; + } + + } + } else if ( n.tagName() == "item" ) { + if ( objClass.mid(1) == "ListBox" ) { + QString s = createListBoxItemImpl( n, fullObjName ); + if ( !s.isEmpty() ) + out << indent << s << endl; + } else if ( objClass.mid(1) == "ComboBox" ) { + QString s = createListBoxItemImpl( n, fullObjName ); + if ( !s.isEmpty() ) + out << indent << s << endl; + } else if ( objClass.mid(1) == "IconView" ) { + QString s = createIconViewItemImpl( n, fullObjName ); + if ( !s.isEmpty() ) + out << indent << s << endl; + } else if ( objClass.mid(1) == "ListView" ) { + QString s = createListViewItemImpl( n, fullObjName, QString::null ); + if ( !s.isEmpty() ) + out << s << endl; + } + } else if ( n.tagName() == "column" ) { + if ( objClass.mid(1) == "ListView" ) { + QString s = createListViewColumnImpl( n, fullObjName ); + if ( !s.isEmpty() ) + out << s; + } + } + } + + // create all children, some widgets have special requirements + + if ( objClass == "QTabWidget" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, fullObjName ); + QString label = DomTool::readAttribute( n, "title", "" ).toString(); + out << indent << fullObjName << ".insertTab(" << page << "," << trmacro << "(" << fixString( label ) << "))" << endl; + } + } + } else { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objClass, fullObjName ); + } + } + + return fullObjName; +} + +/*! + Creates implementation of an listbox item tag. +*/ + +QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString attrib = n2.firstChild().toText().data(); + QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + if ( attrib == "text" ) + txt = v.toString(); + else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { + pix.prepend( pixmapLoaderFunction + "(" ); + pix.append( ")" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + return pix.isEmpty() ? + parent + ".insertItem(" + trmacro + "(" + fixString( txt ) + "))": + parent + ".insertItem(" + pix + "," + trmacro + "(" + fixString( txt ) + "))"; +} + +/*! + Creates implementation of an iconview item tag. +*/ + +QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString attrib = n2.firstChild().toText().data(); + QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + if ( attrib == "text" ) + txt = v.toString(); + else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { + pix.prepend( pixmapLoaderFunction + "( " ); + pix.append( " )" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + if ( pix.isEmpty() ) + return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + "))"; + return "QIconViewItem(" + parent + "," + trmacro + "(" + fixString( txt ) + ")," + pix + ")"; + +} + +/*! + Creates implementation of an listview item tag. +*/ + +QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent, + const QString &parentItem ) +{ + QString s; + + QDomElement n = e.firstChild().toElement(); + + bool hasChildren = e.elementsByTagName( "item" ).count() > 0; + QString item; + + if ( hasChildren ) { + item = registerObject( "item" ); + s = indent + item + " = "; + } else { + item = "item"; + if ( item_used ) + s = indent + item + " = "; + else + s = indent + item + " = "; + item_used = TRUE; + } + + if ( !parentItem.isEmpty() ) + s += "QListViewItem(" + parentItem + "," + lastItem + ")\n"; + else + s += "QListViewItem(" + parent + "," + lastItem + ")\n"; + + QStringList textes; + QStringList pixmaps; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString attrib = n2.firstChild().toText().data(); + QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + if ( attrib == "text" ) + textes << v.toString(); + else if ( attrib == "pixmap" ) { + QString pix = v.toString(); + if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { + pix.prepend( pixmapLoaderFunction + "( " ); + pix.append( " )" ); + } + pixmaps << pix; + } + } + } else if ( n.tagName() == "item" ) { + s += indent + item + ".setOpen(1)\n"; + s += createListViewItemImpl( n, parent, item ); + } + n = n.nextSibling().toElement(); + } + + for ( int i = 0; i < (int)textes.count(); ++i ) { + if ( !textes[ i ].isEmpty() ) + s += indent + item + ".setText(" + QString::number( i ) + "," + trmacro + "(" + fixString( textes[ i ] ) + "))\n"; + if ( !pixmaps[ i ].isEmpty() ) + s += indent + item + ".setPixmap(" + QString::number( i ) + "," + pixmaps[ i ] + ")\n"; + } + + lastItem = item; + return s; +} + +/*! + Creates implementation of an listview column tag. +*/ + +QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &parent ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString pix; + bool clickable = FALSE, resizeable = FALSE; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString attrib = n2.firstChild().toText().data(); + QVariant v = DomTool::elementToVariant( n2.nextSibling().toElement(), QVariant() ); + if ( attrib == "text" ) + txt = v.toString(); + else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { + pix.prepend( pixmapLoaderFunction + "( " ); + pix.append( " )" ); + } + } else if ( attrib == "clickable" ) + clickable = v.toBool(); + else if ( attrib == "resizeable" ) + resizeable = v.toBool(); + } + } + n = n.nextSibling().toElement(); + } + + QString s; + s = indent + parent + ".addColumn(" + trmacro + "(" + fixString( txt ) + "))\n"; + if ( !pix.isEmpty() ) + s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1," + pix + "," + trmacro + "(" + fixString( txt ) + "))\n"; + if ( !clickable ) + s += indent + parent + ".header().setClickEnabled(0," + parent + ".header().count() - 1)\n"; + if ( !resizeable ) + s += indent + parent + ".header().setResizeEnabled(0," + parent + ".header().count() - 1)\n"; + + return s; +} + +/*! + Creates the implementation of a layout tag. Called from createObjectImpl(). + */ +QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout ) +{ + QDomElement n; + QString objClass, objName; + objClass = e.tagName(); + + QString qlayout = "QVBoxLayout"; + if ( objClass == "hbox" ) + qlayout = "QHBoxLayout"; + else if ( objClass == "grid" ) + qlayout = "QGridLayout"; + + bool isGrid = e.tagName() == "grid" ; + objName = registerObject( getLayoutName( e ) ); + layoutObjects += objName; + int margin = DomTool::readProperty( e, "margin", BOXLAYOUT_DEFAULT_MARGIN ).toInt(); + int spacing = DomTool::readProperty( e, "spacing", BOXLAYOUT_DEFAULT_SPACING ).toInt(); + + if ( (parentClass == "QGroupBox" || parentClass == "QButtonGroup") && layout.isEmpty() ) { + // special case for group box + out << indent << parent << ".setColumnLayout(0,Qt.Vertical)" << endl; + out << indent << parent << ".layout().setSpacing(0)" << endl; + out << indent << parent << ".layout().setMargin(0)" << endl; + out << indent << objName << " = " << qlayout << "(" << parent << ".layout())" << endl; + out << indent << objName << ".setAlignment(Qt.AlignTop)" << endl; + } else { + if ( layout.isEmpty() ) + out << indent << objName << " = " << qlayout << "(" << parent << ")" << endl; + else + out << indent << objName << " = " << qlayout << "()" << endl; + } + + out << indent << objName << ".setSpacing(" << spacing << ")" << endl; + out << indent << objName << ".setMargin(" << margin << ")" << endl; + + if ( !isGrid ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "spacer" ) { + QString child = createSpacerImpl( n, parentClass, parent, objName ); + out << indent << objName << ".addItem(" << child << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + QString child = createObjectImpl( n, parentClass, parent, objName ); + if ( isLayout( child ) ) + out << indent << objName << ".addLayout(" << child << ")" << endl; + else + out << indent << objName << ".addWidget(" << child << ")" << endl; + } + } + } else { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + QDomElement ae = n; + int row = ae.attribute( "row" ).toInt(); + int col = ae.attribute( "column" ).toInt(); + int rowspan = ae.attribute( "rowspan" ).toInt(); + int colspan = ae.attribute( "colspan" ).toInt(); + if ( rowspan < 1 ) + rowspan = 1; + if ( colspan < 1 ) + colspan = 1; + if ( n.tagName() == "spacer" ) { + QString child = createSpacerImpl( n, parentClass, parent, objName ); + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell(" << child << "," + << row << "," << row + rowspan - 1 << "," << col << "," + << col + colspan - 1 << ")" << endl; + else + out << indent << objName << ".addItem(" << child << "," + << row << "," << col << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + QString child = createObjectImpl( n, parentClass, parent, objName ); + out << endl; + QString o = "Widget"; + if ( isLayout( child ) ) + o = "Layout"; + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell" << o << "(" << child << "," + << row << "," << row + rowspan - 1 << "," << col << "," << col + colspan - 1 << ")" << endl; + else + out << indent << objName << ".add" << o << "(" << child << "," + << row << "," << col << ")" << endl; + } + } + } + + return objName; +} + + + +QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/) +{ + QDomElement n; + QString objClass, objName; + objClass = e.tagName(); + objName = registerObject( "spacer" ); + + QSize size = DomTool::readProperty( e, "sizeHint", QSize(0,0) ).toSize(); + QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); + bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; + + if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && + DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2 + QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect(); + size = geom.size(); + } + + if ( isVspacer ) + out << indent << objName << " = QSpacerItem(" + << size.width() << "," << size.height() + << ",QSizePolicy.Minimum,QSizePolicy." << sizeType << ")" << endl; + else + out << indent << objName << " = QSpacerItem(" + << size.width() << "," << size.height() + << ",QSizePolicy." << sizeType << ",QSizePolicy.Minimum)" << endl; + + return objName; +} + +/*! + Creates a set-call for property \a exclusiveProp of the object + given in \a e. + + If the object does not have this property, the function does nothing. + + Exclusive properties are used to generate the implementation of + application font or palette change handlers in createFormImpl(). + + */ +void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ) +{ + QDomElement n; + QString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + QString objName = getObjectName( e ); + if ( objClass.isEmpty() ) + return; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = toBool( n.attribute( "stdset" ) ); + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + QString prop = n2.firstChild().toText().data(); + if ( prop != exclusiveProp ) + continue; + QString value = setObjectProperty( objClass, objName, prop, n2.nextSibling().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + out << indent << objName << ".setProperty('" << prop << "',QVariant(" << value << "))" << endl; + } + } + } + +} + + +const char* const ColorRole[] = { + "Foreground", "Button", "Light", "Midlight", "Dark", "Mid", + "Text", "BrightText", "ButtonText", "Base", "Background", "Shadow", + "Highlight", "HighlightedText", 0 +}; + + +/*! + Attention: this function has to be in sync with Resource::setWidgetProperty(). If you change one, change both. + */ +QString Uic::setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ) +{ + QString v; + if ( e.tagName() == "rect" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QRect(%1,%2,%3,%4)"; + v = v.arg(x).arg(y).arg(w).arg(h); + + } else if ( e.tagName() == "point" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QPoint(%1,%2)"; + v = v.arg(x).arg(y); + } else if ( e.tagName() == "size" ) { + QDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QSize(%1,%2)"; + v = v.arg(w).arg(h); + } else if ( e.tagName() == "color" ) { + QDomElement n3 = e.firstChild().toElement(); + int r= 0, g = 0, b = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "red" ) + r = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "green" ) + g = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "blue" ) + b = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QColor(%1,%2,%3)"; + v = v.arg(r).arg(g).arg(b); + } else if ( e.tagName() == "font" ) { + QDomElement n3 = e.firstChild().toElement(); + QString fontname = "f"; + if ( !obj.isEmpty() ) { + fontname = obj + "_font"; + out << indent << fontname << " = QFont(self." << obj << ".font())" << endl; + } else { + out << indent << fontname << " = QFont(self.font())" << endl; + } + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + out << indent << fontname << ".setFamily('" << n3.firstChild().toText().data() << "')" << endl; + else if ( n3.tagName() == "pointsize" ) + out << indent << fontname << ".setPointSize(" << n3.firstChild().toText().data() << ")" << endl; + else if ( n3.tagName() == "bold" ) + out << indent << fontname << ".setBold(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "italic" ) + out << indent << fontname << ".setItalic(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "underline" ) + out << indent << fontname << ".setUnderline(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "strikeout" ) + out << indent << fontname << ".setStrikeOut(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + n3 = n3.nextSibling().toElement(); + } + + if ( prop == "font" ) { + if ( !obj.isEmpty() ) + out << indent << "self." << obj << ".setFont(" << fontname << ")" << endl; + else + out << indent << "self.setFont(" << fontname << ")" << endl; + } else { + v = fontname; + } + } else if ( e.tagName() == "string" ) { + if ( prop == "toolTip" ) { + if ( !obj.isEmpty() ) + out << indent << "QToolTip.add(self." << obj << "," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + else + out << indent << "QToolTip.add(self," + trmacro + "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + } else if ( prop == "whatsThis" ) { + if ( !obj.isEmpty() ) + out << indent << "QWhatsThis.add(self." << obj << "," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + else + out << indent << "QWhatsThis.add(self," << trmacro << "(" << fixString( e.firstChild().toText().data() ) << "))" << endl; + } else { + v = trmacro + "(%1)"; + v = v.arg( fixString( e.firstChild().toText().data() ) ); + } + } else if ( e.tagName() == "cstring" ) { + v = "'%1'"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "number" ) { + v = "%1"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "bool" ) { + if ( stdset ) + v = "%1"; + else + v = "%1,0"; + v = v.arg( mkBool( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "pixmap" ) { + v = e.firstChild().toText().data(); + if ( !pixmapLoaderFunction.isEmpty() ) { + v.prepend( pixmapLoaderFunction + "( " ); + v.append( " )" ); + } + } else if ( e.tagName() == "iconset" ) { + v = "QIconSet(%1)"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "image" ) { + v = e.firstChild().toText().data() + ".convertToImage()"; + } else if ( e.tagName() == "enum" ) { + v = "%1.%2"; + QString oc = objClass; + QString ev = e.firstChild().toText().data(); + if ( oc == "QListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual of WithMode enum in 3.0 + oc = "QScrollView"; + v = v.arg( oc ).arg( ev ); + } else if ( e.tagName() == "set" ) { + QString keys( e.firstChild().toText().data() ); + QStringList lst = QStringList::split( '|', keys ); + v = ""; + for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + v += objClass + "." + *it; + if ( it != lst.fromLast() ) + v += " | "; + } + } else if ( e.tagName() == "sizepolicy" ) { + QDomElement n3 = e.firstChild().toElement(); + QSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + QString tmp; + if ( !obj.isEmpty() ) + tmp = "self." + obj; + else + tmp = "self"; + v = "QSizePolicy(%1,%2," + tmp + ".sizePolicy().hasHeightForWidth())"; + v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ); + } else if ( e.tagName() == "palette" ) { + QPalette pal; + bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; + QDomElement n; + if ( no_pixmaps ) { + n = e.firstChild().toElement(); + while ( !n.isNull() ) { + QColorGroup cg; + if ( n.tagName() == "active" ) { + cg = loadColorGroup( n ); + pal.setActive( cg ); + } else if ( n.tagName() == "inactive" ) { + cg = loadColorGroup( n ); + pal.setInactive( cg ); + } else if ( n.tagName() == "disabled" ) { + cg = loadColorGroup( n ); + pal.setDisabled( cg ); + } + n = n.nextSibling().toElement(); + } + } + if ( no_pixmaps && pal == QPalette( pal.active().button(), pal.active().background() ) ) { + v = "QPalette(QColor(%1,%2,%3),QColor(%1,%2,%3))"; + v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); + v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); + } else { + QString palette = "pal"; + if ( !pal_used ) { + out << indent << palette << " = QPalette()" << endl; + pal_used = TRUE; + } + QString cg = "cg"; + if ( !cg_used ) { + out << indent << cg << " = QColorGroup()" << endl; + cg_used = TRUE; + } + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "active") + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setActive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "inactive") + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setInactive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "disabled") + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setDisabled(" << cg << ")" << endl; + v = palette; + } + } else if ( e.tagName() == "cursor" ) { + v = "QCursor(%1)"; + v = v.arg( e.firstChild().toText().data() ); + } + return v; +} + + + +/*! + Creates a colorgroup with name \a name from the color group \a cg + */ +void Uic::createColorGroupImpl( const QString& name, const QDomElement& e ) +{ + QColorGroup cg; + int r = -1; + QDomElement n = e.firstChild().toElement(); + QString color; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + QColor col = DomTool::readColor( n ); + color = "QColor(%1,%2,%3)"; + color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); + if ( col == white ) + color = "Qt.white"; + else if ( col == black ) + color = "Qt.black"; + if ( n.nextSibling().toElement().tagName() != "pixmap" ) { + out << indent << name << ".setColor(QColorGroup." << ColorRole[r] << "," << color << ")" << endl; + } + } else if ( n.tagName() == "pixmap" ) { + QString pixmap = n.firstChild().toText().data(); + if ( !pixmapLoaderFunction.isEmpty() ) { + pixmap.prepend( pixmapLoaderFunction + "(" ); + pixmap.append( ")" ); + } + out << indent << name << ".setBrush(QColorGroup." + << ColorRole[r] << ",QBrush(" << color << "," << pixmap << "))" << endl; + } + n = n.nextSibling().toElement(); + } +} + +/*! + Auxiliary function to load a color group. The colorgroup must not + contain pixmaps. + */ +QColorGroup Uic::loadColorGroup( const QDomElement &e ) +{ + QColorGroup cg; + int r = -1; + QDomElement n = e.firstChild().toElement(); + QColor col; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + } + n = n.nextSibling().toElement(); + } + return cg; +} + + + +/*! + Registers an object with name \a name. + + The returned name is a valid variable identifier, as similar to \a + name as possible and guaranteed to be unique within the form. + + \sa registeredName(), isObjectRegistered() + */ +QString Uic::registerObject( const QString& name ) +{ + if ( objectNames.isEmpty() ) { + // some temporary variables we need + objectNames += "img"; + objectNames += "item"; + objectNames += "cg"; + objectNames += "pal"; + } + + QString result = name; + int i; + while ( ( i = result.find(' ' )) != -1 ) { + result[i] = '_'; + } + + if ( objectNames.contains( result ) ) { + int i = 2; + while ( objectNames.contains( result + "_" + QString::number(i) ) ) + i++; + result += "_"; + result += QString::number(i); + } + objectNames += result; + objectMapper.insert( name, result ); + return result; +} + +/*! + Returns the registered name for the original name \a name + or \a name if \a name wasn't registered. + + \sa registerObject(), isObjectRegistered() + */ +QString Uic::registeredName( const QString& name ) +{ + if ( !objectMapper.contains( name ) ) + return name; + return objectMapper[name]; +} + +/*! + Returns whether the object \a name was registered yet or not. + */ +bool Uic::isObjectRegistered( const QString& name ) +{ + return objectMapper.contains( name ); +} + + +/*! + Unifies the entries in stringlist \a list. Should really be a QStringList feature. + */ +QStringList Uic::unique( const QStringList& list ) +{ + QStringList result; + if (list.isEmpty() ) + return result; + QStringList l = list; + l.sort(); + result += l.first(); + for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + if ( *it != result.last() ) + result += *it; + } + return result; +} + + + +/*! + Creates an instance of class \a objClass, with parent \a parent and name \a objName + */ +QString Uic::createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ) +{ + + if ( objClass.mid(1) == "ComboBox" ) { + return objClass + "(0," + parent + ",'" + objName + "')"; + } + return objClass + "(" + parent + ",'" + objName + "')"; +} + +bool Uic::isLayout( const QString& name ) const +{ + return layoutObjects.contains( name ); +} + + +#if defined(BLACKADDER) +#include "ba.h" + +int BA::compilePython(const QString &fileName,const QString &outputFile, + const QString &trmacro,bool execCode) +{ +#else +int main( int argc, char * argv[] ) +{ + const char *error = 0; + QString fileName; + QString outputFile; + QString trmacro; + bool execCode = FALSE; + + for ( int n = 1; n < argc && error == 0; n++ ) { + QCString arg = argv[n]; + if ( arg[0] == '-' ) { // option + QCString opt = &arg[1]; + if ( opt[0] == 'o' ) { // output redirection + if ( opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing output-file name"; + break; + } + outputFile = argv[++n]; + } else + outputFile = &opt[1]; + } else if ( opt == "tr" ) { + if ( opt == "tr" || opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing tr macro."; + break; + } + trmacro = argv[++n]; + } else { + trmacro = &opt[1]; + } + } else if ( opt == "x" ) { + execCode = TRUE; + } + } else { + if (!fileName.isEmpty()) // can handle only one file + error = "Too many input files specified"; + else + fileName = argv[n]; + } + } + + if ( argc < 2 || error || fileName.isEmpty() ) { + fprintf( stderr, "PyQt user interface compiler\n" ); + if ( error ) + fprintf( stderr, "pyuic: %s\n", error ); + + fprintf( stderr, "Usage: %s [options] <uifile>\n" + "\nGenerate PyQt implementation:\n" + " %s [options] <uifile>\n" + "Options:\n" + "\t-o file Write output to file rather than stdout\n" + "\t-tr func Use func(...) rather than tr(...) for i18n\n" + "\t-x Generate extra code to test the class\n" + , argv[0], argv[0]); + exit( 1 ); + } +#endif + + QFile file( fileName ); + if ( !file.open( IO_ReadOnly ) ) + qFatal( "pyuic: Could not open file '%s' ", (const char *)fileName ); + + QFile fileOut; + if (!outputFile.isEmpty()) { + fileOut.setName( outputFile ); + if (!fileOut.open( IO_WriteOnly ) ) + qFatal( "pyuic: Could not open output file '%s'", (const char *)outputFile ); + } else { + fileOut.open( IO_WriteOnly, stdout ); + } + QTextStream out( &fileOut ); + out.setEncoding( QTextStream::UnicodeUTF8 ); + + QDomDocument doc; + if ( !doc.setContent( &file ) ) + qFatal( "pyuic: Failed to parse %s\n", (const char *)fileName ); + + out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; + out << "#" << endl; + out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# by: The Python User Interface Compiler (pyuic) " << PYQT_VERSION << endl; + out << "#" << endl; + out << "# WARNING! All changes made in this file will be lost!" << endl; + out << endl; + out << endl; + + if (execCode) + out << "import sys" << endl; + + out << "from qt import *" << endl; + + Uic( out, doc, trmacro.isEmpty() ? QString("self.tr") : trmacro ); + + if (execCode) { + out << endl; + out << endl; + out << "if __name__ == '__main__':" << endl; + out << " a = QApplication(sys.argv)" << endl; + out << " QObject.connect(a,SIGNAL('lastWindowClosed()'),a,SLOT('quit()'))" << endl; + out << " w = " << className << "()" << endl; + out << " a.setMainWidget(w)" << endl; + out << " w.show()" << endl; + out << " a.exec_loop()" << endl; + } + + return 0; +} diff --git a/python/pyqt/pyuic2/uic.h b/python/pyqt/pyuic2/uic.h new file mode 100644 index 00000000..6c7befc4 --- /dev/null +++ b/python/pyqt/pyuic2/uic.h @@ -0,0 +1,133 @@ +/********************************************************************** +** Copyright (C) 2000 Troll Tech AS. All rights reserved. +** Copyright (C) 2000, 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** +** This file is part of Qt GUI Designer. +** +** This file may be distributed under the terms of the GNU General +** Public License version 2 as published by the Free Software +** Foundation and appearing in the file COPYING included in the +** packaging of this file. If you did not get the file, send email +** to info@trolltech.com +** +** The file is provided AS IS with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. +** +**********************************************************************/ + +#ifndef UIC_H +#define UIC_H + +#include <qnamespace.h> +#include <qdom.h> +#include <qstring.h> +#include <qstringlist.h> +#include <qmap.h> +#include <qtextstream.h> +#include <qcolor.h> + + +#define PYQT_VERSION "3.17.2" + + +class Uic : public Qt +{ +public: + Uic( QTextStream& out, QDomDocument doc, const QString &trm ); + + void createFormImpl( const QDomElement &e ); + + QString createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + QString createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + QString createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ); + QString createSpacerImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + void createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ); + QString createListBoxItemImpl( const QDomElement &e, const QString &parent ); + QString createIconViewItemImpl( const QDomElement &e, const QString &parent ); + QString createListViewColumnImpl( const QDomElement &e, const QString &parent ); + QString createListViewItemImpl( const QDomElement &e, const QString &parent, + const QString &parentItem ); + void createColorGroupImpl( const QString& cg, const QDomElement& e ); + QColorGroup loadColorGroup( const QDomElement &e ); + + QString getClassName( const QDomElement& e ); + QString getObjectName( const QDomElement& e ); + QString getLayoutName( const QDomElement& e ); + + QString setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ); + + QString registerObject( const QString& name ); + QString registeredName( const QString& name ); + bool isObjectRegistered( const QString& name ); + QStringList unique( const QStringList& ); + +private: + void pushIndent() + { + ++nrindents; + setIndent(); + } + + void popIndent() + { + --nrindents; + setIndent(); + } + + void setIndent() + { + indent = ""; + + for (int i = 0; i < nrindents; ++i) + indent += newindent; + } + + void initIndent() + { + newindent = " "; + indent = ""; + nrindents = 0; + } + + QString indent, newindent; + int nrindents; + + QTextStream& out; + QStringList objectNames; + QMap<QString,QString> objectMapper; + QStringList tags; + QStringList layouts; + QString formName; + QString lastItem; + QString trmacro; + + struct Buddy + { + Buddy( const QString& k, const QString& b ) + : key( k ), buddy( b ) {} + Buddy(){}; // for valuelist + QString key; + QString buddy; + bool operator==( const Buddy& other ) const + { return (key == other.key); } + }; + struct CustomInclude + { + QString header; + QString location; + }; + QValueList<Buddy> buddies; + + QStringList layoutObjects; + bool isLayout( const QString& name ) const; + + uint item_used : 1; + uint cg_used : 1; + uint pal_used : 1; + + QString pixmapLoaderFunction; + QString nameOfClass; +}; + +#endif diff --git a/python/pyqt/pyuic2/widgetdatabase.cpp b/python/pyqt/pyuic2/widgetdatabase.cpp new file mode 100644 index 00000000..0733fcef --- /dev/null +++ b/python/pyqt/pyuic2/widgetdatabase.cpp @@ -0,0 +1,640 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include <qvariant.h> // HP-UX compiler needs this here + +#include "widgetdatabase.h" + +#if defined(DESIGNER) +#include "../designer/formwindow.h" +#include "../designer/pixmapchooser.h" +#endif + +//#include "../integration/kdevelop/kdewidgets.h" + +#include <globaldefs.h> +#include <qstrlist.h> +#include <qdict.h> +#include <qfile.h> +#include <qtextstream.h> + +#include <qmodules.h> + +const int dbsize = 300; +const int dbcustom = 200; +const int dbdictsize = 211; +static WidgetDatabaseRecord* db[ dbsize ]; +static QDict<int> *className2Id = 0; +static int dbcount = 0; +static int dbcustomcount = 200; +static QStrList *wGroups; +static QStrList *invisibleGroups; +static bool whatsThisLoaded = FALSE; + + +WidgetDatabaseRecord::WidgetDatabaseRecord() +{ + isContainer = FALSE; + icon = 0; + nameCounter = 0; +} + +WidgetDatabaseRecord::~WidgetDatabaseRecord() +{ + delete icon; +} + + +/*! + \class WidgetDatabase widgetdatabase.h + \brief The WidgetDatabase class holds information about widgets + + The WidgetDatabase holds information about widgets like toolTip(), + iconSet(), ... It works Id-based, so all access functions take the + widget id as parameter. To get the id for a widget (classname), use + idFromClassName(). + + All access functions are static. Having multiple widgetdatabases in + one application doesn't make sense anyway and so you don't need more + than an instance of the widgetdatabase. + + For creating widgets, layouts, etc. see WidgetFactory. +*/ + +/*! + Creatse widget database. Does nothing +*/ + +WidgetDatabase::WidgetDatabase() +{ +} + +/*! Sets up the widget database. If the static widgetdatabase already + exists, the functions returns immediately. +*/ + +void WidgetDatabase::setupDataBase() +{ + if ( dbcount ) + return; + + wGroups = new QStrList; + invisibleGroups = new QStrList; + invisibleGroups->append( "Forms" ); + invisibleGroups->append( "Temp" ); + className2Id = new QDict<int>( dbdictsize ); + className2Id->setAutoDelete( TRUE ); + + WidgetDatabaseRecord *r = 0; + + r = new WidgetDatabaseRecord; + r->iconSet = "pushbutton.xpm"; + r->name = "QPushButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Push Button"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "toolbutton.xpm"; + r->name = "QToolButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Tool Button"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "radiobutton.xpm"; + r->name = "QRadioButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Radio Button"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "checkbox.xpm"; + r->name = "QCheckBox"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Check Box"; + + + + + append( r ); + r = new WidgetDatabaseRecord; + r->iconSet = "groupbox.xpm"; + r->name = "QGroupBox"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Group Box"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "buttongroup.xpm"; + r->name = "QButtonGroup"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Button Group"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "frame.xpm"; + r->name = "QFrame"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Frame"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "tabwidget.xpm"; + r->name = "QTabWidget"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Tabwidget"; + r->isContainer = TRUE; + + append( r ); + + + r = new WidgetDatabaseRecord; + r->iconSet = "listbox.xpm"; + r->name = "QListBox"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List Box"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "listview.xpm"; + r->name = "QListView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List View"; + + append( r ); + +#if defined(QT_MODULE_ICONVIEW) || defined(UIC) + r = new WidgetDatabaseRecord; + r->iconSet = "iconview.xpm"; + r->name = "QIconView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Icon View"; + + append( r ); +#endif + +#if defined(QT_MODULE_TABLE) + r = new WidgetDatabaseRecord; + r->iconSet = "table.xpm"; + r->name = "QTable"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Table"; + + append( r ); +#endif + + + r = new WidgetDatabaseRecord; + r->iconSet = "lineedit.xpm"; + r->name = "QLineEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Line Edit"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "spinbox.xpm"; + r->name = "QSpinBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Spin Box"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "multilineedit.xpm"; + r->name = "QMultiLineEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Multi Line Edit"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "combobox.xpm"; + r->name = "QComboBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Combo Box"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "slider.xpm"; + r->name = "QSlider"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Slider"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "dial.xpm"; + r->name = "QDial"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Dial"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "label.xpm"; + r->name = "QLabel"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Label"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "label.xpm"; + r->name = "TextLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Label"; + r->whatsThis = "The Text Label provides a widget to display static text."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "pixlabel.xpm"; + r->name = "PixmapLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Pixmap Label"; + r->whatsThis = "The Pixmap Label provides a widget to display pixmaps."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "lcdnumber.xpm"; + r->name = "QLCDNumber"; + r->group = widgetGroup( "Display" ); + r->toolTip = "LCD Number"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "line.xpm"; + r->name = "Line"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Line"; + r->includeFile = "qframe.h"; + r->whatsThis = "The Line widget provides horizontal and vertical lines."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "progress.xpm"; + r->name = "QProgressBar"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Progress Bar"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "textview.xpm"; + r->name = "QTextView"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text View"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "textbrowser.xpm"; + r->name = "QTextBrowser"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Browser"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "spacer.xpm"; + r->name = "Spacer"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Spacer"; + r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the bahviour of layouts."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QWidget"; + r->isContainer = FALSE; + r->group = widgetGroup( "Forms" ); + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QDialog"; + r->group = widgetGroup( "Forms" ); + r->isContainer = FALSE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QDesignerWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QLayoutWidget"; + r->group = widgetGroup( "Temp" ); + r->includeFile = ""; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "tabwidget.xpm"; + r->name = "QDesignerTabWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "tabwidget.xpm"; + r->name = "QDesignerWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "tabwidget.xpm"; + r->name = "QDesignerDialog"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + +// qt_init_kde_widget_database(); +} + +/*! + Returns the number of elements in the widget database. +*/ + +int WidgetDatabase::count() +{ + setupDataBase(); + return dbcount; +} + +/*! + Returns the id at which the ids of custom widgets start. +*/ + +int WidgetDatabase::startCustom() +{ + setupDataBase(); + return dbcustom; +} + +/*! Returns the iconset which represents the class registered as \a + id. +*/ + +QIconSet WidgetDatabase::iconSet( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QIconSet(); +#if defined(DESIGNER) + if ( !r->icon ) + r->icon = new QIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), + PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) ); + return *r->icon; +#endif + + return QIconSet(); +} + +/*! + Returns the classname of the widget which is registered as \a id. +*/ + +QString WidgetDatabase::className( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->name; +} + +/*! + Returns the group to which the widget registered as \a id belongs. +*/ + +QString WidgetDatabase::group( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->group; +} + +/*! Returns the tooltip text of the widget which is registered as \a + id. +*/ + +QString WidgetDatabase::toolTip( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->toolTip; +} + +/*! Returns the what's this? test of the widget which is registered + as \a id. +*/ + +QString WidgetDatabase::whatsThis( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->whatsThis; +} + +/*! + Returns the include file if the widget which is registered as \a id. +*/ + +QString WidgetDatabase::includeFile( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + if ( r->includeFile.isNull() ) + return r->name.lower() + ".h"; + return r->includeFile; +} + +/*! Returns wheather the widget registered as \a id is a container + (can have children) or not. +*/ + +bool WidgetDatabase::isContainer( int id ) +{ + setupDataBase(); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isContainer; +} + +QString WidgetDatabase::createWidgetName( int id ) +{ + setupDataBase(); + QString n = className( id ); + if ( n == "QLayoutWidget" ) + n = "Layout"; + if ( n[ 0 ] == 'Q' ) + n = n.mid( 1 ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return n; + n += QString::number( ++r->nameCounter ); + return n; +} + +/*! Returns the id for \a name or -1 if \a name is unknown. + */ +int WidgetDatabase::idFromClassName( const QString &name ) +{ + setupDataBase(); + if ( name.isEmpty() ) + return 0; + int *i = className2Id->find( name ); + if ( i ) + return *i; + if ( name == "FormWindow" ) + return idFromClassName( "QLayoutWidget" ); + return -1; +} + +WidgetDatabaseRecord *WidgetDatabase::at( int index ) +{ + if ( index < 0 ) + return 0; + if ( index >= dbcustom && index < dbcustomcount ) + return db[ index ]; + if ( index < dbcount ) + return db[ index ]; + return 0; +} + +void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r ) +{ + if ( index < 0 || index >= dbsize ) + return; + db[ index ] = r; + className2Id->insert( r->name, new int( index ) ); + if ( index < dbcustom ) + dbcount = QMAX( dbcount, index ); +} + +void WidgetDatabase::append( WidgetDatabaseRecord *r ) +{ + insert( dbcount++, r ); +} + +QString WidgetDatabase::widgetGroup( const QString &g ) +{ + if ( wGroups->find( g ) == -1 ) + wGroups->append( g ); + return g; +} + +QString WidgetDatabase::widgetGroup( int i ) +{ + setupDataBase(); + if ( i >= 0 && i < (int)wGroups->count() ) + return wGroups->at( i ); + return QString::null; +} + +int WidgetDatabase::numWidgetGroups() +{ + setupDataBase(); + return wGroups->count(); +} + +bool WidgetDatabase::isGroupVisible( const QString &g ) +{ + setupDataBase(); + return invisibleGroups->find( g ) == -1; +} + +int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r ) +{ + insert( dbcustomcount++, r ); + return dbcustomcount - 1; +} + +bool WidgetDatabase::isCustomWidget( int id ) +{ + if ( id >= dbcustom && id < dbcustomcount ) + return TRUE; + return FALSE; +} + +bool WidgetDatabase::isWhatsThisLoaded() +{ + return whatsThisLoaded; +} + +void WidgetDatabase::loadWhatsThis( const QString &docPath ) +{ + QString whatsthisFile = docPath + "/whatsthis"; + QFile f( whatsthisFile ); + if ( !f.open( IO_ReadOnly ) ) + return; + QTextStream ts( &f ); + while ( !ts.atEnd() ) { + QString s = ts.readLine(); + QStringList l = QStringList::split( " | ", s ); + int id = idFromClassName( l[ 1 ] ); + WidgetDatabaseRecord *r = at( id ); + if ( r ) + r->whatsThis = l[ 0 ]; + } + whatsThisLoaded = TRUE; +} diff --git a/python/pyqt/pyuic2/widgetdatabase.h b/python/pyqt/pyuic2/widgetdatabase.h new file mode 100644 index 00000000..a28cd5fb --- /dev/null +++ b/python/pyqt/pyuic2/widgetdatabase.h @@ -0,0 +1,75 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef WIDGETDATABASE_H +#define WIDGETDATABASE_H + +#include <qiconset.h> +#include <qstring.h> +#include <qstringlist.h> + +struct WidgetDatabaseRecord +{ + WidgetDatabaseRecord(); + ~WidgetDatabaseRecord(); + QString iconSet, name, group, toolTip, whatsThis, includeFile; + uint isContainer : 1; + QIconSet *icon; + int nameCounter; +}; + +class WidgetDatabase : public Qt +{ +public: + WidgetDatabase(); + static void setupDataBase(); + + static int count(); + static int startCustom(); + + static QIconSet iconSet( int id ); + static QString className( int id ); + static QString group( int id ); + static QString toolTip( int id ); + static QString whatsThis( int id ); + static QString includeFile( int id ); + static bool isContainer( int id ); + + static int idFromClassName( const QString &name ); + static QString createWidgetName( int id ); + + static WidgetDatabaseRecord *at( int index ); + static void insert( int index, WidgetDatabaseRecord *r ); + static void append( WidgetDatabaseRecord *r ); + + static QString widgetGroup( const QString &g ); + static QString widgetGroup( int i ); + static int numWidgetGroups(); + static bool isGroupVisible( const QString &g ); + + static int addCustomWidget( WidgetDatabaseRecord *r ); + static bool isCustomWidget( int id ); + + static bool isWhatsThisLoaded(); + static void loadWhatsThis( const QString &docPath ); + +}; + +#endif diff --git a/python/pyqt/pyuic3/LICENSE.GPL b/python/pyqt/pyuic3/LICENSE.GPL new file mode 100644 index 00000000..c7aea189 --- /dev/null +++ b/python/pyqt/pyuic3/LICENSE.GPL @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + 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. + + Preamble + + 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 +rights. + + 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. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 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 +circumstances. + +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 +Foundation. + + 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. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS diff --git a/python/pyqt/pyuic3/domtool.cpp b/python/pyqt/pyuic3/domtool.cpp new file mode 100644 index 00000000..b3514a06 --- /dev/null +++ b/python/pyqt/pyuic3/domtool.cpp @@ -0,0 +1,447 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "domtool.h" + +#include <qsizepolicy.h> +#include <qcolor.h> +#include <qcursor.h> +#include <qdatetime.h> +#include <qrect.h> +#include <qsize.h> +#include <qfont.h> +#include <qdom.h> + +/*! + \class DomTool domtool.h + \brief Tools for the dom + + A collection of static functions used by Resource (part of the + designer) and Uic. + +*/ + +/*! + Returns the contents of property \a name of object \a e as + variant or the variant passed as \a defValue if the property does + not exist. + + \sa hasProperty() +*/ +QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + if ( n.attribute( "name" ) != name ) + continue; + return elementToVariant( n.firstChild().toElement(), defValue, comment ); + } + } + return defValue; +} + + +/*! + \overload + */ +QVariant DomTool::readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ) +{ + QString comment; + return readProperty( e, name, defValue, comment ); +} + +/*! + Returns wheter object \a e defines property \a name or not. + + \sa readProperty() + */ +bool DomTool::hasProperty( const QDomElement& e, const QString& name ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + if ( n.attribute( "name" ) != name ) + continue; + return TRUE; + } + } + return FALSE; +} + +QStringList DomTool::propertiesOfType( const QDomElement& e, const QString& type ) +{ + QStringList result; + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + QDomElement n2 = n.firstChild().toElement(); + if ( n2.tagName() == type ) + result += n.attribute( "name" ); + } + } + return result; +} + + +QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue ) +{ + QString dummy; + return elementToVariant( e, defValue, dummy ); +} + +/*! + Interprets element \a e as variant and returns the result of the interpretation. + */ +QVariant DomTool::elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ) +{ + QVariant v; + if ( e.tagName() == "rect" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QRect( x, y, w, h ) ); + } else if ( e.tagName() == "point" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QPoint( x, y ) ); + } else if ( e.tagName() == "size" ) { + QDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QSize( w, h ) ); + } else if ( e.tagName() == "color" ) { + v = QVariant( readColor( e ) ); + } else if ( e.tagName() == "font" ) { + QDomElement n3 = e.firstChild().toElement(); + QFont f( defValue.toFont() ); + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + f.setFamily( n3.firstChild().toText().data() ); + else if ( n3.tagName() == "pointsize" ) + f.setPointSize( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "bold" ) + f.setBold( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "italic" ) + f.setItalic( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "underline" ) + f.setUnderline( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "strikeout" ) + f.setStrikeOut( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( f ); + } else if ( e.tagName() == "string" ) { + v = QVariant( e.firstChild().toText().data() ); + QDomElement n = e; + n = n.nextSibling().toElement(); + if ( n.tagName() == "comment" ) + comment = n.firstChild().toText().data(); + } else if ( e.tagName() == "cstring" ) { + v = QVariant( QCString( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "number" ) { + bool ok = TRUE; + v = QVariant( e.firstChild().toText().data().toInt( &ok ) ); + if ( !ok ) + v = QVariant( e.firstChild().toText().data().toDouble() ); + } else if ( e.tagName() == "bool" ) { + QString t = e.firstChild().toText().data(); + v = QVariant( t == "true" || t == "1", 0 ); + } else if ( e.tagName() == "pixmap" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "iconset" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "image" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "enum" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "set" ) { + v = QVariant( e.firstChild().toText().data() ); + } else if ( e.tagName() == "sizepolicy" ) { + QDomElement n3 = e.firstChild().toElement(); + QSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "horstretch" ) + sp.setHorStretch( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "verstretch" ) + sp.setVerStretch( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( sp ); + } else if ( e.tagName() == "cursor" ) { + v = QVariant( QCursor( e.firstChild().toText().data().toInt() ) ); + } else if ( e.tagName() == "stringlist" ) { + QStringList lst; + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) + lst << n.firstChild().toText().data(); + v = QVariant( lst ); + } else if ( e.tagName() == "date" ) { + QDomElement n3 = e.firstChild().toElement(); + int y, m, d; + y = m = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QDate( y, m, d ) ); + } else if ( e.tagName() == "time" ) { + QDomElement n3 = e.firstChild().toElement(); + int h, m, s; + h = m = s = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QTime( h, m, s ) ); + } else if ( e.tagName() == "datetime" ) { + QDomElement n3 = e.firstChild().toElement(); + int h, mi, s, y, mo, d ; + h = mi = s = y = mo = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + mi = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + mo = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = QVariant( QDateTime( QDate( y, mo, d ), QTime( h, mi, s ) ) ); + } + return v; +} + + +/*! Returns the color which is returned in the dom element \a e. + */ + +QColor DomTool::readColor( const QDomElement &e ) +{ + QDomElement n = e.firstChild().toElement(); + int r= 0, g = 0, b = 0; + while ( !n.isNull() ) { + if ( n.tagName() == "red" ) + r = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "green" ) + g = n.firstChild().toText().data().toInt(); + else if ( n.tagName() == "blue" ) + b = n.firstChild().toText().data().toInt(); + n = n.nextSibling().toElement(); + } + + return QColor( r, g, b ); +} + +/*! + Returns the contents of attribute \a name of object \a e as + variant or the variant passed as \a defValue if the attribute does + not exist. + + \sa hasAttribute() + */ +QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + if ( n.attribute( "name" ) != name ) + continue; + return elementToVariant( n.firstChild().toElement(), defValue, comment ); + } + } + return defValue; +} + +/*! + \overload +*/ +QVariant DomTool::readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ) +{ + QString comment; + return readAttribute( e, name, defValue, comment ); +} + +/*! + Returns wheter object \a e defines attribute \a name or not. + + \sa readAttribute() + */ +bool DomTool::hasAttribute( const QDomElement& e, const QString& name ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "attribute" ) { + if ( n.attribute( "name" ) != name ) + continue; + return TRUE; + } + } + return FALSE; +} + +static bool toBool( const QString& s ) +{ + return s == "true" || s.toInt() != 0; +} + +/*! + Convert Qt 2.x format to Qt 3.0 format if necessary +*/ +void DomTool::fixDocument( QDomDocument& doc ) +{ + QDomElement e; + QDomNode n; + QDomNodeList nl; + int i = 0; + + e = doc.firstChild().toElement(); + if ( e.tagName() != "UI" ) + return; + + // latest version, don't do anything + if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.0 ) + return; + + nl = doc.elementsByTagName( "property" ); + + // in 3.0, we need to fix a spelling error + if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) { + for ( i = 0; i < (int) nl.length(); i++ ) { + QDomElement el = nl.item(i).toElement(); + QString s = el.attribute( "name" ); + if ( s == "resizeable" ) { + el.removeAttribute( "name" ); + el.setAttribute( "name", "resizable" ); + } + } + return; + } + + + // in versions smaller than 3.0 we need to change more + e.setAttribute( "version", 3.0 ); + + e.setAttribute("stdsetdef", 1 ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + QString name; + QDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + if ( name == "resizeable" ) + e.setAttribute( "name", "resizable" ); + else + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + bool stdset = toBool( e.attribute( "stdset" ) ); + if ( stdset || name == "toolTip" || name == "whatsThis" || + name == "buddy" || + e.parentNode().toElement().tagName() == "item" || + e.parentNode().toElement().tagName() == "spacer" || + e.parentNode().toElement().tagName() == "column" + ) + e.removeAttribute( "stdset" ); + else + e.setAttribute( "stdset", 0 ); + } + + nl = doc.elementsByTagName( "attribute" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + QString name; + QDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + } + + nl = doc.elementsByTagName( "image" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + QString name; + QDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "name" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "name", name ); + e.removeChild( n2 ); + } + } + + nl = doc.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + e = nl.item(i).toElement(); + QString name; + QDomElement n2 = e.firstChild().toElement(); + if ( n2.tagName() == "class" ) { + name = n2.firstChild().toText().data(); + e.setAttribute( "class", name ); + e.removeChild( n2 ); + } + } + +} + diff --git a/python/pyqt/pyuic3/domtool.h b/python/pyqt/pyuic3/domtool.h new file mode 100644 index 00000000..25b795d3 --- /dev/null +++ b/python/pyqt/pyuic3/domtool.h @@ -0,0 +1,47 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef DOMTOOL_H +#define DOMTOOL_H + +#include <qvariant.h> +#include <qnamespace.h> + +class QDomElement; +class QDomDocument; + +class DomTool : public Qt +{ +public: + static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); + static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ); + static bool hasProperty( const QDomElement& e, const QString& name ); + static QStringList propertiesOfType( const QDomElement& e, const QString& type ); + static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue ); + static QVariant elementToVariant( const QDomElement& e, const QVariant& defValue, QString &comment ); + static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue ); + static QVariant readAttribute( const QDomElement& e, const QString& name, const QVariant& defValue, QString& comment ); + static bool hasAttribute( const QDomElement& e, const QString& name ); + static QColor readColor( const QDomElement &e ); + static void fixDocument( QDomDocument& ); +}; + + +#endif // DOMTOOL_H diff --git a/python/pyqt/pyuic3/embed.cpp b/python/pyqt/pyuic3/embed.cpp new file mode 100644 index 00000000..04f6494c --- /dev/null +++ b/python/pyqt/pyuic3/embed.cpp @@ -0,0 +1,323 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** Copyright (c) 2002 Riverbank Computing Limited <info@riverbankcomputing.co.uk> +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include <qfile.h> +#include <qimage.h> +#include <qstringlist.h> +#include <qdatetime.h> +#include <qfileinfo.h> +#include <stdio.h> +#include <ctype.h> + +// on embedded, we do not compress image data. Rationale: by mapping +// the ready-only data directly into memory we are both faster and +// more memory efficient +#if (QT_VERSION < 0x030100 || defined(Q_WS_QWS)) && !defined(QT_NO_IMAGE_COLLECTION_COMPRESSION) +#define QT_NO_IMAGE_COLLECTION_COMPRESSION +#endif + +struct EmbedImage +{ + ~EmbedImage() { delete[] colorTable; } + int width, height, depth; + int numColors; + QRgb* colorTable; + QString name; + QString cname; + bool alpha; +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + ulong compressed; +#endif +}; + +static QString convertToCIdentifier( const char *s ) +{ + QString r = s; + int len = r.length(); + if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) + r[0] = '_'; + for ( int i=1; i<len; i++ ) { + if ( !isalnum( (char)r[i].latin1() ) ) + r[i] = '_'; + } + return r; +} + + +static ulong embedData( QTextStream& out, const uchar* input, int nbytes ) +{ +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + QByteArray bazip( qCompress( input, nbytes ) ); + uint len = bazip.size(); +#else + uint len = (uint)nbytes; +#endif + static const char hexdigits[] = "0123456789abcdef"; + QString s; + for ( uint i=0; i<len; i++ ) { + if ( (i%14) == 0 ) { + if (i) + s += '"'; + + s += " \\\n \""; + out << (const char*)s; + s.truncate( 0 ); + } + uint v = (uchar) +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + bazip +#else + input +#endif + [(int)i]; + s += "\\x"; + s += hexdigits[(v >> 4) & 15]; + s += hexdigits[v & 15]; + if ( i == len-1 ) + s += "\"\n"; + } + if ( s.length() ) + out << (const char*)s; + return (ulong)len; +} + +static void embedData( QTextStream& out, const QRgb* input, int n ) +{ + out << hex; + const QRgb *v = input; + for ( int i=0; i<n; i++ ) { + if ( (i%14) == 0 ) + out << "\n "; + out << "0x"; + out << hex << *v++; + if ( i < n-1 ) + out << ','; + } + out << dec; // back to decimal mode +} + +void Uic::embed( QTextStream& out, const char* project, const QStringList& images ) +{ + + QString cProject = convertToCIdentifier( project ); + + QStringList::ConstIterator it; + out << "# Image collection for project '" << project << "'.\n"; + out << "#\n"; + out << "# Generated from reading image files: \n"; + for ( it = images.begin(); it != images.end(); ++it ) + out << "# " << *it << "\n"; + out << "#\n"; + out << "# Created: " << QDateTime::currentDateTime().toString() << "\n"; + out << "# by: The PyQt User Interface Compiler (pyuic) " << PYQT_VERSION << "\n"; + out << "#\n"; + out << "# WARNING! All changes made in this file will be lost!\n"; + + out << "\n"; + out << "\n"; + out << "from qt import QImage, QMimeSourceFactory"; +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + out << ", qUncompress"; +#endif + out << "\n"; + out << "\n"; + out << "\n"; + + + QPtrList<EmbedImage> list_image; + list_image.setAutoDelete( TRUE ); + int image_count = 0; + for ( it = images.begin(); it != images.end(); ++it ) { + QImage img; + if ( !img.load( *it ) ) { + fprintf( stderr, "pyuic: cannot load image file %s\n", (*it).latin1() ); + continue; + } + EmbedImage *e = new EmbedImage; + e->width = img.width(); + e->height = img.height(); + e->depth = img.depth(); + e->numColors = img.numColors(); + e->colorTable = new QRgb[e->numColors]; + e->alpha = img.hasAlphaBuffer(); + memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb)); + QFileInfo fi( *it ); + e->name = fi.fileName(); + e->cname = QString("image_%1").arg( image_count++); + list_image.append( e ); + out << "# " << *it << "\n"; + QString s; + if ( e->depth == 1 ) + img = img.convertBitOrder(QImage::BigEndian); + out << s.sprintf( "%s_data =", + (const char *)e->cname ); +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + e->compressed = +#endif + embedData( out, img.bits(), img.numBytes() ); + out << "\n"; + if ( e->numColors ) { + out << s.sprintf( "%s_ctable = [", + (const char *)e->cname ); + embedData( out, e->colorTable, e->numColors ); + out << "\n]\n\n"; + } + } + + if ( !list_image.isEmpty() ) { + out << indent << "embed_image_vec = [\n"; + ++indent; + EmbedImage *e = list_image.first(); + while ( e ) { + out << indent << "[" + << e->width << "," + << e->height << "," + << e->depth << "," + << e->cname << "_data," +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + << e->compressed << "," +#endif + << e->numColors << ","; + if ( e->numColors ) + out << e->cname << "_ctable,"; + else + out << "None,"; + if ( e->alpha ) + out << "1,"; + else + out << "0,"; + out << "\"" << e->name << "\"],\n"; + e = list_image.next(); + } + --indent; + out << indent << "]\n"; + + out << "\n" + "\n" + "def uic_findImage(name):\n"; + ++indent; + out << indent << "global embed_image_vec\n"; + out << "\n"; +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + out << indent << "for (w,h,depth,data,comp,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; +#else + out << indent << "for (w,h,depth,data,nrCol,colTab,alpha,iname) in embed_image_vec:" << endl; +#endif + ++indent; + out << indent << "if iname == str(name):" << endl; + ++indent; +#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION + // Keep the data object alive until we have a deep copy of the image. + out << indent << "data = qUncompress(data).data()\n"; +#endif + out << indent << "img = QImage(data,w,h,depth,colTab,nrCol,QImage.BigEndian).copy()\n"; + out << "\n"; + out << indent << "if alpha:\n"; + ++indent; + out << indent << "img.setAlphaBuffer(1)\n"; + --indent; + out << "\n"; + out << indent << "return img\n"; + --indent; + --indent; + out << endl; + out << indent << "return QImage()\n"; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "class MimeSourceFactory_" << cProject << "(QMimeSourceFactory):\n"; + ++indent; + out << indent << "def __init__(self):\n"; + ++indent; + out << indent << "QMimeSourceFactory.__init__(self)\n"; + out << "\n"; + --indent; + out << indent << "def data(self,abs_name):\n"; + ++indent; + out << indent << "d = QMimeSourceFactory.data(self,abs_name)\n"; + out << indent << "if d or abs_name.isNull():\n"; + ++indent; + out << indent << "return d\n"; + --indent; + out << "\n"; + out << indent << "img = uic_findImage(abs_name)\n"; + out << indent << "if not img.isNull():\n"; + ++indent; + out << indent << "self.setImage(abs_name,img)\n"; + --indent; + out << "\n"; + out << indent << "return QMimeSourceFactory.data(self,abs_name)\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "factory = None\n"; + out << "\n"; + + out << indent << "def qInitImages_" << cProject << "():\n"; + ++indent; + out << indent << "global factory\n"; + out << "\n"; + out << indent << "if factory is None:\n"; + ++indent; + out << indent << "factory = MimeSourceFactory_" << cProject << "()\n"; + out << indent << "QMimeSourceFactory.defaultFactory().addFactory(factory)\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "def qCleanupImages_" << cProject << "():\n"; + ++indent; + out << indent << "global factory\n"; + out << "\n"; + out << indent << "if factory is not None:\n"; + ++indent; + out << indent << "QMimeSourceFactory.defaultFactory().removeFactory(factory)\n"; + out << indent << "factory = None\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << indent << "class StaticInitImages_" << cProject << ":\n"; + ++indent; + out << indent << "def __init__(self):\n"; + ++indent; + out << indent << "self.cleanup = qCleanupImages_" << cProject << "\n"; + out << indent << "qInitImages_" << cProject << "()\n"; + --indent; + out << "\n"; + out << indent << "def __del__(self):\n"; + ++indent; + out << indent << "self.cleanup()\n"; + --indent; + --indent; + out << "\n"; + out << "\n"; + + out << "staticImages = StaticInitImages_" << cProject << "()\n"; + } +} diff --git a/python/pyqt/pyuic3/form.cpp b/python/pyqt/pyuic3/form.cpp new file mode 100644 index 00000000..aedb4ac2 --- /dev/null +++ b/python/pyqt/pyuic3/form.cpp @@ -0,0 +1,938 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include <stdio.h> +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include <qstringlist.h> +#include <qfile.h> +#include <qfileinfo.h> +#include <qregexp.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> + +#if QT_VERSION < 0x030100 +#include <zlib.h> +#endif + +static QByteArray unzipXPM( QString data, ulong& length ) +{ +#if QT_VERSION >= 0x030100 + const int lengthOffset = 4; + int baSize = data.length() / 2 + lengthOffset; + uchar *ba = new uchar[ baSize ]; + for ( int i = lengthOffset; i < baSize; ++i ) { + char h = data[ 2 * (i-lengthOffset) ].latin1(); + char l = data[ 2 * (i-lengthOffset) + 1 ].latin1(); + uchar r = 0; + if ( h <= '9' ) + r += h - '0'; + else + r += h - 'a' + 10; + r = r << 4; + if ( l <= '9' ) + r += l - '0'; + else + r += l - 'a' + 10; + ba[ i ] = r; + } + // qUncompress() expects the first 4 bytes to be the expected length of the + // uncompressed data + ba[0] = ( length & 0xff000000 ) >> 24; + ba[1] = ( length & 0x00ff0000 ) >> 16; + ba[2] = ( length & 0x0000ff00 ) >> 8; + ba[3] = ( length & 0x000000ff ); + QByteArray baunzip = qUncompress( ba, baSize ); + delete[] ba; + return baunzip; +#else + uchar *ba = new uchar[ data.length() / 2 ]; + for ( int i = 0; i < (int)data.length() / 2; ++i ) { + char h = data[ 2 * i ].latin1(); + char l = data[ 2 * i + 1 ].latin1(); + uchar r = 0; + if ( h <= '9' ) + r += h - '0'; + else + r += h - 'a' + 10; + r = r << 4; + if ( l <= '9' ) + r += l - '0'; + else + r += l - 'a' + 10; + ba[ i ] = r; + } + // I'm not sure this makes sense. Why couldn't the compressed data be + // less than 20% of the original data? Maybe it's enough to trust the + // `length' passed as an argument. Quoting the zlib header: + // Upon entry, destLen is the total size of the destination + // buffer, which must be large enough to hold the entire + // uncompressed data. (The size of the uncompressed data must + // have been saved previously by the compressor and transmitted + // to the decompressor by some mechanism outside the scope of + // this compression library.) + // Which is the role of `length'. On the other hand this could prevent + // crashes in some cases of slightly corrupt UIC files. + if ( length < data.length() * 5 ) + length = data.length() * 5; + QByteArray baunzip( length ); + ::uncompress( (uchar*) baunzip.data(), &length, ba, data.length()/2 ); + delete[] ba; + return baunzip; +#endif +} + + + +/*! + Creates an implementation ( cpp-file ) for the form given in \a e + + \sa createFormDecl(), createObjectImpl() + */ +void Uic::createFormImpl( const QDomElement &e ) +{ + QDomElement n; + QDomNodeList nl; + int i; + QString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + QString objName = getObjectName( e ); + + // generate local and local includes required + QStringList globalIncludes; + QStringList::Iterator it; + QStringList sqlClasses; + QStringList axwidgets, databrowsers; + + QMap<QString, CustomInclude> customWidgetIncludes; + QMap<QString, QString> functionImpls; + // find additional slots and functions + QStringList extraSlots; + QStringList extraSlotTypes; + nl = e.parentNode().toElement().elementsByTagName( "slot" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "slots" + && n.parentNode().toElement().tagName() != "connections" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + QString slotName = n.firstChild().toText().data().stripWhiteSpace(); + if ( slotName.endsWith( ";" ) ) + slotName = slotName.left( slotName.length() - 1 ); + + extraSlots += Parser::cleanArgs(slotName); + extraSlotTypes += n.attribute( "returnType", "void" ); + } + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "functions" ) { // compatibility + for ( QDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "function" ) { + QString fname = n2.attribute( "name" ); + fname = Parser::cleanArgs( fname ); + functionImpls.insert( fname, n2.firstChild().toText().data() ); + } + } + } + } + + // additional includes (local or global ) and forward declaractions + nl = e.parentNode().toElement().elementsByTagName( "include" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QDomElement n2 = nl.item(i).toElement(); + + QString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) != "local" ) { + if ( s.right( 5 ) == ".ui.h" && !QFile::exists( s ) ) + continue; + if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) + continue; + globalIncludes += s; + } + } + + // do the local includes afterwards, since global includes have priority on clashes + QFileInfo fi(fileName); + + for ( i = 0; i < (int) nl.length(); i++ ) { + QDomElement n2 = nl.item(i).toElement(); + QString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) { + if ( s.right( 5 ) != ".ui.h" ) + continue; + + if ( !QFile::exists( s ) ) + { + s = fi.dirPath() + "/" + s; + + if ( !QFile::exists( s ) ) + continue; + } + + if ( QFile::exists( s ) ) + { + QFile f(s); + f.open(IO_ReadOnly); + QTextStream headerStream(&f); + QString line; + QString functionText; + QString functionName; + QRegExp rx("void .*::(.*\\(.*\\))"); + int pos, inFunction = 0; + + while (line = headerStream.readLine()) + { + pos = rx.search(line); + + if (pos > -1) + { + if (inFunction) + functionImpls.insert(Parser::cleanArgs(functionName),functionText); + + functionName = rx.cap(1); + functionText = ""; + inFunction = 1; + } + functionText += line + "\n"; + } + + if (inFunction) + functionImpls.insert(Parser::cleanArgs(functionName),functionText); + } + } + } + + // additional custom widget headers + nl = e.parentNode().toElement().elementsByTagName( "header" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QDomElement n2 = nl.item(i).toElement(); + QString s = n2.firstChild().toText().data(); + if ( n2.attribute( "location" ) != "local" ) + globalIncludes += s; + } + + // includes for child widgets + for ( it = tags.begin(); it != tags.end(); ++it ) { + nl = e.parentNode().toElement().elementsByTagName( *it ); + for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget + QString name = getClassName( nl.item(i).toElement() ); + if ( name == "Spacer" ) { + globalIncludes += "qlayout.h"; + globalIncludes += "qapplication.h"; + continue; + } + if ( name.mid( 1 ) == "ListView" ) + globalIncludes += "qheader.h"; + else if ( name == "QAxWidget" ) + axwidgets += getObjectName(nl.item(i).toElement()); + else if ( name == "QDataBrowser" ) + databrowsers += getObjectName(nl.item(i).toElement()); + if ( name != objClass ) { + int wid = WidgetDatabase::idFromClassName( name ); + QMap<QString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); + if ( it == customWidgetIncludes.end() ) + globalIncludes += WidgetDatabase::includeFile( wid ); + } + } + } + + if (globalIncludes.findIndex("qtable.h") >= 0) + out << indent << "from qttable import QTable" << endl; + + if (!axwidgets.empty()) + out << indent << "from qtaxcontainer import QAxWidget" << endl; + + if (globalIncludes.findIndex("qextscintilla.h") >= 0) + out << indent << "from qtext import QextScintilla" << endl; + + registerDatabases( e ); + dbConnections = unique( dbConnections ); + if ( dbConnections.count() ) + sqlClasses += "QSqlDatabase"; + if ( dbCursors.count() ) + sqlClasses += "QSqlCursor"; + bool dbForm = FALSE; + if ( dbForms[ "(default)" ].count() ) + dbForm = TRUE; + bool subDbForms = FALSE; + for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { + if ( !(*it).isEmpty() && (*it) != "(default)" ) { + if ( dbForms[ (*it) ].count() ) { + subDbForms = TRUE; + break; + } + } + } + if ( dbForm || subDbForms ) { + sqlClasses += "QSqlForm"; + sqlClasses += "QSqlRecord"; + } + + if (globalIncludes.findIndex("qdatatable.h") >= 0) + sqlClasses += "QDataTable"; + + if (globalIncludes.findIndex("qtableview.h") >= 0) + sqlClasses += "QTableView"; + + if (globalIncludes.findIndex("qdatabrowser.h") >= 0) + sqlClasses += "QDataBrowser"; + + if (globalIncludes.findIndex("qdataview.h") >= 0) + sqlClasses += "QDataView"; + + if ( !sqlClasses.empty() ) { + out << indent << "from qtsql import"; + const char *sep = " "; + + for ( it = sqlClasses.begin(); it != sqlClasses.end(); ++it ) { + out << sep << (*it); + sep = ", "; + } + + out << endl; + } + + // Add any code from the comments. + if (!pyCode.isEmpty()) + out << pyCode; + + out << endl; + + // find out what images are required + QStringList requiredImages; + static const char *imgTags[] = { "pixmap", "iconset", 0 }; + for ( i = 0; imgTags[i] != 0; i++ ) { + nl = e.parentNode().toElement().elementsByTagName( imgTags[i] ); + for ( int j = 0; j < (int) nl.length(); j++ ) { + QDomNode nn = nl.item(j); + while ( nn.parentNode() != e.parentNode() ) + nn = nn.parentNode(); + if ( nn.nodeName() != "customwidgets" ) + requiredImages += nl.item(j).firstChild().toText().data(); + } + } + + // register the object and unify its name + objName = registerObject( objName ); + + QStringList images; + QStringList xpmImages; + if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { + // create images + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "images" ) { + nl = n.elementsByTagName( "image" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); + if ( !requiredImages.contains( img ) ) + continue; + QDomElement tmp = nl.item(i).firstChild().toElement(); + if ( tmp.tagName() != "data" ) + continue; + QString format = tmp.attribute("format", "PNG" ); + QString data = tmp.firstChild().toText().data(); + if ( format == "XPM.GZ" ) { + xpmImages += img; + ulong length = tmp.attribute("length").toULong(); + QByteArray baunzip = unzipXPM( data, length ); + length = baunzip.size(); + // shouldn't we test the initial `length' against the + // resulting `length' to catch corrupt UIC files? + int a = 0; + out << indent << img << "_data = [" << endl; + while ( baunzip[a] != '\"' ) + a++; + for ( ; a < (int) length; a++ ) + { + char ch; + + if ((ch = baunzip[a]) == '}') + { + out << endl << "]"; + break; + } + + out << ch; + } + out << endl; + } else { + images += img; + out << indent << img << "_data = \\" << endl; + ++indent; + out << indent << "\""; + int a ; + for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { + out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]); + if ( a % 12 == 11 ) + out << "\" \\" << endl << indent << "\""; + } + out << "\\x" << QString(data[2*a]) << QString(data[2*a+1]) << "\"" << endl; + --indent; + } + } + } + } + out << endl; + } else if ( externPixmaps ) { +#if QT_VERSION >= 0x030100 + pixmapLoaderFunction = "QPixmap.fromMimeSource"; +#else + out << indent << "def uic_load_pixmap_" << objName << "(name):" << endl; + ++indent; + out << indent << "pix = QPixmap()" << endl; + out << indent << "m = QMimeSourceFactory.defaultFactory().data(name)" << endl; + out << endl; + out << indent << "if m:" << endl; + ++indent; + out << indent << "QImageDrag.decode(m,pix)" << endl; + --indent; + out << endl; + out << indent << "return pix" << endl; + --indent; + out << endl; + out << endl; + pixmapLoaderFunction = "uic_load_pixmap_" + objName; +#endif + } + + + // constructor(s) + + out << indent << "class " << nameOfClass << "(" << objClass << "):" << endl; + ++indent; + + if ( objClass == "QDialog" || objClass == "QWizard" ) { + out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,modal,fl)" << endl; + } else if ( objClass == "QWidget" ) { + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; + } else if ( objClass == "QMainWindow" ) { + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name,fl)" << endl; + out << indent << "self.statusBar()" << endl; + isMainWindow = TRUE; + } else { + out << indent << "def __init__(self,parent = None,name = None):" << endl; + ++indent; + out << indent << objClass << ".__init__(self,parent,name)" << endl; + } + + out << endl; + + // create pixmaps for all images + if ( !images.isEmpty() ) { + QStringList::Iterator it; + for ( it = images.begin(); it != images.end(); ++it ) { + out << indent << "self." << (*it) << " = QPixmap()" << endl; + out << indent << "self." << (*it) << ".loadFromData(" << (*it) << "_data,\"PNG\")" << endl; + } + } + // create pixmaps for all images + if ( !xpmImages.isEmpty() ) { + for ( it = xpmImages.begin(); it != xpmImages.end(); ++it ) { + out << indent << "self." << (*it) << " = QPixmap(" << (*it) << "_data)" << endl; + } + out << endl; + } + + + // set the properties + QSize geometry( 0, 0 ); + + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + QString prop = n.attribute("name"); + QDomElement n2 = n.firstChild().toElement(); + QString value = setObjectProperty( objClass, QString::null, prop, n2, stdset ); + if ( value.isEmpty() ) + continue; + + if ( prop == "geometry" && n2.tagName() == "rect") { + QDomElement n3 = n2.firstChild().toElement(); + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + geometry.setWidth( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "height" ) + geometry.setHeight( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + } else { + QString call; + if ( stdset ) + call = "self." + mkStdSet( prop ) + "(" + value + ")"; + else + call = "self.setProperty(\"" + prop + "\",QVariant(" + value + "))"; + + if ( n2.tagName() == "string" ) { + trout << trindent << call << endl; + } else if ( prop == "name" ) { + out << indent << "if not name:" << endl; + ++indent; + out << indent << call << endl; + --indent; + out << endl; + } else { + out << indent << call << endl; + } + } + } + } + + out << endl; + + // create all children, some forms have special requirements + + if ( objClass == "QWizard" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, "self" ); + QString comment; + QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << "self.addPage(" << page << ",QString(\"\"))" << endl; + trout << trindent << "self.setTitle(" << page << ","<< trcall( label, comment ) << ")" << endl; + QVariant def( FALSE, 0 ); + if ( DomTool::hasAttribute( n, "backEnabled" ) ) + out << indent << "self.setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "nextEnabled" ) ) + out << indent << "self.setNextEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "nextEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finishEnabled" ) ) + out << indent << "self.setFinishEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "finishEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "helpEnabled" ) ) + out << indent << "self.setHelpEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "helpEnabled", def).toBool() ) << ")" << endl; + if ( DomTool::hasAttribute( n, "finish" ) ) + out << indent << "self.setFinish( " << page << "," << mkBool( DomTool::readAttribute( n, "finish", def).toBool() ) << ")" << endl; + } + } + } else { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objName, "self" ); + } + } + + // database support + dbConnections = unique( dbConnections ); + if ( dbConnections.count() ) + out << endl; + for ( it = dbConnections.begin(); it != dbConnections.end(); ++it ) { + if ( !(*it).isEmpty() && (*it) != "(default)") { + out << indent << "self." << (*it) << "Connection = QSqlDatabase.database(\"" <<(*it) << "\")" << endl; + } + } + + nl = e.parentNode().toElement().elementsByTagName( "widget" ); + for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget + n = nl.item(i).toElement(); + QString s = getClassName( n ); + if ( (dbForm || subDbForms) && (s == "QDataBrowser" || s == "QDataView") ) { + QString objName = getObjectName( n ); + QString tab = getDatabaseInfo( n, "table" ); + QString con = getDatabaseInfo( n, "connection" ); + out << indent << objName << "Form = QSqlForm(self,\"" << objName << "Form\")" << endl; + QDomElement n2; + for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) + createFormImpl( n2, objName, con, tab ); + out << indent << "self." << objName << ".setForm(" << objName << "Form)" << endl; + } + } + + // actions, toolbars, menubar + bool needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "actions" ) { + if ( !needEndl ) + out << endl; + createActionImpl( n.firstChild().toElement(), "self" ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "toolbars" ) { + if ( !needEndl ) + out << endl; + createToolbarImpl( n, objClass, objName ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + needEndl = FALSE; + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "menubar" ) { + if ( !needEndl ) + out << endl; + createMenuBarImpl( n, objClass, objName ); + needEndl = TRUE; + } + } + if ( needEndl ) + out << endl; + + out << endl; + out << indent << "self.languageChange()" << endl; + out << endl; + + // take minimumSizeHint() into account, for height-for-width widgets + if ( !geometry.isNull() ) { + out << indent << "self.resize(QSize(" << geometry.width() << "," + << geometry.height() <<").expandedTo(self.minimumSizeHint()))" << endl; + out << indent << "self.clearWState(Qt.WState_Polished)" << endl; + } + + for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "connections" ) { + // setup signals and slots connections + out << endl; + nl = n.elementsByTagName( "connection" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QString sender, receiver, signal, slot; + for ( QDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "sender" ) + sender = n2.firstChild().toText().data(); + else if ( n2.tagName() == "receiver" ) + receiver = n2.firstChild().toText().data(); + else if ( n2.tagName() == "signal" ) + signal = n2.firstChild().toText().data(); + else if ( n2.tagName() == "slot" ) + slot = n2.firstChild().toText().data(); + } + if ( sender.isEmpty() || + receiver.isEmpty() || + signal.isEmpty() || + slot.isEmpty() ) + continue; + if ( sender[0] == '<' || + receiver[0] == '<' || + signal[0] == '<' || + slot[0] == '<' ) + continue; + + sender = registeredName( sender ); + receiver = registeredName( receiver ); + + // translate formwindow name to "self" + if ( sender == objName ) + sender = "self"; + else + sender = "self." + sender; + + bool isaxwidget = (axwidgets.findIndex(receiver) >= 0); + bool isdatabrowser = (databrowsers.findIndex(receiver) >= 0); + + if ( receiver == objName ) + receiver = "self"; + else + receiver = "self." + receiver; + + out << indent << "self.connect(" << sender + << ",SIGNAL(\"" << signal << "\")," << receiver; + + // Normally we never use the SLOT() macro in case the + // connection is to a method of a Python custom widget. The + // exception is if the receiver is a QAxWidget where it must be + // used because the slots are dynamic. + if (isaxwidget) + out << ",SLOT(\"" << slot << "\")"; + else + { + QString mname = slot.left(slot.find('(')); + + // Rename slots that have different names in PyQt. + if (isdatabrowser && mname == "del") + mname = "delOnCursor"; + + out << "." << mname; + } + + out << ")" << endl; + } + } else if ( n.tagName() == "tabstops" ) { + // setup tab order + out << endl; + QString lastName; + QDomElement n2 = n.firstChild().toElement(); + while ( !n2.isNull() ) { + if ( n2.tagName() == "tabstop" ) { + QString name = n2.firstChild().toText().data(); + name = registeredName( name ); + if ( !lastName.isEmpty() ) + out << indent << "self.setTabOrder(self." << lastName << ",self." << name << ")" << endl; + lastName = name; + } + n2 = n2.nextSibling().toElement(); + } + } + } + + // buddies + bool firstBuddy = TRUE; + for ( QValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + if ( isObjectRegistered( (*buddy).buddy ) ) { + if ( firstBuddy ) { + out << endl; + } + out << indent << "self." << (*buddy).key << ".setBuddy(self." << registeredName( (*buddy).buddy ) << ")" << endl; + firstBuddy = FALSE; + } + + } + + if ( extraSlots.find( "init()" ) != extraSlots.end() ) + out << endl << indent << "self.init()" << endl; + + // end of constructor + --indent; + + // destructor + if ( extraSlots.find( "destroy()" ) != extraSlots.end() ) { + out << endl; + out << indent << "def __del__(self):" << endl; + ++indent; + out << indent << "self.destroy()" << endl; + --indent; + } + + // handle application events if required + bool needFontEventHandler = FALSE; + bool needSqlTableEventHandler = FALSE; + bool needSqlDataBrowserEventHandler = FALSE; + nl = e.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) + needFontEventHandler = TRUE; + QString s = getClassName( nl.item(i).toElement() ); + if ( s == "QDataTable" || s == "QDataBrowser" ) { + if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) + continue; + if ( s == "QDataTable" ) + needSqlTableEventHandler = TRUE; + if ( s == "QDataBrowser" ) + needSqlDataBrowserEventHandler = TRUE; + } + if ( needFontEventHandler && needSqlTableEventHandler && needSqlDataBrowserEventHandler ) + break; + } + if ( needFontEventHandler && FALSE ) { + // indent = "\t"; // increase indentation for if-clause below + out << "/* " << endl; + out << " * Main event handler. Reimplemented to handle" << endl; + out << " * application font changes"; + out << " */" << endl; + out << "bool " << nameOfClass << "::event( QEvent* ev )" << endl; + out << "{" << endl; + out << " bool ret = " << objClass << "::event( ev ); " << endl; + if ( needFontEventHandler ) { + ++indent; + out << " if ( ev->type() == QEvent::ApplicationFontChange ) {" << endl; + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + QStringList list = DomTool::propertiesOfType( n, "font" ); + for ( it = list.begin(); it != list.end(); ++it ) + createExclusiveProperty( n, *it ); + } + out << " }" << endl; + --indent; + } + out << "}" << endl; + out << endl; + } + + if ( needSqlTableEventHandler || needSqlDataBrowserEventHandler ) { + out << endl; + out << indent << "# Widget polish. Reimplemented to handle default data" << endl; + if ( needSqlTableEventHandler ) + out << indent << "# table initialization." << endl; + if ( needSqlDataBrowserEventHandler ) + out << indent << "# browser initialization." << endl; + out << indent << "def polish(self):" << endl; + ++indent; + if ( needSqlTableEventHandler ) { + for ( i = 0; i < (int) nl.length(); i++ ) { + QString s = getClassName( nl.item(i).toElement() ); + if ( s == "QDataTable" ) { + n = nl.item(i).toElement(); + QString c = getObjectName( n ); + QString conn = getDatabaseInfo( n, "connection" ); + QString tab = getDatabaseInfo( n, "table" ); + if ( !( conn.isEmpty() || tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { + out << indent << "if self." << c << ":" << endl; + ++indent; + out << indent << "cursor = self." << c << ".sqlCursor()" << endl; + out << endl; + out << indent << "if not cursor:" << endl; + ++indent; + if ( conn == "(default)" ) + out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl; + else + out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "if self." << c << ".isReadOnly():" << endl; + ++indent; + out << indent << "cursor.setMode(QSqlCursor.ReadOnly)" << endl; + --indent; + out << indent << "self." << c << ".setSqlCursor(cursor,0,1)" << endl; + --indent; + out << endl; + out << indent << "if not cursor.isActive():" << endl; + ++indent; + out << indent << "self." << c << ".refresh(QDataTable.RefreshAll)" << endl; + --indent; + --indent; + } + } + } + } + if ( needSqlDataBrowserEventHandler ) { + nl = e.elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + QString s = getClassName( nl.item(i).toElement() ); + if ( s == "QDataBrowser" ) { + QString obj = getObjectName( nl.item(i).toElement() ); + QString tab = getDatabaseInfo( nl.item(i).toElement(), + "table" ); + QString conn = getDatabaseInfo( nl.item(i).toElement(), + "connection" ); + if ( !(tab.isEmpty() || !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) ) { + out << indent << "if self." << obj << ":" << endl; + ++indent; + out << indent << "if not self." << obj << ".sqlCursor():" << endl; + ++indent; + if ( conn == "(default)" ) + out << indent << "cursor = QSqlCursor(\"" << tab << "\")" << endl; + else + out << indent << "cursor = QSqlCursor(\"" << tab << "\",1,self." << conn << "Connection)" << endl; + out << indent << "self." << obj << ".setSqlCursor(cursor,1)" << endl; + out << indent << "self." << obj << ".refresh()" << endl; + out << indent << "self." << obj << ".first()" << endl; + --indent; + --indent; + } + } + } + } + out << indent << objClass << ".polish(self)" << endl; + --indent; + } + + out << endl; + out << endl; + out << indent << "def languageChange(self):" << endl; + uint old = indent.setIndent(0); + out << languageChangeBody << endl; + indent.setIndent(old); + + // create stubs for additional slots if necessary + if ( !extraSlots.isEmpty() && writeFunctImpl ) { + QStringList::ConstIterator cit; + + for ( cit = extraSlots.begin(); cit != extraSlots.end(); ++cit ) { + pySlot(cit); + + bool createWarning = TRUE; + QString fname = Parser::cleanArgs( *cit ); + QMap<QString, QString>::Iterator fit = functionImpls.find( fname ); + if ( fit != functionImpls.end() ) { + int begin = (*fit).find( "{" ); + QString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + createWarning = body.simplifyWhiteSpace().isEmpty(); + if ( !createWarning ) + { + ++indent; + QString formatted_body = body.replace(QRegExp("\n"), QString("\n") + QString(indent)); + out << formatted_body << endl; + --indent; + } + } + if ( createWarning ) { + out << endl; + ++indent; + if ( *cit != "init()" && *cit != "destroy()" ) + out << indent << "print \"" << nameOfClass << "." << (*cit) << ": Not implemented yet\"" << endl; + else + out << indent << "pass" << endl; + --indent; + } + } + } + + --indent; +} + + +/*! Creates form support implementation code for the widgets given + in \a e. + + Traverses recursively over all children. + */ + +void Uic::createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table ) +{ + if ( e.tagName() == "widget" && + e.attribute( "class" ) != "QDataTable" ) { + QString field = getDatabaseInfo( e, "field" ); + if ( !field.isEmpty() ) { + if ( isWidgetInTable( e, connection, table ) ) + out << indent << form << "Form.insert(self." << getObjectName( e ) << "," << fixString( field ) << ")" << endl; + } + } + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + createFormImpl( n, form, connection, table ); + } +} + + +// Generate a Python slot definition. + +void Uic::pySlot(QStringList::ConstIterator &it) +{ + out << endl; + + int astart = (*it).find('('); + out << indent << "def " << (*it).left(astart) << "(self"; + + // We don't reproduce the argument names (if any) because we would have to + // remove the types - too complicated for the moment, so we just count them + // and give them names based on their position. + + QString args = (*it).mid(astart + 1,(*it).find(')') - astart - 1).stripWhiteSpace(); + + if (!args.isEmpty()) { + int nrargs = args.contains(',') + 1; + + for (int i = 0; i < nrargs; ++i) + out << ",a" << i; + } + + out << "):"; +} diff --git a/python/pyqt/pyuic3/globaldefs.h b/python/pyqt/pyuic3/globaldefs.h new file mode 100644 index 00000000..4ae0cd83 --- /dev/null +++ b/python/pyqt/pyuic3/globaldefs.h @@ -0,0 +1,56 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef GLOBALDEFS_H +#define GLOBALDEFS_H + +#include <qcolor.h> +#include <qapplication.h> + +#define BOXLAYOUT_DEFAULT_MARGIN 11 +#define BOXLAYOUT_DEFAULT_SPACING 6 + +#ifndef NO_STATIC_COLORS +static QColor *backColor1 = 0; +static QColor *backColor2 = 0; +static QColor *selectedBack = 0; + +static void init_colors() +{ + if ( backColor1 ) + return; + +#if 0 // a calculated alternative for backColor1 + QColorGroup myCg = qApp->palette().active(); + int h1, s1, v1; + int h2, s2, v2; + myCg.color( QColorGroup::Base ).hsv( &h1, &s1, &v1 ); + myCg.color( QColorGroup::Background ).hsv( &h2, &s2, &v2 ); + QColor c( h1, s1, ( v1 + v2 ) / 2, QColor::Hsv ); +#endif + + backColor1 = new QColor( 250, 248, 235 ); + backColor2 = new QColor( 255, 255, 255 ); + selectedBack = new QColor( 230, 230, 230 ); +} + +#endif + +#endif diff --git a/python/pyqt/pyuic3/main.cpp b/python/pyqt/pyuic3/main.cpp new file mode 100644 index 00000000..265a536c --- /dev/null +++ b/python/pyqt/pyuic3/main.cpp @@ -0,0 +1,245 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include <qapplication.h> +#include <qfile.h> +#include <qstringlist.h> +#include <qdatetime.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> +#include <qregexp.h> +#include <stdio.h> +#include <stdlib.h> + +int main( int argc, char * argv[] ) +{ + PyIndent indent; + bool testCode = FALSE, execCode = FALSE; + bool subcl = FALSE; + bool imagecollection = FALSE; + QStringList images; + const char *error = 0; + const char* fileName = 0; + QCString outputFile; + const char* projectName = 0; + const char* trmacro = 0; + bool fix = FALSE; + QApplication app(argc, argv, FALSE); + QString className, uicClass; + + for ( int n = 1; n < argc && error == 0; n++ ) { + QCString arg = argv[n]; + if ( arg[0] == '-' ) { // option + QCString opt = &arg[1]; + if ( opt[0] == 'o' ) { // output redirection + if ( opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing output-file name"; + break; + } + outputFile = argv[++n]; + } else + outputFile = &opt[1]; + } else if ( opt[0] == 'e' || opt == "embed" ) { + imagecollection = TRUE; + if ( opt == "embed" || opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing name of project"; + break; + } + projectName = argv[++n]; + } else + projectName = &opt[1]; + } else if ( opt == "subimpl" ) { + subcl = TRUE; + if ( !(n < argc-1) ) { + error = "Missing class name"; + break; + } + className = argv[++n]; + } else if ( opt == "tr" ) { + if ( opt == "tr" || opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing tr macro"; + break; + } + trmacro = argv[++n]; + } else { + trmacro = &opt[1]; + } + } else if ( opt == "version" ) { + fprintf( stderr, + "Python User Interface Compiler %s for Qt version %s\n", + PYQT_VERSION, QT_VERSION_STR ); + return 1; + } else if ( opt == "help" ) { + break; + } else if ( opt == "fix" ) { + fix = TRUE; + } else if ( opt[0] == 'p' ) { + uint tabstop; + bool ok; + + if ( opt[1] == '\0' ) { + if ( !(n < argc-1) ) { + error = "Missing Python indent"; + break; + } + tabstop = QCString(argv[++n]).toUInt(&ok); + } else + tabstop = opt.mid(1).toUInt(&ok); + + if (ok) + indent.setTabStop(tabstop); + else + error = "Invalid Python indent"; + } else if ( opt == "test" ) { + testCode = TRUE; + } else if ( opt == "x" ) { + execCode = TRUE; + } else { + error = "Unrecognized option"; + } + } else { + if ( imagecollection ) + images << argv[n]; + else if ( fileName ) // can handle only one file + error = "Too many input files specified"; + else + fileName = argv[n]; + } + } + + if ( argc < 2 || error || (!fileName && !imagecollection ) ) { + fprintf( stderr, "PyQt user interface compiler.\n" ); + if ( error ) + fprintf( stderr, "pyuic: %s\n", error ); + + fprintf( stderr, "Usage: %s [options] [mode] <uifile>\n" + "\nGenerate implementation:\n" + " %s [options] <uifile>\n" + "Generate image collection:\n" + " %s [options] -embed <project> <image1> <image2> <image3> ...\n" + "\t<project>\tproject name\n" + "\t<image[0..n]>\timage files\n" + "Generate subclass implementation:\n" + " %s [options] -subimpl <classname> <uifile>\n" + "\t<classname>\tname of the subclass to generate\n" + "Options:\n" + "\t-o file\t\tWrite output to file rather than stdout\n" + "\t-p indent\tSet the Python indent in spaces (0 to use a tab)\n" + "\t-tr func\tUse func() rather than QApplication.translate() for i18n\n" + "\t-x\t\tGenerate extra code to test and display the class\n" + "\t-test\t\tGenerate extra code to test but not display the class\n" + "\t-version\tDisplay version of pyuic\n" + "\t-help\t\tDisplay this information\n" + , argv[0], argv[0], argv[0], argv[0]); + return 1; + } + + Uic::setIndent(indent); + + QFile fileOut; + if ( !outputFile.isEmpty() ) { + fileOut.setName( outputFile ); + if (!fileOut.open( IO_WriteOnly ) ) + qFatal( "pyuic: Could not open output file '%s'", outputFile.data() ); + } else { + fileOut.open( IO_WriteOnly, stdout ); + } + QTextStream out( &fileOut ); + + if ( imagecollection ) { + out.setEncoding( QTextStream::Latin1 ); + out << "# -*- coding: latin-1 -*-\n\n"; + Uic::embed( out, projectName, images ); + return 0; + } + + + out.setEncoding( QTextStream::UnicodeUTF8 ); + QFile file( fileName ); + if ( !file.open( IO_ReadOnly ) ) + qFatal( "pyuic: Could not open file '%s' ", fileName ); + + QDomDocument doc; + QString errMsg; + int errLine; + if ( !doc.setContent( &file, &errMsg, &errLine ) ) + qFatal( QString("pyuic: Failed to parse %s: ") + errMsg + QString (" in line %d\n"), fileName, errLine ); + + QDomElement e = doc.firstChild().toElement(); + if ( e.hasAttribute("version") && e.attribute("version").toDouble() > 3.3 ) { + qWarning( QString("pyuic: File generated with too recent version of Qt Designer (%s vs. %s)"), + e.attribute("version").latin1(), QT_VERSION_STR ); + return 1; + } + + DomTool::fixDocument( doc ); + + if ( fix ) { + out << doc.toString(); + return 0; + } + + out << "# -*- coding: utf-8 -*-\n\n"; + + if ( !subcl ) { + out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; + out << "#" << endl; + out << "# Created: " << QDateTime::currentDateTime().toString() << endl; + out << "# by: The PyQt User Interface Compiler (pyuic) " << PYQT_VERSION << endl; + out << "#" << endl; + out << "# WARNING! All changes made in this file will be lost!" << endl; + out << endl; + out << endl; + } + + if (testCode || execCode) + out << "import sys" << endl; + + out << "from qt import *" << endl; + + Uic( fileName, outputFile, out, doc, subcl, trmacro, className, uicClass ); + + if (testCode || execCode) { + out << endl; + out << indent << "if __name__ == \"__main__\":" << endl; + ++indent; + out << indent << "a = QApplication(sys.argv)" << endl; + out << indent << "QObject.connect(a,SIGNAL(\"lastWindowClosed()\"),a,SLOT(\"quit()\"))" << endl; + out << indent << "w = " << (subcl ? className : uicClass) << "()" << endl; + out << indent << "a.setMainWidget(w)" << endl; + + if (execCode) { + out << indent << "w.show()" << endl; + out << indent << "a.exec_loop()" << endl; + } + + --indent; + } + + return 0; +} diff --git a/python/pyqt/pyuic3/object.cpp b/python/pyqt/pyuic3/object.cpp new file mode 100644 index 00000000..834427f5 --- /dev/null +++ b/python/pyqt/pyuic3/object.cpp @@ -0,0 +1,704 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "domtool.h" +#include <qregexp.h> +#include <qsizepolicy.h> +#include <qstringlist.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> + + +/*! + Creates an implementation for the object given in \a e. + + Traverses recursively over all children. + + Returns the name of the generated child object. + */ + +static bool createdCentralWidget = FALSE; + +QString Uic::createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& par, const QString& layout ) +{ + QString parent( par ); + if ( parent == "self" && isMainWindow ) { + if ( !createdCentralWidget ) + out << indent << "self.setCentralWidget(QWidget(self,\"qt_central_widget\"))" << endl; + createdCentralWidget = TRUE; + parent = "self.centralWidget()"; + } + QDomElement n; + QString objClass, objName, fullObjName; + int numItems = 0; + int numColumns = 0; + int numRows = 0; + + if ( layouts.contains( e.tagName() ) ) + return createLayoutImpl( e, parentClass, parent, layout ); + + objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return objName; + objName = getObjectName( e ); + + QString definedName = objName; + bool isTmpObject = objName.isEmpty() || objClass == "QLayoutWidget"; + if ( isTmpObject ) { + if ( objClass[0] == 'Q' ) + objName = objClass.mid(1); + else + objName = objClass.lower(); + } + + bool isLine = objClass == "Line"; + if ( isLine ) + objClass = "QFrame"; + + out << endl; + if ( objClass == "QLayoutWidget" ) { + if ( layout.isEmpty() ) { + // register the object and unify its name + objName = registerObject( objName ); + out << indent << objName << " = QWidget(" << parent << ",\"" << definedName << "\")" << endl; + } else { + // the layout widget is not necessary, hide it by creating its child in the parent + QString result; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if (tags.contains( n.tagName() ) ) + result = createObjectImpl( n, parentClass, parent, layout ); + } + return result; + } + + // Layouts don't go into the class instance dictionary. + fullObjName = objName; + } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) { + // register the object and unify its name + objName = registerObject( objName ); + + // Temporary objects don't go into the class instance dictionary. + fullObjName = isTmpObject ? objName : "self." + objName; + + out << indent << fullObjName << " = " << createObjectInstance( objClass, parent, objName ) << endl; + } + else + fullObjName = "self." + objName; + + if ( objClass == "QAxWidget" ) { + QString controlId; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) { + controlId = n.firstChild().toElement().text(); + } + } + out << indent << fullObjName << ".setControl(\"" << controlId << "\")" << endl; + } + + lastItem = "None"; + // set the properties and insert items + bool hadFrameShadow = FALSE; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + QString prop = n.attribute( "name" ); + if ( prop == "database" ) + continue; + QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + if ( prop == "name" ) + continue; + if ( isLine && prop == "frameShadow" ) + hadFrameShadow = TRUE; + if ( prop == "buddy" && value.startsWith("\"") && value.endsWith("\"") ) { + buddies << Buddy( objName, value.mid(1, value.length() - 2 ) ); + continue; + } + if ( isLine && prop == "orientation" ) { + prop = "frameShape"; + if ( value.right(10) == "Horizontal" ) + value = "QFrame.HLine"; + else + value = "QFrame.VLine"; + if ( !hadFrameShadow ) { + prop = "frameStyle"; + value += " | QFrame.Sunken"; + } + } + if ( prop == "buttonGroupId" ) { + if ( parentClass == "QButtonGroup" ) + out << indent << parent << ".insert( " << fullObjName << "," << value << ")" << endl; + continue; + } + if ( prop == "frameworkCode" ) + continue; + if ( objClass == "QMultiLineEdit" && + QRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + continue; + QString call = fullObjName + "."; + QString tail; + if ( stdset ) { + call += mkStdSet( prop ) + "("; + tail = ")"; + } else { + call += "setProperty(\"" + prop + "\",QVariant("; + tail = "))"; + } + if ( prop == "accel" ) { + call += "QKeySequence("; + tail += ")"; + } + call += value + tail; + + if ( n.firstChild().toElement().tagName() == "string" || + prop == "currentItem" ) { + trout << trindent << call << endl; + } else { + out << indent << call << endl; + } + } else if ( n.tagName() == "item" ) { + QString call; + QString value; + + if ( objClass.contains( "ListBox" ) ) { + call = createListBoxItemImpl( n, fullObjName ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "ComboBox" ) ) { + call = createListBoxItemImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "IconView" ) ) { + call = createIconViewItemImpl( n, fullObjName ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << trindent << call << endl; + } + } else if ( objClass.contains( "ListView" ) ) { + call = createListViewItemImpl( n, fullObjName, QString::null ); + if ( !call.isEmpty() ) { + if ( numItems == 0 ) + trout << trindent << fullObjName << ".clear()" << endl; + trout << call << endl; + } + } + if ( !call.isEmpty() ) + numItems++; + } else if ( n.tagName() == "column" || n.tagName() == "row" ) { + QString call; + QString value; + + if ( objClass.contains( "ListView" ) ) { + call = createListViewColumnImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + out << call; + trout << trindent << fullObjName << ".header().setLabel(" + << numColumns++ << "," << value << ")\n"; + } + } else if ( objClass == "QTable" || objClass == "QDataTable" ) { + bool isCols = ( n.tagName() == "column" ); + call = createTableRowColumnImpl( n, fullObjName, &value ); + if ( !call.isEmpty() ) { + out << call; + trout << trindent << fullObjName << "." + << ( isCols ? "horizontalHeader" : "verticalHeader" ) + << "().setLabel(" + << ( isCols ? numColumns++ : numRows++ ) + << "," << value << ")\n"; + } + } + } + } + + // create all children, some widgets have special requirements + + if ( objClass == "QTabWidget" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, fullObjName ); + QString comment; + QString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + out << indent << fullObjName << ".insertTab(" << page << ",QString.fromLatin1(\"\"))" << endl; + trout << trindent << fullObjName << ".changeTab(" << page << "," << trcall( label, comment ) << ")" << endl; + } + } + } else if ( objClass == "QWidgetStack" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, fullObjName ); + int id = DomTool::readAttribute( n, "id", "" ).toInt(); + out << indent << fullObjName << ".addWidget(" << page << "," << id << ")" << endl; + } + } + } else if ( objClass == "QToolBox" ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) { + QString page = createObjectImpl( n, objClass, fullObjName ); + QString comment; + QString label = DomTool::readAttribute( n, "label", "", comment ).toString(); + out << indent << fullObjName << ".addItem(" << page << ",QString.fromLatin1(\"\"))" << endl; + trout << trindent << fullObjName << ".setItemLabel(" << fullObjName + << ".indexOf(" << page << ")," << trcall( label, comment ) + << ")" << endl; + } + } + } else if ( objClass != "QToolBar" && objClass != "QMenuBar" ) { // standard widgets + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( tags.contains( n.tagName() ) ) + createObjectImpl( n, objClass, fullObjName ); + } + } + + return fullObjName; +} + + + +/*! + Creates a set-call for property \a exclusiveProp of the object + given in \a e. + + If the object does not have this property, the function does nothing. + + Exclusive properties are used to generate the implementation of + application font or palette change handlers in createFormImpl(). + + */ +void Uic::createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ) +{ + QDomElement n; + QString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + QString objName = getObjectName( e ); +#if 0 // it's not clear whether this check should be here or not + if ( objName.isEmpty() ) + return; +#endif + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n.hasAttribute( "stdset" ) ) + stdset = toBool( n.attribute( "stdset" ) ); + QString prop = n.attribute( "name" ); + if ( prop != exclusiveProp ) + continue; + QString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + out << indent << indent << objName << ".setProperty(\"" << prop << "\",QVariant(" << value << "))" << endl; + } + } +} + + +/* Convert a QSizePolicy::SizeType to text. */ +static QString mapSizeType(QSizePolicy::SizeType st) +{ + const char *txt; + + switch (st) + { + case QSizePolicy::Fixed: + txt = "QSizePolicy.Fixed"; + break; + + case QSizePolicy::Minimum: + txt = "QSizePolicy.Minimum"; + break; + + case QSizePolicy::Maximum: + txt = "QSizePolicy.Maximum"; + break; + + case QSizePolicy::Preferred: + txt = "QSizePolicy.Preferred"; + break; + + case QSizePolicy::MinimumExpanding: + txt = "QSizePolicy.MinimumExpanding"; + break; + + case QSizePolicy::Expanding: + txt = "QSizePolicy.Expanding"; + break; + + case QSizePolicy::Ignored: + txt = "QSizePolicy.Ignored"; + break; + + default: + txt = "Invalid QSizePolicy::SizeType"; + } + + return txt; +} + + +/*! Attention: this function has to be in sync with + Resource::saveProperty() and DomTool::elementToVariant. If you + change one, change all. + */ +QString Uic::setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ) +{ + QString v; + if ( e.tagName() == "rect" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0, w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QRect(%1,%2,%3,%4)"; + v = v.arg(x).arg(y).arg(w).arg(h); + + } else if ( e.tagName() == "point" ) { + QDomElement n3 = e.firstChild().toElement(); + int x = 0, y = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "x" ) + x = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "y" ) + y = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QPoint(%1,%2)"; + v = v.arg(x).arg(y); + } else if ( e.tagName() == "size" ) { + QDomElement n3 = e.firstChild().toElement(); + int w = 0, h = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "width" ) + w = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "height" ) + h = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QSize(%1,%2)"; + v = v.arg(w).arg(h); + } else if ( e.tagName() == "color" ) { + QDomElement n3 = e.firstChild().toElement(); + int r = 0, g = 0, b = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "red" ) + r = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "green" ) + g = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "blue" ) + b = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QColor(%1,%2,%3)"; + v = v.arg(r).arg(g).arg(b); + } else if ( e.tagName() == "font" ) { + QDomElement n3 = e.firstChild().toElement(); + QString attrname = e.parentNode().toElement().attribute( "name", "font" ); + QString fontname; + if ( !obj.isEmpty() ) { + fontname = registerObject( obj + "_" + attrname ); + out << indent << fontname << " = QFont(self." << obj << ".font())" << endl; + } else { + fontname = registerObject( "f" ); + out << indent << fontname << " = QFont(self.font())" << endl; + } + while ( !n3.isNull() ) { + if ( n3.tagName() == "family" ) + out << indent << fontname << ".setFamily(\"" << n3.firstChild().toText().data() << "\")" << endl; + else if ( n3.tagName() == "pointsize" ) + out << indent << fontname << ".setPointSize(" << n3.firstChild().toText().data() << ")" << endl; + else if ( n3.tagName() == "bold" ) + out << indent << fontname << ".setBold(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "italic" ) + out << indent << fontname << ".setItalic(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "underline" ) + out << indent << fontname << ".setUnderline(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + else if ( n3.tagName() == "strikeout" ) + out << indent << fontname << ".setStrikeOut(" << mkBool( n3.firstChild().toText().data() ) << ")" << endl; + n3 = n3.nextSibling().toElement(); + } + + if ( prop == "font" ) { + if ( !obj.isEmpty() ) + out << indent << "self." << obj << ".setFont(" << fontname << ")" << endl; + else + out << indent << "self.setFont(" << fontname << ")" << endl; + } else { + v = fontname; + } + } else if ( e.tagName() == "string" ) { + QString txt = e.firstChild().toText().data(); + QString com = getComment( e.parentNode() ); + + if ( prop == "toolTip" && objClass != "QAction" && objClass != "QActionGroup" ) { + if ( !obj.isEmpty() ) + trout << trindent << "QToolTip.add(self." << obj << "," + << trcall( txt, com ) << ")" << endl; + else + trout << trindent << "QToolTip.add(self," + << trcall( txt, com ) << ")" << endl; + } else if ( prop == "whatsThis" && objClass != "QAction" && objClass != "QActionGroup" ) { + if ( !obj.isEmpty() ) + trout << trindent << "QWhatsThis.add(self." << obj << "," + << trcall( txt, com ) << ")" << endl; + else + trout << trindent << "QWhatsThis.add(self," + << trcall( txt, com ) << ")" << endl; + } else { + v = trcall( txt, com ); + } + } else if ( e.tagName() == "cstring" ) { + v = "\"%1\""; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "number" ) { + v = "%1"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "bool" ) { + if ( stdset ) + v = "%1"; + else + v = "QVariant(%1,0)"; + v = v.arg( mkBool( e.firstChild().toText().data() ) ); + } else if ( e.tagName() == "pixmap" ) { + v = e.firstChild().toText().data(); + if ( !v.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + v.prepend( "self." ); + } else { + v.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); + v.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( e.tagName() == "iconset" ) { + v = "QIconSet(%1)"; + QString s = e.firstChild().toText().data(); + if ( !s.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + s.prepend( "self." ); + } else { + s.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "" ) ); + s.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + v = v.arg( s ); + } else if ( e.tagName() == "image" ) { + v = e.firstChild().toText().data() + ".convertToImage()"; + } else if ( e.tagName() == "enum" ) { + v = "%1.%2"; + QString oc = objClass; + QString ev = e.firstChild().toText().data(); + if ( oc == "QListView" && ev == "Manual" ) // #### workaround, rename QListView::Manual in 4.0 + oc = "QScrollView"; + v = v.arg( oc ).arg( ev ); + } else if ( e.tagName() == "set" ) { + QString keys( e.firstChild().toText().data() ); + QStringList lst = QStringList::split( '|', keys ); + v = ""; + QStringList::Iterator it = lst.begin(); + while ( it != lst.end() ) { + v += objClass + "." + *it; + if ( it != lst.fromLast() ) + v += " | "; + ++it; + } + } else if ( e.tagName() == "sizepolicy" ) { + QDomElement n3 = e.firstChild().toElement(); + QSizePolicy sp; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hsizetype" ) + sp.setHorData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "vsizetype" ) + sp.setVerData( (QSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "horstretch" ) + sp.setHorStretch( n3.firstChild().toText().data().toInt() ); + else if ( n3.tagName() == "verstretch" ) + sp.setVerStretch( n3.firstChild().toText().data().toInt() ); + n3 = n3.nextSibling().toElement(); + } + QString tmp = "self."; + if ( !obj.isEmpty() ) + tmp += obj + "."; + v = "QSizePolicy(%1,%2,%3,%4," + tmp + "sizePolicy().hasHeightForWidth())"; + v = v.arg( mapSizeType(sp.horData()) ).arg( mapSizeType(sp.verData()) ).arg( sp.horStretch() ).arg( sp.verStretch() ); + } else if ( e.tagName() == "palette" ) { + QPalette pal; + bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; + QDomElement n; + if ( no_pixmaps ) { + n = e.firstChild().toElement(); + while ( !n.isNull() ) { + QColorGroup cg; + if ( n.tagName() == "active" ) { + cg = loadColorGroup( n ); + pal.setActive( cg ); + } else if ( n.tagName() == "inactive" ) { + cg = loadColorGroup( n ); + pal.setInactive( cg ); + } else if ( n.tagName() == "disabled" ) { + cg = loadColorGroup( n ); + pal.setDisabled( cg ); + } + n = n.nextSibling().toElement(); + } + } + if ( no_pixmaps && pal == QPalette( pal.active().button(), pal.active().background() ) ) { + v = "QPalette(QColor(%1,%2,%3),QColor(%1,%2,%3))"; + v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); + v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); + } else { + QString palette = "pal"; + if ( !pal_used ) { + out << indent << palette << " = QPalette()" << endl; + pal_used = TRUE; + } + QString cg = "cg"; + if ( !cg_used ) { + out << indent << cg << " = QColorGroup()" << endl; + cg_used = TRUE; + } + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "active" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setActive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "inactive" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setInactive(" << cg << ")" << endl; + + n = e.firstChild().toElement(); + while ( !n.isNull() && n.tagName() != "disabled" ) + n = n.nextSibling().toElement(); + createColorGroupImpl( cg, n ); + out << indent << palette << ".setDisabled(" << cg << ")" << endl; + v = palette; + } + } else if ( e.tagName() == "cursor" ) { + v = "QCursor(%1)"; + v = v.arg( e.firstChild().toText().data() ); + } else if ( e.tagName() == "date" ) { + QDomElement n3 = e.firstChild().toElement(); + int y, m, d; + y = m = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QDate(%1,%2,%3)"; + v = v.arg(y).arg(m).arg(d); + } else if ( e.tagName() == "time" ) { + QDomElement n3 = e.firstChild().toElement(); + int h, m, s; + h = m = s = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + m = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QTime(%1,%2,%3)"; + v = v.arg(h).arg(m).arg(s); + } else if ( e.tagName() == "datetime" ) { + QDomElement n3 = e.firstChild().toElement(); + int h, mi, s, y, mo, d; + h = mi = s = y = mo = d = 0; + while ( !n3.isNull() ) { + if ( n3.tagName() == "hour" ) + h = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "minute" ) + mi = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "second" ) + s = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "year" ) + y = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "month" ) + mo = n3.firstChild().toText().data().toInt(); + else if ( n3.tagName() == "day" ) + d = n3.firstChild().toText().data().toInt(); + n3 = n3.nextSibling().toElement(); + } + v = "QDateTime(QDate(%1,%2,%3),QTime(%4,%5,%6))"; + v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); + } else if ( e.tagName() == "stringlist" ) { + QStringList l; + QDomElement n3 = e.firstChild().toElement(); + QString listname = "l"; + if ( !obj.isEmpty() ) { + listname = obj + "_stringlist"; + listname = registerObject( listname ); + out << indent << listname << " = QStringList()" << endl; + } else { + out << indent << listname << " = QStringList()" << endl; + } + while ( !n3.isNull() ) { + if ( n3.tagName() == "string" ) + out << indent << listname << ".append(\"" << n3.firstChild().toText().data().simplifyWhiteSpace() << "\")" << endl; + n3 = n3.nextSibling().toElement(); + } + v = listname; + } + return v; +} + + + + +/*! Extracts a named object property from \a e. + */ +QDomElement Uic::getObjectProperty( const QDomElement& e, const QString& name ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); + !n.isNull(); + n = n.nextSibling().toElement() ) { + if ( n.tagName() == "property" && n.toElement().attribute("name") == name ) + return n; + } + return n; +} + diff --git a/python/pyqt/pyuic3/parser.cpp b/python/pyqt/pyuic3/parser.cpp new file mode 100644 index 00000000..4fc13c5f --- /dev/null +++ b/python/pyqt/pyuic3/parser.cpp @@ -0,0 +1,66 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "parser.h" +#include <qobject.h> +#include <qstringlist.h> + +class NormalizeObject : public QObject +{ +public: + NormalizeObject() : QObject() {} + static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); } +}; + +QString Parser::cleanArgs( const QString &func ) +{ + QString slot( func ); + int begin = slot.find( "(" ) + 1; + QString args = slot.mid( begin ); + args = args.left( args.find( ")" ) ); + QStringList lst = QStringList::split( ',', args ); + QString res = slot.left( begin ); + for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + if ( it != lst.begin() ) + res += ","; + QString arg = *it; + int pos = 0; + if ( ( pos = arg.find( "&" ) ) != -1 ) { + arg = arg.left( pos + 1 ); + } else if ( ( pos = arg.find( "*" ) ) != -1 ) { + arg = arg.left( pos + 1 ); + } else { + arg = arg.simplifyWhiteSpace(); + if ( ( pos = arg.find( ':' ) ) != -1 ) + arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); + QStringList l = QStringList::split( ' ', arg ); + if ( l.count() == 2 ) { + if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" ) + arg = l[ 0 ]; + } else if ( l.count() == 3 ) { + arg = l[ 0 ] + " " + l[ 1 ]; + } + } + res += arg; + } + res += ")"; + + return QString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) ); +} diff --git a/python/pyqt/pyuic3/parser.h b/python/pyqt/pyuic3/parser.h new file mode 100644 index 00000000..5a5671ad --- /dev/null +++ b/python/pyqt/pyuic3/parser.h @@ -0,0 +1,33 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef PARSER_H +#define PARSER_H + +#include <qstring.h> + +class Parser +{ +public: + static QString cleanArgs( const QString &func ); + +}; + +#endif diff --git a/python/pyqt/pyuic3/pyuic-prof.sbf b/python/pyqt/pyuic3/pyuic-prof.sbf new file mode 100644 index 00000000..25013493 --- /dev/null +++ b/python/pyqt/pyuic3/pyuic-prof.sbf @@ -0,0 +1,24 @@ +# This is the build file for pyuic for Qt v3 Professional Edition. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + +target = pyuic +sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp qdom.cpp qxml.cpp +headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/python/pyqt/pyuic3/pyuic.pro.in b/python/pyqt/pyuic3/pyuic.pro.in new file mode 100644 index 00000000..faebbd6f --- /dev/null +++ b/python/pyqt/pyuic3/pyuic.pro.in @@ -0,0 +1,36 @@ +# Copyright (c) 2001 +# Phil Thompson <phil@river-bank.demon.co.uk> +# Copyright (c) 2002, 2003 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# The project file for pyuic for Qt v3. + + +TEMPLATE = app +CONFIG += qt console warn_on release @PYQT_RBPROF@ +INCLUDEPATH += @BLX_INCLUDEPATH@ $(QTDIR)/src/3rdparty/zlib +DEFINES += UIC QT_INTERNAL_XML @BLX_DEFINES@ + +DESTDIR = @PYQT_BINDIR@ +TARGET = pyuic + +HEADERS = uic.h \ + widgetdatabase.h \ + domtool.h \ + parser.h \ + widgetinterface.h + +SOURCES = main.cpp \ + uic.cpp \ + form.cpp \ + object.cpp \ + subclassing.cpp \ + embed.cpp \ + widgetdatabase.cpp \ + domtool.cpp \ + parser.cpp + +rbprof:exists($(QTDIR)/src/qt_professional.pri) { + QT_SOURCE_TREE = $(QTDIR) + include($(QTDIR)/src/qt_professional.pri) +} diff --git a/python/pyqt/pyuic3/pyuic.sbf b/python/pyqt/pyuic3/pyuic.sbf new file mode 100644 index 00000000..a40245de --- /dev/null +++ b/python/pyqt/pyuic3/pyuic.sbf @@ -0,0 +1,24 @@ +# This is the build file for pyuic for Qt v3. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + +target = pyuic +sources = main.cpp uic.cpp form.cpp object.cpp subclassing.cpp embed.cpp widgetdatabase.cpp domtool.cpp parser.cpp +headers = domtool.h globaldefs.h parser.h uic.h widgetdatabase.h widgetinterface.h diff --git a/python/pyqt/pyuic3/subclassing.cpp b/python/pyqt/pyuic3/subclassing.cpp new file mode 100644 index 00000000..299e0449 --- /dev/null +++ b/python/pyqt/pyuic3/subclassing.cpp @@ -0,0 +1,185 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include <qfile.h> +#include <qstringlist.h> +#include <qdatetime.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> +#include <qregexp.h> +#include <stdio.h> +#include <stdlib.h> + + +/*! + Creates an implementation for a subclass \a subClass of the form + given in \a e + + \sa createSubDecl() + */ +void Uic::createSubImpl( const QDomElement &e, const QString& subClass ) +{ + QDomElement n; + QDomNodeList nl; + int i; + + QString objClass = getClassName( e ); + if ( objClass.isEmpty() ) + return; + + QString supClsMod = fileName; + int tail = supClsMod.findRev('.',-1); + if (tail >= 0) + supClsMod.truncate(tail); + + out << indent << "from " << supClsMod << " import " << nameOfClass << endl; + out << endl; + out << endl; + + out << indent << "class " << subClass << "(" << nameOfClass << "):" << endl; + ++indent; + out << endl; + + // constructor + if ( objClass == "QDialog" || objClass == "QWizard" ) { + out << indent << "def __init__(self,parent = None,name = None,modal = 0,fl = 0):" << endl; + ++indent; + out << indent << nameOfClass << ".__init__(self,parent,name,modal,fl)" << endl; + } else { // standard QWidget + out << indent << "def __init__(self,parent = None,name = None,fl = 0):" << endl; + ++indent; + out << indent << nameOfClass << ".__init__(self,parent,name,fl)" << endl; + } + --indent; + + // find additional functions + QStringList publicSlots, protectedSlots, privateSlots; + QStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; + QStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; + QStringList publicFuncts, protectedFuncts, privateFuncts; + QStringList publicFunctRetTyp, protectedFunctRetTyp, privateFunctRetTyp; + QStringList publicFunctSpec, protectedFunctSpec, privateFunctSpec; + + nl = e.parentNode().toElement().elementsByTagName( "slot" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "slots" + && n.parentNode().toElement().tagName() != "connections" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + QString returnType = n.attribute( "returnType", "void" ); + QString functionName = n.firstChild().toText().data().stripWhiteSpace(); + if ( functionName.endsWith( ";" ) ) + functionName = functionName.left( functionName.length() - 1 ); + QString specifier = n.attribute( "specifier" ); + QString access = n.attribute( "access" ); + if ( access == "protected" ) { + protectedSlots += functionName; + protectedSlotTypes += returnType; + protectedSlotSpecifier += specifier; + } else if ( access == "private" ) { + privateSlots += functionName; + privateSlotTypes += returnType; + privateSlotSpecifier += specifier; + } else { + publicSlots += functionName; + publicSlotTypes += returnType; + publicSlotSpecifier += specifier; + } + } + + nl = e.parentNode().toElement().elementsByTagName( "function" ); + for ( i = 0; i < (int) nl.length(); i++ ) { + n = nl.item(i).toElement(); + if ( n.parentNode().toElement().tagName() != "functions" ) + continue; + if ( n.attribute( "language", "C++" ) != "C++" ) + continue; + QString returnType = n.attribute( "returnType", "void" ); + QString functionName = n.firstChild().toText().data().stripWhiteSpace(); + if ( functionName.endsWith( ";" ) ) + functionName = functionName.left( functionName.length() - 1 ); + QString specifier = n.attribute( "specifier" ); + QString access = n.attribute( "access" ); + if ( access == "protected" ) { + protectedFuncts += functionName; + protectedFunctRetTyp += returnType; + protectedFunctSpec += specifier; + } else if ( access == "private" ) { + privateFuncts += functionName; + privateFunctRetTyp += returnType; + privateFunctSpec += specifier; + } else { + publicFuncts += functionName; + publicFunctRetTyp += returnType; + publicFunctSpec += specifier; + } + } + + if ( !publicFuncts.isEmpty() ) + writeFunctionsSubImpl( publicFuncts, publicFunctRetTyp, publicFunctSpec, subClass, "public function" ); + + // create stubs for public additional slots + if ( !publicSlots.isEmpty() ) + writeFunctionsSubImpl( publicSlots, publicSlotTypes, publicSlotSpecifier, subClass, "public slot" ); + + if ( !protectedFuncts.isEmpty() ) + writeFunctionsSubImpl( protectedFuncts, protectedFunctRetTyp, protectedFunctSpec, subClass, "protected function" ); + + // create stubs for protected additional slots + if ( !protectedSlots.isEmpty() ) + writeFunctionsSubImpl( protectedSlots, protectedSlotTypes, protectedSlotSpecifier, subClass, "protected slot" ); + + if ( !privateFuncts.isEmpty() ) + writeFunctionsSubImpl( privateFuncts, privateFunctRetTyp, privateFunctSpec, subClass, "private function" ); + + // create stubs for private additional slots + if ( !privateSlots.isEmpty() ) + writeFunctionsSubImpl( privateSlots, privateSlotTypes, privateSlotSpecifier, subClass, "private slot" ); + + --indent; +} + +void Uic::writeFunctionsSubImpl( const QStringList &fuLst, const QStringList &typLst, const QStringList &specLst, + const QString &subClass, const QString &descr ) +{ + QValueListConstIterator<QString> it, it2, it3; + for ( it = fuLst.begin(), it2 = typLst.begin(), it3 = specLst.begin(); + it != fuLst.end(); ++it, ++it2, ++it3 ) { + QString type = *it2; + if ( type.isEmpty() ) + type = "void"; + if ( *it3 == "non virtual" ) + continue; + out << endl; + out << indent << "# " << descr << endl; + pySlot(it); + ++indent; + out << endl; + out << indent << "print \"" << subClass << "." << (*it) << ": Not implemented yet\"" << endl; + --indent; + } + out << endl; +} diff --git a/python/pyqt/pyuic3/uic.cpp b/python/pyqt/pyuic3/uic.cpp new file mode 100644 index 00000000..d3593020 --- /dev/null +++ b/python/pyqt/pyuic3/uic.cpp @@ -0,0 +1,1145 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2004 Phil Thompson <phil@riverbankcomputing.co.uk> +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "uic.h" +#include "parser.h" +#include "widgetdatabase.h" +#include "domtool.h" +#include <qfile.h> +#include <qstringlist.h> +#include <qdatetime.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> +#include <qregexp.h> +#include <stdio.h> +#include <stdlib.h> + +bool Uic::isMainWindow = FALSE; +PyIndent Uic::indent; +PyIndent Uic::trindent; + + +// Re-calculate the indent string based on the current number and nature of the +// indent. +void PyIndent::calc() +{ + indstr.truncate(0); + + for (uint i = current; i > 0; --i) + if (tabStop == 0) + indstr += '\t'; + else + for (uint t = 0; t < tabStop; ++t) + indstr += ' '; +} + + +QString Uic::getComment( const QDomNode& n ) +{ + QDomNode child = n.firstChild(); + while ( !child.isNull() ) { + if ( child.toElement().tagName() == "comment" ) + return child.toElement().firstChild().toText().data(); + child = child.nextSibling(); + } + return QString::null; +} + +QString Uic::mkBool( bool b ) +{ + return b? "1" : "0"; +} + +QString Uic::mkBool( const QString& s ) +{ + return mkBool( s == "true" || s == "1" ); +} + +bool Uic::toBool( const QString& s ) +{ + return s == "true" || s.toInt() != 0; +} + +QString Uic::fixString( const QString &str, bool encode ) +{ +#if QT_VERSION >= 0x030100 + QString s; + if ( !encode ) { + s = str; + s.replace( "\\", "\\\\" ); + s.replace( "\"", "\\\"" ); + s.replace( "\r", "" ); + s.replace( "\n", "\\n\"\n\"" ); + } else { + QCString utf8 = str.utf8(); + const int l = utf8.length(); + + for ( int i = 0; i < l; ++i ) { + uchar ch = (uchar)utf8[i]; + + if (ch != 0x0d) { // skip \r + s += "\\x"; + + if (ch <= 0x0f) + s += "0"; + + s += QString::number( ch, 16 ); + } + } + } +#else + QString s( str ); + s.replace( QRegExp( "\\\\" ), "\\\\" ); + s.replace( QRegExp( "\"" ), "\\\"" ); + s.replace( QRegExp( "\r?\n" ), "\\n\"\n\"" ); +#endif + return "\"" + s + "\""; +} + +QString Uic::trcall( const QString& sourceText, const QString& comment ) +{ + if ( sourceText.isEmpty() && comment.isEmpty() ) + return "QString.null"; + + QString t = trmacro; + bool encode = FALSE; + if ( t.isNull() ) { + t = "self.__tr"; + for ( int i = 0; i < (int) sourceText.length(); i++ ) { + if ( sourceText[i].unicode() >= 0x80 ) { + t = "self.__trUtf8"; + encode = TRUE; + break; + } + } + + if (encode) + pyNeedTrUtf8 = TRUE; + else + pyNeedTr = TRUE; + } + + if ( comment.isEmpty() ) { + return t + "(" + fixString( sourceText, encode ) + ")"; + } else { + return t + "(" + fixString( sourceText, encode ) + "," + + fixString( comment, encode ) + ")"; + } +} + +QString Uic::mkStdSet( const QString& prop ) +{ + return QString( "set" ) + prop[0].upper() + prop.mid(1); +} + + + +/*! + \class Uic uic.h + \brief User Interface Compiler + + The class Uic encapsulates the user interface compiler (uic). + */ +Uic::Uic( const QString &fn, const char *outputFn, QTextStream &outStream, + QDomDocument doc, bool subcl, const QString &trm, + const QString& subClass, QString &uicClass ) + : out( outStream ), trout (&languageChangeBody ), + outputFileName( outputFn ), trmacro( trm ), + pyNeedTr(FALSE), pyNeedTrUtf8(FALSE) +{ + fileName = fn; + writeFunctImpl = TRUE; + defMargin = BOXLAYOUT_DEFAULT_MARGIN; + defSpacing = BOXLAYOUT_DEFAULT_SPACING; + externPixmaps = FALSE; + + trindent.setIndent(2); + + item_used = cg_used = pal_used = 0; + + layouts << "hbox" << "vbox" << "grid"; + tags = layouts; + tags << "widget"; + + pixmapLoaderFunction = getPixmapLoaderFunction( doc.firstChild().toElement() ); + nameOfClass = getFormClassName( doc.firstChild().toElement() ); + +#if QT_VERSION >= 0x030300 + uiFileVersion = doc.firstChild().toElement().attribute("version"); +#endif + stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); + + if ( doc.firstChild().isNull() || doc.firstChild().firstChild().isNull() ) + return; + + // Extract any Python code in the comments. + QStringList comm = QStringList::split('\n',getComment(doc.firstChild())); + + for (QStringList::Iterator it = comm.begin(); it != comm.end(); ++it) + if ((*it).startsWith("Python:")) + pyCode += (*it).mid(7) + "\n"; + + QDomElement e = doc.firstChild().firstChild().toElement(); + QDomElement widget; + while ( !e.isNull() ) { + if ( e.tagName() == "widget" ) { + widget = e; + } else if ( e.tagName() == "pixmapinproject" ) { + externPixmaps = TRUE; + } else if ( e.tagName() == "layoutdefaults" ) { + defSpacing = e.attribute( "spacing", defSpacing.toString() ); + defMargin = e.attribute( "margin", defMargin.toString() ); + } else if ( e.tagName() == "layoutfunctions" ) { + defSpacing = e.attribute( "spacing", defSpacing.toString() ); + + bool ok; + defSpacing.toInt( &ok ); + if ( !ok ) { + QString buf = defSpacing.toString(); + defSpacing = buf.append( "()" ); + } + defMargin = e.attribute( "margin", defMargin.toString() ); + defMargin.toInt( &ok ); + if ( !ok ) { + QString buf = defMargin.toString(); + defMargin = buf.append( "()" ); + } + } + e = e.nextSibling().toElement(); + } + e = widget; + + if ( nameOfClass.isEmpty() ) + nameOfClass = getObjectName( e ); + + uicClass = nameOfClass; + + namespaces = QStringList::split( "::", nameOfClass ); + bareNameOfClass = namespaces.last(); + namespaces.remove( namespaces.fromLast() ); + + if ( subcl ) { + createSubImpl( e, subClass ); + } else { + createFormImpl( e ); + } + + ++indent; + + if (pyNeedTr) + { + out << "\n"; + out << indent << "def __tr(self,s,c = None):\n"; + ++indent; + out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c)\n"; + --indent; + } + + if (pyNeedTrUtf8) + { + out << "\n"; + out << indent << "def __trUtf8(self,s,c = None):\n"; + ++indent; + out << indent << "return qApp.translate(\"" << nameOfClass << "\",s,c,QApplication.UnicodeUTF8)\n"; + --indent; + } + + --indent; +} + +/*! Extracts a pixmap loader function from \a e + */ +QString Uic::getPixmapLoaderFunction( const QDomElement& e ) +{ + QDomElement n; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "pixmapfunction" ) + return n.firstChild().toText().data(); + } + return QString::null; +} + + +/*! Extracts the forms class name from \a e + */ +QString Uic::getFormClassName( const QDomElement& e ) +{ + QDomElement n; + QString cn; + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "class" ) { + QString s = n.firstChild().toText().data(); + int i; + while ( ( i = s.find(' ' )) != -1 ) + s[i] = '_'; + cn = s; + } + } + return cn; +} + +/*! Extracts a class name from \a e. + */ +QString Uic::getClassName( const QDomElement& e ) +{ + QString s = e.attribute( "class" ); + if ( s.isEmpty() && e.tagName() == "toolbar" ) + s = "QToolBar"; + else if ( s.isEmpty() && e.tagName() == "menubar" ) + s = "QMenuBar"; + return s; +} + +/*! Returns TRUE if database framework code is generated, else FALSE. +*/ + +bool Uic::isFrameworkCodeGenerated( const QDomElement& e ) +{ + QDomElement n = getObjectProperty( e, "frameworkCode" ); + if ( n.attribute("name") == "frameworkCode" && + !DomTool::elementToVariant( n.firstChild().toElement(), QVariant( TRUE, 0 ) ).toBool() ) + return FALSE; + return TRUE; +} + +/*! Extracts an object name from \a e. It's stored in the 'name' + property. + */ +QString Uic::getObjectName( const QDomElement& e ) +{ + QDomElement n = getObjectProperty( e, "name" ); + if ( n.firstChild().toElement().tagName() == "cstring" ) + return n.firstChild().toElement().firstChild().toText().data(); + return QString::null; +} + +/*! Extracts an layout name from \a e. It's stored in the 'name' + property of the preceeding sibling (the first child of a QLayoutWidget). + */ +QString Uic::getLayoutName( const QDomElement& e ) +{ + QDomElement p = e.parentNode().toElement(); + QString name; + + if ( getClassName(p) != "QLayoutWidget" ) + name = "Layout"; + + QDomElement n = getObjectProperty( p, "name" ); + if ( n.firstChild().toElement().tagName() == "cstring" ) { + name.prepend( n.firstChild().toElement().firstChild().toText().data() ); + return QStringList::split( "::", name ).last(); + } + return e.tagName(); +} + + +QString Uic::getDatabaseInfo( const QDomElement& e, const QString& tag ) +{ + QDomElement n; + QDomElement n1; + int child = 0; + // database info is a stringlist stored in this order + if ( tag == "connection" ) + child = 0; + else if ( tag == "table" ) + child = 1; + else if ( tag == "field" ) + child = 2; + else + return QString::null; + n = getObjectProperty( e, "database" ); + if ( n.firstChild().toElement().tagName() == "stringlist" ) { + // find correct stringlist entry + QDomElement n1 = n.firstChild().firstChild().toElement(); + for ( int i = 0; i < child && !n1.isNull(); ++i ) + n1 = n1.nextSibling().toElement(); + if ( n1.isNull() ) + return QString::null; + return n1.firstChild().toText().data(); + } + return QString::null; +} + + +/*! + Returns include file for class \a className or a null string. + */ +QString Uic::getInclude( const QString& className ) +{ + int wid = WidgetDatabase::idFromClassName( className ); + if ( wid != -1 ) + return WidgetDatabase::includeFile( wid ); + return QString::null; +} + + +void Uic::createActionImpl( const QDomElement &n, const QString &parent ) +{ + for ( QDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { + QString objName = registerObject( getObjectName( ae ) ); + if ( ae.tagName() == "action" ) + out << indent << "self." << objName << " = QAction(" << parent << ",\"" << objName << "\")" << endl; + else if ( ae.tagName() == "actiongroup" ) + out << indent << "self." << objName << " = QActionGroup(" << parent << ",\"" << objName << "\")" << endl; + else + continue; + bool subActionsDone = FALSE; +#if QT_VERSION >= 0x030300 + bool hasMenuText = FALSE; + QString actionText; +#endif + for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "property" ) { + bool stdset = stdsetdef; + if ( n2.hasAttribute( "stdset" ) ) + stdset = toBool( n2.attribute( "stdset" ) ); + QString prop = n2.attribute("name"); + if ( prop == "name" ) + continue; + QString value = setObjectProperty( "QAction", objName, prop, n2.firstChild().toElement(), stdset ); + if ( value.isEmpty() ) + continue; + + QString call = "self." + objName + "."; + if ( stdset ) + call += mkStdSet( prop ) + "(" + value + ")"; + else + call += "setProperty(\"" + prop + "\",QVariant(" + value + "))"; + +#if QT_VERSION >= 0x030300 + if (prop == "menuText") + hasMenuText = TRUE; + else if (prop == "text") + actionText = value; +#endif + + if ( n2.firstChild().toElement().tagName() == "string" ) { + trout << trindent << call << endl; + } else { + out << indent << call << endl; + } + } else if ( !subActionsDone && ( n2.tagName() == "actiongroup" || n2.tagName() == "action" ) ) { + createActionImpl( n2, "self." + objName ); + subActionsDone = TRUE; + } + } +#if QT_VERSION >= 0x030300 + // workaround for loading pre-3.3 files expecting bogus QAction behavior + if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") + trout << indent << "self." << objName << ".setMenuText(" << actionText << ")" << endl; +#endif + } +} + +QString get_dock( const QString &d ) +{ + if ( d == "0" ) + return "Qt.DockUnmanaged"; + if ( d == "1" ) + return "Qt.DockTornOff"; + if ( d == "2" ) + return "Qt.DockTop"; + if ( d == "3" ) + return "Qt.DockBottom"; + if ( d == "4" ) + return "Qt.DockRight"; + if ( d == "5" ) + return "Qt.DockLeft"; + if ( d == "6" ) + return "Qt.DockMinimized"; + return ""; +} + +void Uic::createToolbarImpl( const QDomElement &n, const QString &parentClass, const QString &parent ) +{ + QDomNodeList nl = n.elementsByTagName( "toolbar" ); + for ( int i = 0; i < (int) nl.length(); i++ ) { + QDomElement ae = nl.item( i ).toElement(); + QString dock = get_dock( ae.attribute( "dock" ) ); + QString objName = getObjectName( ae ); + out << indent << "self." << objName << " = QToolBar(QString(\"\"),self," << dock << ")" << endl; + createObjectImpl( ae, parentClass, parent ); + for ( QDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + if ( n2.tagName() == "action" ) { + out << indent << "self." << n2.attribute( "name" ) << ".addTo(self." << objName << ")" << endl; + } else if ( n2.tagName() == "separator" ) { + out << indent << "self." << objName << ".addSeparator()" << endl; + } else if ( n2.tagName() == "widget" ) { + if ( n2.attribute( "class" ) != "Spacer" ) { + createObjectImpl( n2, "QToolBar", "self." + objName ); + } else { + QString child = createSpacerImpl( n2, parentClass, parent, objName ); + out << indent << "QApplication.sendPostedEvents(self." << objName + << ",QEvent.ChildInserted)" << endl; + out << indent << "self." << objName << ".boxLayout().addItem(" << child << ")" << endl; + } + } + } + } +} + +void Uic::createMenuBarImpl( const QDomElement &n, const QString &parentClass, const QString &parent ) +{ + QString objName = getObjectName( n ); + out << indent << "self." << objName << " = QMenuBar(self,\"" << objName << "\")" << endl; + createObjectImpl( n, parentClass, parent ); + + int i = 0; + QDomElement c = n.firstChild().toElement(); + while ( !c.isNull() ) { + if ( c.tagName() == "item" ) { + QString itemName = "self." + c.attribute( "name" ); + out << endl; + out << indent << itemName << " = QPopupMenu(self)" << endl; + createPopupMenuImpl( c, parentClass, itemName ); + out << indent << "self." << objName << ".insertItem(QString(\"\")," << itemName << "," << i << ")" << endl; + QString findItem("self." + objName + ".findItem(%1)"); + findItem = findItem.arg(i); + trout << indent << "if " << findItem << ":" << endl; + ++indent; + trout << indent << findItem << ".setText(" << trcall( c.attribute( "text" ) ) << ")" << endl; + --indent; + } else if ( c.tagName() == "separator" ) { + out << endl; + out << indent << "self." << objName << ".insertSeparator(" << i << ")" << endl; + } + c = c.nextSibling().toElement(); + i++; + } +} + +void Uic::createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent ) +{ + int i = 0; + for ( QDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) { + QDomElement n2 = n.nextSibling().toElement(); + if ( n2.tagName() == "item" ) { // the action has a sub menu + QString itemName = "self." + n2.attribute( "name" ); + QString itemText = n2.attribute( "text" ); + out << indent << itemName << " = QPopupMenu(self)" << endl; + out << indent << parent << ".setAccel(" << trcall( n2.attribute( "accel" ) ) << ","; + out << parent << ".insertItem(" << "self." << n.attribute( "name" ) << ".iconSet(),"; + out << trcall( itemText ) << "," << itemName << "))" << endl; + trout << indent << parent << ".changeItem(" << parent << ".idAt(" << i << "),"; + trout << trcall( itemText ) << ")" << endl; + createPopupMenuImpl( n2, parentClass, itemName ); + n = n2; + } else { + out << indent << "self." << n.attribute( "name" ) << ".addTo(" << parent << ")" << endl; + } + } else if ( n.tagName() == "separator" ) { + out << indent << parent << ".insertSeparator()" << endl; + } + ++i; + } +} + +/*! + Creates implementation of an listbox item tag. +*/ + +QString Uic::createListBoxItemImpl( const QDomElement &e, const QString &parent , + QString *value ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString com; + QString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QString attrib = n.attribute( "name" ); + QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); + pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + if ( pix.isEmpty() ) + return parent + ".insertItem(" + trcall( txt, com ) + ")"; + + return parent + ".insertItem(" + pix + "," + trcall( txt, com ) + ")"; +} + +/*! + Creates implementation of an iconview item tag. +*/ + +QString Uic::createIconViewItemImpl( const QDomElement &e, const QString &parent ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString com; + QString pix; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QString attrib = n.attribute( "name" ); + QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); + pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } + } + n = n.nextSibling().toElement(); + } + + if ( pix.isEmpty() ) + return "QIconViewItem(" + parent + "," + trcall( txt, com ) + ")"; + else + return "QIconViewItem(" + parent + "," + trcall( txt, com ) + "," + pix + ")"; +} + +/*! + Creates implementation of an listview item tag. +*/ + +QString Uic::createListViewItemImpl( const QDomElement &e, const QString &parent, + const QString &parentItem ) +{ + QString s; + + QDomElement n = e.firstChild().toElement(); + + bool hasChildren = e.elementsByTagName( "item" ).count() > 0; + QString item; + + if ( hasChildren ) { + item = registerObject( "item" ); + } else { + item = "item"; + item_used = TRUE; + } + s = trindent + item + " = "; + + if ( !parentItem.isEmpty() ) + s += "QListViewItem(" + parentItem + "," + lastItem + ")\n"; + else + s += "QListViewItem(" + parent + "," + lastItem + ")\n"; + + QStringList texts; + QStringList pixmaps; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QString attrib = n.attribute("name"); + QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + if ( attrib == "text" ) + texts << v.toString(); + else if ( attrib == "pixmap" ) { + QString pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); + pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + pixmaps << pix; + } + } else if ( n.tagName() == "item" ) { + s += trindent + item + ".setOpen(1)\n"; + s += createListViewItemImpl( n, parent, item ); + } + n = n.nextSibling().toElement(); + } + + for ( int i = 0; i < (int)texts.count(); ++i ) { + if ( !texts[ i ].isEmpty() ) + s += trindent + item + ".setText(" + QString::number( i ) + "," + trcall( texts[ i ] ) + ")\n"; + if ( !pixmaps[ i ].isEmpty() ) + s += trindent + item + ".setPixmap(" + QString::number( i ) + "," + pixmaps[ i ] + ")\n"; + } + + lastItem = item; + return s; +} + +/*! + Creates implementation of an listview column tag. +*/ + +QString Uic::createListViewColumnImpl( const QDomElement &e, const QString &parent, + QString *value ) +{ + QDomElement n = e.firstChild().toElement(); + QString txt; + QString com; + QString pix; + bool clickable = FALSE, resizable = FALSE; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QString attrib = n.attribute("name"); + QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); + pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( attrib == "clickable" ) + clickable = v.toBool(); + else if ( attrib == "resizable" || attrib == "resizeable" ) + resizable = v.toBool(); + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + QString s; + s = indent + parent + ".addColumn(" + trcall( txt, com ) + ")\n"; + if ( !pix.isEmpty() ) + s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1,QIconSet(" + pix + ")," + trcall( txt, com ) + ")\n"; + if ( !clickable ) + s += indent + parent + ".header().setClickEnabled(0," + parent + ".header().count() - 1)\n"; + if ( !resizable ) + s += indent + parent + ".header().setResizeEnabled(0," + parent + ".header().count() - 1)\n"; + return s; +} + +QString Uic::createTableRowColumnImpl( const QDomElement &e, const QString &parent, + QString *value ) +{ + QString objClass = getClassName( e.parentNode().toElement() ); + QDomElement n = e.firstChild().toElement(); + QString txt; + QString com; + QString pix; + QString field; + bool isRow = e.tagName() == "row"; + while ( !n.isNull() ) { + if ( n.tagName() == "property" ) { + QString attrib = n.attribute("name"); + QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + if ( attrib == "text" ) { + txt = v.toString(); + com = getComment( n ); + } else if ( attrib == "pixmap" ) { + pix = v.toString(); + if ( !pix.isEmpty() ) { + if ( pixmapLoaderFunction.isEmpty() ) { + pix.prepend( "self." ); + } else { + pix.prepend( pixmapLoaderFunction + "( " + QString( externPixmaps ? "\"" : "self." ) ); + pix.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + } + } else if ( attrib == "field" ) + field = v.toString(); + } + n = n.nextSibling().toElement(); + } + + if ( value ) + *value = trcall( txt, com ); + + // ### This generated code sucks! We have to set the number of + // rows/cols before and then only do setLabel/() + // ### careful, though, since QDataTable has an API which makes this code pretty good + + QString s; + if ( isRow ) { + s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1)\n"; + if ( pix.isEmpty() ) + s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1," + + trcall( txt, com ) + ")\n"; + else + s += indent + parent + ".verticalHeader().setLabel(" + parent + ".numRows() - 1,QIconSet(" + + pix + ")," + trcall( txt, com ) + ")\n"; + } else { + if ( objClass == "QTable" ) { + s = indent + parent + ".setNumCols(" + parent + ".numCols() + 1)\n"; + if ( pix.isEmpty() ) + s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1," + + trcall( txt, com ) + ")\n"; + else + s += indent + parent + ".horizontalHeader().setLabel(" + parent + ".numCols() - 1,QIconSet(" + + pix + ")," + trcall( txt, com ) + ")\n"; + } else if ( objClass == "QDataTable" ) { + if ( !txt.isEmpty() && !field.isEmpty() ) { + if ( pix.isEmpty() ) + out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ")" << endl; + else + out << indent << parent << ".addColumn(" << fixString( field ) << "," << trcall( txt, com ) << ",QIconSet(" << pix << "))" << endl; + } + } + } + return s; +} + +/*! + Creates the implementation of a layout tag. Called from createObjectImpl(). + */ +QString Uic::createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout ) +{ + QDomElement n; + QString objClass, objName; + objClass = e.tagName(); + + QString qlayout = "QVBoxLayout"; + if ( objClass == "hbox" ) + qlayout = "QHBoxLayout"; + else if ( objClass == "grid" ) + qlayout = "QGridLayout"; + + bool isGrid = e.tagName() == "grid" ; + objName = registerObject( getLayoutName( e ) ); + layoutObjects += objName; + + QString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); + QString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); + QString resizeMode = DomTool::readProperty( e, "resizeMode", QString::null ).toString(); + + QString optcells; + if ( isGrid ) + optcells = "1,1,"; + if ( (parentClass == "QGroupBox" || parentClass == "QButtonGroup") && layout.isEmpty() ) { + // special case for group box + out << indent << parent << ".setColumnLayout(0,Qt.Vertical)" << endl; + out << indent << parent << ".layout().setSpacing(" << spacing << ")" << endl; + out << indent << parent << ".layout().setMargin(" << margin << ")" << endl; + out << indent << objName << " = " << qlayout << "(" << parent << ".layout())" << endl; + out << indent << objName << ".setAlignment(Qt.AlignTop)" << endl; + } else { + out << indent << objName << " = " << qlayout << "("; + if ( layout.isEmpty() ) + out << parent; + else { + out << "None"; + if ( !DomTool::hasProperty( e, "margin" ) ) + margin = "0"; + } + out << "," << optcells << margin << "," << spacing << ",\"" << objName << "\")" << endl; + } + if ( !resizeMode.isEmpty() ) + out << indent << objName << ".setResizeMode(QLayout." << resizeMode << ")" << endl; + + if ( !isGrid ) { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + if ( n.tagName() == "spacer" ) { + QString child = createSpacerImpl( n, parentClass, parent, objName ); + out << indent << objName << ".addItem(" << child << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + QString child = createObjectImpl( n, parentClass, parent, objName ); + if ( isLayout( child ) ) + out << indent << objName << ".addLayout(" << child << ")" << endl; + else + out << indent << objName << ".addWidget(" << child << ")" << endl; + } + } + } else { + for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + QDomElement ae = n; + int row = ae.attribute( "row" ).toInt(); + int col = ae.attribute( "column" ).toInt(); + int rowspan = ae.attribute( "rowspan" ).toInt(); + int colspan = ae.attribute( "colspan" ).toInt(); + if ( rowspan < 1 ) + rowspan = 1; + if ( colspan < 1 ) + colspan = 1; + if ( n.tagName() == "spacer" ) { + QString child = createSpacerImpl( n, parentClass, parent, objName ); + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell(" << child << "," + << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; + else + out << indent << objName << ".addItem(" << child << "," + << row << "," << col << ")" << endl; + } else if ( tags.contains( n.tagName() ) ) { + QString child = createObjectImpl( n, parentClass, parent, objName ); + out << endl; + QString o = "Widget"; + if ( isLayout( child ) ) + o = "Layout"; + if ( rowspan * colspan != 1 ) + out << indent << objName << ".addMultiCell" << o << "(" << child << "," + << row << "," << ( row + rowspan - 1 ) << "," << col << "," << ( col + colspan - 1 ) << ")" << endl; + else + out << indent << objName << ".add" << o << "(" << child << "," + << row << "," << col << ")" << endl; + } + } + } + + return objName; +} + + + +QString Uic::createSpacerImpl( const QDomElement &e, const QString& /*parentClass*/, const QString& /*parent*/, const QString& /*layout*/) +{ + QDomElement n; + QString objClass, objName; + objClass = e.tagName(); + objName = registerObject( getObjectName( e ) ); + + QSize size = DomTool::readProperty( e, "sizeHint", QSize( 0, 0 ) ).toSize(); + QString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); + bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; + + if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && + DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2 + QRect geom = DomTool::readProperty( e, "geometry", QRect(0,0,0,0) ).toRect(); + size = geom.size(); + } + + if ( isVspacer ) + out << indent << objName << " = QSpacerItem(" + << size.width() << "," << size.height() + << ",QSizePolicy.Minimum,QSizePolicy." << sizeType << ")" << endl; + else + out << indent << objName << " = QSpacerItem(" + << size.width() << "," << size.height() + << ",QSizePolicy." << sizeType << ",QSizePolicy.Minimum)" << endl; + + return objName; +} + +static const char* const ColorRole[] = { + "Foreground", "Button", "Light", "Midlight", "Dark", "Mid", + "Text", "BrightText", "ButtonText", "Base", "Background", "Shadow", + "Highlight", "HighlightedText", "Link", "LinkVisited", 0 +}; + + +/*! + Creates a colorgroup with name \a name from the color group \a cg + */ +void Uic::createColorGroupImpl( const QString& name, const QDomElement& e ) +{ + QColorGroup cg; + int r = -1; + QDomElement n = e.firstChild().toElement(); + QString color; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + QColor col = DomTool::readColor( n ); + color = "QColor(%1,%2,%3)"; + color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); + if ( col == white ) + color = "Qt.white"; + else if ( col == black ) + color = "Qt.black"; + if ( n.nextSibling().toElement().tagName() != "pixmap" ) { + out << indent << name << ".setColor(QColorGroup." << ColorRole[r] << "," << color << ")" << endl; + } + } else if ( n.tagName() == "pixmap" ) { + QString pixmap = n.firstChild().toText().data(); + if ( pixmapLoaderFunction.isEmpty() ) { + pixmap.prepend( "self." ); + } else { + pixmap.prepend( pixmapLoaderFunction + "(" + QString( externPixmaps ? "\"" : "self." ) ); + pixmap.append( QString( externPixmaps ? "\"" : "" ) + ")" ); + } + out << indent << name << ".setBrush(QColorGroup." + << ColorRole[r] << ",QBrush(" << color << "," << pixmap << "))" << endl; + } + n = n.nextSibling().toElement(); + } +} + +/*! + Auxiliary function to load a color group. The colorgroup must not + contain pixmaps. + */ +QColorGroup Uic::loadColorGroup( const QDomElement &e ) +{ + QColorGroup cg; + int r = -1; + QDomElement n = e.firstChild().toElement(); + QColor col; + while ( !n.isNull() ) { + if ( n.tagName() == "color" ) { + r++; + cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + } + n = n.nextSibling().toElement(); + } + return cg; +} + +/*! Returns TRUE if the widget properties specify that it belongs to + the database \a connection and \a table. +*/ + +bool Uic::isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table ) +{ + QString conn = getDatabaseInfo( e, "connection" ); + QString tab = getDatabaseInfo( e, "table" ); + if ( conn == connection && tab == table ) + return TRUE; + return FALSE; +} + +/*! + Registers all database connections, cursors and forms. +*/ + +void Uic::registerDatabases( const QDomElement& e ) +{ + QDomElement n; + QDomNodeList nl; + int i; + nl = e.parentNode().toElement().elementsByTagName( "widget" ); + for ( i = 0; i < (int) nl.length(); ++i ) { + n = nl.item(i).toElement(); + QString conn = getDatabaseInfo( n, "connection" ); + QString tab = getDatabaseInfo( n, "table" ); + QString fld = getDatabaseInfo( n, "field" ); + if ( !conn.isNull() ) { + dbConnections += conn; + if ( !tab.isNull() ) { + dbCursors[conn] += tab; + if ( !fld.isNull() ) + dbForms[conn] += tab; + } + } + } +} + +/*! + Registers an object with name \a name. + + The returned name is a valid variable identifier, as similar to \a + name as possible and guaranteed to be unique within the form. + + \sa registeredName(), isObjectRegistered() + */ +QString Uic::registerObject( const QString& name ) +{ + if ( objectNames.isEmpty() ) { + // some temporary variables we need + objectNames += "img"; + objectNames += "item"; + objectNames += "cg"; + objectNames += "pal"; + } + + QString result = name; + int i; + while ( ( i = result.find(' ' )) != -1 ) { + result[i] = '_'; + } + + if ( objectNames.contains( result ) ) { + int i = 2; + while ( objectNames.contains( result + "_" + QString::number(i) ) ) + i++; + result += "_"; + result += QString::number(i); + } + objectNames += result; + objectMapper.insert( name, result ); + return result; +} + +/*! + Returns the registered name for the original name \a name + or \a name if \a name wasn't registered. + + \sa registerObject(), isObjectRegistered() + */ +QString Uic::registeredName( const QString& name ) +{ + if ( !objectMapper.contains( name ) ) + return name; + return objectMapper[name]; +} + +/*! + Returns whether the object \a name was registered yet or not. + */ +bool Uic::isObjectRegistered( const QString& name ) +{ + return objectMapper.contains( name ); +} + + +/*! + Unifies the entries in stringlist \a list. Should really be a QStringList feature. + */ +QStringList Uic::unique( const QStringList& list ) +{ + if ( list.isEmpty() ) + return list; + + QStringList result; + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + if ( !result.contains(*it) ) + result += *it; + } + return result; +} + + + +/*! + Creates an instance of class \a objClass, with parent \a parent and name \a objName + */ +QString Uic::createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ) +{ + + if ( objClass.mid( 1 ) == "ComboBox" ) { + return objClass + "(0," + parent + ",\"" + objName + "\")"; + } + return objClass + "(" + parent + ",\"" + objName + "\")"; +} + +bool Uic::isLayout( const QString& name ) const +{ + return layoutObjects.contains( name ); +} diff --git a/python/pyqt/pyuic3/uic.h b/python/pyqt/pyuic3/uic.h new file mode 100644 index 00000000..ea52ac34 --- /dev/null +++ b/python/pyqt/pyuic3/uic.h @@ -0,0 +1,183 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** Copyright (c) 2001 Phil Thompson <phil@river-bank.demon.co.uk> +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef UIC_H +#define UIC_H +#include <qdom.h> +#include <qstring.h> +#include <qstringlist.h> +#include <qmap.h> +#include <qtextstream.h> +#include <qpalette.h> +#include <qvariant.h> + + +#define PYQT_VERSION "3.17.2" + + +class PyIndent +{ +public: + PyIndent() : tabStop(4), current(0) {calc();} + + void setTabStop(uint n) {tabStop = n; calc();} + uint setIndent(uint i) {uint old = current; current = i; calc(); return old;} + void operator++() {++current; calc();} + void operator--() {--current; calc();} + operator QString() {return indstr;} + +private: + uint tabStop; + uint current; + QString indstr; + + void calc(); +}; + + +class Uic : public Qt +{ +public: + Uic( const QString &fn, const char *outputFn, QTextStream& out, + QDomDocument doc, bool subcl, const QString &trm, + const QString& subclname, QString &uicClass ); + + static void setIndent(const PyIndent &pyind) {indent = pyind; trindent = pyind;} + + void createFormImpl( const QDomElement &e ); + + void createSubImpl( const QDomElement &e, const QString& subclname ); + + void createActionImpl( const QDomElement& e, const QString &parent ); + void createToolbarImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); + void createMenuBarImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); + void createPopupMenuImpl( const QDomElement &e, const QString &parentClass, const QString &parent ); + QString createObjectImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + QString createLayoutImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + QString createObjectInstance( const QString& objClass, const QString& parent, const QString& objName ); + QString createSpacerImpl( const QDomElement &e, const QString& parentClass, const QString& parent, const QString& layout = QString::null ); + void createExclusiveProperty( const QDomElement & e, const QString& exclusiveProp ); + QString createListBoxItemImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); + QString createIconViewItemImpl( const QDomElement &e, const QString &parent ); + QString createListViewColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); + QString createTableRowColumnImpl( const QDomElement &e, const QString &parent, QString *value = 0 ); + QString createListViewItemImpl( const QDomElement &e, const QString &parent, + const QString &parentItem ); + void createColorGroupImpl( const QString& cg, const QDomElement& e ); + QColorGroup loadColorGroup( const QDomElement &e ); + + QDomElement getObjectProperty( const QDomElement& e, const QString& name ); + QString getPixmapLoaderFunction( const QDomElement& e ); + QString getFormClassName( const QDomElement& e ); + QString getClassName( const QDomElement& e ); + QString getObjectName( const QDomElement& e ); + QString getLayoutName( const QDomElement& e ); + QString getInclude( const QString& className ); + + QString setObjectProperty( const QString& objClass, const QString& obj, const QString &prop, const QDomElement &e, bool stdset ); + + QString registerObject( const QString& name ); + QString registeredName( const QString& name ); + bool isObjectRegistered( const QString& name ); + QStringList unique( const QStringList& ); + + QString trcall( const QString& sourceText, const QString& comment = "" ); + + static void embed( QTextStream& out, const char* project, const QStringList& images ); + +private: + QTextStream& out; + QTextOStream trout; + QString languageChangeBody; + QCString outputFileName; + QStringList objectNames; + QMap<QString,QString> objectMapper; + QStringList tags; + QStringList layouts; + QString formName; + QString lastItem; + QString trmacro; + static PyIndent indent, trindent; + + struct Buddy + { + Buddy( const QString& k, const QString& b ) + : key( k ), buddy( b ) {} + Buddy(){} // for valuelist + QString key; + QString buddy; + bool operator==( const Buddy& other ) const + { return (key == other.key); } + }; + struct CustomInclude + { + QString header; + QString location; + }; + QValueList<Buddy> buddies; + + QStringList layoutObjects; + bool isLayout( const QString& name ) const; + + uint item_used : 1; + uint cg_used : 1; + uint pal_used : 1; + uint stdsetdef : 1; + uint externPixmaps : 1; + +#if QT_VERSION >= 0x030300 + QString uiFileVersion; +#endif + QString nameOfClass; + QStringList namespaces; + QString bareNameOfClass; + QString pixmapLoaderFunction; + + void registerDatabases( const QDomElement& e ); + bool isWidgetInTable( const QDomElement& e, const QString& connection, const QString& table ); + bool isFrameworkCodeGenerated( const QDomElement& e ); + QString getDatabaseInfo( const QDomElement& e, const QString& tag ); + void createFormImpl( const QDomElement& e, const QString& form, const QString& connection, const QString& table ); + void writeFunctionsSubImpl( const QStringList &fuLst, const QStringList &typLst, const QStringList &specLst, + const QString &subClass, const QString &descr ); + QStringList dbConnections; + QMap< QString, QStringList > dbCursors; + QMap< QString, QStringList > dbForms; + + static bool isMainWindow; + static QString mkBool( bool b ); + static QString mkBool( const QString& s ); + bool toBool( const QString& s ); + static QString fixString( const QString &str, bool encode = FALSE ); + static bool onlyAscii; + static QString mkStdSet( const QString& prop ); + static QString getComment( const QDomNode& n ); + QVariant defSpacing, defMargin; + QString fileName; + bool writeFunctImpl; + + void pySlot(QStringList::ConstIterator &it); + + QString pyCode; + bool pyNeedTr, pyNeedTrUtf8; +}; + +#endif diff --git a/python/pyqt/pyuic3/widgetdatabase.cpp b/python/pyqt/pyuic3/widgetdatabase.cpp new file mode 100644 index 00000000..6c447d5b --- /dev/null +++ b/python/pyqt/pyuic3/widgetdatabase.cpp @@ -0,0 +1,953 @@ +/********************************************************************** +** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#include "widgetdatabase.h" +#include "widgetinterface.h" + +#include <qapplication.h> +#define NO_STATIC_COLORS +#include <globaldefs.h> +#include <qstrlist.h> +#include <qdict.h> +#include <qfile.h> +#include <qtextstream.h> +#include <qcleanuphandler.h> +#include <qfeatures.h> + +#include <stdlib.h> + +const int dbsize = 300; +const int dbcustom = 200; +const int dbdictsize = 211; +static WidgetDatabaseRecord* db[ dbsize ]; +static QDict<int> *className2Id = 0; +static int dbcount = 0; +static int dbcustomcount = 200; +static QStrList *wGroups; +static QStrList *invisibleGroups; +static bool whatsThisLoaded = FALSE; +static QPluginManager<WidgetInterface> *widgetPluginManager = 0; +static bool plugins_set_up = FALSE; +static bool was_in_setup = FALSE; + +QCleanupHandler<QPluginManager<WidgetInterface> > cleanup_manager; + +WidgetDatabaseRecord::WidgetDatabaseRecord() +{ + isForm = FALSE; + isContainer = FALSE; + icon = 0; + nameCounter = 0; + isCommon = FALSE; + isPlugin = FALSE; +} + +WidgetDatabaseRecord::~WidgetDatabaseRecord() +{ + delete icon; +} + + +/*! + \class WidgetDatabase widgetdatabase.h + \brief The WidgetDatabase class holds information about widgets + + The WidgetDatabase holds information about widgets like toolTip(), + iconSet(), ... It works Id-based, so all access functions take the + widget id as parameter. To get the id for a widget (classname), use + idFromClassName(). + + All access functions are static. Having multiple widgetdatabases in + one application doesn't make sense anyway and so you don't need more + than an instance of the widgetdatabase. + + For creating widgets, layouts, etc. see WidgetFactory. +*/ + +/*! + Creates widget database. Does nothing. +*/ + +WidgetDatabase::WidgetDatabase() +{ +} + +/*! Sets up the widget database. If the static widgetdatabase already + exists, the functions returns immediately. +*/ + +void WidgetDatabase::setupDataBase( int id ) +{ + was_in_setup = TRUE; +#ifndef UIC + Q_UNUSED( id ) + if ( dbcount ) + return; +#else + if ( dbcount && id != -2 ) + return; + if ( dbcount && !plugins_set_up ) { + setupPlugins(); + return; + } + if ( dbcount && plugins_set_up) + return; +#endif + + wGroups = new QStrList; + invisibleGroups = new QStrList; + invisibleGroups->append( "Forms" ); + invisibleGroups->append( "Temp" ); + className2Id = new QDict<int>( dbdictsize ); + className2Id->setAutoDelete( TRUE ); + + WidgetDatabaseRecord *r = 0; + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_pushbutton.png"; + r->name = "QPushButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Push Button"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_toolbutton.png"; + r->name = "QToolButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Tool Button"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_radiobutton.png"; + r->name = "QRadioButton"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Radio Button"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_checkbox.png"; + r->name = "QCheckBox"; + r->group = widgetGroup( "Buttons" ); + r->toolTip = "Check Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_groupbox.png"; + r->name = "QGroupBox"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Group Box"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_buttongroup.png"; + r->name = "QButtonGroup"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Button Group"; + r->isContainer = TRUE; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_frame.png"; + r->name = "QFrame"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Frame"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "QTabWidget"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Tabwidget"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_widgetstack.png"; + r->name = "QWidgetStack"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Widget Stack"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_toolbox.png"; + r->name = "QToolBox"; + r->group = widgetGroup( "Containers" ); + r->toolTip = "Tool Box"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_listbox.png"; + r->name = "QListBox"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_listview.png"; + r->name = "QListView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "List View"; + + append( r ); + +#if !defined(QT_NO_ICONVIEW) || defined(UIC) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_iconview.png"; + r->name = "QIconView"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Icon View"; + + append( r ); +#endif + +#if !defined(QT_NO_TABLE) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_table.png"; + r->name = "QTable"; + r->group = widgetGroup( "Views" ); + r->toolTip = "Table"; + + append( r ); +#endif + +#if !defined(QT_NO_SQL) + r = new WidgetDatabaseRecord; + r->iconSet = "designer_datatable.png"; + r->includeFile = "qdatatable.h"; + r->name = "QDataTable"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data Table"; + + append( r ); +#endif + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_lineedit.png"; + r->name = "QLineEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Line Edit"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_spinbox.png"; + r->name = "QSpinBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Spin Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_dateedit.png"; + r->name = "QDateEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Date Edit"; + r->includeFile = "qdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_timeedit.png"; + r->name = "QTimeEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Time Edit"; + r->includeFile = "qdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_datetimeedit.png"; + r->name = "QDateTimeEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Date-Time Edit"; + r->includeFile = "qdatetimeedit.h"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_multilineedit.png"; + r->name = "QMultiLineEdit"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Multi Line Edit"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_richtextedit.png"; + r->name = "QTextEdit"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Rich Text Edit"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_combobox.png"; + r->name = "QComboBox"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Combo Box"; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_slider.png"; + r->name = "QSlider"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Slider"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_scrollbar.png"; + r->name = "QScrollBar"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Scrollbar"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_dial.png"; + r->name = "QDial"; + r->group = widgetGroup( "Input" ); + r->toolTip = "Dial"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_label.png"; + r->name = "QLabel"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Label"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_label.png"; + r->name = "TextLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Label"; + r->whatsThis = "The Text Label provides a widget to display static text."; + r->isCommon = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_pixlabel.png"; + r->name = "PixmapLabel"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Pixmap Label"; + r->whatsThis = "The Pixmap Label provides a widget to display pixmaps."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_lcdnumber.png"; + r->name = "QLCDNumber"; + r->group = widgetGroup( "Display" ); + r->toolTip = "LCD Number"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_line.png"; + r->name = "Line"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Line"; + r->includeFile = "qframe.h"; + r->whatsThis = "The Line widget provides horizontal and vertical lines."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_progress.png"; + r->name = "QProgressBar"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Progress Bar"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_textview.png"; + r->name = "QTextView"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Text View"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_textbrowser.png"; + r->name = "QTextBrowser"; + r->group = widgetGroup( "Display" ); + r->toolTip = "Text Browser"; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_spacer.png"; + r->name = "Spacer"; + r->group = widgetGroup( "Temp" ); + r->toolTip = "Spacer"; + r->whatsThis = "The Spacer provides horizontal and vertical spacing to be able to manipulate the behaviour of layouts."; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QWidget"; + r->isForm = TRUE; + r->group = widgetGroup( "Forms" ); + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QDialog"; + r->group = widgetGroup( "Forms" ); + r->isForm = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QDesignerWizard"; + r->group = widgetGroup( "Forms" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QLayoutWidget"; + r->group = widgetGroup( "Temp" ); + r->includeFile = ""; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->name = "QSplitter"; + r->group = widgetGroup( "Temp" ); + r->includeFile = "qsplitter.h"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "QDesignerTabWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "QDesignerWidget"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = "designer_tabwidget.png"; + r->name = "QDesignerDialog"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QMainWindow"; + r->includeFile = "qmainwindow.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QDesignerAction"; + r->includeFile = "qaction.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = FALSE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QDesignerActionGroup"; + r->includeFile = "qaction.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = FALSE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QScrollView"; + r->includeFile = "qscrollview.h"; + r->group = widgetGroup( "Temp" ); + r->isContainer = TRUE; + + append( r ); + +#ifndef QT_NO_SQL + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QDataBrowser"; + r->includeFile = "qdatabrowser.h"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data Browser"; + r->iconSet = "designer_databrowser.png"; + r->isContainer = TRUE; + + append( r ); + + r = new WidgetDatabaseRecord; + r->iconSet = ""; + r->name = "QDataView"; + r->includeFile = "qdataview.h"; + r->group = widgetGroup( "Database" ); + r->toolTip = "Data View"; + r->iconSet = "designer_dataview.png"; + r->isContainer = TRUE; + + append( r ); +#endif + +#ifndef UIC + setupPlugins(); +#endif +} + +void WidgetDatabase::setupPlugins() +{ + if ( plugins_set_up ) + return; + plugins_set_up = TRUE; + QStringList widgets = widgetManager()->featureList(); + for ( QStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { + if ( hasWidget( *it ) ) + continue; + WidgetDatabaseRecord *r = new WidgetDatabaseRecord; + WidgetInterface *iface = 0; + widgetManager()->queryInterface( *it, &iface ); + if ( !iface ) + continue; + +#ifndef UIC + QIconSet icon = iface->iconSet( *it ); + if ( !icon.pixmap().isNull() ) + r->icon = new QIconSet( icon ); +#endif + QString grp = iface->group( *it ); + if ( grp.isEmpty() ) + grp = "3rd party widgets"; + r->group = widgetGroup( grp ); + r->toolTip = iface->toolTip( *it ); + r->whatsThis = iface->whatsThis( *it ); + r->includeFile = iface->includeFile( *it ); + r->isContainer = iface->isContainer( *it ); + r->name = *it; + r->isPlugin = TRUE; + append( r ); + iface->release(); + } +} + +/*! + Returns the number of elements in the widget database. +*/ + +int WidgetDatabase::count() +{ + setupDataBase( -1 ); + return dbcount; +} + +/*! + Returns the id at which the ids of custom widgets start. +*/ + +int WidgetDatabase::startCustom() +{ + setupDataBase( -1 ); + return dbcustom; +} + +/*! + Returns the iconset which represents the class registered as \a id. +*/ + +QIconSet WidgetDatabase::iconSet( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QIconSet(); +#if !defined(UIC) && !defined(RESOURCE) + if ( !r->icon ) { + if ( r->iconSet.isEmpty() ) + return QIconSet(); + QPixmap pix = QPixmap::fromMimeSource( r->iconSet ); + if ( pix.isNull() ) + pix = QPixmap( r->iconSet ); + r->icon = new QIconSet( pix ); + } + return *r->icon; +#else + return QIconSet(); +#endif +} + +/*! + Returns the classname of the widget which is registered as \a id. +*/ + +QString WidgetDatabase::className( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->name; +} + +/*! + Returns the group the widget registered as \a id belongs to. +*/ + +QString WidgetDatabase::group( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->group; +} + +/*! + Returns the tooltip text of the widget which is registered as \a id. +*/ + +QString WidgetDatabase::toolTip( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->toolTip; +} + +/*! + Returns the what's this? text of the widget which is registered as \a id. +*/ + +QString WidgetDatabase::whatsThis( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + return r->whatsThis; +} + +/*! + Returns the include file if the widget which is registered as \a id. +*/ + +QString WidgetDatabase::includeFile( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return QString::null; + if ( r->includeFile.isNull() ) + return r->name.lower() + ".h"; + return r->includeFile; +} + +/*! Returns whether the widget registered as \a id is a form. +*/ +bool WidgetDatabase::isForm( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isForm; +} + +/*! Returns whether the widget registered as \a id can have children. +*/ + +bool WidgetDatabase::isContainer( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isContainer || r->isForm; +} + +bool WidgetDatabase::isCommon( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isCommon; +} + +QString WidgetDatabase::createWidgetName( int id ) +{ + setupDataBase( id ); + QString n = className( id ); + if ( n == "QLayoutWidget" ) + n = "Layout"; + if ( n[ 0 ] == 'Q' && n[ 1 ].lower() != n[ 1 ] ) + n = n.mid( 1 ); + int colonColon = n.findRev( "::" ); + if ( colonColon != -1 ) + n = n.mid( colonColon + 2 ); + + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return n; + n += QString::number( ++r->nameCounter ); + n[0] = n[0].lower(); + return n; +} + +/*! Returns the id for \a name or -1 if \a name is unknown. + */ +int WidgetDatabase::idFromClassName( const QString &name ) +{ + setupDataBase( -1 ); + if ( name.isEmpty() ) + return 0; + int *i = className2Id->find( name ); + if ( i ) + return *i; + if ( name == "FormWindow" ) + return idFromClassName( "QLayoutWidget" ); +#ifdef UIC + setupDataBase( -2 ); + i = className2Id->find( name ); + if ( i ) + return *i; +#endif + return -1; +} + +bool WidgetDatabase::hasWidget( const QString &name ) +{ + return className2Id->find( name ) != 0; +} + +WidgetDatabaseRecord *WidgetDatabase::at( int index ) +{ + if ( index < 0 ) + return 0; + if ( index >= dbcustom && index < dbcustomcount ) + return db[ index ]; + if ( index < dbcount ) + return db[ index ]; + return 0; +} + +void WidgetDatabase::insert( int index, WidgetDatabaseRecord *r ) +{ + if ( index < 0 || index >= dbsize ) + return; + db[ index ] = r; + className2Id->insert( r->name, new int( index ) ); + if ( index < dbcustom ) + dbcount = QMAX( dbcount, index ); +} + +void WidgetDatabase::append( WidgetDatabaseRecord *r ) +{ + if ( !was_in_setup ) + setupDataBase( -1 ); + insert( dbcount++, r ); +} + +QString WidgetDatabase::widgetGroup( const QString &g ) +{ + if ( wGroups->find( g ) == -1 ) + wGroups->append( g ); + return g; +} + +bool WidgetDatabase::isGroupEmpty( const QString &grp ) +{ + WidgetDatabaseRecord *r = 0; + for ( int i = 0; i < dbcount; ++i ) { + if ( !( r = db[ i ] ) ) + continue; + if ( r->group == grp ) + return FALSE; + } + return TRUE; +} + +QString WidgetDatabase::widgetGroup( int i ) +{ + setupDataBase( -1 ); + if ( i >= 0 && i < (int)wGroups->count() ) + return wGroups->at( i ); + return QString::null; +} + +int WidgetDatabase::numWidgetGroups() +{ + setupDataBase( -1 ); + return wGroups->count(); +} + +bool WidgetDatabase::isGroupVisible( const QString &g ) +{ + setupDataBase( -1 ); + return invisibleGroups->find( g ) == -1; +} + +int WidgetDatabase::addCustomWidget( WidgetDatabaseRecord *r ) +{ + insert( dbcustomcount++, r ); + return dbcustomcount - 1; +} + +void WidgetDatabase::customWidgetClassNameChanged( const QString &oldName, + const QString &newName ) +{ + int id = idFromClassName( oldName ); + if ( id == -1 ) + return; + WidgetDatabaseRecord *r = db[ id ]; + r->name = newName; + className2Id->remove( oldName ); + className2Id->insert( newName, new int( id ) ); +} + +bool WidgetDatabase::isCustomWidget( int id ) +{ + if ( id >= dbcustom && id < dbcustomcount ) + return TRUE; + return FALSE; +} + +bool WidgetDatabase::isCustomPluginWidget( int id ) +{ + setupDataBase( id ); + WidgetDatabaseRecord *r = at( id ); + if ( !r ) + return FALSE; + return r->isPlugin; +} + +bool WidgetDatabase::isWhatsThisLoaded() +{ + return whatsThisLoaded; +} + +void WidgetDatabase::loadWhatsThis( const QString &docPath ) +{ + QString whatsthisFile = docPath + "/whatsthis"; + QFile f( whatsthisFile ); + if ( !f.open( IO_ReadOnly ) ) + return; + QTextStream ts( &f ); + while ( !ts.atEnd() ) { + QString s = ts.readLine(); + QStringList l = QStringList::split( " | ", s ); + int id = idFromClassName( l[ 1 ] ); + WidgetDatabaseRecord *r = at( id ); + if ( r ) + r->whatsThis = l[ 0 ]; + } + whatsThisLoaded = TRUE; +} + + +// ### Qt 3.1: make these publically accessible via QWidgetDatabase API +#if defined(UIC) +bool dbnounload = FALSE; +QStringList *dbpaths = 0; +#else +extern QString *qwf_plugin_dir; +#endif + + +QPluginManager<WidgetInterface> *widgetManager() +{ + if ( !widgetPluginManager ) { + QString pluginDir = "/designer"; +#if !defined(UIC) + if ( qwf_plugin_dir ) + pluginDir = *qwf_plugin_dir; +#endif + widgetPluginManager = new QPluginManager<WidgetInterface>( IID_Widget, QApplication::libraryPaths(), pluginDir ); + cleanup_manager.add( &widgetPluginManager ); +#if defined(UIC) + if ( dbnounload ) + widgetPluginManager->setAutoUnload( FALSE ); + if ( dbpaths ) { + QStringList::ConstIterator it = dbpaths->begin(); + for ( ; it != dbpaths->end(); ++it ) + widgetPluginManager->addLibraryPath( *it ); + } +#endif + } + return widgetPluginManager; +} diff --git a/python/pyqt/pyuic3/widgetdatabase.h b/python/pyqt/pyuic3/widgetdatabase.h new file mode 100644 index 00000000..b44ef885 --- /dev/null +++ b/python/pyqt/pyuic3/widgetdatabase.h @@ -0,0 +1,96 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition +** licenses may use this file in accordance with the Qt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about Qt Commercial License Agreements. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef WIDGETDATABASE_H +#define WIDGETDATABASE_H + +#include <qiconset.h> +#include <qstring.h> +#include "widgetinterface.h" // up here for GCC 2.7.* compatibility +#include <private/qpluginmanager_p.h> + + +extern QPluginManager<WidgetInterface> *widgetManager(); + +struct WidgetDatabaseRecord +{ + WidgetDatabaseRecord(); + ~WidgetDatabaseRecord(); + QString iconSet, name, group, toolTip, whatsThis, includeFile; + uint isContainer : 1; + uint isForm : 1; + uint isCommon : 1; + uint isPlugin : 1; + QIconSet *icon; + int nameCounter; +}; + +class WidgetDatabase : public Qt +{ +public: + WidgetDatabase(); + static void setupDataBase( int id ); + static void setupPlugins(); + + static int count(); + static int startCustom(); + + static QIconSet iconSet( int id ); + static QString className( int id ); + static QString group( int id ); + static QString toolTip( int id ); + static QString whatsThis( int id ); + static QString includeFile( int id ); + static bool isForm( int id ); + static bool isContainer( int id ); + static bool isCommon( int id ); + + static int idFromClassName( const QString &name ); + static QString createWidgetName( int id ); + + static WidgetDatabaseRecord *at( int index ); + static void insert( int index, WidgetDatabaseRecord *r ); + static void append( WidgetDatabaseRecord *r ); + + static QString widgetGroup( const QString &g ); + static QString widgetGroup( int i ); + static int numWidgetGroups(); + static bool isGroupVisible( const QString &g ); + static bool isGroupEmpty( const QString &grp ); + + static int addCustomWidget( WidgetDatabaseRecord *r ); + static bool isCustomWidget( int id ); + static bool isCustomPluginWidget( int id ); + + static bool isWhatsThisLoaded(); + static void loadWhatsThis( const QString &docPath ); + + static bool hasWidget( const QString &name ); + static void customWidgetClassNameChanged( const QString &oldName, const QString &newName ); + +}; + +#endif diff --git a/python/pyqt/pyuic3/widgetinterface.h b/python/pyqt/pyuic3/widgetinterface.h new file mode 100644 index 00000000..bf6bcd55 --- /dev/null +++ b/python/pyqt/pyuic3/widgetinterface.h @@ -0,0 +1,29 @@ + /********************************************************************** +** Copyright (C) 2000-2001 Trolltech AS. All rights reserved. +** +** This file is part of Qt Designer. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef WIDGETINTERFACE_H +#define WIDGETINTERFACE_H + +#include <private/qwidgetinterface_p.h> + +#define WidgetInterface QWidgetFactoryInterface +#define IID_Widget IID_QWidgetFactory + +#endif diff --git a/python/pyqt/sip/pyqt-gpl.sip b/python/pyqt/sip/pyqt-gpl.sip new file mode 100644 index 00000000..bec8f9e3 --- /dev/null +++ b/python/pyqt/sip/pyqt-gpl.sip @@ -0,0 +1 @@ +%License /Type="gpl"/ diff --git a/python/pyqt/sip/qt/copying.sip b/python/pyqt/sip/qt/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qt/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qt/qaccel.sip b/python/pyqt/sip/qt/qaccel.sip new file mode 100644 index 00000000..9c547ef4 --- /dev/null +++ b/python/pyqt/sip/qt/qaccel.sip @@ -0,0 +1,104 @@ +// This is the SIP interface definition for QAccel. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAccel</Title> +<Para> +<Literal>QAccel</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QAccel : QObject +{ +%TypeHeaderCode +#include <qaccel.h> +%End + +public: + QAccel(QWidget * /TransferThis/,char * = 0); +%If (Qt_2_1_0 -) + QAccel(QWidget *,QObject * /TransferThis/,char * = 0); +%End + + bool isEnabled(); + void setEnabled(bool); + + uint count(); + +%If (- Qt_3_0_0) + int insertItem(int,int = -1); +%End +%If (Qt_3_0_0 -) + int insertItem(const QKeySequence &,int = -1); +%End + void removeItem(int); + void clear(); + +%If (- Qt_3_0_0) + int key(int); + int findKey(int) const; +%End +%If (Qt_3_0_0 -) + QKeySequence key(int); + int findKey(const QKeySequence &) const; +%End + + bool isItemEnabled(int) const; + void setItemEnabled(int,bool); + + bool connectItem(int,SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + bool disconnectItem(int,SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); + + void repairEventFilter(); + +%If (Qt_2_00 -) + void setWhatsThis(int,const QString &); + QString whatsThis(int) const; + void setIgnoreWhatsThis(bool); + bool ignoreWhatsThis() const; +%End + +%If (Qt_2_00 - Qt_3_0_0) + static int shortcutKey(const QString &); + static QString keyToString(int); + static int stringToKey(const QString &); +%End +%If (Qt_3_0_0 -) + static QKeySequence shortcutKey(const QString &); + static QString keyToString(QKeySequence); + static QKeySequence stringToKey(const QString &); +%End + +signals: + void activated(int); +%If (Qt_3_1_0 -) + void activatedAmbiguously(int); +%End + +protected: + bool eventFilter(QObject *,QEvent *); + +private: + QAccel(const QAccel &); +}; diff --git a/python/pyqt/sip/qt/qaction.sip b/python/pyqt/sip/qt/qaction.sip new file mode 100644 index 00000000..e1f5c705 --- /dev/null +++ b/python/pyqt/sip/qt/qaction.sip @@ -0,0 +1,210 @@ +// This is the SIP interface definition for QAction and QActionGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAction (Qt v2.2+)</Title> +<Para> +<Literal>QAction</Literal> is fully implemented. +</Para> + +</Sect2> +<Sect2><Title>QActionGroup (Qt v2.2+)</Title> +<Para> +<Literal>QActionGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_ACTION) +%If (Qt_2_2_0 -) + +class QAction : QObject +{ +%TypeHeaderCode +#include <qaction.h> +%End + +public: +%If (- Qt_3_0_0) + QAction(QObject * /TransferThis/ = 0,const char * = 0,bool = 0); + QAction(const QString &,const QIconSet &,const QString &,int, + QObject * /TransferThis/,const char * = 0,bool = 0); + QAction(const QString &,const QString &,int,QObject * /TransferThis/, + const char * = 0,bool = 0); +%End +%If (Qt_3_0_0 - Qt_3_2_0) + QAction(QObject * /TransferThis/,const char * = 0,bool = 0); +%End +%If (Qt_3_2_0 -) + QAction(QObject * /TransferThis/,const char * = 0); + QAction(const QString &,QKeySequence,QObject * /TransferThis/, + const char * = 0); + QAction(const QIconSet &,const QString &,QKeySequence, + QObject * /TransferThis/,const char * = 0); +%End +%If (Qt_3_0_0 -) + // Obsolete. + QAction(const QString &,const QIconSet &,const QString &,QKeySequence, + QObject * /TransferThis/,const char * = 0,bool = 0); + // Obsolete. + QAction(const QString &,const QString &,QKeySequence, + QObject * /TransferThis/,const char * = 0,bool = 0); +%End +%If (Qt_3_2_0 -) + // Obsolete. + QAction(QObject * /TransferThis/,const char *,bool); +%End + + virtual void setIconSet(const QIconSet &); + QIconSet iconSet() const; + virtual void setText(const QString &); + QString text() const; + virtual void setMenuText(const QString &); + QString menuText() const; + virtual void setToolTip(const QString &); + QString toolTip() const; + virtual void setStatusTip(const QString &); + QString statusTip() const; + virtual void setWhatsThis(const QString &); + QString whatsThis() const; +%If (- Qt_3_0_0) + virtual void setAccel(int); + int accel() const; +%End +%If (Qt_3_0_0 -) + virtual void setAccel(const QKeySequence &); + QKeySequence accel() const; +%End + virtual void setToggleAction(bool); + bool isToggleAction() const; +%If (- Qt_3_0_0) + virtual void setOn(bool); +%End + bool isOn() const; + bool isEnabled() const; +%If (Qt_3_1_0 -) + bool isVisible() const; +%End + virtual bool addTo(QWidget *); + virtual bool removeFrom(QWidget *); + +protected: +%If (Qt_3_0_0 -) + virtual void addedTo(QWidget *,QWidget *); + virtual void addedTo(int,QPopupMenu *); +%End + +public slots: +%If (Qt_3_3_0 -) + void activate(); +%End +%If (Qt_3_0_0 -) + void toggle(); + virtual void setOn(bool); +%End + virtual void setEnabled(bool); +%If (Qt_3_3_0 -) + void setDisabled(bool); +%End +%If (Qt_3_1_0 -) + void setVisible(bool); +%End + +signals: + void activated(); + void toggled(bool); + +private: +%If (Qt_3_1_0 -) + QAction(const QAction &); +%End +}; + + +class QActionGroup : QAction +{ +%TypeHeaderCode +#include <qaction.h> +%End + +public: +%If (- Qt_3_0_0) + QActionGroup(QWidget * /TransferThis/,const char * = 0,bool = 1); +%End +%If (Qt_3_0_0 - Qt_3_2_0) + QActionGroup(QObject * /TransferThis/,const char * = 0,bool = 1); +%End +%If (Qt_3_2_0 -) + QActionGroup(QObject * /TransferThis/,const char * = 0); + // Obsolete. + QActionGroup(QObject * /TransferThis/,const char *,bool); +%End + + void setExclusive(bool); + bool isExclusive() const; +%If (- Qt_3_0_0) + void insert(QAction *); +%End +%If (Qt_3_0_0 -) + void add(QAction *); + void addSeparator(); +%End + bool addTo(QWidget *); + bool removeFrom(QWidget *); + void setEnabled(bool); +%If (Qt_3_2_0 -) + void setToggleAction(bool); + void setOn(bool); +%End + +%If (Qt_3_0_0 -) + void setUsesDropDown(bool); + bool usesDropDown() const; + + void setIconSet(const QIconSet &); + void setText(const QString &); + void setMenuText(const QString &); + void setToolTip(const QString &); + void setWhatsThis(const QString &); +%End + +protected: +%If (Qt_3_0_0 -) + void childEvent(QChildEvent *); + virtual void addedTo(QWidget *,QWidget *,QAction *); + virtual void addedTo(int,QPopupMenu *,QAction *); + virtual void addedTo(QWidget *,QWidget *); + virtual void addedTo(int,QPopupMenu *); +%End + +signals: + void selected(QAction *); + +private: +%If (Qt_3_1_0 -) + QActionGroup(const QActionGroup &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qapplication.sip b/python/pyqt/sip/qt/qapplication.sip new file mode 100644 index 00000000..fbdf9e5e --- /dev/null +++ b/python/pyqt/sip/qt/qapplication.sip @@ -0,0 +1,574 @@ +// This is the SIP interface definition for QApplication. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QApplication</Title> +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes one parameter which is a list of argument strings. Arguments +used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>bool <Parameter>GUIenabled</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QApplication</Function></FuncDef> + <ParamDef>int &<Parameter>argc</Parameter></ParamDef> + <ParamDef>char **<Parameter>argv</Parameter></ParamDef> + <ParamDef>Type <Parameter>type</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, the first of which is a list of argument strings. +Arguments used by Qt are removed from the list. (Qt v2.2+) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +%End + + +QApplication *qApp; + + +class QApplication : QObject +{ +%TypeHeaderCode +#include <qapplication.h> +#include <qwidgetlist.h> +%End + +public: + QApplication(SIP_PYLIST) /PostHook=__pyQtQAppHook__/ [(int &,char **)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQApplication(nargc,argv); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + QApplication(SIP_PYLIST,bool) /PostHook=__pyQtQAppHook__/ [(int &,char **,bool)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQApplication(nargc,argv,a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + +%If (Qt_2_2_0 -) + enum Type { + Tty, + GuiClient, + GuiServer + }; + + QApplication(SIP_PYLIST,Type) /PostHook=__pyQtQAppHook__/ [(int &,char **,Type)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + static int nargc; + nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQApplication(nargc,argv,(QApplication::Type)a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End +%End + + ~QApplication(); +%MethodCode + // Make sure all remaining top level widgets are not owned by + // Python. When a PyQt script terminates we have no control + // over the order in which the QApplication instance and the + // top level widgets are destroyed. If the former happens + // first then we get a seg. fault. We could take the approach + // of only pretending to delete the QApplication instance, but + // Qt seems to allow an application to delete the QApplication + // instance and then create another one. The approach we take + // is to transfer ownership of all top level widgets away from + // Python so that the C++ dtor is not called if they are + // destroyed after the QApplication instance. This might be + // seen as a memory leak - but if we really are terminating + // then it doesn't matter, and if we are just deleting the + // QApplication instance then (I think) we should have already + // deleted the top level widgets manually. In any event, the X + // server resources will be freed. + + QWidgetList *tlw = QApplication::topLevelWidgets(); + QWidgetListIt it(*tlw); + QWidget *w; + + while ((w = it.current()) != 0) + { + PyObject *sw; + + if ((sw = sipGetWrapper(w,sipClass_QWidget)) != NULL) + sipTransferTo(sw,NULL); + + ++it; + } + + delete tlw; +%End + + int argc() const; + SIP_PYLIST argv() const; +%MethodCode + // The Python interface returns a list of strings. + + int argc = sipCpp -> argc(); + + if ((sipRes = PyList_New(argc)) == NULL) + sipIsErr = 1; + else + for (int a = 0; a < argc; ++a) + if (PyList_SetItem(sipRes,a,PyString_FromString(sipCpp -> argv()[a])) < 0) + { + Py_DECREF(sipRes); + sipIsErr = 1; + break; + } +%End + +%If (Qt_2_3_0 -) + Type type() const; +%End +%If (- Qt_2_00) + static GUIStyle style(); + static void setStyle(GUIStyle); +%End +%If (Qt_2_00 -) + static QStyle &style(); + static void setStyle(QStyle * /Transfer/); +%End +%If (Qt_3_0_0 -) + static QStyle *setStyle(const QString &); +%End + +%If (- Qt_2_00) + enum ColorSpec + { + NormalColor = 0, + CustomColor = 1, + PrivateColor = 4, + ManyColor = 4, + TrueColor = 4 + }; +%End +%If (Qt_2_00 -) + enum ColorSpec + { + NormalColor = 0, + CustomColor = 1, + ManyColor = 2 + }; +%End + + static int colorSpec(); + static void setColorSpec(int); + static QCursor *overrideCursor(); + static void setOverrideCursor(QCursor &,bool = 0); + static void restoreOverrideCursor(); + static bool hasGlobalMouseTracking(); + static void setGlobalMouseTracking(bool); +%If (- Qt_2_00) + static QPalette *palette(); + static void setPalette(QPalette &,bool = 0); + static QFont *font(); + static void setFont(const QFont &,bool = 0); +%End +%If (Qt_2_00 -) + static QPalette palette(const QWidget * = 0); + static void setPalette(QPalette &,bool = 0,const char * = 0); + static QFont font(const QWidget * = 0); + static void setFont(const QFont &,bool = 0,const char * = 0); +%End + static QFontMetrics fontMetrics(); + QWidget *mainWidget() const; +%If (- Qt_2_00) + // We may not need the /Transfer/ now that the QApplication dtor is + // instrumented, but we'll leave it in so as not to break old programs + // needlessly. + void setMainWidget(QWidget * /Transfer/); +%End +%If (Qt_2_00 -) + virtual void setMainWidget(QWidget *); + virtual void polish(QWidget *); +%End + static QWidgetList *allWidgets(); + static QWidgetList *topLevelWidgets(); +%If (- Qt_3_0_0) + static QWidget *desktop(); +%End +%If (Qt_3_0_0 -) + static QDesktopWidget *desktop(); +%End + static QWidget *activePopupWidget(); + static QWidget *activeModalWidget(); + static QClipboard *clipboard(); + QWidget *focusWidget() const; +%If (Qt_2_00 -) + QWidget *activeWindow() const; +%End + static QWidget *widgetAt(int,int,bool = 0); + static QWidget *widgetAt(const QPoint &,bool = 0); + +%If (Qt_3_1_0 -) + static QEventLoop *eventLoop(); +%End + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; + void processEvents() /ReleaseGIL/; + void processEvents(int) /ReleaseGIL/; + void processOneEvent() /ReleaseGIL/; +%If (Qt_3_0_0 -) + bool hasPendingEvents(); +%End + int enter_loop() /ReleaseGIL/; + void exit_loop(); +%If (Qt_2_00 -) + int loopLevel() const; +%End + static void exit(int = 0); + static bool sendEvent(QObject *,QEvent *) /ReleaseGIL/; + static void postEvent(QObject *,QEvent * /Transfer/) /ReleaseGIL/; + static void sendPostedEvents(QObject *,int) /ReleaseGIL/; +%If (Qt_2_00 -) + static void sendPostedEvents() /ReleaseGIL/; + static void removePostedEvents(QObject *); +%End + virtual bool notify(QObject *,QEvent *) /ReleaseGIL/; + static bool startingUp(); + static bool closingDown(); + static void flushX(); +%If (Qt_3_0_0 -) + static void flush(); +%End + static void syncX(); + static void beep(); +%If (Qt_2_00 -) + void setDefaultCodec(QTextCodec *); + QTextCodec *defaultCodec() const; + void installTranslator(QTranslator *); + void removeTranslator(QTranslator *); +%End +%If (Qt_2_00 - Qt_3_0_0) + QString translate(const char *,const char *) const; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + QString translate(const char *,const char *,const char *) const; +%End +%If (Qt_3_0_0 -) + enum Encoding { + DefaultCodec, + UnicodeUTF8 + }; + + QString translate(const char *,const char *,const char * = 0, + Encoding = DefaultCodec) const; +%End +%If (Qt_3_2_0 -) + QString applicationDirPath(); + QString applicationFilePath(); +%End +%If (- Qt_3_0_0) + static void setWinStyleHighlightColor(const QColor &); + static const QColor &winStyleHighlightColor(); +%End +%If (Qt_2_00 -) + static void setDesktopSettingsAware(bool); + static bool desktopSettingsAware(); + static void setCursorFlashTime(int); + static int cursorFlashTime(); +%End + static void setDoubleClickInterval(int); + static int doubleClickInterval(); +%If (Qt_2_1_0 -) + static void setWheelScrollLines(int); + static int wheelScrollLines(); +%If (Qt_2_2_0 -) + static void setGlobalStrut(const QSize &); + static QSize globalStrut(); +%End +%If (Qt_3_0_0 -) + static void setLibraryPaths(const QStringList &); + static QStringList libraryPaths(); + static void addLibraryPath(const QString &); + static void removeLibraryPath(const QString &); +%End + static void setStartDragTime(int); + static int startDragTime(); + static void setStartDragDistance(int); + static int startDragDistance(); +%If (Qt_3_0_0 -) + static void setReverseLayout(bool); + static bool reverseLayout(); + + static int horizontalAlignment(int); +%End +%If (Qt_2_2_0 -) + static bool isEffectEnabled(Qt::UIEffect); + static void setEffectEnabled(Qt::UIEffect,bool = 1); +%End +%End + + +%If (Qt_2_00 -) + bool isSessionRestored() const; + QString sessionId() const; +%If (Qt_3_1_0 -) + QString sessionKey() const; +%End + virtual void commitData(QSessionManager &); + virtual void saveState(QSessionManager &); +%End +%If (Qt_2_1_0 -) + void wakeUpGuiThread(); +%End +%If (Qt_THREAD_SUPPORT) +%If (Qt_2_2_0 -) + void lock() /ReleaseGIL/; + void unlock(bool = 1); + bool locked(); +%End +%If (Qt_3_0_0 -) + bool tryLock(); +%End +%End + +signals: + void lastWindowClosed(); +%If (Qt_2_00 -) + void aboutToQuit(); +%End +%If (Qt_2_1_0 -) + void guiThreadAwake(); +%End + +public slots: + void quit(); +%If (Qt_2_00 -) + void closeAllWindows(); +%End +%If (Qt_3_2_0 -) + void aboutQt(); +%End + +protected: +%If (Qt_3_1_0 -) + bool event(QEvent *); +%End + +private: + QApplication(const QApplication &); + + +%TypeCode +#include <string.h> + + +// Convert a Python argv list to a conventional C argc count and argv array. +static char **pyArgvToC(PyObject *argvlist,int &argc) +{ + char **argv; + + argc = PyList_Size(argvlist); + + // Allocate space for two copies of the argument pointers, plus the + // terminating NULL. + if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL) + return NULL; + + // Convert the list. + for (int a = 0; a < argc; ++a) + { + char *arg; + + // Get the argument and allocate memory for it. + if ((arg = PyString_AsString(PyList_GetItem(argvlist,a))) == NULL || + (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL) + return NULL; + + // Copy the argument and save a pointer to it. + strcpy(argv[a],arg); + argv[a + argc + 1] = argv[a]; + } + + argv[argc + argc + 1] = argv[argc] = NULL; + + return argv; +} + + +// Remove arguments from the Python argv list that have been removed from the +// C argv array. +static void updatePyArgv(PyObject *argvlist,int argc,char **argv) +{ + for (int a = 0, na = 0; a < argc; ++a) + { + // See if it was removed. + if (argv[na] == argv[a + argc + 1]) + ++na; + else + PyList_SetSlice(argvlist,na,na + 1,NULL); + } +} +%End + +}; + + +enum QtMsgType { + QtDebugMsg, + QtWarningMsg, + QtFatalMsg +}; + + +SIP_PYCALLABLE qInstallMsgHandler(SIP_PYCALLABLE /AllowNone/); +%MethodCode + void (*old)(QtMsgType, const char *); + + // Treat None as the default handler. + old = qInstallMsgHandler((a0 != Py_None) ? pyqtMsgHandler : 0); + + // If we recognise the old handler, then return it. Otherwise return + // the default handler. This doesn't exactly mimic the Qt behaviour + // but it is probably close enough for the way it will be used. + sipRes = (old == pyqtMsgHandler) ? pyqtPyMsgHandler : Py_None; + Py_INCREF(sipRes); + + // Save the new Python handler. + Py_XDECREF(pyqtPyMsgHandler); + pyqtPyMsgHandler = a0; + Py_INCREF(pyqtPyMsgHandler); +%End + +%ModuleCode +// The user supplied Python handler. +static PyObject *pyqtPyMsgHandler = 0; + +// The C++ wrapper around the Python handler. +static void pyqtMsgHandler(QtMsgType type, const char *msg) +{ + PyObject *res; + + SIP_BLOCK_THREADS + +#if SIP_VERSION >= 0x040200 + res = sipCallMethod(0, pyqtPyMsgHandler, "Es", type, sipEnum_QtMsgType, msg); +#elif SIP_VERSION >= 0x040000 + res = sipCallMethod(0, pyqtPyMsgHandler, "es", type, msg); +#else + PyObject *args = Py_BuildValue("is", type, msg); + + if (args != NULL) + { + res = PyEval_CallObject(pyqtPyMsgHandler, args); + Py_DECREF(args); + } +#endif + + Py_XDECREF(res); + + if (res != NULL && res != Py_None) + { + PyErr_SetString(PyExc_TypeError, "invalid result type from PyQt message handler"); + res = NULL; + } + + if (res == NULL) + PyErr_Print(); + + SIP_UNBLOCK_THREADS +} +%End diff --git a/python/pyqt/sip/qt/qarray.sip b/python/pyqt/sip/qt/qarray.sip new file mode 100644 index 00000000..76125e1a --- /dev/null +++ b/python/pyqt/sip/qt/qarray.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for all types based on the QArray +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QArray<type> (Qt 1.x, 2.x)</Title> +<Para> +Types based on the <Literal>QArray</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%If (- Qt_3_0_0) + +%MappedType QArray<int> +{ +%TypeHeaderCode +#include <qarray.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + for (uint i = 0; i < sipCpp -> count(); ++i) + if (PyList_SetItem(l,i,PyInt_FromLong((long)(sipCpp -> at(i)))) < 0) + { + Py_DECREF(l); + + return NULL; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of integers to a QArray<int> on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QArray<int> *qa = new QArray<int>(PyList_GET_SIZE(sipPy)); + + PyErr_Clear(); + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + qa[i] = (int)PyInt_AsLong(PyList_GET_ITEM(sipPy,i)); + + if (PyErr_Occurred() != NULL) + { + delete qa; + *sipIsErr = 1; + + return 0; + } + } + + *sipCppPtr = qa; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qassistantclient.sip b/python/pyqt/sip/qt/qassistantclient.sip new file mode 100644 index 00000000..34c48203 --- /dev/null +++ b/python/pyqt/sip/qt/qassistantclient.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QAssistantClient. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAssistantClient (Qt v3.1+)</Title> +<Para> +<Literal>QAssistantClient</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_ASSISTANTCLIENT) +%If (Qt_3_1_0 -) + +class QAssistantClient : QObject +{ +%TypeHeaderCode +#include <qassistantclient.h> +%End + +public: + QAssistantClient(const QString &,QObject * /TransferThis/ = 0, + const char * = 0); + + bool isOpen() const; + +%If (Qt_3_2_0 -) + void setArguments(const QStringList &); +%End + +public slots: + virtual void openAssistant() /ReleaseGIL/; + virtual void closeAssistant(); + virtual void showPage(const QString &); + +signals: + void assistantOpened(); + void assistantClosed(); + void error(const QString &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qbitmap.sip b/python/pyqt/sip/qt/qbitmap.sip new file mode 100644 index 00000000..b0132ddc --- /dev/null +++ b/python/pyqt/sip/qt/qbitmap.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for QBitmap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QBitmap</Title> +<Para> +<Literal>QBitmap</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QBitmap : QPixmap +{ +%TypeHeaderCode +#include <qbitmap.h> +%End + +public: + QBitmap(); +%If (- Qt_2_00) + QBitmap(int,int,bool = 0); + QBitmap(const QSize &,bool = 0); +%End +%If (Qt_2_00 -) + QBitmap(int,int,bool = 0,QPixmap::Optimization = QPixmap::DefaultOptim); + QBitmap(const QSize &,bool = 0,QPixmap::Optimization = QPixmap::DefaultOptim); +%End + QBitmap(int,int,uchar *,bool = 0); + QBitmap(const QSize &,uchar *,bool = 0); + QBitmap(const QBitmap &); +%If (- Qt_2_00) + QBitmap(const char *,const char * = 0); +%End +%If (Qt_2_00 -) + QBitmap(const QString &,const char * = 0); +%End + + QBitmap xForm(const QWMatrix &) const; +}; diff --git a/python/pyqt/sip/qt/qbrush.sip b/python/pyqt/sip/qt/qbrush.sip new file mode 100644 index 00000000..ab629d75 --- /dev/null +++ b/python/pyqt/sip/qt/qbrush.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for QBrush. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QBrush</Title> +<Para> +<Literal>QBrush</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +enum BrushStyle { + NoBrush, + SolidPattern, + Dense1Pattern, + Dense2Pattern, + Dense3Pattern, + Dense4Pattern, + Dense5Pattern, + Dense6Pattern, + Dense7Pattern, + HorPattern, + VerPattern, + CrossPattern, + BDiagPattern, + FDiagPattern, + DiagCrossPattern, + CustomPattern = 24 +}; + + +class QBrush +{ +%TypeHeaderCode +#include <qbrush.h> +%End + +public: + QBrush(); + QBrush(BrushStyle); + QBrush(const QColor &,BrushStyle = SolidPattern); + QBrush(const QColor &,const QPixmap &); + QBrush(const QBrush &); + + BrushStyle style() const; + void setStyle(BrushStyle); + const QColor &color() const; + void setColor(const QColor &); + QPixmap *pixmap() const; + void setPixmap(const QPixmap &); +}; + +%End + + +%If (Qt_2_00 -) + +class QBrush : Qt +{ +%TypeHeaderCode +#include <qbrush.h> +%End + +public: + QBrush(); + QBrush(BrushStyle); + QBrush(const QColor &,BrushStyle = SolidPattern); + QBrush(const QColor &,const QPixmap &); + QBrush(const QBrush &); + + BrushStyle style() const; + void setStyle(BrushStyle); + const QColor &color() const; + void setColor(const QColor &); + QPixmap *pixmap() const; + void setPixmap(const QPixmap &); + + bool operator==(const QBrush &) const; + bool operator!=(const QBrush &) const; +}; + +%End diff --git a/python/pyqt/sip/qt/qbutton.sip b/python/pyqt/sip/qt/qbutton.sip new file mode 100644 index 00000000..356de1e9 --- /dev/null +++ b/python/pyqt/sip/qt/qbutton.sip @@ -0,0 +1,184 @@ +// This is the SIP interface definition for QButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QButton</Title> +<Para> +<Literal>QButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QButton : QWidget +{ +%TypeHeaderCode +#include <qbutton.h> +%End + +public: +%If (- Qt_2_00) + QButton(QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QButton(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + +%If (- Qt_2_00) + const char *text() const; + void setText(const char *); +%End +%If (Qt_2_00 -) + QString text() const; + virtual void setText(const QString &); +%End + const QPixmap *pixmap() const; +%If (- Qt_2_00) + void setPixmap(const QPixmap &); +%End +%If (Qt_2_00 -) + virtual void setPixmap(const QPixmap &); +%End + +%If (- Qt_3_0_0) + int accel() const; +%End +%If (Qt_3_0_0 -) + QKeySequence accel() const; +%End +%If (- Qt_2_00) + void setAccel(int); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setAccel(int); +%End +%If (Qt_3_0_0 -) + virtual void setAccel(const QKeySequence &); +%End + + bool isToggleButton() const; + +%If (Qt_2_00 -) + enum ToggleType + { + SingleShot, + Toggle, + Tristate + }; + + ToggleType toggleType() const; +%End + +%If (- Qt_2_00) + void setDown(bool); +%End +%If (Qt_2_00 -) + virtual void setDown(bool); +%End + bool isDown() const; + + bool isOn() const; + +%If (Qt_2_00 -) + enum ToggleState + { + Off, + NoChange, + On + }; + + ToggleState state() const; +%End + +%If (- Qt_3_0_0) + bool autoResize() const; +%End +%If (- Qt_2_00) + void setAutoResize(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setAutoResize(bool); +%End + + bool autoRepeat() const; +%If (- Qt_2_00) + void setAutoRepeat(bool); +%End +%If (Qt_2_00 -) + virtual void setAutoRepeat(bool); +%End + +%If (Qt_2_00 -) + bool isExclusiveToggle() const; +%End + +%If (Qt_2_00 - Qt_3_0_0) + bool focusNextPrevChild(bool); +%End + +%If (Qt_2_00 -) + QButtonGroup *group() const; +%End + +public slots: + void animateClick(); + void toggle(); + +signals: + void pressed(); + void released(); + void clicked(); + void toggled(bool); +%If (Qt_2_00 -) + void stateChanged(int); +%End + +protected: + void setToggleButton(bool); +%If (Qt_2_00 -) + virtual void setToggleType(ToggleType); +%End + void setOn(bool); +%If (Qt_2_00 -) + virtual void setState(ToggleState); +%End + + virtual bool hitButton(const QPoint &) const; + virtual void drawButton(QPainter *); + virtual void drawButtonLabel(QPainter *); + + void keyPressEvent(QKeyEvent *); +%If (Qt_2_1_0 -) + void keyReleaseEvent(QKeyEvent *); +%End + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void paintEvent(QPaintEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + + void enabledChange(bool); + +private: + QButton(const QButton &); +}; diff --git a/python/pyqt/sip/qt/qbuttongroup.sip b/python/pyqt/sip/qt/qbuttongroup.sip new file mode 100644 index 00000000..647bb173 --- /dev/null +++ b/python/pyqt/sip/qt/qbuttongroup.sip @@ -0,0 +1,104 @@ +// This is the SIP interface definition for QButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QButtonGroup</Title> +<Para> +<Literal>QButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QButtonGroup : QGroupBox +{ +%TypeHeaderCode +#include <qbuttongroup.h> +%End + +public: + QButtonGroup(QWidget * /TransferThis/ = 0,const char * = 0); +%If (- Qt_2_00) + QButtonGroup(const char *,QWidget * /TransferThis/ = 0, + const char * = 0); +%End +%If (Qt_2_00 -) + QButtonGroup(const QString &,QWidget * /TransferThis/ = 0, + const char * = 0); + QButtonGroup(int,Orientation,QWidget * /TransferThis/ = 0, + const char * = 0); + QButtonGroup(int,Orientation,const QString &, + QWidget * /TransferThis/ = 0,const char * = 0); +%End + + bool isExclusive() const; +%If (- Qt_2_00) + void setExclusive(bool); + void setButton(int); +%End +%If (Qt_2_00 -) + bool isRadioButtonExclusive() const; + virtual void setExclusive(bool); + virtual void setRadioButtonExclusive(bool); +%End + + int insert(QButton *,int = -1); + void remove(QButton *); + QButton *find(int) const; +%If (Qt_2_00 -) + int id(QButton *) const; + int count() const; + + virtual void setButton(int); + + virtual void moveFocus(int); +%End + +%If (Qt_2_00 - Qt_3_0_0) + QButton *selected(); +%End +%If (Qt_3_0_0 -) + QButton *selected() const; +%End +%If (Qt_3_2_0 -) + int selectedId() const; +%End + +signals: + void pressed(int); + void released(int); + void clicked(int); + +protected slots: + void buttonPressed(); + void buttonReleased(); + void buttonClicked(); + void buttonToggled(bool); + +protected: +%If (Qt_3_1_0 -) + bool event(QEvent *); +%End + +private: + QButtonGroup(const QButtonGroup &); +}; diff --git a/python/pyqt/sip/qt/qbytearray.sip b/python/pyqt/sip/qt/qbytearray.sip new file mode 100644 index 00000000..fa992ec6 --- /dev/null +++ b/python/pyqt/sip/qt/qbytearray.sip @@ -0,0 +1,203 @@ +// This is the SIP interface definition for QByteArray. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QByteArray</Title> +<Para> +A Python string can be used whenever a <Literal>QByteArray</Literal> can be +used. A <Literal>QByteArray</Literal> can be converted to a Python string +using the Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>QByteArray &<Function>assign</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>char &<Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>contains</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>fill</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>int <Parameter>size</Parameter> = -1</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>find</Function></FuncDef> + <ParamDef>const char &<Parameter>d</Parameter></ParamDef> + <ParamDef>uint <Parameter>i</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>resetRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QByteArray &<Function>setRawData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint<Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class QByteArray +{ +%TypeHeaderCode +#include <qstring.h> +%End + +public: + QByteArray(); + QByteArray(int); + QByteArray(const QByteArray &); + + SIP_PYOBJECT data() const; +%MethodCode + // QByteArrays aren't '\0' terminated so set the size + // explicitly. + + char *res; + uint len; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> data(); + len = sipCpp -> size(); + Py_END_ALLOW_THREADS + + if (res) + { + if ((sipRes = PyString_FromStringAndSize(res,len)) == NULL) + sipIsErr = 1; + } + else + { + Py_INCREF(Py_None); + sipRes = Py_None; + } +%End + + // These are actually in QMemArray, which isn't implemented so pretend + // they are here. + + uint nrefs() const; + bool isEmpty() const; + bool isNull() const; + bool resize(uint); + bool truncate(uint); +// bool fill(const char &,int = -1); + void detach(); + QByteArray copy() const; + QByteArray &assign(const QByteArray &); +// QByteArray &assign(const char *,uint); + QByteArray &duplicate(const QByteArray &); + QByteArray &duplicate(const char *,uint); +// QByteArray &setRawData(const char *,uint); +// void resetRawData(const char *,uint); +// int find(const char &,uint = 0) const; +// int contains(const char &) const; +// char &at(uint) const; + + SIP_PYOBJECT __str__(); +%MethodCode + // QByteArrays aren't '\0' terminated so set the size + // explicitly. + + char *data; + uint len; + + Py_BEGIN_ALLOW_THREADS + data = sipCpp -> data(); + len = sipCpp -> size(); + Py_END_ALLOW_THREADS + + if (data == NULL) + sipRes = PyString_FromString(""); + else + sipRes = PyString_FromStringAndSize(data,len); +%End + +%ConvertToTypeCode + // Allow a Python string whenever a QByteArray is expected. + + if (sipIsErr == NULL) + return (PyString_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_QByteArray,SIP_NO_CONVERTORS)); + + if (PyString_Check(sipPy)) + { + Py_BEGIN_ALLOW_THREADS + QByteArray *ba = new QByteArray(); + + ba -> duplicate(PyString_AS_STRING(sipPy),PyString_GET_SIZE(sipPy)); + + *sipCppPtr = ba; + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); + } + + *sipCppPtr = reinterpret_cast<QByteArray *>(sipConvertToInstance(sipPy,sipClass_QByteArray,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End +}; + + +%If (Qt_3_1_0 -) +QByteArray qCompress(const uchar * /Array/,int /ArraySize/); +QByteArray qCompress(const QByteArray &); +QByteArray qUncompress(const uchar * /Array/,int /ArraySize/); +QByteArray qUncompress(const QByteArray &); +%End diff --git a/python/pyqt/sip/qt/qcdestyle.sip b/python/pyqt/sip/qt/qcdestyle.sip new file mode 100644 index 00000000..790662ff --- /dev/null +++ b/python/pyqt/sip/qt/qcdestyle.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for QCDEStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCDEStyle (Qt v2+)</Title> +<Para> +<Literal>QCDEStyle</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_STYLE_CDE) +%If (Qt_2_00 -) + +class QCDEStyle : QMotifStyle +{ +%TypeHeaderCode +#include <qcdestyle.h> +%End + +public: + QCDEStyle(bool = 0); + +%If (- Qt_3_0_0) + int defaultFrameWidth() const; + void drawArrow(QPainter *,ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0); + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &,int, + bool = 0,bool = 1); + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); +%End +%If (Qt_3_0_0 -) + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qcheckbox.sip b/python/pyqt/sip/qt/qcheckbox.sip new file mode 100644 index 00000000..9c2bfc45 --- /dev/null +++ b/python/pyqt/sip/qt/qcheckbox.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for QCheckBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCheckBox</Title> +<Para> +<Literal>QCheckBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QCheckBox : QButton +{ +%TypeHeaderCode +#include <qcheckbox.h> +%End + +public: +%If (- Qt_2_00) + QCheckBox(QWidget * /TransferThis/ = 0,const char * = 0); + QCheckBox(const char *,QWidget * /TransferThis/,const char * = 0); +%End +%If (Qt_2_00 -) + QCheckBox(QWidget * /TransferThis/,const char * = 0); + QCheckBox(const QString &,QWidget * /TransferThis/,const char * = 0); +%End + + bool isChecked() const; + +%If (Qt_2_00 -) + void setNoChange(); + + void setTristate(bool = 1); +%End +%If (Qt_2_2_0 -) + bool isTristate() const; +%End + + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (- Qt_3_0_0) + void setChecked(bool); +%End + +public slots: +%If (Qt_3_0_0 -) + void setChecked(bool); +%End + +protected: +%If (Qt_2_00 -) + void resizeEvent(QResizeEvent *); +%End + void drawButton(QPainter *); + void drawButtonLabel(QPainter *); +%If (Qt_2_00 -) + void updateMask(); +%End +%If (Qt_3_2_0 -) + bool hitButton(const QPoint &) const; +%End + +private: + QCheckBox(const QCheckBox &); +}; diff --git a/python/pyqt/sip/qt/qclipboard.sip b/python/pyqt/sip/qt/qclipboard.sip new file mode 100644 index 00000000..4220c371 --- /dev/null +++ b/python/pyqt/sip/qt/qclipboard.sip @@ -0,0 +1,152 @@ +// This is the SIP interface definition for QClipboard. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QClipboard</Title> +<FuncSynopsis> + <FuncDef>void *<Function>data</Function> const</FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (Qt v1.x). +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>void *<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented (Qt v1.x). +</Para> +</Sect2> +%End + + +%If (Qt_CLIPBOARD) + +class QClipboard : QObject +{ +%TypeHeaderCode +#include <qclipboard.h> +%End + +private: + QClipboard(QObject * /TransferThis/ = 0,const char * = 0); + ~QClipboard(); + +public: +%If (Qt_3_1_0 -) + enum Mode { + Clipboard, + Selection + }; + + void clear(Mode); +%End + void clear(); + +%If (Qt_3_0_0 -) + bool supportsSelection() const; + bool ownsSelection() const; + bool ownsClipboard() const; + + void setSelectionMode(bool); + bool selectionModeEnabled() const; +%End + +%If (Qt_3_1_0 -) + QString text(Mode) const; + QString text(QCString &,Mode) const; + void setText(const QString &,Mode); + +%If (Qt_MIMECLIPBOARD) + QMimeSource *data(Mode) const; + void setData(QMimeSource * /GetWrapper/,Mode); +%MethodCode + sipCpp->setData(a0, a1); + + // Transfer ownership to C++ and make sure the Python object + // stays alive by giving it a reference to itself. The cycle + // will be broken by QMimeSource's virtual dtor. + sipTransferTo(a0Wrapper, a0Wrapper); +%End + + QImage image(Mode) const; + QPixmap pixmap(Mode) const; + void setImage(const QImage &,Mode); + void setPixmap(const QPixmap &,Mode); +%End +%End + +%If (- Qt_2_00) +// void *data(const char *) const; +// void setData(const char *,void *); + const char *text() const; + void setText(const char *); + QPixmap *pixmap() const; +%End + +%If (Qt_2_00 -) +%If (Qt_MIMECLIPBOARD) + QMimeSource *data() const; + void setData(QMimeSource * /GetWrapper/); +%MethodCode + sipCpp->setData(a0); + + // Transfer ownership to C++ and make sure the Python object + // stays alive by giving it a reference to itself. The cycle + // will be broken by QMimeSource's virtual dtor. + sipTransferTo(a0Wrapper, a0Wrapper); +%End +%End + QString text() const; +%If (Qt_2_2_0 -) + QString text(QCString &) const; +%End + void setText(const QString &); +%If (Qt_MIMECLIPBOARD) + QImage image() const; + QPixmap pixmap() const; + void setImage(const QImage &); +%End +%End + +%If (Qt_MIMECLIPBOARD) + void setPixmap(const QPixmap &); +%End + +signals: +%If (Qt_3_0_0 -) + void selectionChanged(); +%End + void dataChanged(); + +protected: + void connectNotify(const char *); + bool event(QEvent *); + +private: + QClipboard(const QClipboard &); +}; + +%End diff --git a/python/pyqt/sip/qt/qcolor.sip b/python/pyqt/sip/qt/qcolor.sip new file mode 100644 index 00000000..7d0d53ed --- /dev/null +++ b/python/pyqt/sip/qt/qcolor.sip @@ -0,0 +1,207 @@ +// This is the SIP interface definition for QColor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QColor</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getHsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getRgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>hsv</Function></FuncDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> + <ParamDef>int *<Parameter>s</Parameter></ParamDef> + <ParamDef>int *<Parameter>v</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>h</Literal>, +<Literal>s</Literal> and <Literal>v</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rgb</Function></FuncDef> + <ParamDef>int *<Parameter>r</Parameter></ParamDef> + <ParamDef>int *<Parameter>g</Parameter></ParamDef> + <ParamDef>int *<Parameter>b</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the <Literal>r</Literal>, +<Literal>g</Literal> and <Literal>b</Literal> values as a tuple. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qcolor.h> +%End + + +%If (- Qt_2_00) +// The global colours. + +QColor color0; +QColor color1; +QColor black; +QColor white; +QColor darkGray; +QColor gray; +QColor lightGray; +QColor red; +QColor green; +QColor blue; +QColor cyan; +QColor magenta; +QColor yellow; +QColor darkRed; +QColor darkGreen; +QColor darkBlue; +QColor darkCyan; +QColor darkMagenta; +QColor darkYellow; +%End + + +// Related functions. + +int qRed(QRgb); +int qGreen(QRgb); +int qBlue(QRgb); +QRgb qRgb(int,int,int); +int qGray(int,int,int); +int qGray(QRgb); + +%If (Qt_2_00 -) +int qAlpha(QRgb); +QRgb qRgba(int,int,int,int); +%End + + +class QColor +{ +%TypeHeaderCode +#include <qcolor.h> +%End + +public: + enum Spec { + Rgb, + Hsv + }; + + QColor(); + QColor(int,int,int); + QColor(int,int,int,Spec); + QColor(QRgb,uint = 0xffffffff); +%If (Qt_2_00 -) + QColor(const QString &); +%End + QColor(const char *); + QColor(const QColor &); + + bool isValid() const; + bool isDirty() const; +%If (- Qt_2_00) + void setNamedColor(const char *); +%End +%If (Qt_2_1_0 -) + QString name() const; +%End +%If (Qt_2_00 -) + void setNamedColor(const QString &); +%End + + QRgb rgb() const; + void setRgb(int,int,int); + void setRgb(QRgb); +%If (Qt_3_2_0 -) + void getRgb(int *,int *,int *) const; +%End + + // Obsolete and is hidden anyway by the overload above. + //void rgb(int *,int *,int *) const; + + int red() const; + int green() const; + int blue() const; + + void setHsv(int,int,int); + +%If (Qt_3_2_0 -) + void getHsv(int *,int *,int *) const; +%End +%If (- Qt_3_2_0) + void getHsv(int &,int &,int &) const; +%End + + // Obsolete. + void hsv(int *,int *,int *) const; + + QColor light(int = 150) const; + QColor dark(int = 200) const; +%If (- Qt_3_0_0) + static bool lazyAlloc(); + static void setLazyAlloc(bool); +%End + + bool operator==(const QColor &) const; + bool operator!=(const QColor &) const; + + uint alloc(); + uint pixel() const; + static int maxColors(); + static int numBitPlanes(); + static int enterAllocContext(); + static void leaveAllocContext(); + static int currentAllocContext(); + static void destroyAllocContext(int); +%If (Qt_3_0_0 -) +%End + static void initialize(); + static void cleanup(); +%If (Qt_3_2_0 -) + static QStringList colorNames(); +%End +}; diff --git a/python/pyqt/sip/qt/qcolordialog.sip b/python/pyqt/sip/qt/qcolordialog.sip new file mode 100644 index 00000000..2f715d93 --- /dev/null +++ b/python/pyqt/sip/qt/qcolordialog.sip @@ -0,0 +1,77 @@ +// This is the SIP interface definition for QColorDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QColorDialog (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>static QRgb <Function>getRgba</Function></FuncDef> + <ParamDef>QRgb <Parameter>initial</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>initial</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>QRgb</Literal> result and the <Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) +%If (Qt_COLORDIALOG) + +class QColorDialog : QDialog +{ +%TypeHeaderCode +#include <qcolordialog.h> +%End + +public: +%If (- Qt_3_0_0) + static QColor getColor(QColor,QWidget * = 0,const char * = 0) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + static QColor getColor(const QColor & = Qt::white,QWidget * = 0, + const char * = 0) /ReleaseGIL/; +%End +%If (Qt_2_1_0 -) + static QRgb getRgba(QRgb,bool * = 0,QWidget * = 0,const char * = 0) /ReleaseGIL/; + static int customCount(); + static QRgb customColor(int); + static void setCustomColor(int,QRgb); +%End +%If (Qt_3_1_0 -) + static void setStandardColor(int,QRgb); +%End + +private: +%If (Qt_2_1_0 -) + QColorDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0); + QColorDialog(const QColorDialog &); + ~QColorDialog(); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qcolorgroup.sip b/python/pyqt/sip/qt/qcolorgroup.sip new file mode 100644 index 00000000..20e37b0e --- /dev/null +++ b/python/pyqt/sip/qt/qcolorgroup.sip @@ -0,0 +1,125 @@ +// This is the SIP interface definition for QColorGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QColorGroup</Title> +<Para> +<Literal>QColorGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QColorGroup +{ +%TypeHeaderCode +#include <qpalette.h> +%End + +public: + QColorGroup(); + QColorGroup(const QColor &,const QColor &,const QColor &,const QColor &, + const QColor &,const QColor &,const QColor &); +%If (Qt_2_00 -) + QColorGroup(const QBrush &,const QBrush &,const QBrush &,const QBrush &, + const QBrush &,const QBrush &,const QBrush &,const QBrush &, + const QBrush &); +%End + QColorGroup(QColorGroup&); + +%If (- Qt_2_00) + QColor midlight() const; +%End + +%If (Qt_2_00 - Qt_3_0_0) + enum ColorRole + { + Foreground, + Button, + Light, + Midlight, + Dark, + Mid, + Text, + BrightText, + ButtonText, + Base, + Background, + Shadow, + Highlight, + HighlightedText, + NColorRoles + }; +%End +%If (Qt_3_0_0 -) + enum ColorRole + { + Foreground, + Button, + Light, + Midlight, + Dark, + Mid, + Text, + BrightText, + ButtonText, + Base, + Background, + Shadow, + Highlight, + HighlightedText, + Link, + LinkVisited, + NColorRoles + }; +%End + +%If (Qt_2_00 -) + const QColor &color(ColorRole) const; + const QBrush &brush(ColorRole) const; + void setColor(ColorRole,const QColor &); + void setBrush(ColorRole,const QBrush &); +%End + + const QColor &foreground() const; +%If (Qt_2_00 -) + const QColor &button() const; +%End + const QColor &light() const; + const QColor &dark() const; + const QColor &mid() const; + const QColor &text() const; + const QColor &base() const; + const QColor &background() const; +%If (Qt_2_00 -) + const QColor &midlight() const; + const QColor &brightText() const; + const QColor &buttonText() const; + const QColor &shadow() const; + const QColor &highlight() const; + const QColor &highlightedText() const; +%End +%If (Qt_3_0_0 -) + const QColor &link() const; + const QColor &linkVisited() const; +%End +}; diff --git a/python/pyqt/sip/qt/qcombobox.sip b/python/pyqt/sip/qt/qcombobox.sip new file mode 100644 index 00000000..3555eba1 --- /dev/null +++ b/python/pyqt/sip/qt/qcombobox.sip @@ -0,0 +1,277 @@ +// This is the SIP interface definition for QComboBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QComboBox</Title> +<Para> +<Literal>QComboBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QComboBox : QWidget +{ +%TypeHeaderCode +#include <qcombobox.h> +%End + +public: + QComboBox(QWidget * /TransferThis/ = 0,char * = 0); + QComboBox(bool,QWidget * /TransferThis/ = 0,char * = 0); + + int count() const; + +%If (Qt_2_00 -) + void insertStringList(QStringList &,int = -1); +%End + void insertStrList(const QStrList *,int = -1); +// void insertStrList(const QStrList &,int = -1); +// void insertStrList(const char **,int = -1,int = -1); + +%If (- Qt_2_00) + void insertItem(const char *,int = -1); +%End +%If (Qt_2_00 -) + void insertItem(const QString &,int = -1); +%End + void insertItem(const QPixmap &,int = -1); +%If (Qt_2_1_0 -) + void insertItem(const QPixmap &,const QString &,int = -1); +%End + + void removeItem(int); + +%If (- Qt_3_0_0) + void clear(); +%End + + int currentItem() const; +%If (- Qt_2_00) + void setCurrentItem(int); +%End +%If (Qt_2_00 -) + virtual void setCurrentItem(int); +%End + +%If (- Qt_2_00) + const char *currentText() const; +%End +%If (Qt_2_00 -) + QString currentText() const; +%End +%If (Qt_3_0_0 -) + virtual void setCurrentText(const QString &); +%End + +%If (- Qt_2_00) + const char *text(int) const; +%End +%If (Qt_2_00 -) + QString text(int) const; +%End + const QPixmap *pixmap(int) const; + +%If (- Qt_2_00) + void changeItem(const char *,int); +%End +%If (Qt_2_00 -) + void changeItem(const QString &,int); +%End + void changeItem(const QPixmap &,int); +%If (Qt_2_1_0 -) + void changeItem(const QPixmap &,const QString &,int); +%End + + bool autoResize() const; +%If (- Qt_2_00) + void setAutoResize(bool); +%End +%If (Qt_2_00 -) + virtual void setAutoResize(bool); +%End + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + virtual QSizePolicy sizePolicy() const; +%End + +%If (- Qt_2_00) + void setBackgroundColor(const QColor &); + void setStyle(GUIStyle); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setBackgroundColor(const QColor &); +%End +%If (- Qt_2_00) + void setPalette(const QPalette &); + void setFont(const QFont &); + void setEnabled(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setPalette(const QPalette &); + virtual void setFont(const QFont &); + virtual void setEnabled(bool); +%End +%If (Qt_3_0_0 -) + void setPalette(const QPalette &); + void setFont(const QFont &); + void setEnabled(bool); +%End + +%If (- Qt_2_00) + void setSizeLimit(int); +%End +%If (Qt_2_00 -) + virtual void setSizeLimit(int); +%End + int sizeLimit() const; + +%If (- Qt_2_00) + void setMaxCount(int); +%End +%If (Qt_2_00 -) + virtual void setMaxCount(int); +%End + int maxCount() const; + + enum Policy { + NoInsertion, + AtTop, + AtCurrent, + AtBottom, + AfterCurrent, + BeforeCurrent + }; + +%If (- Qt_2_00) + void setInsertionPolicy(Policy); +%End +%If (Qt_2_00 -) + virtual void setInsertionPolicy(Policy); +%End + Policy insertionPolicy() const; + +%If (- Qt_2_00) + void setValidator(QValidator *); + QValidator *validator() const; +%End +%If (Qt_2_00 -) + virtual void setValidator(const QValidator *); + const QValidator *validator() const; +%End + +%If (- Qt_2_00) + void setListBox(QListBox *); +%End +%If (Qt_2_00 -) + virtual void setListBox(QListBox *); +%End + QListBox *listBox() const; + +%If (Qt_3_0_0 -) + virtual void setLineEdit(QLineEdit *); +%End +%If (Qt_2_1_0 -) + QLineEdit *lineEdit() const; +%End + +%If (- Qt_2_00) + void setAutoCompletion(bool); +%End +%If (Qt_2_00 -) + virtual void setAutoCompletion(bool); +%End + bool autoCompletion() const; + + bool eventFilter(QObject *,QEvent *); + +%If (Qt_2_1_0 -) + void setDuplicatesEnabled(bool); + bool duplicatesEnabled() const; +%End + +%If (Qt_2_2_0 -) + bool editable() const; + void setEditable(bool); +%End + +%If (Qt_3_0_0 -) + virtual void popup(); +%End + +%If (Qt_3_3_0 -) + void hide(); +%End + +public slots: +%If (Qt_3_0_0 -) + void clear(); +%End + void clearValidator(); + void clearEdit(); +%If (- Qt_2_00) + void setEditText(const char *); +%End +%If (Qt_2_00 -) + virtual void setEditText(const QString &); +%End + +signals: + void activated(int); + void highlighted(int); +%If (- Qt_2_00) + void activated(const char *); + void highlighted(const char *); +%End +%If (Qt_2_00 -) + void activated(const QString &); + void highlighted(const QString &); + void textChanged(const QString &); +%End + +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); +%If (Qt_3_1_1 -) + void focusOutEvent(QFocusEvent *); +%End +%If (Qt_3_1_0 -) + void wheelEvent(QWheelEvent *); +%End +%If (- Qt_3_0_0) + void popup(); +%End +%If (Qt_2_00 -) + void styleChange(QStyle &); + + void updateMask(); +%End + +private: + QComboBox(const QComboBox &); +}; diff --git a/python/pyqt/sip/qt/qcommonstyle.sip b/python/pyqt/sip/qt/qcommonstyle.sip new file mode 100644 index 00000000..b8387168 --- /dev/null +++ b/python/pyqt/sip/qt/qcommonstyle.sip @@ -0,0 +1,137 @@ +// This is the SIP interface definition for QCommonStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCommonStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QCommonStyle : QStyle +{ +%TypeHeaderCode +#include <qcommonstyle.h> +%End + +public: +%If (- Qt_3_0_0) + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); + void drawComboButtonMask(QPainter *,int,int,int,int); + void drawPushButtonLabel(QPushButton *,QPainter *); + void getButtonShift(int &,int &); + int defaultFrameWidth() const; + void tabbarMetrics(const QTabBar *,int &,int &,int &); + void drawTab(QPainter *,const QTabBar *,QTab *,bool); + void drawTabMask(QPainter *,const QTabBar *,QTab *,bool); + ScrollControl scrollBarPointOver(const QScrollBar *,int,const QPoint &); + void drawSliderMask(QPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGrooveMask(QPainter *,int,int,int,int,QCOORD,Orientation); + int maximumSliderDragDistance() const; + int popupSubmenuIndicatorWidth(const QFontMetrics &); +%End + +%If (Qt_3_0_0 -) + QCommonStyle(); + + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption& = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControlMask(ControlElement,QPainter *,const QWidget *, + const QRect &, + const QStyleOption & = QStyleOption()) const; + + QRect subRect(SubRect,const QWidget *) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + void drawComplexControlMask(ComplexControl,QPainter *,const QWidget *, + const QRect &, + const QStyleOption & = QStyleOption()) const; + + QRect querySubControlMetrics(ComplexControl,const QWidget *,SubControl, + const QStyleOption & = QStyleOption()) const; + + SubControl querySubControl(ComplexControl,const QWidget *, + const QPoint &, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + QSize sizeFromContents(ContentsType,const QWidget *,const QSize &, + const QStyleOption & = QStyleOption()) const; + + int styleHint(StyleHint,const QWidget *,const QStyleOption &, + QStyleHintReturn *) const; + + QPixmap stylePixmap(StylePixmap,const QWidget * = 0, + const QStyleOption & = QStyleOption()) const; + +%End + +private: +%If (- Qt_3_0_0) + QCommonStyle(GUIStyle); + ~QCommonStyle(); +%End +%If (Qt_3_0_0 -) + QCommonStyle(const QCommonStyle &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qcstring.sip b/python/pyqt/sip/qt/qcstring.sip new file mode 100644 index 00000000..64b3b2ab --- /dev/null +++ b/python/pyqt/sip/qt/qcstring.sip @@ -0,0 +1,223 @@ +// This is the SIP interface definition for QCString. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCString (Qt v2+)</Title> +<Para> +A Python string can be used whenever a <Literal>QCString</Literal> can be used. +A <Literal>QCString</Literal> can be converted to a Python string using the +Python <Literal>str()</Literal> function. +</Para> + +<FuncSynopsis> + <FuncDef>QCString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QCString : QByteArray +{ +%TypeHeaderCode +#include <qcstring.h> +%End + +public: + QCString(); + QCString(int); + QCString(const QCString &); + QCString(const char *); + QCString(const char *,uint); + + bool isNull() const; + bool isEmpty() const; + uint length() const; + bool resize(uint); + bool truncate(uint); + bool fill(char,int = -1); + QCString copy() const; +// QCString &sprintf(const char *,...); +// int find(char,int = 0,bool = 1) const; + int find(const char *,int = 0,bool = 1) const; + int find(const QRegExp &,int = 0) const; +// int findRev(char,int = -1,bool = 1) const; + int findRev(const char *,int = -1,bool = 1) const; + int findRev(const QRegExp &,int = -1) const; +// int contains(char,bool = 1) const; + int contains(const char *,bool = 1) const; + int contains(const QRegExp &) const; + QCString left(uint) const; + QCString right(uint) const; + QCString mid(uint,uint = 0xffffffff) const; + QCString leftJustify(uint,char = ' ',bool = 0) const; + QCString rightJustify(uint,char = ' ',bool = 0) const; + QCString lower() const; + QCString upper() const; + QCString stripWhiteSpace() const; + QCString simplifyWhiteSpace() const; + QCString &insert(uint,const char *); +// QCString &insert(uint,char); + QCString &append(const char *); + QCString &prepend(const char *); + QCString &remove(uint,uint); + QCString &replace(uint,uint,const char *); + QCString &replace(const QRegExp &,const char *); +%If (Qt_3_1_0 -) +// QCString &replace(char,const char *); + QCString &replace(const char *,const char *); +// QCString &replace(char,char); +%End + + short toShort(bool * = 0) const; + ushort toUShort(bool * = 0) const; + int toInt(bool * = 0) const; + uint toUInt(bool * = 0) const; + long toLong(bool * = 0) const; + ulong toULong(bool * = 0) const; + float toFloat(bool * = 0) const; + double toDouble(bool * = 0) const; + + QCString &setStr(const char *); +// QCString &setNum(short); +// QCString &setNum(ushort); + QCString &setNum(int /Constrained/); +// QCString &setNum(uint); +// QCString &setNum(long); +// QCString &setNum(ulong); +// QCString &setNum(float,char = 'g',int = 6); + QCString &setNum(double,char = 'g',int = 6); + bool setExpand(uint,char); + + SIP_PYOBJECT __str__(); +%MethodCode + const char *s; + + Py_BEGIN_ALLOW_THREADS + s = *sipCpp; + Py_END_ALLOW_THREADS + + if (s == NULL) + s = ""; + + sipRes = PyString_FromString(s); +%End + +%ConvertToTypeCode + // Allow a Python string whenever a QCString is expected. + + if (sipIsErr == NULL) + return (PyString_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_QCString,SIP_NO_CONVERTORS)); + + if (PyString_Check(sipPy)) + { + *sipCppPtr = new QCString(PyString_AS_STRING(sipPy)); + + return sipGetState(sipTransferObj); + } + + *sipCppPtr = reinterpret_cast<QCString *>(sipConvertToInstance(sipPy,sipClass_QCString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qcursor.sip b/python/pyqt/sip/qt/qcursor.sip new file mode 100644 index 00000000..3631c30e --- /dev/null +++ b/python/pyqt/sip/qt/qcursor.sip @@ -0,0 +1,144 @@ +// This is the SIP interface definition for QCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCursor</Title> +<Para> +<Literal>QCursor</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qcursor.h> +%End + + +%If (- Qt_2_00) +// Global cursors. + +const QCursor arrowCursor; +const QCursor upArrowCursor; +const QCursor crossCursor; +const QCursor waitCursor; +const QCursor ibeamCursor; +const QCursor sizeVerCursor; +const QCursor sizeHorCursor; +const QCursor sizeBDiagCursor; +const QCursor sizeFDiagCursor; +const QCursor sizeAllCursor; +const QCursor blankCursor; +%End + + +%If (- Qt_3_0_0) +enum QCursorShape { + ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IbeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + LastCursor = BlankCursor, + BitmapCursor = 24 +}; + + +class QCursor +{ +%TypeHeaderCode +#include <qcursor.h> +%End + +public: + QCursor(); + QCursor(int); + QCursor(const QBitmap &,const QBitmap &,int = -1,int = -1); +%If (Qt_2_00 -) + QCursor(const QPixmap &,int = -1,int = -1); +%End + QCursor(const QCursor &); + + int shape() const; + void setShape(int); + const QBitmap *bitmap() const; + const QBitmap *mask() const; + QPoint hotSpot() const; +%If (- Qt_2_00) + HANDLE handle() const; +%End +%If (Qt_2_00 -) +%If (WS_X11) + HANDLE handle() const; +%End +%End + static QPoint pos(); + static void setPos(int,int); + static void setPos(const QPoint &); + static void initialize(); + static void cleanup(); +}; +%End + +%If (Qt_3_0_0 -) +class QCursor : Qt +{ +%TypeHeaderCode +#include <qcursor.h> +%End + +public: + QCursor(); + QCursor(int); + QCursor(const QBitmap &,const QBitmap &,int = -1,int = -1); + QCursor(const QPixmap &,int = -1,int = -1); + QCursor(const QCursor &); + + int shape() const; + void setShape(int); + const QBitmap *bitmap() const; + const QBitmap *mask() const; + QPoint hotSpot() const; + +%If (WS_X11) + HANDLE handle() const; +%If (Qt_3_3_0 -) + // This would have the same Python signature as QCursor(int). + //QCursor(HANDLE); +%End +%End + static QPoint pos(); + static void setPos(int,int); + static void setPos(const QPoint &); + static void initialize(); + static void cleanup(); +%If (WS_X11) + static int x11Screen(); +%End +}; +%End diff --git a/python/pyqt/sip/qt/qdatastream.sip b/python/pyqt/sip/qt/qdatastream.sip new file mode 100644 index 00000000..1a271326 --- /dev/null +++ b/python/pyqt/sip/qt/qdatastream.sip @@ -0,0 +1,224 @@ +// This is the SIP interface definition for QDataStream. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDataStream</Title> +<FuncSynopsis> + <FuncDef>QDataStream &<Function>readBytes</Function></FuncDef> + <ParamDef>const char *&<Parameter>s</Parameter></ParamDef> + <ParamDef>uint &<Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters. The <Literal>QDataStream</Literal> result and the +data read are returned as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>l</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>l</Literal> parameter. The +<Literal>QDataStream</Literal> result and the data read are returned as a +tuple. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>writeBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> + +<FuncSynopsis> + <FuncDef>QDataStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>s</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>s</Literal> and not passed as a +parameter. +</Para> +</Sect2> +%End + + +class QDataStream +{ +%TypeHeaderCode +#include <qdatastream.h> +%End + +public: + QDataStream(); + QDataStream(QIODevice *); + QDataStream(QByteArray,int); + + QIODevice *device() const; + void setDevice(QIODevice *); + void unsetDevice(); +%If (Qt_2_00 -) + bool atEnd() const; +%End + bool eof() const; + + enum ByteOrder { + BigEndian, + LittleEndian + }; + + int byteOrder() const; + void setByteOrder(int); + bool isPrintableData() const; + void setPrintableData(bool); + int version() const; + void setVersion(int); + + SIP_PYTUPLE readBytes() /ReleaseGIL/; +%MethodCode + char *c; + uint l; + + Py_BEGIN_ALLOW_THREADS + sipCpp -> QDataStream::readBytes(c,l); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(Sa)",sipSelf,c,l); + + if (c) + delete[] c; +%End + + SIP_PYTUPLE readRawBytes(uint) /ReleaseGIL/; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipCpp -> QDataStream::readRawBytes(buf,a0); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(Sa)",sipSelf,buf,a0); + + sipFree((ANY *)buf); + } +%End + + QDataStream &writeBytes(const char * /Array/, + uint /ArraySize/) /ReleaseGIL/; + QDataStream &writeRawBytes(const char * /Array/, + uint /ArraySize/) /ReleaseGIL/; + +%If (Qt_3_0_0 -) + // These are taken from the corresponding class definitions. We limit + // them to Qt v3.0.0 and later just to avoid checking earlier versions. + + QDataStream &operator<<(const QBrush &); + QDataStream &operator>>(QBrush & /Constrained/); + + QDataStream &operator<<(const QColor &); + QDataStream &operator>>(QColor & /Constrained/); + + QDataStream &operator<<(const QByteArray &); + QDataStream &operator>>(QByteArray & /Constrained/); + + QDataStream &operator<<(const QCString &); + QDataStream &operator>>(QCString & /Constrained/); + + QDataStream &operator<<(const QCursor &); + QDataStream &operator>>(QCursor & /Constrained/); + + QDataStream &operator<<(const QDate &); + QDataStream &operator>>(QDate & /Constrained/); + + QDataStream &operator<<(const QTime &); + QDataStream &operator>>(QTime & /Constrained/); + + QDataStream &operator<<(const QDateTime &); + QDataStream &operator>>(QDateTime & /Constrained/); + + QDataStream &operator<<(const QFont &); + QDataStream &operator>>(QFont & /Constrained/); + + QDataStream &operator<<(const QImage &); + QDataStream &operator>>(QImage & /Constrained/); + + QDataStream &operator<<(const QKeySequence &); + QDataStream &operator>>(QKeySequence & /Constrained/); + + QDataStream &operator<<(const QColorGroup &); + QDataStream &operator>>(QColorGroup & /Constrained/); + + QDataStream &operator<<(const QPalette &); + QDataStream &operator>>(QPalette & /Constrained/); + + QDataStream &operator<<(const QPen &); + QDataStream &operator>>(QPen & /Constrained/); + + QDataStream &operator<<(const QPicture &); + QDataStream &operator>>(QPicture & /Constrained/); + + QDataStream &operator<<(const QPixmap &); + QDataStream &operator>>(QPixmap & /Constrained/); + + QDataStream &operator<<(const QPointArray &); + QDataStream &operator>>(QPointArray & /Constrained/); + + QDataStream &operator<<(const QPoint &); + QDataStream &operator>>(QPoint & /Constrained/); + + QDataStream &operator<<(const QRect &); + QDataStream &operator>>(QRect & /Constrained/); + + QDataStream &operator<<(const QRegion &); + QDataStream &operator>>(QRegion & /Constrained/); + + QDataStream &operator<<(const QSize &); + QDataStream &operator>>(QSize & /Constrained/); + + QDataStream &operator<<(const QString &); + QDataStream &operator>>(QString & /Constrained/); + + QDataStream &operator<<(const QStringList &); + QDataStream &operator>>(QStringList & /Constrained/); + + QDataStream &operator<<(const QVariant &); + QDataStream &operator>>(QVariant & /Constrained/); + + QDataStream &operator<<(const QWMatrix &); + QDataStream &operator>>(QWMatrix & /Constrained/); +%End +%If (Qt_3_1_0 -) + QDataStream &operator<<(const QUuid &); + QDataStream &operator>>(QUuid & /Constrained/); +%End + +private: + QDataStream(const QDataStream &); +}; diff --git a/python/pyqt/sip/qt/qdatetime.sip b/python/pyqt/sip/qt/qdatetime.sip new file mode 100644 index 00000000..cede0216 --- /dev/null +++ b/python/pyqt/sip/qt/qdatetime.sip @@ -0,0 +1,280 @@ +// This is the SIP interface definition for QDate, QDateTime and QTime. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDate</Title> +<Para> +The Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>weekNumber</Function></FuncDef> + <ParamDef>int *<Parameter>yearNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the week number and the year number as a +tuple. (Qt v3.1+) +</Para> +</Sect2> + +<Sect2><Title>QDateTime</Title> +<Para> +<Literal>QDateTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> + +<Sect2><Title>QTime</Title> +<Para> +<Literal>QTime</Literal> is fully implemented, including the Python +<Literal>==</Literal>, <Literal>!=</Literal>, +<Literal><</Literal>, <Literal><=</Literal>, +<Literal>></Literal>, <Literal>>=</Literal> +and <Literal>__nonzero__</Literal> +operators. +</Para> +</Sect2> +%End + + +class QDate +{ +%TypeHeaderCode +#include <qdatetime.h> +%End + +public: + QDate(); + QDate(int,int,int); + + bool isNull() const; + bool isValid() const; + + int year() const; + int month() const; + int day() const; + int dayOfWeek() const; + int dayOfYear() const; + int daysInMonth() const; + int daysInYear() const; + +%If (Qt_3_1_0 -) + int weekNumber(int * = 0) const; +%End + +%If (- Qt_2_00) + virtual const char *monthName(int) const; + virtual const char *dayName(int) const; +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual QString monthName(int) const; + virtual QString dayName(int) const; +%End +%If (Qt_3_0_0 -) + static QString shortMonthName(int); + static QString shortDayName(int); + static QString longMonthName(int); + static QString longDayName(int); +%End + +%If (- Qt_3_0_0) + QString toString() const; +%End +%If (Qt_3_0_0 -) + QString toString(Qt::DateFormat = Qt::TextDate) const; + QString toString(const QString &) const; +%End + bool setYMD(int,int,int); + QDate addDays(int) const; +%If (Qt_3_0_0 -) + QDate addMonths(int) const; + QDate addYears(int) const; +%End + int daysTo(const QDate &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const QDate &) const; + bool operator!=(const QDate &) const; + bool operator<(const QDate &) const; + bool operator<=(const QDate &) const; + bool operator>(const QDate &) const; + bool operator>=(const QDate &) const; + + static QDate currentDate(); +%If (Qt_3_1_0 -) + static QDate currentDate(Qt::TimeSpec); +%End +%If (Qt_3_0_0 -) + static QDate fromString(const QString &,Qt::DateFormat = Qt::TextDate); +%End + static bool isValid(int,int,int); + static bool leapYear(int); + +%If (Qt_3_0_0 -) + // These are defined in Qt3 but not documented. + //static uint gregorianToJulian(int,int,int); + //static void julianToGregorian(uint,int &,int &,int &); +%End +}; + + +class QTime +{ +%TypeHeaderCode +#include <qdatetime.h> +%End + +public: + QTime(); + QTime(int,int,int = 0,int = 0); + + bool isNull() const; + bool isValid() const; + int hour() const; + int minute() const; + int second() const; + int msec() const; + +%If (- Qt_3_0_0) + QString toString() const; +%End +%If (Qt_3_0_0 -) + QString toString(Qt::DateFormat = Qt::TextDate) const; + QString toString(const QString &) const; +%End + + bool setHMS(int,int,int,int = 0); + + QTime addSecs(int) const; + int secsTo(const QTime &) const; + QTime addMSecs(int) const; + int msecsTo(const QTime &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const QTime &) const; + bool operator!=(const QTime &) const; + bool operator<(const QTime &) const; + bool operator<=(const QTime &) const; + bool operator>(const QTime &) const; + bool operator>=(const QTime &) const; + + static QTime currentTime(); +%If (Qt_3_1_0 -) + static QTime currentTime(Qt::TimeSpec); +%End +%If (Qt_3_0_0 -) + static QTime fromString(const QString &,Qt::DateFormat = Qt::TextDate); +%End + static bool isValid(int,int,int,int = 0); + + void start(); + int restart(); +%If (- Qt_3_0_0) + int elapsed(); +%End +%If (Qt_3_0_0 -) + int elapsed() const; +%End +}; + + +class QDateTime +{ +%TypeHeaderCode +#include <qdatetime.h> +%End + +public: + QDateTime(); + QDateTime(const QDate &); + QDateTime(const QDate &,const QTime &); + + bool isNull() const; + bool isValid() const; + + QDate date() const; + QTime time() const; +%If (Qt_3_1_0 -) + uint toTime_t() const; +%End + void setDate(const QDate &); + void setTime(const QTime &); + void setTime_t(uint); +%If (Qt_3_1_0 -) + void setTime_t(uint,Qt::TimeSpec); +%End + +%If (- Qt_3_0_0) + QString toString() const; +%End +%If (Qt_3_0_0 -) + QString toString(Qt::DateFormat = Qt::TextDate) const; + QString toString(const QString &) const; +%End + + QDateTime addDays(int) const; +%If (Qt_3_0_0 -) + QDateTime addMonths(int) const; + QDateTime addYears(int) const; +%End + QDateTime addSecs(int) const; + int daysTo(const QDateTime &) const; + int secsTo(const QDateTime &) const; + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const QDateTime &) const; + bool operator!=(const QDateTime &) const; + bool operator<(const QDateTime &) const; + bool operator<=(const QDateTime &) const; + bool operator>(const QDateTime &) const; + bool operator>=(const QDateTime &) const; + + static QDateTime currentDateTime(); +%If (Qt_3_1_0 -) + static QDateTime currentDateTime(Qt::TimeSpec); +%End +%If (Qt_3_0_0 -) + static QDateTime fromString(const QString &, + Qt::DateFormat = Qt::TextDate); +%End +}; diff --git a/python/pyqt/sip/qt/qdatetimeedit.sip b/python/pyqt/sip/qt/qdatetimeedit.sip new file mode 100644 index 00000000..27ee8304 --- /dev/null +++ b/python/pyqt/sip/qt/qdatetimeedit.sip @@ -0,0 +1,256 @@ +// This is the SIP interface definition for QDateEdit, QDateTimeEdit and +// QTimeEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDateEdit (Qt v3+)</Title> +<Para> +<Literal>QDateEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTimeEdit (Qt v3+)</Title> +<Para> +<Literal>QTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDateTimeEdit (Qt v3+)</Title> +<Para> +<Literal>QDateTimeEdit</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +// QDateEdit actually inherits QDateTimeEditBase but that's an internal class +// and isn't exported under Windows in all versions. + +class QDateEdit : QWidget +{ +%TypeHeaderCode +#include <qdatetimeedit.h> +%End + +public: + QDateEdit(QWidget * /TransferThis/ = 0,const char * = 0); + QDateEdit(const QDate &,QWidget * /TransferThis/ = 0,const char * = 0); + + enum Order { + DMY, + MDY, + YMD, + YDM + }; + + QSize sizeHint() const; + QSize minimumSizeHint() const; +%If (- Qt_3_1_0) + virtual void setDate(const QDate &); +%End + QDate date() const; + virtual void setOrder(Order); + Order order() const; + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + + virtual void setMinValue(const QDate &); + QDate minValue() const; + virtual void setMaxValue(const QDate &); + QDate maxValue() const; + virtual void setRange(const QDate &,const QDate &); + QString separator() const; + virtual void setSeparator(const QString &); + +%If (Qt_3_2_0 -) + void removeFirstNumber(int); +%End + +public slots: +%If (Qt_3_1_0 -) + virtual void setDate(const QDate &); +%End + +signals: + void valueChanged(const QDate &); + +protected: + bool event(QEvent *); + void timerEvent(QTimerEvent *); + void resizeEvent(QResizeEvent *); + void stepUp(); + void stepDown(); + QString sectionFormattedText(int); + void addNumber(int,int); + void removeLastNumber(int); + bool setFocusSection(int); + + virtual void setYear(int); + virtual void setMonth(int); + virtual void setDay(int); + virtual void fix(); + virtual bool outOfRange(int,int,int) const; + +protected slots: + void updateButtons(); + +private: +%If (Qt_3_1_0 -) + QDateEdit(const QDateEdit &); +%End +}; + + +// QDateEdit actually inherits QDateTimeEditBase but that's an internal class +// and isn't exported under Windows in all versions. + +class QTimeEdit : QWidget +{ +%TypeHeaderCode +#include <qdatetimeedit.h> +%End + +public: +%If (Qt_3_1_0 -) + enum Display { + Hours, + Minutes, + Seconds, + AMPM + }; +%End + + QTimeEdit(QWidget * /TransferThis/ = 0,const char * = 0); + QTimeEdit(const QTime &,QWidget * /TransferThis/ = 0,const char * = 0); + + QSize sizeHint() const; + QSize minimumSizeHint() const; +%If (- Qt_3_1_0) + virtual void setTime(const QTime &); +%End + QTime time() const; + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + + virtual void setMinValue(const QTime &); + QTime minValue() const; + virtual void setMaxValue(const QTime &); + QTime maxValue() const; + virtual void setRange(const QTime &,const QTime &); + QString separator() const; + virtual void setSeparator(const QString &); + +%If (Qt_3_1_0 -) + uint display() const; + void setDisplay(uint); +%End + +%If (Qt_3_2_0 -) + void removeFirstNumber(int); +%End + +public slots: +%If (Qt_3_1_0 -) + virtual void setTime(const QTime &); +%End + +signals: + void valueChanged(const QTime &); + +protected: + bool event(QEvent *); + void timerEvent(QTimerEvent *); + void resizeEvent(QResizeEvent *); + void stepUp(); + void stepDown(); + QString sectionFormattedText(int); + void addNumber(int,int); + void removeLastNumber(int); + bool setFocusSection(int); + + virtual bool outOfRange(int,int,int) const; + virtual void setHour(int); + virtual void setMinute(int); + virtual void setSecond(int); + +protected slots: + void updateButtons(); + +private: +%If (Qt_3_1_0 -) + QTimeEdit(const QTimeEdit &); +%End +}; + + +class QDateTimeEdit : QWidget +{ +%TypeHeaderCode +#include <qdatetimeedit.h> +%End + +public: + QDateTimeEdit(QWidget * /TransferThis/ = 0,const char * = 0); + QDateTimeEdit(const QDateTime &,QWidget * /TransferThis/ = 0, + const char * = 0); + + QSize sizeHint() const; + QSize minimumSizeHint() const; +%If (- Qt_3_1_0) + virtual void setDateTime(const QDateTime &); +%End + QDateTime dateTime() const; + + QDateEdit* dateEdit(); + QTimeEdit* timeEdit(); + + virtual void setAutoAdvance(bool); + bool autoAdvance() const; + +public slots: +%If (Qt_3_1_0 -) + virtual void setDateTime(const QDateTime &); +%End + +signals: + void valueChanged(const QDateTime &); + +protected: + void init(); + void resizeEvent(QResizeEvent *); +%If (- Qt_3_1_2) + void layoutEditors(); +%End + +protected slots: + void newValue(const QDate &); + void newValue(const QTime &); + +private: +%If (Qt_3_1_0 -) + QDateTimeEdit(const QDateTimeEdit &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qdesktopwidget.sip b/python/pyqt/sip/qt/qdesktopwidget.sip new file mode 100644 index 00000000..a6030e68 --- /dev/null +++ b/python/pyqt/sip/qt/qdesktopwidget.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for QDesktopWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDesktopWidget (Qt v3+)</Title> +<Para> +<Literal>QDesktopWidget</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDesktopWidget : QWidget +{ +%TypeHeaderCode +#include <qdesktopwidget.h> +%End + +public: + QDesktopWidget(); + + bool isVirtualDesktop() const; + + int numScreens() const; + int primaryScreen() const; + + int screenNumber(QWidget * = 0) const; + int screenNumber(const QPoint &) const; + + QWidget *screen(int = -1); + + const QRect &screenGeometry(int = -1) const; +%If (Qt_3_1_0 -) + const QRect &screenGeometry(QWidget *) const; + const QRect &screenGeometry(const QPoint &) const; + + const QRect &availableGeometry(int = -1) const; + const QRect &availableGeometry(QWidget *) const; + const QRect &availableGeometry(const QPoint &) const; + + void insertChild(QObject *); +%End + +signals: +%If (Qt_3_2_0 -) + void resized(int); +%End +%If (Qt_3_3_0 -) + void workAreaResized(int); +%End + +protected: +%If (Qt_3_1_0 -) + void resizeEvent(QResizeEvent *); +%End + +private: +%If (Qt_3_1_0 -) + QDesktopWidget(const QDesktopWidget &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qdial.sip b/python/pyqt/sip/qt/qdial.sip new file mode 100644 index 00000000..9587e8c4 --- /dev/null +++ b/python/pyqt/sip/qt/qdial.sip @@ -0,0 +1,112 @@ +// This is the SIP interface definition for QDial. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDial (Qt v2.2+)</Title> +<Para> +<Literal>QDial</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) +%If (Qt_DIAL) + +class QDial : QWidget, QRangeControl +{ +%TypeHeaderCode +#include <qdial.h> +%End + +public: +%If (- Qt_3_0_0) + QDial(QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_3_0_0 -) + QDial(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + QDial(int,int,int,int,QWidget * /TransferThis/ = 0,const char * = 0); + + bool tracking() const; + + bool wrapping() const; + + int notchSize() const; + + virtual void setNotchTarget(double); + double notchTarget() const; + + bool notchesVisible() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; + +public slots: + virtual void setValue(int); + void addLine(); + void subtractLine(); + void addPage(); + void subtractPage(); + virtual void setNotchesVisible(bool); + virtual void setWrapping(bool); + virtual void setTracking(bool); + +signals: + void valueChanged(int); + void dialPressed(); + void dialMoved(int); + void dialReleased(); + +protected: + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + + void keyPressEvent(QKeyEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void wheelEvent(QWheelEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + + void valueChange(); + void rangeChange(); + + virtual void repaintScreen(const QRect * = 0); + +private: + QDial(const QDial &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qdialog.sip b/python/pyqt/sip/qt/qdialog.sip new file mode 100644 index 00000000..c2835202 --- /dev/null +++ b/python/pyqt/sip/qt/qdialog.sip @@ -0,0 +1,158 @@ +// This is the SIP interface definition for QDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDialog</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ dialog to be transfered +to Python. This means that the C++ dialog will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the dialog is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +%End + + +class QDialog : QWidget +{ +%TypeHeaderCode +#include <qdialog.h> +%End + +public: + QDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0,WFlags = 0); + + enum DialogCode { + Rejected, + Accepted + }; + +%If (- Qt_3_0_0) + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal dialog will + // probably have the main window as it's parent). This means + // the Qt dialog will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QDialog::exec(); + Py_END_ALLOW_THREADS +%End +%End + + int result() const; + + void show(); +%If (Qt_2_00 -) + void hide(); +%End + void move(int,int); + void move(const QPoint &); + void resize(int,int); + void resize(const QSize &); + void setGeometry(int,int,int,int); + void setGeometry(const QRect &); + +%If (Qt_2_2_0 -) + void setOrientation(Orientation); + Orientation orientation() const; + + void setExtension(QWidget *); + QWidget *extension() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + void setSizeGripEnabled(bool); + bool isSizeGripEnabled() const; +%End + +%If (Qt_3_2_0 -) + void setModal(bool); + bool isModal() const; +%End + +public slots: +%If (Qt_3_0_0 -) + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal dialog will + // probably have the main window as it's parent). This means + // the Qt dialog will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QDialog::exec(); + Py_END_ALLOW_THREADS +%End +%End + +protected slots: + virtual void done(int); +%If (- Qt_2_00) + void accept(); + void reject(); +%End +%If (Qt_2_00 -) + virtual void accept(); + virtual void reject(); +%End + +%If (Qt_2_2_0 -) + void showExtension(bool); +%End + +protected: + void setResult(int); + void keyPressEvent(QKeyEvent *); + void closeEvent(QCloseEvent *); +%If (Qt_2_2_0 -) + void resizeEvent(QResizeEvent *); +%End +%If (Qt_3_0_0 -) + void contextMenuEvent(QContextMenuEvent *); + bool eventFilter(QObject *,QEvent *); + void adjustPosition(QWidget *); +%End + +private: + QDialog(const QDialog &); +}; diff --git a/python/pyqt/sip/qt/qdir.sip b/python/pyqt/sip/qt/qdir.sip new file mode 100644 index 00000000..906e8051 --- /dev/null +++ b/python/pyqt/sip/qt/qdir.sip @@ -0,0 +1,384 @@ +// This is the SIP interface definition for QDir and QFileInfoList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDir</Title> +<Para> +<Literal>QDir</Literal> is fully implemented, including the Python +<Literal>len</Literal>, <Literal>[]</Literal> (for reading slices and +individual elements), <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>in</Literal> operators +</Para> +</Sect2> + +<Sect2><Title>QFileInfoList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QFileInfoList</Literal> is +the return type of a function or the type of an argument, a Python list of +<Literal>QFileInfo</Literal> instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType QFileInfoList +{ +%TypeHeaderCode +#include <qdir.h> +#include "sipqtQFileInfo.h" +%End + +%ConvertFromTypeCode + PyObject *pl; + QFileInfo *obj; + + // Convert the list. + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (QFileInfoListIterator it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_QFileInfo,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of QFileInfo instances to a QFileInfoList on + // the heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QFileInfo,0)) + return 0; + + return 1; + } + + QFileInfoList *qfil = new QFileInfoList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + QFileInfo *qfi; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qfi = reinterpret_cast<QFileInfo *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QFileInfo,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete qfil; + return 0; + } + + qfil -> append(qfi); + } + + *sipCppPtr = qfil; + + return sipGetState(sipTransferObj); +%End +}; + + +class QDir +{ +%TypeHeaderCode +#include <qdir.h> +%End + +public: + enum FilterSpec { + Dirs, + Files, + Drives, + NoSymLinks, + All, + TypeMask, + + Readable, + Writable, + Executable, + RWEMask, + + Modified, + Hidden, + System, + AccessMask, + + DefaultFilter + }; + + enum SortSpec { + Name, + Time, + Size, + Unsorted, + SortByMask, + + DirsFirst, + Reversed, + IgnoreCase, + DefaultSort + }; + + QDir(); +%If (- Qt_2_00) + QDir(const char *,const char * = 0,int = Name | IgnoreCase,int = All); +%End +%If (Qt_2_00 -) + QDir(const QString &,const QString & = QString::null, + int = Name | IgnoreCase,int = All); +%End + QDir(const QDir &); + +%If (- Qt_2_00) + void setPath(const char *); + const char *path() const; + QString absPath() const; + QString canonicalPath() const; + + QString dirName() const; + QString filePath(const char *,bool = 1) const; + QString absFilePath(const char *,bool = 1) const; + + static QString convertSeparators(const char *); + + bool cd(const char *,bool = 1); + bool cdUp(); + + const char *nameFilter() const; + void setNameFilter(const char *); +%End +%If (Qt_2_00 -) + virtual void setPath(const QString &); + virtual QString path() const; + virtual QString absPath() const; + virtual QString canonicalPath() const; + + virtual QString dirName() const; + virtual QString filePath(const QString &,bool = 1) const; + virtual QString absFilePath(const QString &,bool = 1) const; + + static QString convertSeparators(const QString &); + + virtual bool cd(const QString &,bool = 1); + virtual bool cdUp(); + + QString nameFilter() const; + virtual void setNameFilter(const QString &); +%End + FilterSpec filter() const; +%If (- Qt_2_00) + void setFilter(int); +%End +%If (Qt_2_00 -) + virtual void setFilter(int); +%End + SortSpec sorting() const; +%If (- Qt_2_00) + void setSorting(int); +%End +%If (Qt_2_00 -) + virtual void setSorting(int); +%End + + bool matchAllDirs() const; +%If (- Qt_2_00) + void setMatchAllDirs(bool); +%End +%If (Qt_2_00 -) + virtual void setMatchAllDirs(bool); +%End + + uint count() const; + + int __len__() const; +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> count(); + Py_END_ALLOW_THREADS +%End + + QString operator[](int) const; +%MethodCode + int len; + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); + Py_END_ALLOW_THREADS + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QString((*sipCpp)[a0]); + Py_END_ALLOW_THREADS + } +%End + + QStringList operator[](SIP_PYSLICE) const; +%MethodCode +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t len, start, stop, step, slicelength, i; +#else + int len, start, stop, step, slicelength, i; +#endif + + Py_BEGIN_ALLOW_THREADS + len = sipCpp -> count(); + Py_END_ALLOW_THREADS + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QStringList(); + + for (i = 0; i < slicelength; ++i) + { + (*sipRes) += (*sipCpp)[start]; + start += step; + } + Py_END_ALLOW_THREADS + } +%End + + int __contains__(const QString &) const; +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = (sipCpp -> entryList().findIndex(*a0) >= 0); + Py_END_ALLOW_THREADS +%End + +%If (- Qt_2_00) + const QStrList *entryList(int = DefaultFilter,int = DefaultSort) const; + const QStrList *entryList(const char *,int = DefaultFilter, + int = DefaultSort) const; + const QFileInfoList *entryInfoList(int = DefaultFilter, + int = DefaultSort) const; + const QFileInfoList *entryInfoList(const char *,int = DefaultFilter, + int = DefaultSort) const; +%End +%If (Qt_2_00 -) + virtual QStrList encodedEntryList(int = DefaultFilter, + int = DefaultSort) const; + virtual QStrList encodedEntryList(const QString &,int = DefaultFilter, + int = DefaultSort) const; + virtual QStringList entryList(int = DefaultFilter, + int = DefaultSort) const; + virtual QStringList entryList(const QString &,int = DefaultFilter, + int = DefaultSort) const; + virtual const QFileInfoList *entryInfoList(int = DefaultFilter, + int = DefaultSort) const; + virtual const QFileInfoList *entryInfoList(const QString &, + int = DefaultFilter, + int = DefaultSort) const; +%End + + static const QFileInfoList *drives(); + +%If (- Qt_2_00) + bool mkdir(const char *,bool = 1) const; + bool rmdir(const char *,bool = 1) const; + + bool isReadable() const; + bool exists() const; + bool isRoot() const; + + bool isRelative() const; + void convertToAbs(); + + bool operator==(const QDir &) const; + bool operator!=(const QDir &) const; + + bool remove(const char *,bool = 1); + bool rename(const char *,const char *,bool = 1); + bool exists(const char *,bool = 1); +%End +%If (Qt_2_00 -) + virtual bool mkdir(const QString &,bool = 1) const; + virtual bool rmdir(const QString &,bool = 1) const; + + virtual bool isReadable() const; + virtual bool exists() const; + virtual bool isRoot() const; + + virtual bool isRelative() const; + virtual void convertToAbs(); + + virtual bool remove(const QString &,bool = 1); + virtual bool rename(const QString &,const QString &,bool = 1); + virtual bool exists(const QString &,bool = 1); +%End + + static char separator(); + +%If (- Qt_2_00) + static bool setCurrent(const char *); +%End +%If (Qt_2_00 -) + static bool setCurrent(const QString &); +%End + static QDir current(); + static QDir home(); + static QDir root(); + static QString currentDirPath(); + static QString homeDirPath(); + static QString rootDirPath(); + +%If (- Qt_2_00) + static bool match(const char *,const char *); + static QString cleanDirPath(const char *); + static bool isRelativePath(const char *); +%End +%If (Qt_2_1_0 -) + static bool match(const QStringList &,const QString &); +%End +%If (Qt_2_00 -) + static bool match(const QString &,const QString &); + static QString cleanDirPath(const QString &); + static bool isRelativePath(const QString &); +%End +%If (Qt_3_1_0 -) + void refresh() const; +%End +}; diff --git a/python/pyqt/sip/qt/qdockarea.sip b/python/pyqt/sip/qt/qdockarea.sip new file mode 100644 index 00000000..87c01268 --- /dev/null +++ b/python/pyqt/sip/qt/qdockarea.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for QDockArea. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDockArea (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>hasDockWindow</Function> const</FuncDef> + <ParamDef>QDockWindow *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns the index of the +QDockWIndow or -1 if the QDockArea does not contain the QDockWindow. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDockArea : QWidget +{ +%TypeHeaderCode +#include <qdockarea.h> +%End + +public: + enum HandlePosition { + Normal, + Reverse + }; + + QDockArea(Orientation,HandlePosition = Normal, + QWidget * /TransferThis/ = 0,const char * = 0); + + void moveDockWindow(QDockWindow *,const QPoint &,const QRect &,bool); + void removeDockWindow(QDockWindow *,bool,bool,bool = 1); + void moveDockWindow(QDockWindow *,int = -1); + + int hasDockWindow(QDockWindow *); +%MethodCode + // The Python interface returns the index. + + Py_BEGIN_ALLOW_THREADS + sipCpp -> QDockArea::hasDockWindow(a0,&sipRes); + Py_END_ALLOW_THREADS +%End + + void invalidNextOffset(QDockWindow *); + + Orientation orientation() const; + HandlePosition handlePosition() const; + + bool eventFilter(QObject *,QEvent *); + bool isEmpty() const; + int count() const; + QPtrList<QDockWindow> dockWindowList() const; + + bool isDockWindowAccepted(QDockWindow *); + void setAcceptDockWindow(QDockWindow *,bool); + +public slots: + void lineUp(bool); + +private: + QDockArea(const QDockArea &); +}; + +%End diff --git a/python/pyqt/sip/qt/qdockwindow.sip b/python/pyqt/sip/qt/qdockwindow.sip new file mode 100644 index 00000000..5a2bef66 --- /dev/null +++ b/python/pyqt/sip/qt/qdockwindow.sip @@ -0,0 +1,135 @@ +// This is the SIP interface definition for QDockWindow. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDockWindow (Qt v3+)</Title> +<Para> +<Literal>QDockWindow</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDockWindow : QFrame +{ +%TypeHeaderCode +#include <qdockwindow.h> +%End + +public: + enum Place { + InDock, + OutsideDock + }; + + enum CloseMode { + Never, + Docked, + Undocked, + Always + }; + + QDockWindow(Place = InDock,QWidget * /TransferThis/ = 0, + const char * = 0,WFlags = 0); +%If (Qt_3_1_0 -) + QDockWindow(QWidget * /TransferThis/,const char * = 0,WFlags = 0); +%End + + virtual void setWidget(QWidget *); + QWidget *widget() const; + + Place place() const; + + QDockArea *area() const; + + virtual void setCloseMode(int); + bool isCloseEnabled() const; + int closeMode() const; + + virtual void setResizeEnabled(bool); + virtual void setMovingEnabled(bool); + bool isResizeEnabled() const; + bool isMovingEnabled() const; + + virtual void setHorizontallyStretchable(bool); + virtual void setVerticallyStretchable(bool); + bool isHorizontallyStretchable() const; + bool isVerticallyStretchable() const; + bool isStretchable() const; + + virtual void setOffset(int); + int offset() const; + + virtual void setFixedExtentWidth(int); + virtual void setFixedExtentHeight(int); + QSize fixedExtent() const; + + virtual void setNewLine(bool); + bool newLine() const; + + Qt::Orientation orientation() const; + + QSize sizeHint() const; + QSize minimumSize() const; + QSize minimumSizeHint() const; + + QBoxLayout *boxLayout(); + + virtual void setOpaqueMoving(bool); + bool opaqueMoving() const; + + bool eventFilter(QObject *,QEvent *); + +signals: + void orientationChanged(Orientation); + void placeChanged(QDockWindow::Place); + void visibilityChanged(bool); + +public slots: + virtual void undock(QWidget *); + virtual void undock(); + virtual void dock(); + virtual void setOrientation(Orientation); + void setCaption(const QString &); + +protected: + void resizeEvent(QResizeEvent *); + void showEvent(QShowEvent *); + void hideEvent(QHideEvent *); + void contextMenuEvent(QContextMenuEvent *); + +%If (Qt_3_0_1 -) + void drawFrame(QPainter *); +%End +%If (Qt_3_1_0 -) + void drawContents(QPainter *); +%End + + bool event(QEvent *); + +private: + QDockWindow(const QDockWindow &); +}; + +%End diff --git a/python/pyqt/sip/qt/qdragobject.sip b/python/pyqt/sip/qt/qdragobject.sip new file mode 100644 index 00000000..54652195 --- /dev/null +++ b/python/pyqt/sip/qt/qdragobject.sip @@ -0,0 +1,374 @@ +// This is the SIP interface definition for QDragObject, QImageDrag, +// QStoredDrag, QTextDrag, QUriDrag, QUrlDrag, QColorDrag. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QColorDrag (Qt v2.1+)</Title> +<Para> +<Literal>QColorDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragObject</Title> +<Para> +<Literal>QDragObject</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QImageDrag</Title> +<Para> +<Literal>QImageDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QStoredDrag</Title> +<Para> +<Literal>QStoredDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextDrag</Title> +<Para> +<Literal>QTextDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QUriDrag (Qt v2+)</Title> +<Para> +<Literal>QUriDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QUrlDrag (Qt v1.x)</Title> +<Para> +<Literal>QUrlDrag</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QDragObject : QObject +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + enum DragMode { + DragDefault, + DragCopy, + DragMove, + DragCopyOrMove + }; + + QDragObject(QWidget * /TransferThis/ = 0,const char * = 0); + + bool drag(); + bool dragMove(); + void dragCopy(); + virtual bool provides(const char *) const; + virtual const char *format(int) const = 0; + virtual QByteArray encodedData(const char *) const = 0; + void setPixmap(QPixmap); + void setPixmap(QPixmap,QPoint); + QPixmap pixmap() const; + QPoint pixmapHotSpot() const; + QWidget *source(); + +protected: + virtual bool drag(DragMode); +}; + +%End + +%If (Qt_2_00 -) + +class QDragObject : QObject, QMimeSource +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QDragObject(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (Qt_DRAGANDDROP) + bool drag(); + bool dragMove(); + void dragCopy(); +%If (Qt_3_0_0 -) + void dragLink(); +%End + + virtual void setPixmap(QPixmap); +%If (- Qt_3_0_0) + virtual void setPixmap(QPixmap,QPoint); +%End +%If (Qt_3_0_0 -) + virtual void setPixmap(QPixmap,const QPoint &); +%End + QPixmap pixmap() const; + QPoint pixmapHotSpot() const; +%End + + QWidget *source(); + static QWidget *target(); + + static void setTarget(QWidget *); + +%If (Qt_DRAGANDDROP) +%If (- Qt_3_0_0) + enum DragMode { + DragDefault, + DragCopy, + DragMove, + DragCopyOrMove + }; +%End +%If (Qt_3_0_0 -) + enum DragMode { + DragDefault, + DragCopy, + DragMove, + DragLink, + DragCopyOrMove + }; +%End +%End + +protected: +%If (Qt_DRAGANDDROP) + virtual bool drag(DragMode); +%End + +private: +%If (Qt_3_1_0 -) + QDragObject(const QDragObject &); +%End +}; + +%End + + +class QStoredDrag : QDragObject +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QStoredDrag(const char *,QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_00) + void setEncodedData(const QByteArray&); +%End +%If (Qt_2_00 -) + virtual void setEncodedData(const QByteArray&); +%End + + const char *format(int) const; + virtual QByteArray encodedData(const char *) const; + +private: +%If (Qt_3_1_0 -) + QStoredDrag(const QStoredDrag &); +%End +}; + + +%If (- Qt_2_00) + +class QTextDrag : QStoredDrag +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QTextDrag(const char *,QWidget * /TransferThis/ = 0,const char * = 0); + QTextDrag(QWidget * /TransferThis/ = 0,const char * = 0); + + void setText(const char *); + static bool canDecode(QDragMoveEvent *); + static bool decode(QDropEvent *,QString &); +}; + +%End + +%If (Qt_2_00 -) + +class QTextDrag : QDragObject +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QTextDrag(const QString &,QWidget * /TransferThis/ = 0, + const char * = 0); + QTextDrag(QWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setText(const QString &); + virtual void setSubtype(const QCString &); + + const char *format(int) const; + virtual QByteArray encodedData(const char *) const; + + static bool canDecode(const QMimeSource *); + static bool decode(const QMimeSource *,QString &); + static bool decode(const QMimeSource *,QString &,QCString &); + +private: +%If (Qt_3_1_0 -) + QTextDrag(const QTextDrag &); +%End +}; + +%End + + +class QImageDrag : QDragObject +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QImageDrag(QImage,QWidget * /TransferThis/ = 0,const char * = 0); + QImageDrag(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_00) + void setImage(QImage); +%End +%If (Qt_2_00 -) + virtual void setImage(QImage); +%End + + const char *format(int) const; + virtual QByteArray encodedData(const char *) const; + +%If (- Qt_2_00) + static bool canDecode(QDragMoveEvent *); + static bool decode(QDropEvent *,QImage &); + static bool decode(QDropEvent *,QPixmap &); +%End +%If (Qt_2_00 -) + static bool canDecode(const QMimeSource *); + static bool decode(const QMimeSource *,QImage &); + static bool decode(const QMimeSource *,QPixmap &); +%End + +private: +%If (Qt_3_1_0 -) + QImageDrag(const QImageDrag &); +%End +}; + + +%If (- Qt_2_00) + +class QUrlDrag : QStoredDrag +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QUrlDrag(QStrList,QWidget * /TransferThis/ = 0,const char * = 0); + QUrlDrag(QWidget * /TransferThis/ = 0,const char * = 0); + + void setUrls(QStrList); + static QString urlToLocalFile(const char *); + static bool canDecode(QDragMoveEvent *); + static bool decode(QDropEvent *,QStrList &); + static bool decodeLocalFiles(QDropEvent *,QStrList &); +}; + +%End + +%If (Qt_2_00 -) + +class QUriDrag : QStoredDrag +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QUriDrag(QStrList,QWidget * /TransferThis/ = 0,const char * = 0); + QUriDrag(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_3_0_0) + void setFilenames(QStringList); + void setUnicodeUris(QStringList); +%End +%If (Qt_3_0_0 -) + void setFileNames(const QStringList &); + void setUnicodeUris(const QStringList &); +%End + virtual void setUris(QStrList); + + static QString uriToLocalFile(const char *); + static QCString localFileToUri(const QString &); + static QString uriToUnicodeUri(const char *); + static QCString unicodeUriToUri(const QString &); + static bool canDecode(const QMimeSource *); + static bool decode(const QMimeSource *,QStrList &); + static bool decodeToUnicodeUris(const QMimeSource *,QStringList &); + static bool decodeLocalFiles(const QMimeSource *,QStringList &); + +private: +%If (Qt_3_1_0 -) + QUriDrag(const QUriDrag &); +%End +}; + +%End + + +%If (Qt_2_1_0 -) + +class QColorDrag : QStoredDrag +{ +%TypeHeaderCode +#include <qdragobject.h> +%End + +public: + QColorDrag(const QColor &,QWidget * /TransferThis/ = 0, + const char * = 0); + QColorDrag(QWidget * /TransferThis/ = 0,const char * = 0); + + void setColor(const QColor &); + + static bool canDecode(QMimeSource *); + static bool decode(QMimeSource *,QColor &); + +private: +%If (Qt_3_1_0 -) + QColorDrag(const QColorDrag &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qdrawutil.sip b/python/pyqt/sip/qt/qdrawutil.sip new file mode 100644 index 00000000..413ca4ad --- /dev/null +++ b/python/pyqt/sip/qt/qdrawutil.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for the Qt drawing utilities. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ModuleHeaderCode +#include <qdrawutil.h> +%End + + +void qDrawShadeLine(QPainter *,int,int,int,int,const QColorGroup &,bool = 1, + int = 1,int = 0); +void qDrawShadeLine(QPainter *,const QPoint &,const QPoint &, + const QColorGroup &,bool = 1,int = 1,int = 0); + +void qDrawShadeRect(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + int = 1,int = 0,const QBrush * = 0); +void qDrawShadeRect(QPainter *,const QRect &,const QColorGroup &,bool = 0, + int = 1,int = 0,const QBrush * = 0); + +void qDrawShadePanel(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + int = 1,const QBrush * = 0); +void qDrawShadePanel(QPainter *,const QRect &,const QColorGroup &,bool = 0, + int = 1,const QBrush * = 0); + +void qDrawWinButton(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); +void qDrawWinButton(QPainter *,const QRect &,const QColorGroup &,bool = 0, + const QBrush * = 0); + +void qDrawWinPanel(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); +void qDrawWinPanel(QPainter *,const QRect &,const QColorGroup &,bool = 0, + const QBrush * = 0); + +void qDrawPlainRect(QPainter *,int,int,int,int,const QColor &,int = 1, + const QBrush * = 0); +void qDrawPlainRect(QPainter *,const QRect &,const QColor &,int = 1, + const QBrush * = 0); + +%If (- Qt_2_00) +QRect qItemRect(QPainter *,GUIStyle,int,int,int,int,int,bool,const QPixmap *, + const char *,int = -1); + +void qDrawItem(QPainter *,GUIStyle,int,int,int,int,int,const QColorGroup &,bool, + const QPixmap *,const char *,int = -1); + +enum ArrowType { + UpArrow, + DownArrow, + LeftArrow, + RightArrow +}; + +void qDrawArrow(QPainter *,ArrowType,GUIStyle,bool,int,int,int,int, + const QColorGroup &,bool); +%End diff --git a/python/pyqt/sip/qt/qdropsite.sip b/python/pyqt/sip/qt/qdropsite.sip new file mode 100644 index 00000000..a2c11dee --- /dev/null +++ b/python/pyqt/sip/qt/qdropsite.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for QDropSite. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDropSite</Title> +<Para> +<Literal>QDropSite</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_DRAGANDDROP) + +class QDropSite +{ +%TypeHeaderCode +#include <qdropsite.h> +%End + +public: + QDropSite(QWidget *); + +%If (- Qt_2_00) + virtual void dragEnterEvent(QDragEnterEvent *); + virtual void dragMoveEvent(QDragMoveEvent *); + virtual void dragLeaveEvent(QDragLeaveEvent *); + virtual void dropEvent(QDropEvent *); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qerrormessage.sip b/python/pyqt/sip/qt/qerrormessage.sip new file mode 100644 index 00000000..1f31264c --- /dev/null +++ b/python/pyqt/sip/qt/qerrormessage.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QErrorMessage. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QErrorMessage (Qt v3+)</Title> +<Para> +<Literal>QErrorMessage</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QErrorMessage : QDialog +{ +%TypeHeaderCode +#include <qerrormessage.h> +%End + +public: + QErrorMessage(QWidget * /TransferThis/,const char * = 0); + + static QErrorMessage *qtHandler(); + +public slots: + void message(const QString &); + +protected: + void done(int); + +private: +%If (Qt_3_1_0 -) + QErrorMessage(const QErrorMessage &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qevent.sip b/python/pyqt/sip/qt/qevent.sip new file mode 100644 index 00000000..d4db7057 --- /dev/null +++ b/python/pyqt/sip/qt/qevent.sip @@ -0,0 +1,1235 @@ +// This is the SIP interface definition for QEvent, QChildEvent, QCloseEvent, +// QIconDragEvent, QContextMenuEvent, QCustomEvent, QDragEnterEvent, +// QDragLeaveEvent, QDragMoveEvent, QDropEvent, QFocusEvent, QHideEvent, +// QIMEvent, QIMComposeEvent, QKeyEvent, QMouseEvent, QMoveEvent, QPaintEvent, +// QResizeEvent, QShowEvent, QTabletEvent, QTimerEvent, QWheelEvent. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QEvent</Title> +<Para> +<Literal>QEvent</Literal> is fully implemented. +</Para> +<Para> +Instances of <Literal>QEvent</Literal>s are automatically converted to the +correct sub-class. +</Para> +</Sect2> + +<Sect2><Title>QChildEvent</Title> +<Para> +<Literal>QChildEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCloseEvent</Title> +<Para> +<Literal>QCloseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDragEvent (Qt v3.3+)</Title> +<Para> +<Literal>QIconDragEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QContextMenuEvent (Qt v3+)</Title> +<Para> +<Literal>QContextMenuEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCustomEvent</Title> +<Para> +<Literal>QCustomEvent</Literal> is fully implemented. Any Python object can be +passed as the event data and its reference count is increased. +</Para> +</Sect2> + +<Sect2><Title>QDragEnterEvent</Title> +<Para> +<Literal>QDragEnterEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragLeaveEvent</Title> +<Para> +<Literal>QDragLeaveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDragMoveEvent</Title> +<Para> +<Literal>QDragMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDropEvent</Title> +<Para> +<Literal>QDropEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFocusEvent</Title> +<Para> +<Literal>QFocusEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHideEvent</Title> +<Para> +<Literal>QHideEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIMComposeEvent (Qt v3.1+)</Title> +<Para> +<Literal>QIMComposeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIMEvent (Qt v3+)</Title> +<Para> +<Literal>QIMEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QKeyEvent</Title> +<Para> +<Literal>QKeyEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMouseEvent</Title> +<Para> +<Literal>QMouseEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMoveEvent</Title> +<Para> +<Literal>QMoveEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QPaintEvent</Title> +<Para> +<Literal>QPaintEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QResizeEvent</Title> +<Para> +<Literal>QResizeEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QShowEvent</Title> +<Para> +<Literal>QShowEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTabletEvent (Qt v3+)</Title> +<Para> +<Literal>QTabletEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTimerEvent</Title> +<Para> +<Literal>QTimerEvent</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWheelEvent (Qt v2+)</Title> +<Para> +<Literal>QWheelEvent</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qevent.h> +%End + + +%If (- Qt_2_00) + +const int Event_None; +const int Event_Timer; +const int Event_MouseButtonPress; +const int Event_MouseButtonRelease; +const int Event_MouseButtonDblClick; +const int Event_MouseMove; +const int Event_KeyPress; +const int Event_KeyRelease; +const int Event_FocusIn; +const int Event_FocusOut; +const int Event_Enter; +const int Event_Leave; +const int Event_Paint; +const int Event_Move; +const int Event_Resize; +const int Event_Create; +const int Event_Destroy; +const int Event_Show; +const int Event_Hide; +const int Event_Close; +const int Event_Quit; +const int Event_Accel; +const int Event_Clipboard; +const int Event_SockAct; +const int Event_DragEnter; +const int Event_DragMove; +const int Event_DragLeave; +const int Event_Drop; +const int Event_DragResponse; +const int Event_ChildInserted; +const int Event_ChildRemoved; +const int Event_LayoutHint; +const int Event_ActivateControl; +const int Event_DeactivateControl; +const int Event_User; + + +enum ButtonState { + NoButton = 0x00, + LeftButton = 0x01, + RightButton = 0x02, + MidButton = 0x04, + MouseButtonMask = 0x07, + ShiftButton = 0x08, + ControlButton = 0x10, + AltButton = 0x20, + KeyButtonMask = 0x38 +}; + + +class QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QEvent(int); + QEvent(QEvent&); + + int type() const; + +%ConvertToSubClassCode + switch (sipCpp -> type()) + { + case Event_Timer: + sipClass = sipClass_QTimerEvent; + break; + + case Event_MouseButtonPress: + case Event_MouseButtonRelease: + case Event_MouseButtonDblClick: + case Event_MouseMove: + sipClass = sipClass_QMouseEvent; + break; + + case Event_KeyPress: + case Event_KeyRelease: + sipClass = sipClass_QKeyEvent; + break; + + case Event_FocusIn: + case Event_FocusOut: + sipClass = sipClass_QFocusEvent; + break; + + case Event_Paint: + sipClass = sipClass_QPaintEvent; + break; + + case Event_Move: + sipClass = sipClass_QMoveEvent; + break; + + case Event_Resize: + sipClass = sipClass_QResizeEvent; + break; + + case Event_Close: + sipClass = sipClass_QCloseEvent; + break; + + case Event_Show: + sipClass = sipClass_QShowEvent; + break; + + case Event_Hide: + sipClass = sipClass_QHideEvent; + break; + + case Event_DragMove: + sipClass = sipClass_QDragMoveEvent; + break; + + case Event_DragEnter: + sipClass = sipClass_QDragEnterEvent; + break; + + case Event_DragLeave: + sipClass = sipClass_QDragLeaveEvent; + break; + + case Event_Drop: + sipClass = sipClass_QDropEvent; + break; + + case Event_ChildInserted: + case Event_ChildRemoved: + sipClass = sipClass_QChildEvent; + break; + + default: + sipClass = NULL; + } +%End +}; + +%End + +%If (Qt_2_00 -) + +class QEvent : Qt +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + enum Type + { + None, + Timer, + MouseButtonPress, + MouseButtonRelease, + MouseButtonDblClick, + MouseMove, + KeyPress, + KeyRelease, + FocusIn, + FocusOut, + Enter, + Leave, + Paint, + Move, + Resize, + Create, + Destroy, + Show, + Hide, + Close, + Quit, +%If (Qt_2_1_0 -) + Reparent, + ShowMinimized, + ShowNormal, + WindowActivate, + WindowDeactivate, + ShowToParent, + HideToParent, + ShowMaximized, +%End +%If (Qt_3_0_0 -) + ShowFullScreen, +%End + Accel, + Wheel, + AccelAvailable, +%If (Qt_2_1_0 -) + CaptionChange, + IconChange, + ParentFontChange, + ApplicationFontChange, + ParentPaletteChange, + ApplicationPaletteChange, +%End +%If (Qt_3_0_0 -) + PaletteChange, +%End + Clipboard, +%If (Qt_2_2_0 -) + Speech, +%End + SockAct, +%If (Qt_2_2_0 -) + AccelOverride, +%End +%If (Qt_3_0_0 -) + DeferredDelete, +%End + DragEnter, + DragMove, + DragLeave, + Drop, + DragResponse, + ChildInserted, + ChildRemoved, + LayoutHint, +%If (Qt_2_2_0 -) + ShowWindowRequest, +%End +%If (Qt_3_3_0 -) + WindowBlocked, + WindowUnblocked, +%End + ActivateControl, + DeactivateControl, +%If (Qt_2_1_0 - Qt_2_2_0) + Configure, + ConfigureLayout, +%End +%If (Qt_3_0_0 -) + ContextMenu, + IMStart, + IMCompose, + IMEnd, + Accessibility, +%End +%If (Qt_3_0_0 - Qt_3_1_0) + Tablet, +%End +%If (Qt_3_1_0 -) + TabletMove, + LocaleChange, + LanguageChange, + LayoutDirectionChange, + Style, + TabletPress, + TabletRelease, +%End +%If (Qt_3_3_0 -) + OkRequest, + HelpRequest, + IconDrag, + WindowStateChange, +%End + User, +%If (Qt_3_0_0 -) + MaxUser, +%End + }; + + QEvent(Type); + QEvent(QEvent&); + virtual ~QEvent(); + + Type type() const; +%If (Qt_3_0_0 -) + bool spontaneous() const; +%End + +%ConvertToSubClassCode + switch (sipCpp -> type()) + { + case QEvent::Timer: + sipClass = sipClass_QTimerEvent; + break; + + case QEvent::MouseButtonPress: + case QEvent::MouseButtonRelease: + case QEvent::MouseButtonDblClick: + case QEvent::MouseMove: + sipClass = sipClass_QMouseEvent; + break; + + case QEvent::Accel: +#if QT_VERSION >= 220 + case QEvent::AccelOverride: +#endif + case QEvent::KeyPress: + case QEvent::KeyRelease: + sipClass = sipClass_QKeyEvent; + break; + + case QEvent::FocusIn: + case QEvent::FocusOut: + sipClass = sipClass_QFocusEvent; + break; + + case QEvent::Paint: + sipClass = sipClass_QPaintEvent; + break; + + case QEvent::Move: + sipClass = sipClass_QMoveEvent; + break; + + case QEvent::Resize: + sipClass = sipClass_QResizeEvent; + break; + + case QEvent::Close: + sipClass = sipClass_QCloseEvent; + break; + +#if QT_VERSION >= 0x030300 + case QEvent::IconDrag: + sipClass = sipClass_QIconDragEvent; + break; +#endif + + case QEvent::Wheel: + sipClass = sipClass_QWheelEvent; + break; + + case QEvent::Show: + sipClass = sipClass_QShowEvent; + break; + + case QEvent::Hide: + sipClass = sipClass_QHideEvent; + break; + +#if defined(SIP_FEATURE_Qt_DRAGANDDROP) + case QEvent::DragMove: + sipClass = sipClass_QDragMoveEvent; + break; + + case QEvent::DragEnter: + sipClass = sipClass_QDragEnterEvent; + break; + + case QEvent::DragLeave: + sipClass = sipClass_QDragLeaveEvent; + break; + + case QEvent::Drop: + sipClass = sipClass_QDropEvent; + break; +#endif + + case QEvent::ChildInserted: + case QEvent::ChildRemoved: + sipClass = sipClass_QChildEvent; + break; + +#if QT_VERSION >= 0x030000 + case QEvent::ContextMenu: + sipClass = sipClass_QContextMenuEvent; + break; + + case QEvent::IMStart: + case QEvent::IMEnd: + sipClass = sipClass_QIMEvent; + break; +#endif + +#if QT_VERSION >= 0x030000 && QT_VERSION < 0x030100 + case QEvent::IMCompose: + sipClass = sipClass_QIMEvent; + break; + + case QEvent::Tablet: + sipClass = sipClass_QTabletEvent; + break; +#endif + +#if QT_VERSION >= 0x030100 + case QEvent::IMCompose: + sipClass = sipClass_QIMComposeEvent; + break; + + case QEvent::TabletMove: + case QEvent::TabletPress: + case QEvent::TabletRelease: + sipClass = sipClass_QTabletEvent; + break; +#endif + + default: + sipClass = (sipCpp -> type() < QEvent::User ? + sipClass_QEvent : + sipClass_QCustomEvent); + } +%End +}; + +%End + + +class QTimerEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QTimerEvent(int); + + int timerId() const; +}; + + +class QMouseEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QMouseEvent(int,const QPoint &,int,int); + QMouseEvent(int,const QPoint &,const QPoint &,int,int); +%End +%If (Qt_2_00 -) + QMouseEvent(Type,const QPoint &,int,int); + QMouseEvent(Type,const QPoint &,const QPoint &,int,int); +%End + + const QPoint &pos() const; + const QPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; +%If (- Qt_2_00) + int button() const; + int state() const; +%End +%If (Qt_2_00 -) + ButtonState button() const; + ButtonState state() const; + ButtonState stateAfter() const; +%End +%If (Qt_3_0_0 -) + bool isAccepted() const; + void accept(); + void ignore(); +%End +}; + + +%If (Qt_2_00 -) + +class QWheelEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_3_0_0) + QWheelEvent(const QPoint &,int,int); + QWheelEvent(const QPoint &,const QPoint &,int,int); +%End +%If (Qt_3_0_0 -) + QWheelEvent(const QPoint &,int,int,Orientation = Vertical); + QWheelEvent(const QPoint &,const QPoint &,int,int, + Orientation = Vertical); +%End + + int delta() const; + const QPoint &pos() const; + const QPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; + ButtonState state() const; +%If (Qt_3_0_0 -) + Orientation orientation() const; +%End + bool isAccepted() const; + void accept(); + void ignore(); +}; + +%End + + +%If (Qt_3_0_0 -) + +class QTabletEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + enum TabletDevice { + NoDevice, + Puck, + Stylus, + Eraser + }; + +%If (- Qt_3_1_0) + QTabletEvent(const QPoint &,int,int,int,int,const QPair<int,int> &); +%End +%If (Qt_3_1_0 -) + QTabletEvent(Type,const QPoint &,const QPoint &,int,int,int,int, + const QPair<int,int> &); +%End + QTabletEvent(const QPoint &,const QPoint &,int,int,int,int, + const QPair<int,int> &); + + int pressure() const; + int xTilt() const; + int yTilt() const; + const QPoint &pos() const; + const QPoint &globalPos() const; + int x() const; + int y() const; + int globalX() const; + int globalY() const; + TabletDevice device() const; + int isAccepted() const; + void accept(); + void ignore(); + QPair<int,int> uniqueId(); +}; + +%End + + +class QKeyEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QKeyEvent(int,int,int,int); +%End +%If (Qt_2_00 -) + QKeyEvent(Type,int,int,int,const QString & = QString::null,bool = 0, + ushort = 1); +%End + + int key() const; + int ascii() const; + bool isAccepted() const; + void accept(); + void ignore(); + +%If (- Qt_2_00) + int state() const; +%End + +%If (Qt_2_00 -) + ButtonState state() const; + ButtonState stateAfter() const; + QString text() const; + bool isAutoRepeat() const; + int count() const; +%End +}; + + +class QFocusEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QFocusEvent(int); +%End +%If (Qt_2_00 -) + QFocusEvent(Type); +%End + + bool gotFocus() const; + bool lostFocus() const; + +%If (Qt_2_1_0 -) +%If (- Qt_3_0_0) + enum Reason { + Mouse, + Tab, + ActiveWindow, + Popup, + Shortcut, + Other + }; +%End +%If (Qt_3_0_0 -) + enum Reason { + Mouse, + Tab, + Backtab, + ActiveWindow, + Popup, + Shortcut, + Other + }; +%End + + static Reason reason(); + static void setReason(Reason); + static void resetReason(); +%End +}; + + +class QPaintEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QPaintEvent(const QRect &); +%End +%If (Qt_2_00 -) + QPaintEvent(const QRegion &,bool = 1); + QPaintEvent(const QRect &,bool = 1); +%End +%If (Qt_3_3_0 -) + QPaintEvent(const QRegion &,const QRect &,bool = 1); +%End + + const QRect &rect() const; +%If (Qt_2_00 -) + const QRegion ®ion() const; + bool erased() const; +%End +}; + + +class QMoveEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QMoveEvent(const QPoint &,const QPoint &); + + const QPoint &pos() const; + const QPoint &oldPos() const; +}; + + +class QResizeEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QResizeEvent(const QSize &,const QSize &); + + const QSize &size() const; + const QSize &oldSize() const; +}; + + +class QCloseEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QCloseEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + + +%If (Qt_3_3_0 -) + +class QIconDragEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QIconDragEvent(); + + bool isAccepted() const; + void accept(); + void ignore(); +}; + +%End + + +class QShowEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_3_0_0) + QShowEvent(bool); + + bool spontaneous() const; +%End +%If (Qt_3_0_0 -) + QShowEvent(); +%End +}; + + +class QHideEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_3_0_0) + QHideEvent(bool); + + bool spontaneous() const; +%End +%If (Qt_3_0_0 -) + QHideEvent(); +%End +}; + + +%If (Qt_3_0_0 -) + +class QContextMenuEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + enum Reason { + Mouse, + Keyboard, + Other + }; + + QContextMenuEvent(Reason,const QPoint &,const QPoint &,int); + QContextMenuEvent(Reason,const QPoint &,int); + + int x() const; + int y() const; + int globalX() const; + int globalY() const; + + const QPoint &pos() const; + const QPoint &globalPos() const; + + ButtonState state() const; + bool isAccepted() const; + bool isConsumed() const; + void consume(); + void accept(); + void ignore(); + Reason reason() const; +}; + +%End + + +%If (Qt_3_0_0 -) + +class QIMEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QIMEvent(Type,const QString &,int); + + const QString &text() const; + int cursorPos() const; + bool isAccepted() const; + void accept(); + void ignore(); +%If (Qt_3_1_0 -) + int selectionLength() const; +%End +}; + +%End + + +%If (Qt_3_1_0 -) + +class QIMComposeEvent : QIMEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QIMComposeEvent(Type,const QString &,int,int); +}; + +%End + + +%If (- Qt_2_00) + +class QDropEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDropEvent(const QPoint &); + + const QPoint &pos() const; + bool isAccepted() const; + void accept(); + void ignore(); + QByteArray data(const char *); +}; + +%End + + +%If (Qt_2_00 -) +%If (Qt_DRAGANDDROP) + +class QDropEvent : QEvent, QMimeSource +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDropEvent(const QPoint &,Type = Drop); + + const QPoint &pos() const; + bool isAccepted() const; + void accept(bool = 1); + void ignore(); + bool isActionAccepted() const; + void acceptAction(bool = 1); + + enum Action + { + Copy, + Link, + Move, + Private, + UserAction = 100 + }; + + void setAction(Action); + Action action() const; + QWidget *source() const; + const char *format(int = 0) const; + QByteArray encodedData(const char *) const; + bool provides(const char *) const; + QByteArray data(const char *) const; + void setPoint(const QPoint &); +}; + +%End +%End + + +%If (- Qt_2_00) + +class QDragMoveEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDragMoveEvent(const QPoint &); + + const QPoint &pos() const; + bool isAccepted() const; + void accept(); + void ignore(); + void accept(const QRect &); + void ignore(const QRect &); + QRect answerRect() const; + const char *format(int = 0); + bool provides(const char *); + QByteArray data(const char *); + +protected: + QDragMoveEvent(const QPoint &,int); +}; + +%End + + +%If (Qt_DRAGANDDROP) +%If (Qt_2_00 -) + +class QDragMoveEvent : QDropEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDragMoveEvent(const QPoint &,Type = DragMove); + + QRect answerRect() const; + void accept(bool = 1); + void accept(const QRect &); + void ignore(const QRect &); + void ignore(); +}; + +%End + + +class QDragEnterEvent : QDragMoveEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDragEnterEvent(const QPoint &); +}; + + +class QDragLeaveEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: + QDragLeaveEvent(); +}; + +%End + + +class QChildEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QChildEvent(int,QWidget *); +%End +%If (Qt_2_00 -) + QChildEvent(Type,QObject *); +%End + +%If (- Qt_2_00) + QWidget *child() const; +%End +%If (Qt_2_00 -) + QObject *child() const; +%End + bool inserted() const; + bool removed() const; +}; + + +class QCustomEvent : QEvent +{ +%TypeHeaderCode +#include <qevent.h> +%End + +public: +%If (- Qt_2_00) + QCustomEvent(int,SIP_PYOBJECT /Transfer/); +%End +%If (Qt_2_00 -) + QCustomEvent(Type,SIP_PYOBJECT /Transfer/); +%End +%If (Qt_2_1_0 -) + QCustomEvent(int); +%End + ~QCustomEvent(); +%VirtualCatcherCode + // We need to garbage collect any current data. + + PyObject *old = reinterpret_cast<PyObject *>(data()); + + SIP_BLOCK_THREADS + Py_XDECREF(old); + SIP_UNBLOCK_THREADS +%End + + SIP_PYOBJECT data() const; +%MethodCode + // We need to cast the result. + + sipRes = reinterpret_cast<PyObject *>(sipCpp -> QCustomEvent::data()); + + // In case the event has been created from C++ code. + if (!sipRes) + sipRes = Py_None; + + Py_INCREF(sipRes); +%End + +%If (Qt_2_1_0 -) + void setData(SIP_PYOBJECT /Transfer/); +%MethodCode + // We need to garbage collect any current data. + + PyObject *old = reinterpret_cast<PyObject *>(sipCpp -> QCustomEvent::data()); + sipCpp -> QCustomEvent::setData(a0); + + Py_XDECREF(old); +%End +%End + +%GCTraverseCode + // Support the Python garbage collector. Although it's not obviously + // documented, we can't release the GIL in traverse code. + + PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> QCustomEvent::data()); + + if (obj) + sipRes = sipVisit(obj, sipArg); + else + sipRes = 0; +%End + +%GCClearCode + // Support the Python garbage collector. + + PyObject *obj = reinterpret_cast<PyObject *>(sipCpp -> QCustomEvent::data()); + + sipCpp -> QCustomEvent::setData(0); + + Py_XDECREF(obj); + + sipRes = 0; +%End +}; diff --git a/python/pyqt/sip/qt/qeventloop.sip b/python/pyqt/sip/qt/qeventloop.sip new file mode 100644 index 00000000..22d7a2cd --- /dev/null +++ b/python/pyqt/sip/qt/qeventloop.sip @@ -0,0 +1,89 @@ +// This is the SIP interface definition for QEventLoop. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QEventLoop (Qt v3.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>exec_loop</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_1_0 -) + +class QEventLoop : QObject +{ +%TypeHeaderCode +#include <qeventloop.h> +%End + +public: + QEventLoop(QObject * /TransferThis/ = 0,const char * = 0); + + enum ProcessEvents { + AllEvents, + ExcludeUserInput, + ExcludeSocketNotifiers, + WaitForMore + }; + + typedef uint ProcessEventsFlags; + + void processEvents(ProcessEventsFlags,int) /ReleaseGIL/; + virtual bool processEvents(ProcessEventsFlags) /ReleaseGIL/; + + virtual bool hasPendingEvents() const; + + virtual void registerSocketNotifier(QSocketNotifier *); + virtual void unregisterSocketNotifier(QSocketNotifier *); +%If (Qt_3_1_1 -) + // These were present in the X11 version of Qt v3.1.0 but didn't make + // it to the Windows version until Qt v3.1.1. + void setSocketNotifierPending(QSocketNotifier *); + int activateSocketNotifiers(); + + int activateTimers(); + int timeToWait() const; +%End + + virtual int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; + virtual void exit(int = 0); + + virtual int enterLoop(); + virtual void exitLoop(); + virtual int loopLevel() const; + + virtual void wakeUp(); + +signals: + void awake(); + void aboutToBlock(); +}; + +%End diff --git a/python/pyqt/sip/qt/qfile.sip b/python/pyqt/sip/qt/qfile.sip new file mode 100644 index 00000000..f87685c7 --- /dev/null +++ b/python/pyqt/sip/qt/qfile.sip @@ -0,0 +1,310 @@ +// This is the SIP interface definition for QFile. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFile</Title> +<FuncSynopsis> + <FuncDef>bool <Function>open</Function></FuncDef> + <ParamDef>int <Parameter>m</Parameter></ParamDef> + <ParamDef>FILE *<Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readLine</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setDecodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>setEncodingFunction</Function></FuncDef> + <ParamDef>EncoderFn <Parameter>f</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +class QFile : QIODevice +{ +%TypeHeaderCode +#include <qfile.h> +%End + +public: + QFile(); +%If (- Qt_2_00) + QFile(const char *); +%End +%If (Qt_2_00 -) + QFile(const QString &); +%End + +%If (- Qt_2_00) + const char *name() const; + void setName(const char *); +%End +%If (Qt_2_00 -) + QString name() const; + void setName(const QString &); +%End + +%If (Qt_2_00 -) + static QCString encodeName(const QString &); + static QString decodeName(const QCString &); +// static void setEncodingFunction(EncoderFn); +// static void setDecodingFunction(DecoderFn); +%End + + bool exists() const; +%If (- Qt_2_00) + static bool exists(const char *); +%End +%If (Qt_2_00 -) + static bool exists(const QString &); +%End + + bool remove(); +%If (- Qt_2_00) + static bool remove(const char *); +%End +%If (Qt_2_00 -) + static bool remove(const QString &); +%End + + bool open(int) /ReleaseGIL/; +// bool open(int,FILE *) /ReleaseGIL/; + bool open(int,int) /ReleaseGIL/; + void close(); + void flush() /ReleaseGIL/; + +%If (- Qt_3_0_0) + uint size() const; + int at() const; + bool at(int); +%End +%If (Qt_3_0_0 -) + Offset size() const; + Offset at() const; + bool at(Offset); +%End + bool atEnd() const; + +%If (- Qt_3_0_0) + SIP_PYOBJECT readBlock(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QFile::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + int writeBlock(const char * /Array/,uint /ArraySize/) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + SIP_PYOBJECT readBlock(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QFile::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + + Q_LONG writeBlock(const char * /Array/, + Q_ULONG /ArraySize/) /ReleaseGIL/; +%End +%If (Qt_2_00 - Qt_3_0_0) + int writeBlock(const QByteArray &) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + Q_LONG writeBlock(const QByteArray &) /ReleaseGIL/; +%End + +%If (- Qt_3_0_0) + SIP_PYOBJECT readLine(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QFile::readLine(buf,a0) : sipCpp -> readLine(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%End +%If (Qt_3_0_0 -) + SIP_PYOBJECT readLine(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QFile::readLine(buf,a0) : sipCpp -> readLine(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%End + +%If (Qt_2_00 - Qt_3_0_0) + int readLine(QString &,uint) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + Q_LONG readLine(QString &,Q_ULONG) /ReleaseGIL/; +%End + + int getch(); + int putch(int); + int ungetch(int); + + int handle() const; + +%If (Qt_3_2_0 -) + QString errorString() const; +%End + +protected: +%If (Qt_3_2_0 -) + void setErrorString(const QString &); +%End + +private: + QFile(const QFile &); +}; diff --git a/python/pyqt/sip/qt/qfiledialog.sip b/python/pyqt/sip/qt/qfiledialog.sip new file mode 100644 index 00000000..611387a3 --- /dev/null +++ b/python/pyqt/sip/qt/qfiledialog.sip @@ -0,0 +1,361 @@ +// This is the SIP interface definition for QFileDialog, QFileIconProvider and +// QFilePreview. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFileDialog</Title> +<Para> +<Literal>QFileDialog</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFileIconProvider</Title> +<Para> +<Literal>QFileIconProvider</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QFilePreview</Title> +<Para> +<Literal>QFilePreview</Literal> is fully implemented. However it cannot be +used from Python in the same way as it is used from C++ because PyQt does not +support multiple inheritance involving more than one wrapped class. A trick +that seems to work is to use composition rather than inheritance as in the +following code fragment. +</Para> +<ProgramListing> +class FilePreview(QFilePreview): + pass + +class Preview(QLabel): + def __init__(self, parent=None): + QLabel.__init__(self, parent) + self.preview = FilePreview() + self.preview.previewUrl = self.previewUrl +</ProgramListing> +<Para> +Note that QFilePreview cannot be instantiated directly because it is abstract. +Thanks to Hans-Peter Jansen for this trick. +</Para> +</Sect2> +%End + + +%If (Qt_FILEDIALOG) + +class QFileIconProvider : QObject +{ +%TypeHeaderCode +#include <qfiledialog.h> +%End + +public: + QFileIconProvider(QObject * /TransferThis/ = 0,const char * = 0); + + virtual const QPixmap *pixmap(const QFileInfo &); + +private: +%If (Qt_2_1_0 -) + QFileIconProvider(const QFileIconProvider &); +%End +}; + + +%If (Qt_2_1_0 -) +class QFilePreview +{ +%TypeHeaderCode +#include <qfiledialog.h> +%End + +public: + QFilePreview(); + + virtual void previewUrl(const QUrl &) = 0; +}; +%End + + +class QFileDialog : QDialog +{ +%TypeHeaderCode +#include <qfiledialog.h> +%End + +public: +%If (- Qt_2_00) + QFileDialog(const char *,const char * = 0,QWidget * /TransferThis/ = 0, + const char * = 0,bool = 0); +%End +%If (Qt_2_00 -) + QFileDialog(const QString &,const QString & = QString::null, + QWidget * /TransferThis/ = 0,const char * = 0,bool = 0); +%End + QFileDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0); + +%If (- Qt_2_00) + static QString getOpenFileName(const char * = 0,const char * = 0, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QString getSaveFileName(const char * = 0,const char * = 0, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QString getExistingDirectory(const char * = 0,QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QStrList getOpenFileNames(const char * = 0,const char * = 0, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; +%End +%If (Qt_2_00 - Qt_3_0_0) + static QString getOpenFileName(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QString getSaveFileName(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QString getExistingDirectory(const QString & = QString::null, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; + static QStringList getOpenFileNames(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0, + const char * = 0) /ReleaseGIL/; +%End +%If (Qt_2_1_0 - Qt_3_0_0) + static QString getOpenFileName(const QString &,const QString &, + QWidget *,const char *, + const QString &) /ReleaseGIL/; + static QString getSaveFileName(const QString &,const QString &, + QWidget *,const char *, + const QString &) /ReleaseGIL/; + static QString getExistingDirectory(const QString &,QWidget *, + const char *, + const QString &) /ReleaseGIL/; + static QStringList getOpenFileNames(const QString &,const QString &, + QWidget *,const char *, + const QString &) /ReleaseGIL/; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + static QString getExistingDirectory(const QString &,QWidget *, + const char *, + const QString &,bool) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + static QString getOpenFileName(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0,const char * = 0, + const QString & = QString::null, + QString * = 0,bool = 1) /ReleaseGIL/; + + static QString getSaveFileName(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0,const char * = 0, + const QString & = QString::null, + QString * = 0,bool = 1) /ReleaseGIL/; + + static QString getExistingDirectory(const QString & = QString::null, + QWidget * = 0,const char * = 0, + const QString & = QString::null, + bool = 1,bool = 1) /ReleaseGIL/; + + static QStringList getOpenFileNames(const QString & = QString::null, + const QString & = QString::null, + QWidget * = 0,const char * = 0, + const QString & = QString::null, + QString * = 0, + bool = 1) /ReleaseGIL/; + +%End + + static void setIconProvider(QFileIconProvider *); + static QFileIconProvider *iconProvider(); + + QString selectedFile() const; +%If (Qt_2_1_0 -) + QString selectedFilter() const; +%End +%If (Qt_3_0_0 -) + virtual void setSelectedFilter(const QString &); + virtual void setSelectedFilter(int); +%End + +%If (- Qt_2_00) + void setSelection(const char *); +%End +%If (Qt_2_00 -) + void setSelection(const QString &); +%End + +%If (Qt_2_1_0 -) + void selectAll(bool); + + QStringList selectedFiles() const; +%End + +%If (- Qt_2_00) + const char *dirPath() const; +%End +%If (Qt_2_00 -) + QString dirPath() const; +%End + + void setDir(const QDir &); + const QDir* dir() const; + +%If (Qt_2_1_0 -) + void setShowHiddenFiles(bool); + bool showHiddenFiles() const; +%End + + void rereadDir() /ReleaseGIL/; +%If (Qt_2_1_0 -) + void resortDir(); +%End + +%If (- Qt_2_2_0) + enum Mode { + AnyFile, + ExistingFile, + Directory, + ExistingFiles + }; +%End +%If (Qt_2_2_0 -) + enum Mode { + AnyFile, + ExistingFile, + Directory, + ExistingFiles, + DirectoryOnly + }; +%End + + void setMode(Mode); + Mode mode() const; + +%If (Qt_2_1_0 -) + enum ViewMode { + Detail, + List + }; + + enum PreviewMode { + NoPreview, + Contents, + Info + }; + + void setViewMode(ViewMode); + ViewMode viewMode() const; + void setPreviewMode(PreviewMode); + PreviewMode previewMode() const; +%End + + bool eventFilter(QObject *,QEvent *); + +%If (Qt_2_1_0 -) + bool isInfoPreviewEnabled() const; + bool isContentsPreviewEnabled() const; + void setInfoPreviewEnabled(bool); + void setContentsPreviewEnabled(bool); + + void setInfoPreview(QWidget *,QFilePreview *); + void setContentsPreview(QWidget *,QFilePreview *); + + QUrl url() const; +%End + +%If (Qt_3_0_0 -) + void addFilter(const QString &); +%End + +public slots: +%If (Qt_2_2_0 -) + void done(int); +%End +%If (- Qt_2_00) + void setDir(const char *); +%End +%If (Qt_2_00 -) + void setDir(const QString &); +%End +%If (Qt_2_1_0 -) + void setUrl(const QUrlOperator &); +%End +%If (- Qt_2_00) + void setFilter(const char *); +%End +%If (Qt_2_00 -) + void setFilter(const QString &); +%End +%If (Qt_2_1_0 -) + void setFilters(const QString &); +%End +// void setFilters(const char **); +%If (- Qt_2_00) + void setFilters(const QStrList &); +%End +%If (Qt_2_00 -) + void setFilters(const QStringList &); +%End + +signals: +%If (- Qt_2_00) + void fileHighlighted(const char *); + void fileSelected(const char *); + void dirEntered(const char *); +%End +%If (Qt_2_00 -) + void fileHighlighted(const QString &); + void fileSelected(const QString &); +%End +%If (Qt_3_0_0 -) + void filesSelected(const QStringList &); +%End +%If (Qt_2_00 -) + void dirEntered(const QString &); +%End +%If (Qt_3_0_0 -) + void filterSelected(const QString &); +%End + +protected: + void resizeEvent(QResizeEvent *); + void keyPressEvent(QKeyEvent *); + + void addWidgets(QLabel *,QWidget *,QPushButton *); +%If (Qt_2_1_0 -) + void addToolButton(QButton *,bool = 0); + void addLeftWidget(QWidget *); + void addRightWidget(QWidget *); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void addFilter(const QString &); +%End + +private: + QFileDialog(const QFileDialog &); +}; + +%End diff --git a/python/pyqt/sip/qt/qfileinfo.sip b/python/pyqt/sip/qt/qfileinfo.sip new file mode 100644 index 00000000..3755e317 --- /dev/null +++ b/python/pyqt/sip/qt/qfileinfo.sip @@ -0,0 +1,145 @@ +// This is the SIP interface definition for QFileInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFileInfo</Title> +<Para> +<Literal>QFileInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QFileInfo +{ +%TypeHeaderCode +#include <qfileinfo.h> +%End + +public: + enum PermissionSpec { +%If (Qt_3_2_0 -) + ReadOwner, WriteOwner, ExeOwner, +%End + ReadUser, WriteUser, ExeUser, + ReadGroup, WriteGroup, ExeGroup, + ReadOther, WriteOther, ExeOther + }; + + QFileInfo(); +%If (- Qt_2_00) + QFileInfo(const char *); +%End +%If (Qt_2_00 -) + QFileInfo(const QString &); +%End + QFileInfo(const QFile &); +%If (- Qt_2_00) + QFileInfo(const QDir &,const char *); +%End +%If (Qt_2_00 -) + QFileInfo(const QDir &,const QString &); +%End + QFileInfo(const QFileInfo &); + +%If (- Qt_2_00) + void setFile(const char *); +%End +%If (Qt_2_00 -) + void setFile(const QString &); +%End + void setFile(const QFile &); +%If (- Qt_2_00) + void setFile(const QDir &,const char *); +%End +%If (Qt_2_00 -) + void setFile(const QDir &,const QString &); +%End + bool exists() const; + void refresh() const; + bool caching() const; + void setCaching(bool); + +%If (- Qt_2_00) + const char *filePath() const; +%End +%If (Qt_2_00 -) + const QString filePath() const; +%End + QString fileName() const; + QString absFilePath() const; +%If (- Qt_3_0_0) + QString baseName() const; +%End +%If (Qt_3_0_0 -) + QString baseName(bool = 1) const; +%End +%If (- Qt_2_00) + QString extension() const; +%End +%If (Qt_2_00 -) + QString extension(bool = 1) const; +%End + + QString dirPath(bool = 0) const; + QDir dir(bool = 0) const; + bool isReadable() const; + bool isWritable() const; + bool isExecutable() const; +%If (Qt_3_1_0 -) + bool isHidden() const; +%End + + bool isRelative() const; + bool convertToAbs(); + + bool isFile() const; + bool isDir() const; + bool isSymLink() const; + + QString readLink() const /ReleaseGIL/; + +%If (- Qt_2_00) + const char *owner() const; +%End +%If (Qt_2_00 -) + QString owner() const; +%End + uint ownerId() const; +%If (- Qt_2_00) + const char *group() const; +%End +%If (Qt_2_00 -) + QString group() const; +%End + uint groupId() const; + + bool permission(int) const; + + uint size() const; + +%If (Qt_3_0_0 -) + QDateTime created() const; +%End + QDateTime lastModified() const; + QDateTime lastRead() const; +}; diff --git a/python/pyqt/sip/qt/qfont.sip b/python/pyqt/sip/qt/qfont.sip new file mode 100644 index 00000000..b2abfd40 --- /dev/null +++ b/python/pyqt/sip/qt/qfont.sip @@ -0,0 +1,441 @@ +// This is the SIP interface definition for QFont. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFont</Title> +<Para> +<Literal>QFont</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class QFont +{ +%TypeHeaderCode +#include <qfont.h> +%End + +public: +%If (- Qt_2_00) + enum CharSet { + Latin1, ISO_8859_1 = Latin1, AnyCharSet, + Latin2, ISO_8859_2 = Latin2, + Latin3, ISO_8859_3 = Latin3, + Latin4, ISO_8859_4 = Latin4, + Latin5, ISO_8859_5 = Latin5, + Latin6, ISO_8859_6 = Latin6, + Latin7, ISO_8859_7 = Latin7, + Latin8, ISO_8859_8 = Latin8, + Latin9, ISO_8859_9 = Latin9, + KOI8R + }; +%End +%If (Qt_2_00 - Qt_2_1_0) + enum CharSet { + ISO_8859_1, Latin1 = ISO_8859_1, AnyCharSet, + ISO_8859_2, Latin2 = ISO_8859_2, + ISO_8859_3, Latin3 = ISO_8859_3, + ISO_8859_4, Latin4 = ISO_8859_4, + ISO_8859_5, + ISO_8859_6, + ISO_8859_7, + ISO_8859_8, + ISO_8859_9, Latin5 = ISO_8859_9, + ISO_8859_10, Latin6 = ISO_8859_10, + ISO_8859_11, + ISO_8859_12, + ISO_8859_13, Latin7 = ISO_8859_13, + ISO_8859_14, Latin8 = ISO_8859_14, + ISO_8859_15, Latin9 = ISO_8859_15, + KOI8R, + Set_Ja, Set_1 = Set_Ja, + Set_Ko, + Set_Th_TH, + Set_Zh, + Set_Zh_TW, Set_N = Set_Zh_TW, + Unicode + }; +%End +%If (Qt_2_1_0 - Qt_2_2_0) + enum CharSet { + ISO_8859_1, Latin1 = ISO_8859_1, AnyCharSet, + ISO_8859_2, Latin2 = ISO_8859_2, + ISO_8859_3, Latin3 = ISO_8859_3, + ISO_8859_4, Latin4 = ISO_8859_4, + ISO_8859_5, + ISO_8859_6, + ISO_8859_7, + ISO_8859_8, + ISO_8859_9, Latin5 = ISO_8859_9, + ISO_8859_10, Latin6 = ISO_8859_10, + ISO_8859_11, + ISO_8859_12, + ISO_8859_13, Latin7 = ISO_8859_13, + ISO_8859_14, Latin8 = ISO_8859_14, + ISO_8859_15, Latin9 = ISO_8859_15, + KOI8R, + Set_Ja, Set_1 = Set_Ja, + Set_Ko, + Set_Th_TH, + Set_Zh, + Set_Zh_TW, Set_N = Set_Zh_TW, + Unicode, + Set_GBK, + Set_Big5 + }; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + enum CharSet { + ISO_8859_1, Latin1 = ISO_8859_1, AnyCharSet, + ISO_8859_2, Latin2 = ISO_8859_2, + ISO_8859_3, Latin3 = ISO_8859_3, + ISO_8859_4, Latin4 = ISO_8859_4, + ISO_8859_5, + ISO_8859_6, + ISO_8859_7, + ISO_8859_8, + ISO_8859_9, Latin5 = ISO_8859_9, + ISO_8859_10, Latin6 = ISO_8859_10, + ISO_8859_11, + ISO_8859_12, + ISO_8859_13, Latin7 = ISO_8859_13, + ISO_8859_14, Latin8 = ISO_8859_14, + ISO_8859_15, Latin9 = ISO_8859_15, + KOI8R, + Set_Ja, Set_1 = Set_Ja, + Set_Ko, + Set_Th_TH, + Set_Zh, + Set_Zh_TW, Set_N = Set_Zh_TW, + Unicode, + Set_GBK, + Set_Big5, + JIS_X_0201 = 0xa0, + JIS_X_0208 = 0xc0, Enc16 = JIS_X_0208, + KSC_5601, + GB_2312, + Big5, + TSCII + }; +%End + + enum StyleHint { + Helvetica, + Times, + Courier, + OldEnglish, + System, + AnyStyle, + SansSerif, + Serif, + TypeWriter, + Decorative + }; + +%If (Qt_2_2_0 -) + enum StyleStrategy { + PreferDefault, + PreferBitmap, + PreferDevice, + PreferOutline, + ForceOutline, + PreferMatch, + PreferQuality, +%If (Qt_3_0_0 -) + PreferAntialias, + NoAntialias, +%End +%If (Qt_3_2_0 -) + OpenGLCompatible, +%End + }; +%End + + enum Weight { + Light, + Normal, + DemiBold, + Bold, + Black + }; + +%If (Qt_3_2_0 -) + enum Stretch { + UltraCondensed, + ExtraCondensed, + Condensed, + SemiCondensed, + Unstretched, + SemiExpanded, + Expanded, + ExtraExpanded, + UltraExpanded + }; +%End + + QFont(); +%If (- Qt_2_00) + QFont(const char *,int = 12,int = Normal,bool = 0); + QFont(const char *,int,int,bool,CharSet); +%End +%If (Qt_2_00 - Qt_3_2_0) + QFont(const QString &,int = 12,int = Normal,bool = 0); +%End +%If (Qt_3_2_0 -) + QFont(const QString &,int = 12,int = -1,bool = 0); +%End +%If (Qt_2_00 - Qt_3_0_0) + QFont(const QString &,int,int,bool,CharSet); +%End + QFont(const QFont &); + +%If (- Qt_2_00) + const char *family() const; + void setFamily(const char *); +%End +%If (Qt_2_00 -) + QString family() const; + void setFamily(const QString &); + + float pointSizeFloat() const; + void setPointSizeFloat(float); + + int pixelSize() const; + void setPixelSize(int); + void setPixelSizeFloat(float); +%End + int pointSize() const; + void setPointSize(int); + + int weight() const; + void setWeight(int); + + bool bold() const; + void setBold(bool); + + bool italic() const; + void setItalic(bool); + + bool underline() const; + void setUnderline(bool); + +%If (Qt_3_2_0 -) + bool overline() const; + void setOverline(bool); +%End + + bool strikeOut() const; + void setStrikeOut(bool); + + bool fixedPitch() const; + void setFixedPitch(bool); + + StyleHint styleHint() const; +%If (Qt_2_2_0 -) + StyleStrategy styleStrategy() const; +%End +%If (- Qt_3_0_0) + void setStyleHint(StyleHint); +%End +%If (Qt_2_2_0 - Qt_3_0_0) + void setStyleHint(StyleHint,StyleStrategy); +%End +%If (Qt_3_0_0 -) + void setStyleHint(StyleHint,StyleStrategy = PreferDefault); + void setStyleStrategy(StyleStrategy); +%End + +%If (- Qt_3_0_0) + CharSet charSet() const; + void setCharSet(CharSet); +%End + +%If (Qt_3_2_0 -) + int stretch() const; + void setStretch(int); +%End + + bool rawMode() const; + void setRawMode(bool); + + bool exactMatch() const; + + bool operator==(const QFont &) const; + bool operator!=(const QFont &) const; + + bool isCopyOf(const QFont &) const; + +%If (- Qt_2_00) + HANDLE handle(HANDLE = 0); + const char *rawName() const; + static const QFont &defaultFont(); + static const char *substitute(const char *); + static void insertSubstitution(const char *,const char *); + static void removeSubstitution(const char *); + static void listSubstitutions(QStrList *); +%End + +%If (Qt_2_00 - Qt_3_0_0) + static CharSet charSetForLocale(); +%End + +%If (Qt_2_00 -) +%If (- Qt_3_0_0) +%If (WS_X11) + HANDLE handle() const; +%End +%End +%If (Qt_3_0_0 -) +%If (WS_X11) + Qt::HANDLE handle() const; +%End +%End + void setRawName(const QString &); + QString rawName() const; +%End + QString key() const; +%If (Qt_3_0_0 -) + QString toString() const; + bool fromString(const QString &); +%End +%If (Qt_2_00 - Qt_3_0_0) + static QString encodingName(CharSet); +%End +%If (Qt_2_00 -) + static QString substitute(const QString &); +%If (Qt_3_0_0 -) + static QStringList substitutes(const QString &); +%End + static QStringList substitutions(); + static void insertSubstitution(const QString &,const QString &); +%If (Qt_3_0_0 -) + static void insertSubstitutions(const QString &,const QStringList &); +%End + static void removeSubstitution(const QString &); +%If (- Qt_3_0_0) + static void locale_init(); +%End +%End + + static void initialize(); + static void cleanup(); + static void cacheStatistics(); + +%If (Qt_3_0_0 -) + enum Script { + Latin, + Greek, + Cyrillic, + Armenian, + Georgian, + Runic, + Ogham, + SpacingModifiers, + CombiningMarks, + + Hebrew, + Arabic, + Syriac, + Thaana, + + Devanagari, + Bengali, + Gurmukhi, + Gujarati, + Oriya, + Tamil, + Telugu, + Kannada, + Malayalam, + Sinhala, + Thai, + Lao, + Tibetan, + Myanmar, + Khmer, + + Han, + Hiragana, + Katakana, + Hangul, + Bopomofo, + Yi, + + Ethiopic, + Cherokee, + CanadianAboriginal, + Mongolian, + + CurrencySymbols, + LetterlikeSymbols, + NumberForms, + MathematicalOperators, + TechnicalSymbols, + GeometricSymbols, + MiscellaneousSymbols, + EnclosedAndSquare, + Braille, + + Unicode, + +%If (Qt_3_2_0 -) + Tagalog, + Hanunoo, + Buhid, + Tagbanwa, + + KatakanaHalfWidth, +%End + +%If (Qt_3_3_0 -) + Limbu, + TaiLe, +%End + }; + + QString defaultFamily() const; + QString lastResortFamily() const; + QString lastResortFont() const; +%End + +%If (Qt_2_00 - Qt_3_0_0) + static QFont defaultFont(); +%End +%If (- Qt_3_0_0) + static void setDefaultFont(const QFont &); +%End + +%If (Qt_3_2_0 -) + QFont resolve(const QFont &) const; +%End + +protected: + bool dirty() const; +%If (- Qt_3_0_0) + QString defaultFamily() const; + QString lastResortFamily() const; + QString lastResortFont() const; +%End + int deciPointSize() const; +}; diff --git a/python/pyqt/sip/qt/qfontdatabase.sip b/python/pyqt/sip/qt/qfontdatabase.sip new file mode 100644 index 00000000..cacecea7 --- /dev/null +++ b/python/pyqt/sip/qt/qfontdatabase.sip @@ -0,0 +1,121 @@ +// This is the SIP interface definition for QFontDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFontDatabase (Qt v2.1+)</Title> +<Para> +<Literal>QFontDatabase</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_FONTDATABASE) +%If (Qt_2_1_0 -) + +class QFontDatabase +{ +%TypeHeaderCode +#include <qfontdatabase.h> +%End + +public: + QFontDatabase(); + + static QValueList<int> standardSizes(); + +%If (- Qt_3_0_0) + QStringList charSets(const QString &,bool = 1 ) const; + QStringList families(bool = 1) const; + QStringList styles(const QString &, + const QString & = QString::null) const; + QValueList<int> pointSizes(const QString &, + const QString & = QString::null, + const QString & = QString::null); + QValueList<int> smoothSizes(const QString &,const QString &, + const QString & = QString::null); +%End +%If (Qt_3_0_0 -) + QStringList families() const; +%If (Qt_3_2_0 -) + QStringList families(QFont::Script) const; +%End + QStringList styles(const QString &) const; + QValueList<int> pointSizes(const QString &, + const QString & = QString::null); + QValueList<int> smoothSizes(const QString &,const QString &); +%End + QString styleString(const QFont &); + +%If (- Qt_3_0_0) + QFont font(const QString,const QString &,int, + const QString = QString::null); + + bool isBitmapScalable(const QString &,const QString & = QString::null, + const QString & = QString::null) const; + bool isSmoothlyScalable(const QString &, + const QString & = QString::null, + const QString & = QString::null) const; + bool isScalable(const QString &,const QString & = QString::null, + const QString & = QString::null) const; +%End +%If (Qt_3_0_0 -) + QFont font(const QString,const QString &,int); + + bool isBitmapScalable(const QString &, + const QString & = QString::null) const; + bool isSmoothlyScalable(const QString &, + const QString & = QString::null) const; + bool isScalable(const QString &,const QString & = QString::null) const; +%End +%If (Qt_2_3_0 - Qt_3_0_0) + bool isFixedPitch(const QString &,const QString & = QString::null, + const QString & = QString::null) const; +%End +%If (Qt_3_0_0 -) + bool isFixedPitch(const QString &, + const QString & = QString::null) const; +%End + +%If (- Qt_3_0_0) + bool italic(const QString &,const QString &, + const QString & = QString::null) const; + bool bold(const QString &,const QString &, + const QString & = QString::null) const; + int weight(const QString &,const QString &, + const QString & = QString::null) const; + + static QString verboseCharSetName(const QString &); + static QString charSetSample(const QString &); +%End +%If (Qt_3_0_0 -) + bool italic(const QString &,const QString &) const; + bool bold(const QString &,const QString &) const; + int weight(const QString &,const QString &) const; + + static QString scriptName(QFont::Script); + static QString scriptSample(QFont::Script); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qfontdialog.sip b/python/pyqt/sip/qt/qfontdialog.sip new file mode 100644 index 00000000..9196000e --- /dev/null +++ b/python/pyqt/sip/qt/qfontdialog.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for QFontDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFontDialog (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>static QFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>const QFont &<Parameter>def</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>def</Literal>, <Literal>parent</Literal> and +<Literal>name</Literal> parameters and returns a tuple containing the +<Literal>QFont</Literal> result and the <Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>static QFont <Function>getFont</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>parent</Literal> and <Literal>name</Literal> parameters +and returns a tuple containing the <Literal>QFont</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) +%If (Qt_FONTDIALOG) + +class QFontDialog : QDialog +{ +%TypeHeaderCode +#include <qfontdialog.h> +%End + +public: + static QFont getFont(bool *,const QFont &,QWidget * = 0, + const char * = 0); + static QFont getFont(bool *,QWidget * = 0,const char * = 0); + +signals: +%If (- Qt_3_2_0) + void fontSelected(const QFont &); + void fontHighlighted(const QFont &); +%End + +protected: +%If (- Qt_3_2_0) + bool eventFilter(QObject *,QEvent *); + + QListBox *familyListBox() const; + virtual void updateFamilies(); + + QListBox *styleListBox() const; + virtual void updateStyles(); + + QListBox *sizeListBox() const; + virtual void updateSizes(); + + QComboBox *scriptCombo() const; + virtual void updateScripts(); +%End + +protected slots: +%If (- Qt_3_2_0) + void sizeChanged(const QString &); +%End + +private: + QFontDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); +%If (Qt_2_1_0 -) + QFontDialog(const QFontDialog &); +%End + ~QFontDialog(); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qfontinfo.sip b/python/pyqt/sip/qt/qfontinfo.sip new file mode 100644 index 00000000..d58eab0f --- /dev/null +++ b/python/pyqt/sip/qt/qfontinfo.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for QFontInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFontInfo</Title> +<Para> +<Literal>QFontInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QFontInfo +{ +%TypeHeaderCode +#include <qfontinfo.h> +%End + +public: + QFontInfo(const QFont &); +%If (Qt_3_2_0 -) + QFontInfo(const QFont &,QFont::Script); +%End + QFontInfo(const QFontInfo &); + +%If (- Qt_2_00) + const char *family() const; +%End +%If (Qt_2_00 -) + QString family() const; +%End +%If (Qt_3_0_0 -) + int pixelSize() const; +%End + int pointSize() const; + bool italic() const; + int weight() const; + bool bold() const; + bool underline() const; +%If (Qt_3_2_0 -) + bool overline() const; +%End + bool strikeOut() const; + bool fixedPitch() const; + QFont::StyleHint styleHint() const; +%If (- Qt_3_0_0) + QFont::CharSet charSet() const; +%End + bool rawMode() const; + bool exactMatch() const; +}; diff --git a/python/pyqt/sip/qt/qfontmetrics.sip b/python/pyqt/sip/qt/qfontmetrics.sip new file mode 100644 index 00000000..e5059fb5 --- /dev/null +++ b/python/pyqt/sip/qt/qfontmetrics.sip @@ -0,0 +1,220 @@ +// This is the SIP interface definition for QFontMetrics. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFontMetrics</Title> +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> + +<FuncSynopsis> + <FuncDef>QSize <Function>size</Function></FuncDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>int <Parameter>tabstops</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>tabarray</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>tabarray</Literal> parameter is a Python list of integers. +</Para> +</Sect2> +%End + + +class QFontMetrics +{ +%TypeHeaderCode +#include <qfontmetrics.h> +%End + +public: + QFontMetrics(const QFont &); +%If (Qt_3_2_0 -) + QFontMetrics(const QFont &,QFont::Script); +%End + QFontMetrics(const QFontMetrics &); + + int ascent() const; + int descent() const; + int height() const; + int leading() const; + int lineSpacing() const; + int minLeftBearing() const; + int minRightBearing() const; + int maxWidth() const; +%If (- Qt_2_00) + bool inFont(char) const; + int leftBearing(char) const; + int rightBearing(char) const; + int width(const char *,int = -1) const; + int width(char) const; + QRect boundingRect(const char *,int = -1) const; + QRect boundingRect(char) const; + + QRect boundingRect(int,int,int,int,int,const char *,int = -1, + SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a8,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QRect(sipCpp -> QFontMetrics::boundingRect(a0,a1,a2,a3,a4,a5,a6,a7,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((ANY *)tabarray); + } +%End + + QSize size(int,const char *,int = -1,int = 0, + SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a4,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QSize(sipCpp -> QFontMetrics::size(a0,a1,a2,a3,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((ANY *)tabarray); + } +%End +%End +%If (Qt_2_00 -) + bool inFont(QChar) const; + int leftBearing(QChar) const; + int rightBearing(QChar) const; + int width(const QString &,int = -1) const; + int width(QChar) const; +%If (Qt_3_0_0 -) + int charWidth(const QString &,int) const; +%End + QRect boundingRect(const QString &,int = -1) const; + QRect boundingRect(QChar) const; + + QRect boundingRect(int,int,int,int,int,const QString &,int = -1, + int = 0,SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a8,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QRect(sipCpp -> QFontMetrics::boundingRect(a0,a1,a2,a3,a4,*a5,a6,a7,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((ANY *)tabarray); + } +%End + + QSize size(int,const QString &,int = -1,int = 0, + SIP_PYLIST /AllowNone/ = 0) const; +%MethodCode + int *tabarray; + + if (intListToArray(a4,&tabarray) < 0) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = new QSize(sipCpp -> QFontMetrics::size(a0,*a1,a2,a3,tabarray)); + Py_END_ALLOW_THREADS + + if (tabarray) + sipFree((ANY *)tabarray); + } +%End +%End + + int underlinePos() const; +%If (Qt_3_2_0 -) + int overlinePos() const; +%End + int strikeOutPos() const; + int lineWidth() const; + +%TypeCode +// Convert an optional Python list of integers to a zero terminated array. +// Return a negative value if there was an error. +static int intListToArray(PyObject *pl,int **ap) +{ + int i, nint, *ip; + + // The trivial case. + if (!pl || pl == Py_None) + { + *ap = 0; + return 0; + } + + nint = PyList_Size(pl); + + if ((*ap = (int *)sipMalloc((nint + 1) * sizeof (int))) == NULL) + return -1; + + // Convert the list. + PyErr_Clear(); + + ip = *ap; + + for (i = 0; i < nint; ++i) + { + *ip++ = PyInt_AsLong(PyList_GetItem(pl,i)); + + if (PyErr_Occurred()) + { + sipFree((ANY *)*ap); + return -1; + } + } + + // Terminate the list. + *ip = 0; + + return 0; +} +%End + +}; diff --git a/python/pyqt/sip/qt/qframe.sip b/python/pyqt/sip/qt/qframe.sip new file mode 100644 index 00000000..9e2a4e24 --- /dev/null +++ b/python/pyqt/sip/qt/qframe.sip @@ -0,0 +1,180 @@ +// This is the SIP interface definition for QFrame. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFrame</Title> +<Para> +<Literal>QFrame</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QFrame : QWidget +{ +%TypeHeaderCode +#include <qframe.h> +%End + +public: +%If (- Qt_3_0_0) + QFrame(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0, + bool = 1); +%End +%If (Qt_3_0_0 -) + QFrame(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + + int frameStyle() const; +%If (- Qt_2_00) + void setFrameStyle(int); +%End +%If (Qt_2_00 -) + virtual void setFrameStyle(int); +%End + + int frameWidth() const; + QRect contentsRect() const; + +%If (- Qt_2_00) + bool lineShapesOk() const; +%End + + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (- Qt_2_00) + enum { + NoFrame, + Box, + Panel, + WinPanel, + HLine, + VLine, + MShape, + Plain, + Raised, + Sunken, + MShadow + }; +%End +%If (Qt_2_00 -) + enum Shape { + NoFrame, + Box, + Panel, + WinPanel, + HLine, + VLine, + StyledPanel, + PopupPanel, +%If (Qt_3_0_0 -) + MenuBarPanel, + ToolBarPanel, +%End +%If (Qt_3_0_1 -) + LineEditPanel, + TabWidgetPanel, +%End +%If (Qt_3_1_0 -) + GroupBoxPanel, +%End + MShape + }; +%End + +%If (Qt_2_00 -) + enum Shadow { + Plain, + Raised, + Sunken, + MShadow + }; +%End + +%If (- Qt_2_00) + int frameShape() const; +%End +%If (Qt_2_00 -) + Shape frameShape() const; + void setFrameShape(Shape); +%End +%If (- Qt_2_00) + int frameShadow() const; +%End +%If (Qt_2_00 -) + Shadow frameShadow() const; + void setFrameShadow(Shadow); +%End + + int lineWidth() const; +%If (- Qt_2_00) + void setLineWidth(int); +%End +%If (Qt_2_00 -) + virtual void setLineWidth(int); +%End + + int margin() const; +%If (- Qt_2_00) + void setMargin(int); +%End +%If (Qt_2_00 -) + virtual void setMargin(int); +%End + + int midLineWidth() const; +%If (- Qt_2_00) + void setMidLineWidth(int); +%End +%If (Qt_2_00 -) + virtual void setMidLineWidth(int); +%End + + QRect frameRect() const; +%If (Qt_2_00 -) + virtual void setFrameRect(const QRect &); +%End + +protected: +%If (- Qt_2_00) + void setFrameRect(const QRect &); +%End + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + virtual void drawFrame(QPainter *); + virtual void drawContents(QPainter *); + virtual void frameChanged(); +%If (Qt_2_00 - Qt_3_0_0) + void updateMask(); + virtual void drawFrameMask(QPainter *); + virtual void drawContentsMask(QPainter *); +%End +%If (Qt_3_1_0 -) + void styleChange(QStyle &); +%End + +private: + QFrame(const QFrame &); +}; diff --git a/python/pyqt/sip/qt/qglobal.sip b/python/pyqt/sip/qt/qglobal.sip new file mode 100644 index 00000000..e2fb63a9 --- /dev/null +++ b/python/pyqt/sip/qt/qglobal.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for some Qt globals. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ModuleHeaderCode +#include <qglobal.h> +%End + + +const int QT_VERSION; +const char *QT_VERSION_STR; + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned uint; +typedef unsigned long ulong; +typedef char * pchar; +typedef uchar * puchar; +typedef const char * pcchar; + +typedef char Q_INT8; +typedef unsigned char Q_UINT8; +typedef short Q_INT16; +typedef unsigned short Q_UINT16; +typedef int Q_INT32; +typedef unsigned Q_UINT32; + +%If (Qt_Q_LONG_IS_long) +typedef long Q_LONG; +typedef unsigned long Q_ULONG; +%End +%If (!Qt_Q_LONG_IS_long) +typedef long long Q_LONG; +typedef unsigned long long Q_ULONG; +%End + +const char *qVersion(); + +%If (Qt_3_0_0 -) +%End + +%If (Qt_3_1_0 -) +const char *qInstallPath(); +const char *qInstallPathDocs(); +const char *qInstallPathHeaders(); +const char *qInstallPathLibs(); +const char *qInstallPathBins(); +const char *qInstallPathPlugins(); +const char *qInstallPathData(); +%End +%If (Qt_3_2_0 -) +const char *qInstallPathTranslations(); +%If (!WS_WIN) +const char *qInstallPathSysconf(); +%End +%End diff --git a/python/pyqt/sip/qt/qgmanager.sip b/python/pyqt/sip/qt/qgmanager.sip new file mode 100644 index 00000000..5a194b81 --- /dev/null +++ b/python/pyqt/sip/qt/qgmanager.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for QGManager. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGManager (Qt v1.x)</Title> +<Para> +<Literal>QGManager</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QChain (Qt v1.x)</Title> +<Para> +<Literal>QChain</Literal> is implemented as an opaque class. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QChain; + + +class QGManager : QObject +{ +%TypeHeaderCode +#include <qgmanager.h> +%End + +public: + QGManager(QWidget *,const char * = 0); + + enum Direction { + LeftToRight, + RightToLeft, + Down, + Up + }; + + enum { + unlimited = QCOORD_MAX + }; + + void setBorder(int); + QChain *newSerChain(Direction); + QChain *newParChain(Direction); + bool add(QChain *,QChain *,int = 0); + bool addWidget(QChain *,QWidget *,int = 0); + bool addSpacing(QChain *,int,int = 0,int = unlimited); + bool addBranch(QChain *,QChain *,int,int); + void setStretch(QChain *,int); + bool activate(); + void freeze(int = 0,int = 0); + void unFreeze(); + QChain *xChain(); + QChain *yChain(); + void setMenuBar(QWidget *); + QWidget *mainWidget(); + void remove(QWidget *); + void setName(QChain *,const char *); + +protected: + bool eventFilter(QObject *,QEvent *); + +private: + QGManager(const QGManager &); +}; + +%End diff --git a/python/pyqt/sip/qt/qgrid.sip b/python/pyqt/sip/qt/qgrid.sip new file mode 100644 index 00000000..f26acb34 --- /dev/null +++ b/python/pyqt/sip/qt/qgrid.sip @@ -0,0 +1,72 @@ +// This is the SIP interface definition for QGrid. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGrid (Qt v2+)</Title> +<Para> +<Literal>QGrid</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QGrid : QFrame +{ +%TypeHeaderCode +#include <qgrid.h> +%End + +public: +%If (- Qt_3_0_0) + enum Direction { + Horizontal, + Vertical + }; +%End + + QGrid(int,QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%If (- Qt_3_0_0) + QGrid(int,Direction,QWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); +%End +%If (Qt_3_0_0 -) + QGrid(int,Orientation,QWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); +%End + + void setSpacing(int); +%If (Qt_2_1_0 -) + QSize sizeHint() const; +%End + +protected: + void frameChanged(); + +private: +%If (Qt_2_1_0 -) + QGrid(const QGrid &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qgridview.sip b/python/pyqt/sip/qt/qgridview.sip new file mode 100644 index 00000000..d1ca16b1 --- /dev/null +++ b/python/pyqt/sip/qt/qgridview.sip @@ -0,0 +1,76 @@ +// This is the SIP interface definition for QGridView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGridView (Qt v3+)</Title> +<Para> +<Literal>QGridView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QGridView : QScrollView +{ +%TypeHeaderCode +#include <qgridview.h> +%End + +public: + QGridView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int numRows() const; + virtual void setNumRows(int); + int numCols() const; + virtual void setNumCols(int); + + int cellWidth() const; + virtual void setCellWidth(int); + int cellHeight() const; + virtual void setCellHeight(int); + + QRect cellRect() const; + QRect cellGeometry(int,int); + QSize gridSize() const; + + int rowAt(int) const; + int columnAt(int) const; + + void repaintCell(int,int,bool = 1); + void updateCell(int,int); + void ensureCellVisible(int,int); + +protected: + virtual void paintCell(QPainter *,int,int) = 0; + virtual void paintEmptyArea(QPainter *,int,int,int,int); + + void drawContents(QPainter *,int,int,int,int); + + virtual void dimensionChange(int,int); + +private: + QGridView(const QGridView &); +}; + +%End diff --git a/python/pyqt/sip/qt/qgroupbox.sip b/python/pyqt/sip/qt/qgroupbox.sip new file mode 100644 index 00000000..c420082c --- /dev/null +++ b/python/pyqt/sip/qt/qgroupbox.sip @@ -0,0 +1,135 @@ +// This is the SIP interface definition for QGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGroupBox</Title> +<Para> +<Literal>QGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QGroupBox : QFrame +{ +%TypeHeaderCode +#include <qgroupbox.h> +%End + +public: + QGroupBox(QWidget * /TransferThis/ = 0,const char * = 0); +%If (- Qt_2_00) + QGroupBox(const char *,QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QGroupBox(const QString &,QWidget * /TransferThis/ = 0, + const char * = 0); + QGroupBox(int,Orientation,QWidget * /TransferThis/ = 0, + const char * = 0); + QGroupBox(int,Orientation,const QString &,QWidget * /TransferThis/ = 0, + const char * = 0); +%End + +%If (Qt_2_00 -) + virtual void setColumnLayout(int,Orientation); +%End + +%If (- Qt_2_00) + const char *title() const; + void setTitle(const char *); +%End +%If (Qt_2_00 -) + QString title() const; + virtual void setTitle(const QString &); +%End + + int alignment() const; +%If (- Qt_2_00) + void setAlignment(int); +%End +%If (Qt_2_00 -) + virtual void setAlignment(int); +%End + +%If (Qt_2_1_0 -) + int columns() const; + void setColumns(int); + + Orientation orientation() const; + void setOrientation(Orientation); +%End + +%If (Qt_3_0_0 -) + int insideMargin() const; + int insideSpacing() const; + void setInsideMargin(int); + void setInsideSpacing(int); +%End + +%If (Qt_2_1_0 -) + void addSpace(int); +%End +%If (Qt_2_2_0 -) + QSize sizeHint() const; +%End + +%If (Qt_3_1_0 -) + bool isFlat() const; + void setFlat(bool); +%End +%If (Qt_3_2_0 -) + bool isCheckable() const; + void setCheckable(bool); + bool isChecked() const; + void setEnabled(bool); +%End + +public slots: +%If (Qt_3_2_0 -) + void setChecked(bool); +%End + +signals: +%If (Qt_3_2_0 -) + void toggled(bool); +%End + +protected: +%If (Qt_2_2_0 -) + bool event(QEvent *); +%End +%If (Qt_2_00 -) + void childEvent(QChildEvent *); + void resizeEvent(QResizeEvent *); +%End + void paintEvent(QPaintEvent *); +%If (Qt_2_00 - Qt_3_0_0) + void updateMask(); +%End +%If (Qt_2_1_0 -) + void focusInEvent(QFocusEvent *); + void fontChange(const QFont &); +%End + +private: + QGroupBox(const QGroupBox &); +}; diff --git a/python/pyqt/sip/qt/qhbox.sip b/python/pyqt/sip/qt/qhbox.sip new file mode 100644 index 00000000..7e5b2ee3 --- /dev/null +++ b/python/pyqt/sip/qt/qhbox.sip @@ -0,0 +1,75 @@ +// This is the SIP interface definition for QHBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHBox (Qt v2+)</Title> +<Para> +<Literal>QHBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QHBox : QFrame +{ +%TypeHeaderCode +#include <qhbox.h> +%End + +public: +%If (- Qt_3_0_0) + QHBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0, + bool = 1); +%End +%If (Qt_3_0_0 -) + QHBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + + void setSpacing(int); +%If (Qt_2_1_0 -) + bool setStretchFactor(QWidget *,int); + QSize sizeHint() const; +%End + +protected: +%If (- Qt_3_0_0) + QHBox(bool,QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0, + bool = 1); +%End +%If (Qt_3_0_0 - Qt_3_2_0) + QHBox(bool,QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End +%If (Qt_3_2_0 -) + QHBox(bool,QWidget * /TransferThis/,const char *,WFlags = 0); +%End + + void frameChanged(); + +private: +%If (Qt_3_1_0 -) + QHBox(const QHBox &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qhbuttongroup.sip b/python/pyqt/sip/qt/qhbuttongroup.sip new file mode 100644 index 00000000..60cad68a --- /dev/null +++ b/python/pyqt/sip/qt/qhbuttongroup.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for QHButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHButtonGroup (Qt v2+)</Title> +<Para> +<Literal>QHButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QHButtonGroup : QButtonGroup +{ +%TypeHeaderCode +#include <qhbuttongroup.h> +%End + +public: + QHButtonGroup(QWidget * /TransferThis/ = 0,const char * = 0); + QHButtonGroup(const QString &,QWidget * /TransferThis/ = 0,const char * = 0); + +private: + QHButtonGroup(const QHButtonGroup &); +}; + +%End diff --git a/python/pyqt/sip/qt/qheader.sip b/python/pyqt/sip/qt/qheader.sip new file mode 100644 index 00000000..30302082 --- /dev/null +++ b/python/pyqt/sip/qt/qheader.sip @@ -0,0 +1,268 @@ +// This is the SIP interface definition for QHeader. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHeader</Title> +<Para> +<Literal>QHeader</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QHeader : QTableView +{ +%TypeHeaderCode +#include <qheader.h> +%End + +public: + QHeader(QWidget * /TransferThis/ = 0,const char * = 0); + QHeader(int,QWidget * /TransferThis/ = 0,const char * = 0); + + enum Orientation { + Horizontal, + Vertical + }; + + int addLabel(const char *,int = -1); + void setLabel(int,const char *,int = -1); + const char *label(int); + void setOrientation(Orientation); + Orientation orientation() const; + void setTracking(bool); + bool tracking() const; + void setClickEnabled(bool,int = -1); + void setResizeEnabled(bool,int = -1); + void setMovingEnabled(bool); + void setCellSize(int,int); + int cellSize(int) const; + int cellPos(int) const; + int cellAt(int) const; + int count() const; + int offset() const; + QSize sizeHint() const; + int mapToLogical(int) const; + int mapToActual(int) const; + +public slots: + void setOffset(int); + +signals: + void sectionClicked(int); + void sizeChange(int,int,int); + void moved(int,int); + +protected: + void resizeEvent(QResizeEvent *); + QRect sRect(int); + void paintCell(QPainter *,int,int); + void setupPainter(QPainter *); + int cellHeight(int); + int cellWidth(int); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + +private: + QHeader(const QHeader &); +}; + +%End + + +%If (Qt_2_00 -) + +class QHeader : QWidget +{ +%TypeHeaderCode +#include <qheader.h> +%End + +public: + QHeader(QWidget * /TransferThis/ = 0,const char * = 0); + QHeader(int,QWidget * /TransferThis/ = 0,const char * = 0); + + int addLabel(const QString &,int = -1); + int addLabel(const QIconSet &,const QString &,int = -1); +%If (Qt_2_1_0 -) + void removeLabel(int); +%End + virtual void setLabel(int,const QString &,int = -1); + virtual void setLabel(int,const QIconSet &,const QString &,int = -1); + + QString label(int) const; + QIconSet *iconSet(int) const; + + virtual void setOrientation(Orientation); + Orientation orientation() const; + virtual void setTracking(bool); + bool tracking() const; + + virtual void setClickEnabled(bool,int = -1); + virtual void setResizeEnabled(bool,int = -1); + virtual void setMovingEnabled(bool); +%If (Qt_3_0_0 -) + virtual void setStretchEnabled(bool,int); +%End +%If (Qt_2_1_0 -) + bool isClickEnabled(int = -1) const; + bool isResizeEnabled(int = -1) const; + bool isMovingEnabled() const; +%End +%If (Qt_3_0_0 -) + bool isStretchEnabled() const; + bool isStretchEnabled(int) const; +%End + +%If (Qt_2_1_0 -) + void resizeSection(int,int); + int sectionSize(int) const; + int sectionPos(int) const; + int sectionAt(int) const; +%End + int count() const; +%If (Qt_3_0_0 -) + int headerWidth() const; + QRect sectionRect(int) const; +%End + +%If (- Qt_3_0_0) + virtual void setCellSize(int,int); + int cellSize(int) const; + int cellPos(int) const; + int cellAt(int) const; +%End + + int offset() const; + + QSize sizeHint() const; +%If (- Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_2_1_0 -) + int mapToSection(int) const; + int mapToIndex(int) const; +%End +%If (- Qt_3_0_0) + int mapToLogical(int) const; + int mapToActual(int) const; +%End + +%If (Qt_2_1_0 -) + void moveSection(int,int); +%End +%If (- Qt_3_0_0) + virtual void moveCell(int,int); +%End + +%If (Qt_3_2_0 -) + // This is placed before the obsolete version below so that it has + // precedence. It may still cause problems with old code until SIP + // distinguishes between bools and enums. + void setSortIndicator(int,SortOrder); + int sortIndicatorSection() const; + SortOrder sortIndicatorOrder() const; +%End +%If (Qt_2_1_0 -) + // Obsolete. + void setSortIndicator(int,bool = 1); +%End + +%If (Qt_3_0_0 -) + void adjustHeaderSize(); +%End + +public slots: +%If (Qt_2_2_0 -) + void setUpdatesEnabled(bool); +%End + virtual void setOffset(int); + +signals: +%If (Qt_2_1_0 -) + void clicked(int); + void pressed(int); + void released(int); +%End + void sizeChange(int,int,int); +%If (Qt_2_1_0 -) + void indexChange(int,int,int); +%End +%If (- Qt_3_0_0) + void sectionClicked(int); + void moved(int,int); +%End +%If (Qt_3_2_0 -) + void sectionHandleDoubleClicked(int); +%End + +protected: +%If (Qt_2_1_0 -) + void paintEvent(QPaintEvent *); +%End +%If (Qt_2_2_0 -) + void showEvent(QShowEvent *); +%End +%If (- Qt_2_1_0) + void resizeEvent(QResizeEvent *); +%End +%If (Qt_3_0_0 -) + void resizeEvent(QResizeEvent *); +%End + QRect sRect(int); + +%If (- Qt_3_0_0) + void paintSection(QPainter *,int,QRect); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void paintSectionLabel(QPainter *,int,const QRect &); +%End +%If (Qt_3_0_0 -) + virtual void paintSection(QPainter *,int,const QRect &); + virtual void paintSectionLabel(QPainter *,int,const QRect &); +%End + +%If (Qt_3_1_0 -) + void fontChange(const QFont &); +%End + + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +%If (Qt_3_2_0 -) + void mouseDoubleClickEvent(QMouseEvent *); +%End + +%If (Qt_3_1_0 -) + void keyPressEvent(QKeyEvent *); + void keyReleaseEvent(QKeyEvent *); +%End + +private: + QHeader(const QHeader &); +}; + +%End diff --git a/python/pyqt/sip/qt/qhgroupbox.sip b/python/pyqt/sip/qt/qhgroupbox.sip new file mode 100644 index 00000000..c12059af --- /dev/null +++ b/python/pyqt/sip/qt/qhgroupbox.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for QHGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHGroupBox (Qt v2+)</Title> +<Para> +<Literal>QHGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QHGroupBox : QGroupBox +{ +%TypeHeaderCode +#include <qhgroupbox.h> +%End + +public: + QHGroupBox(QWidget * /TransferThis/ = 0,const char * = 0); + QHGroupBox(const QString &,QWidget * /TransferThis/ = 0,const char * = 0); + +private: + QHGroupBox(const QHGroupBox &); +}; + +%End diff --git a/python/pyqt/sip/qt/qiconset.sip b/python/pyqt/sip/qt/qiconset.sip new file mode 100644 index 00000000..4a55058a --- /dev/null +++ b/python/pyqt/sip/qt/qiconset.sip @@ -0,0 +1,146 @@ +// This is the SIP interface definition for QIconSet and QIconFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QIconSet</Title> +<Para> +<Literal>QIconSet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconFactory (Qt v3.1+)</Title> +<Para> +<Literal>QIconFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QIconSet +{ +%TypeHeaderCode +#include <qiconset.h> +%End + +public: + enum Size { + Automatic, + Small, + Large + }; + + enum Mode { + Normal, + Disabled, + Active + }; + +%If (Qt_3_0_0 -) + enum State { + On, + Off + }; +%End + +%If (Qt_2_1_0 -) + QIconSet(); +%End + QIconSet(const QPixmap &,Size = Automatic); +%If (Qt_2_2_0 -) + QIconSet(const QPixmap &,const QPixmap &); +%End + QIconSet(const QIconSet &); + + void reset(const QPixmap &,Size); + +%If (- Qt_2_00) + void setPixmap(const QPixmap &,Size,Mode = Normal); + void setPixmap(const char *,Size,Mode = Normal); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setPixmap(const QPixmap &,Size,Mode = Normal); + virtual void setPixmap(const QString &,Size,Mode = Normal); +%End +%If (Qt_3_0_0 -) + virtual void setPixmap(const QPixmap &,Size,Mode = Normal,State = Off); + virtual void setPixmap(const QString &,Size,Mode = Normal,State = Off); +%End +%If (- Qt_3_0_0) + QPixmap pixmap(Size,Mode) const; +%If (Qt_2_1_0 -) +// QPixmap pixmap(Size,bool) const; +%End +%End +%If (Qt_3_0_0 -) + QPixmap pixmap(Size,Mode,State = Off) const; +// QPixmap pixmap(Size,bool,State = Off) const; +%End + QPixmap pixmap() const; +%If (- Qt_3_0_0) + bool isGenerated(Size,Mode) const; +%End +%If (Qt_3_0_0 -) + bool isGenerated(Size,Mode,State = Off) const; + void clearGenerated(); +%End +%If (Qt_3_1_0 -) + void installIconFactory(QIconFactory *); +%End + +%If (Qt_2_1_0 -) + bool isNull() const; +%End + + void detach(); + +%If (Qt_3_0_0 -) + static void setIconSize(Size,const QSize &); + static const QSize &iconSize(Size); +%End +}; + + +%If (Qt_3_1_0 -) + +class QIconFactory +{ +%TypeHeaderCode +#include <qiconset.h> +%End + +public: + QIconFactory(); + + virtual QPixmap *createPixmap(const QIconSet &,QIconSet::Size, + QIconSet::Mode, + QIconSet::State) /Factory/; + void setAutoDelete(bool); + bool autoDelete() const; + + static QIconFactory *defaultFactory(); + static void installDefaultFactory(QIconFactory * /Transfer/); + +private: + QIconFactory(const QIconFactory &); +}; + +%End diff --git a/python/pyqt/sip/qt/qiconview.sip b/python/pyqt/sip/qt/qiconview.sip new file mode 100644 index 00000000..122d2ec2 --- /dev/null +++ b/python/pyqt/sip/qt/qiconview.sip @@ -0,0 +1,457 @@ +// This is the SIP interface definition for QIconView, QIconViewItem, QIconDrag +// and QIconDragItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QIconView (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>QIconViewItem *<Function>makeRowLayout</Function></FuncDef> + <ParamDef>QIconViewItem *<Parameter>begin</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconViewItem (Qt v2.1+)</Title> +<Para> +<Literal>QIconViewItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDrag (Qt v2.1+)</Title> +<Para> +<Literal>QIconDrag</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QIconDragItem (Qt v2.1+)</Title> +<Para> +<Literal>QIconDragItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_ICONVIEW) +%If (Qt_2_1_0 -) + +%If (Qt_DRAGANDDROP) + +class QIconDragItem +{ +%TypeHeaderCode +#include <qiconview.h> +%End + +public: + QIconDragItem(); + + virtual QByteArray data() const; + virtual void setData(const QByteArray &); +}; + + +class QIconDrag : QDragObject +{ +%TypeHeaderCode +#include <qiconview.h> +%End + +public: + QIconDrag(QWidget * /TransferThis/,const char * = 0); + + void append(const QIconDragItem &,const QRect &,const QRect &); + + virtual const char* format(int) const; + static bool canDecode(QMimeSource *); + virtual QByteArray encodedData(const char *) const; + +private: +%If (Qt_3_1_0 -) + QIconDrag(const QIconDrag &); +%End +}; + +%End + + +class QIconViewItem : Qt +{ +%TypeHeaderCode +#include <qiconview.h> +%End + +public: + QIconViewItem(QIconView * /TransferThis/); + QIconViewItem(QIconView * /TransferThis/,QIconViewItem *); + QIconViewItem(QIconView * /TransferThis/,const QString &); + QIconViewItem(QIconView * /TransferThis/,QIconViewItem *, + const QString &); + QIconViewItem(QIconView * /TransferThis/,const QString &, + const QPixmap &); + QIconViewItem(QIconView * /TransferThis/,QIconViewItem *, + const QString &,const QPixmap &); +%If (Qt_3_0_0 -) + QIconViewItem(QIconView * /TransferThis/,const QString &, + const QPicture &); + QIconViewItem(QIconView * /TransferThis/,QIconViewItem *, + const QString &,const QPicture &); +%End + + virtual void setRenameEnabled(bool); + virtual void setDragEnabled(bool); + virtual void setDropEnabled(bool); + + virtual QString text() const; + virtual QPixmap *pixmap() const; +%If (Qt_3_0_0 -) + virtual QPicture *picture() const; +%End + virtual QString key() const; + + bool renameEnabled() const; + bool dragEnabled() const; + bool dropEnabled() const; + + QIconView *iconView() const; + QIconViewItem *prevItem() const; + QIconViewItem *nextItem() const; + + int index() const; + + virtual void setSelected(bool,bool); + virtual void setSelected(bool); + virtual void setSelectable(bool); + + bool isSelected() const; + bool isSelectable() const; + + virtual void repaint(); + +%If (- Qt_3_0_0) + virtual void move(int,int); +%End +%If (Qt_3_0_0 -) + virtual bool move(int,int); +%End + virtual void moveBy(int,int); +%If (- Qt_3_0_0) + virtual void move(const QPoint &); +%End +%If (Qt_3_0_0 -) + virtual bool move(const QPoint &); +%End + virtual void moveBy(const QPoint &); + + QRect rect() const; + int x() const; + int y() const; + int width() const; + int height() const; + QSize size() const; + QPoint pos() const; + QRect textRect(bool = 1) const; + QRect pixmapRect(bool = 1) const; +%If (- Qt_3_0_0) + bool contains(QPoint) const; + bool intersects(QRect) const; +%End +%If (Qt_3_0_0 -) + bool contains(const QPoint &) const; + bool intersects(const QRect &) const; +%End + + virtual bool acceptDrop(const QMimeSource *) const; + + void rename(); + + virtual int compare(QIconViewItem *) const; + + virtual void setText(const QString &); + virtual void setPixmap(const QPixmap &); +%If (Qt_3_0_0 -) + virtual void setPicture(const QPicture &); +%End + virtual void setText(const QString &,bool,bool = 1); + virtual void setPixmap(const QPixmap &,bool,bool = 1); + virtual void setKey(const QString &); + +%If (Qt_3_0_0 -) + virtual int rtti() const; +%End + +protected: + virtual void removeRenameBox(); + virtual void calcRect(const QString & = QString::null); + virtual void paintItem(QPainter *,const QColorGroup &); + virtual void paintFocus(QPainter *,const QColorGroup &); +%If (Qt_DRAGANDDROP) + virtual void dropped(QDropEvent *,const QValueList<QIconDragItem> &); +%End + virtual void dragEntered(); + virtual void dragLeft(); + void setItemRect(const QRect &); + void setTextRect(const QRect &); + void setPixmapRect(const QRect &); + void calcTmpText(); +%If (Qt_3_1_0 -) + QString tempText() const; +%End +}; + + +class QIconView : QScrollView +{ +%TypeHeaderCode +#include <qiconview.h> +%End + +public: + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; + + enum Arrangement { + LeftToRight, + TopToBottom + }; + + enum ResizeMode { + Fixed, + Adjust + }; + + enum ItemTextPos { + Bottom, + Right + }; + + QIconView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void insertItem(QIconViewItem *,QIconViewItem * = 0); + virtual void takeItem(QIconViewItem *); + + int index(const QIconViewItem *) const; + + QIconViewItem *firstItem() const; + QIconViewItem *lastItem() const; + QIconViewItem *currentItem() const; + virtual void setCurrentItem(QIconViewItem *); + virtual void setSelected(QIconViewItem *,bool,bool = 0); + + uint count() const; + + virtual void showEvent(QShowEvent *); + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + QIconViewItem *findItem(const QPoint &) const; +%If (- Qt_3_0_0) + QIconViewItem *findItem(const QString &) const; +%End +%If (Qt_3_0_0 -) + QIconViewItem *findItem(const QString &, + ComparisonFlags = BeginsWith) const; +%End + virtual void selectAll(bool); + virtual void clearSelection(); + virtual void invertSelection(); + + virtual void repaintItem(QIconViewItem *); +%If (Qt_3_1_0 -) + void repaintSelectedItems(); +%End + + void ensureItemVisible(QIconViewItem *); + QIconViewItem* findFirstVisibleItem(const QRect &) const; + QIconViewItem* findLastVisibleItem(const QRect &) const; + + virtual void clear(); + + virtual void setGridX(int); + virtual void setGridY(int); + int gridX() const; + int gridY() const; + virtual void setSpacing(int); + int spacing() const; + virtual void setItemTextPos(ItemTextPos); + ItemTextPos itemTextPos() const; + virtual void setItemTextBackground(const QBrush &); + QBrush itemTextBackground() const; + virtual void setArrangement(Arrangement); + Arrangement arrangement() const; + virtual void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + virtual void setMaxItemWidth(int); + int maxItemWidth() const; + virtual void setMaxItemTextLength(int); + int maxItemTextLength() const; + virtual void setAutoArrange(bool); + bool autoArrange() const; + virtual void setShowToolTips(bool); + bool showToolTips() const; + + void setSorting(bool,bool = 1); + bool sorting() const; + bool sortDirection() const; + + virtual void setItemsMovable(bool); + bool itemsMovable() const; + virtual void setWordWrapIconText(bool); + bool wordWrapIconText() const; + + bool eventFilter(QObject *,QEvent *); + + QSize minimumSizeHint() const; +%If (- Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + QSize sizeHint() const; + + virtual void sort(bool = 1); + + virtual void setFont(const QFont &); + virtual void setPalette(const QPalette &); + +%If (Qt_3_0_0 -) + bool isRenaming() const; +%End + +public slots: + virtual void arrangeItemsInGrid(const QSize &,bool = 1); + virtual void arrangeItemsInGrid(bool = 1); + virtual void setContentsPos(int,int); + virtual void updateContents(); + +signals: + void selectionChanged(); + void selectionChanged(QIconViewItem *); + void currentChanged(QIconViewItem *); + void clicked(QIconViewItem *); + void clicked(QIconViewItem *,const QPoint &); + void pressed(QIconViewItem *); + void pressed(QIconViewItem *,const QPoint &); + + void doubleClicked(QIconViewItem *); + void returnPressed(QIconViewItem *); + void rightButtonClicked(QIconViewItem *,const QPoint &); + void rightButtonPressed(QIconViewItem *,const QPoint &); + void mouseButtonPressed(int,QIconViewItem *,const QPoint &); + void mouseButtonClicked(int,QIconViewItem *,const QPoint &); +%If (Qt_3_0_0 -) + void contextMenuRequested(QIconViewItem *,const QPoint &); +%End +%If (Qt_DRAGANDDROP) + void dropped(QDropEvent *,const QValueList<QIconDragItem> &); +%End + void moved(); + void onItem(QIconViewItem *); + void onViewport(); + void itemRenamed(QIconViewItem *,const QString &); + void itemRenamed(QIconViewItem *); + +protected slots: + virtual void doAutoScroll(); + virtual void adjustItems(); + virtual void slotUpdate(); + +protected: +%If (- Qt_3_0_0) + virtual void drawContents(QPainter *,int,int,int,int); + virtual void contentsMousePressEvent(QMouseEvent *); + virtual void contentsMouseReleaseEvent(QMouseEvent *); + virtual void contentsMouseMoveEvent(QMouseEvent *); + virtual void contentsMouseDoubleClickEvent(QMouseEvent *); +%End +%If (Qt_3_0_0 -) + void drawContents(QPainter *,int,int,int,int); + void contentsMousePressEvent(QMouseEvent *); + void contentsMouseReleaseEvent(QMouseEvent *); + void contentsMouseMoveEvent(QMouseEvent *); + void contentsMouseDoubleClickEvent(QMouseEvent *); + void contentsContextMenuEvent(QContextMenuEvent *); +%End + +%If (- Qt_3_0_0) +%If (Qt_DRAGANDDROP) + virtual void contentsDragEnterEvent(QDragEnterEvent *); + virtual void contentsDragMoveEvent(QDragMoveEvent *); + virtual void contentsDragLeaveEvent(QDragLeaveEvent *); + virtual void contentsDropEvent(QDropEvent *); +%End + + virtual void resizeEvent(QResizeEvent *); + virtual void keyPressEvent(QKeyEvent *); + virtual void focusInEvent(QFocusEvent *); + virtual void focusOutEvent(QFocusEvent *); + virtual void enterEvent(QEvent *); +%End +%If (Qt_3_0_0 -) +%If (Qt_DRAGANDDROP) + void contentsDragEnterEvent(QDragEnterEvent *); + void contentsDragMoveEvent(QDragMoveEvent *); + void contentsDragLeaveEvent(QDragLeaveEvent *); + void contentsDropEvent(QDropEvent *); +%End + + void resizeEvent(QResizeEvent *); + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void enterEvent(QEvent *); +%End + + virtual void drawRubber(QPainter *); +%If (Qt_DRAGANDDROP) + virtual QDragObject *dragObject(); + virtual void startDrag(); +%End + virtual void insertInGrid(QIconViewItem *); + virtual void drawBackground(QPainter *,const QRect &); + + void emitSelectionChanged(QIconViewItem * = 0); + void emitRenamed(QIconViewItem *); + +%If (- Qt_3_0_0) +// QIconViewItem *makeRowLayout(QIconViewItem *,int &); +%End +%If (Qt_3_0_0 -) +// QIconViewItem *makeRowLayout(QIconViewItem *,int &,bool &); +%End + + void styleChange(QStyle &); +%If (Qt_3_0_0 -) + void windowActivationChange(bool); +%End + +private: + QIconView(const QIconView &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qimage.sip b/python/pyqt/sip/qt/qimage.sip new file mode 100644 index 00000000..aa7e2e5f --- /dev/null +++ b/python/pyqt/sip/qt/qimage.sip @@ -0,0 +1,544 @@ +// This is the SIP interface definition for QImage, QImageIO and +// QImageTextKeyLang. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QImage</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QImage</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QImage</Function></FuncDef> + <ParamDef>uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>depth</Parameter></ParamDef> + <ParamDef>QRgb *<Parameter>colorTable</Parameter></ParamDef> + <ParamDef>int <Parameter>numColors</Parameter></ParamDef> + <ParamDef>Endian <Parameter>bitOrder</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The <Literal>colorTable</Literal> parameter is a list of QRgb instances or +None. (Qt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>bits</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>QRgb *<Function>colorTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>QImage <Function>convertDepthWithPalette</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>QRgb *<Parameter>p</Parameter></ParamDef> + <ParamDef>int <Parameter>pc</Parameter></ParamDef> + <ParamDef>int <Parameter>cf</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar **<Function>jumpTable</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>uchar *<Function>scanLine</Function></FuncDef> + <ParamDef>int <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The return value is a <Literal>sip.voidptr</Literal> object which is only +useful if passed to another Python module. +</Para> +</Sect2> + +<Sect2><Title>QImageIO</Title> +<FuncSynopsis> + <FuncDef>static void <Function>defineIOHandler</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>const char *<Parameter>header</Parameter></ParamDef> + <ParamDef>const char *<Parameter>flags</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>read_image</Parameter></ParamDef> + <ParamDef>image_io_handler <Parameter>write_image</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QImageTextKeyLang</Title> +<Para> +<Literal>QImageTextKeyLang</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QImage +{ +%TypeHeaderCode +#include <qimage.h> +%End + +public: + enum Endian { + IgnoreEndian, + BigEndian, + LittleEndian + }; + + QImage(); + QImage(int,int,int,int = 0,Endian = IgnoreEndian); + QImage(const QSize &,int,int = 0,Endian = IgnoreEndian); +%If (- Qt_2_00) + QImage(const char *,char * = 0); +%End +%If (Qt_2_00 -) + QImage(const QString &,char * = 0); +%End + + QImage(SIP_PYLIST) [(const char **)]; +%MethodCode + // The Python interface is a list of strings that make up the + // image. + + const char **str; + + if ((str = PyQt_qt_ListToArray(a0)) == NULL) + sipIsErr = 1; + else + { + // There is no wrapper class for QImage. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new QImage(str); + Py_END_ALLOW_THREADS + + sipFree((ANY *)str); + } +%End + +%If (Qt_2_00 -) + QImage(const QByteArray &); +%End + +%If (Qt_2_1_0 -) + QImage(uchar *,int,int,int,SIP_PYLIST /AllowNone/,int,Endian) [(uchar *,int,int,int,int,QRgb *,int,Endian)]; +%MethodCode + // The Python interface takes a list of QRgb instances. + + QRgb *coltab; + + if (a4 == Py_None) + coltab = 0; + else + { + int len = PyList_Size(a4); + + if (a5 > len) + a5 = len; + + coltab = new QRgb[len]; + + PyErr_Clear(); + + for (int i = 0; i < a5; ++i) + { + coltab[i] = PyLong_AsLong(PyList_GetItem(a4,i)); + + if (PyErr_Occurred()) + { + delete[] coltab; + sipIsErr = 1; + break; + } + } + } + + if (!sipIsErr) + { + // There is no wrapper class for QImage. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new QImage(a0,a1,a2,a3,0,a5,(QImage::Endian)a6); + + if (coltab) + { + // Now set the colours using the QImage's self + // allocated colour table. If we had passed in + // coltab as the colour table then we couldn't + // have freed it and it would leak. + for (int i = 0; i < a5; ++i) + sipCpp -> setColor(i,coltab[i]); + + delete[] coltab; + } + Py_END_ALLOW_THREADS + } +%End +%End + + QImage(const QImage &); + + bool operator==(const QImage &) const; + bool operator!=(const QImage &) const; + + void detach(); + QImage copy() const; + QImage copy(int,int,int,int,int = 0) const; +%If (- Qt_3_0_0) + QImage copy(QRect &) const; +%End +%If (Qt_3_0_0 -) + QImage copy(const QRect &) const; +%End +%If (Qt_3_1_0 -) + static QImage fromMimeSource(const QString &); +%End + bool isNull() const; + + int width() const; + int height() const; + QSize size() const; + QRect rect() const; + int depth() const; + int numColors() const; + Endian bitOrder() const; + + QRgb color(int) const; + void setColor(int,QRgb); + void setNumColors(int); + + bool hasAlphaBuffer() const; + void setAlphaBuffer(bool); + + bool allGray() const; + bool isGrayscale() const; + + // Actually returns uchar *. + void *bits() const; + // Actually returns uchar *. + void *scanLine(int) const; + // Actually returns uchar **. + void *jumpTable() const; + // Actually returns QRgb *. + void *colorTable() const; + int numBytes() const; + int bytesPerLine() const; + + bool create(int,int,int,int = 0,Endian = IgnoreEndian); + bool create(const QSize &,int,int = 0,Endian = IgnoreEndian); + void reset(); + + void fill(uint); +%If (Qt_2_00 -) + void invertPixels(bool = 1); +%End + + QImage convertDepth(int) const; +// QImage convertDepthWithPalette(int,QRgb *,int,int = 0) const; + QImage convertDepth(int,int) const; + QImage convertBitOrder(Endian) const; + +%If (- Qt_3_0_0) + QImage smoothScale(int,int) const; +%End +%If (Qt_3_0_0 -) + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; + + QImage smoothScale(int,int,ScaleMode = ScaleFree) const; + QImage smoothScale(const QSize &,ScaleMode = ScaleFree) const; + QImage scale(int,int,ScaleMode = ScaleFree) const; + QImage scale(const QSize &,ScaleMode = ScaleFree) const; + QImage scaleWidth(int) const; + QImage scaleHeight(int) const; + QImage xForm(const QWMatrix &) const; +%End + +%If (- Qt_2_00) + QImage createAlphaMask(bool = 0) const; + QImage createAlphaMask(int) const; +%End +%If (Qt_2_00 -) + QImage createAlphaMask(int = 0) const; +%End + QImage createHeuristicMask(bool = 1) const; +%If (Qt_2_00 -) + QImage mirror() const; +%End +%If (Qt_2_1_0 -) + QImage mirror(bool,bool) const; +%End +%If (Qt_2_00 -) + QImage swapRGB() const; +%End + + static Endian systemBitOrder(); + static Endian systemByteOrder(); + +%If (- Qt_2_00) + static const char *imageFormat(const char *); +%End +%If (Qt_2_00 -) + static const char *imageFormat(const QString &); +%End + static QStrList inputFormats(); + static QStrList outputFormats(); +%If (Qt_2_1_0 -) + static QStringList inputFormatList(); + static QStringList outputFormatList(); +%End +%If (- Qt_2_00) + bool load(const char *,const char * = 0); +%End +%If (Qt_2_00 -) + bool load(const QString &,const char * = 0); +%End + bool loadFromData(const uchar * /Array/,uint /ArraySize/, + const char * = 0); + bool loadFromData(QByteArray,char * = 0); +%If (- Qt_2_00) + bool save(const char *,const char *) const; +%End +%If (Qt_2_00 - Qt_3_0_0) + bool save(const QString &,const char *) const; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + bool save(const QString &,const char *,int) const; +%End +%If (Qt_3_0_0 -) + bool save(const QString &,const char *,int = -1) const; +%End +%If (Qt_3_2_0 -) + bool save(QIODevice *,const char *,int = -1) const; +%End + + bool valid(int,int) const; + int pixelIndex(int,int) const; + QRgb pixel(int,int) const; + void setPixel(int,int,uint); + +%If (Qt_2_1_0 -) + int dotsPerMeterX() const; + int dotsPerMeterY() const; + void setDotsPerMeterX(int); + void setDotsPerMeterY(int); + QPoint offset() const; + void setOffset(const QPoint &); +%If (Qt_IMAGE_TEXT) + QValueList<QImageTextKeyLang> textList() const; + QStringList textLanguages() const; + QStringList textKeys() const; + QString text(const char *,const char * = 0) const; + QString text(const QImageTextKeyLang &) const; + void setText(const char *,const char *,const QString &); +%End +%End +}; + + +void bitBlt(QImage *,int,int,const QImage *,int = 0,int = 0,int = -1,int = -1, + int = 0); + + +class QImageIO +{ +%TypeHeaderCode +#include <qimage.h> +%End + +public: + QImageIO(); + QImageIO(QIODevice *,const char *); +%If (Qt_2_00 -) + QImageIO(const QString &,const char *); +%End +%If (- Qt_2_00) + QImageIO(const char *,const char *); +%End + + const QImage &image() const; + int status() const; + const char *format() const; + QIODevice *ioDevice() const; +%If (Qt_2_00 -) + QString fileName() const; +%End +%If (- Qt_2_00) + const char *fileName() const; +%End +%If (Qt_3_0_0 -) + int quality() const; +%End +%If (Qt_2_00 -) + QString description() const; +%End +%If (- Qt_2_00) + const char *description() const; +%End + const char *parameters() const; +%If (Qt_3_0_0 -) + float gamma() const; +%End + + void setImage(const QImage &); + void setStatus(int); + void setFormat(const char *); + void setIODevice(QIODevice *); +%If (Qt_2_00 -) + void setFileName(const QString &); +%End +%If (- Qt_2_00) + void setFileName(const char *); +%End +%If (Qt_3_0_0 -) + void setQuality(int); +%End +%If (Qt_2_00 -) + void setDescription(const QString &); +%End +%If (- Qt_2_00) + void setDescription(const char *); +%End + void setParameters(const char *); +%If (Qt_3_0_0 -) + void setGamma(float); +%End + + bool read(); + bool write(); + + static const char *imageFormat(const QString &); + static const char *imageFormat(QIODevice *); + static QStrList inputFormats(); + static QStrList outputFormats(); + +// static void defineIOHandler(const char *,const char *,const char *, +// image_io_handler,image_io_handler); + +private: + QImageIO(const QImageIO &); +}; + + +%If (Qt_2_1_0 -) +%If (Qt_IMAGE_TEXT) + +class QImageTextKeyLang +{ +%TypeHeaderCode +#include <qimage.h> +%End + +public: + QImageTextKeyLang(const char *,const char *); + QImageTextKeyLang(); + + QCString key; + QCString lang; +}; + +%End +%End + + +%ModuleHeaderCode +const char **PyQt_qt_ListToArray(PyObject *lst); +%End + + +%ModuleCode +// Convert a list of strings to an array of strings on the heap. Also used by +// QPixmap. +const char **PyQt_qt_ListToArray(PyObject *lst) +{ + int nstr; + const char **str, **sp; + + nstr = PyList_Size(lst); + + if ((str = (const char **)sipMalloc(nstr * sizeof (char *))) == NULL) + return NULL; + + // Convert the list. + sp = str; + + for (int i = 0; i < nstr; ++i) + { + char *s; + + if ((s = PyString_AsString(PyList_GetItem(lst,i))) == NULL) + { + sipFree((ANY *)str); + return NULL; + } + + *sp++ = s; + } + + return str; +} +%End diff --git a/python/pyqt/sip/qt/qinputdialog.sip b/python/pyqt/sip/qt/qinputdialog.sip new file mode 100644 index 00000000..80a5394f --- /dev/null +++ b/python/pyqt/sip/qt/qinputdialog.sip @@ -0,0 +1,174 @@ +// This is the SIP interface definition for QInputDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QInputDialog (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v2.1 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>QLineEdit::EchoMode<Parameter>echo</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v2.2 - v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getText</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>QLineEdit::EchoMode<Parameter>echo</Parameter> = QLineEdit::Normal</ParamDef> + <ParamDef>const QString &<Parameter>text</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +(Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>static int <Function>getInteger</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>int <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>int <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static double <Function>getDouble</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>double <Parameter>num</Parameter> = 0</ParamDef> + <ParamDef>double <Parameter>from</Parameter> = -2147483647</ParamDef> + <ParamDef>double <Parameter>to</Parameter> = 2147483647</ParamDef> + <ParamDef>int <Parameter>step</Parameter> = 1</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>static QString <Function>getItem</Function></FuncDef> + <ParamDef>const QString &<Parameter>caption</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>label</Parameter></ParamDef> + <ParamDef>const QStringList &<Parameter>list</Parameter></ParamDef> + <ParamDef>int <Parameter>current</Parameter> = 0</ParamDef> + <ParamDef>bool <Parameter>editable</Parameter> = TRUE</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 -) +%If (Qt_INPUTDIALOG) + +class QInputDialog : QDialog +{ +%TypeHeaderCode +#include <qinputdialog.h> +%End + +public: +%If (Qt_3_0_0 -) + static QString getText(const QString &,const QString &, + QLineEdit::EchoMode = QLineEdit::Normal, + const QString & = QString::null, + bool * = 0,QWidget * = 0,const char * = 0); +%End + +%If (- Qt_3_0_0) + static QString getText(const QString &,const QString &, + const QString & = QString::null, + bool * = 0,QWidget * = 0,const char * = 0); +%End + +%If (Qt_2_2_0 - Qt_3_0_0) + static QString getText(const QString &,const QString &, + QLineEdit::EchoMode, + const QString & = QString::null, + bool * = 0,QWidget * = 0,const char * = 0); +%End + + static int getInteger(const QString &,const QString &,int = 0, + int = -2147483647,int = 2147483647,int = 1, + bool * = 0,QWidget * = 0,const char * = 0); + + static double getDouble(const QString &,const QString &, + double = 0,double = -2147483647, + double = 2147483647,int = 1, + bool * = 0,QWidget * = 0,const char * = 0); + + static QString getItem(const QString &,const QString &, + const QStringList &,int = 0,bool = TRUE, + bool * = 0,QWidget * = 0,const char * = 0); + +private: + QInputDialog(const QInputDialog &); + ~QInputDialog(); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qinterlacestyle.sip b/python/pyqt/sip/qt/qinterlacestyle.sip new file mode 100644 index 00000000..5455b2fb --- /dev/null +++ b/python/pyqt/sip/qt/qinterlacestyle.sip @@ -0,0 +1,103 @@ +// This is the SIP interface definition for QInterlaceStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QInterlaceStyle (Qt v2.3.1+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +</Para> +</Sect2> +%End + + +// Temporary until it is ported to Qt3. +%If (Qt_STYLE_INTERLACE) +%If (Qt_2_3_1 - Qt_3_0_0) + +class QInterlaceStyle : QMotifStyle +{ +%TypeHeaderCode +#include <qinterlacestyle.h> +%End + +public: + QInterlaceStyle(); + + void polish(QApplication *); + void unPolish(QApplication *); + void polish(QWidget *); + void unPolish(QWidget *); + int defaultFrameWidth() const; + QRect pushButtonContentsRect(QPushButton *); + void drawFocusRect(QPainter *,const QRect &,const QColorGroup &, + const QColor * = 0,bool = 0); + void drawButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawButtonMask(QPainter *,int,int,int,int); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + + void drawPushButton(QPushButton *,QPainter *); + QSize indicatorSize() const; + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &, + int,bool = 0,bool = 1); + void drawIndicatorMask(QPainter *,int,int,int,int,int); + QSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0, + bool = 1); + void drawExclusiveIndicatorMask(QPainter *,int,int,int,int,bool); + QRect comboButtonRect(int,int,int,int); + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool,bool,bool,const QBrush *); + void drawPushButtonLabel(QPushButton *,QPainter *); + void drawPanel(QPainter *,int,int,int,int,const QColorGroup &,bool,int, + const QBrush *); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint, + uint); + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderMask(QPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); + void drawSliderGrooveMask(QPainter *,int,int,int,int,QCOORD, + Orientation); + int splitterWidth() const; + void drawSplitter(QPainter *,int,int,int,int,const QColorGroup &, + Orientation); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qiodevice.sip b/python/pyqt/sip/qt/qiodevice.sip new file mode 100644 index 00000000..32079d2d --- /dev/null +++ b/python/pyqt/sip/qt/qiodevice.sip @@ -0,0 +1,408 @@ +// This is the SIP interface definition for QIODevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QIODevice</Title> +<Para> +<Literal>QIODevice</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qiodevice.h> +%End + + +// Device access types. + +const int IO_Direct; +const int IO_Sequential; +const int IO_Combined; +const int IO_TypeMask; + +// Handling modes. + +const int IO_Raw; +const int IO_Async; + +// Device open modes. + +const int IO_ReadOnly; +const int IO_WriteOnly; +const int IO_ReadWrite; +const int IO_Append; +const int IO_Truncate; +const int IO_Translate; +const int IO_ModeMask; + +// Device state. + +const int IO_Open; +const int IO_StateMask; + +// Device status. + +const int IO_Ok; +const int IO_ReadError; +const int IO_WriteError; +const int IO_FatalError; +const int IO_ResourceError; +const int IO_OpenError; +const int IO_ConnectError; +const int IO_AbortError; +const int IO_TimeOutError; +%If (Qt_2_00 -) +const int IO_UnspecifiedError; +%End + + +class QIODevice +{ +%TypeHeaderCode +#include <qiodevice.h> +%End + +public: +%If (Qt_3_0_0 -) + typedef Q_ULONG Offset; +%End + + QIODevice(); + + int flags() const; + int mode() const; + int state() const; + bool isDirectAccess() const; + bool isSequentialAccess() const; + bool isCombinedAccess() const; + bool isBuffered() const; + bool isRaw() const; + bool isSynchronous() const; + bool isAsynchronous() const; + bool isTranslated() const; + bool isReadable() const; + bool isWritable() const; + bool isReadWrite() const; + bool isInactive() const; + bool isOpen() const; + + int status() const; + void resetStatus(); + + virtual bool open(int) = 0 /ReleaseGIL/; + virtual void close() = 0; + virtual void flush() = 0 /ReleaseGIL/; + +%If (- Qt_3_0_0) + virtual uint size() const = 0; + virtual int at() const; + virtual bool at(int); +%End +%If (Qt_3_0_0 -) + virtual Offset size() const = 0; + virtual Offset at() const; + virtual bool at(Offset); +%End + virtual bool atEnd() const; + bool reset(); + +%If (- Qt_3_0_0) + virtual SIP_PYOBJECT readBlock(uint) = 0 /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"i",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1; + else if (!PyString_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyString_AS_STRING(buf),PyString_GET_SIZE(buf)); + sipRes = PyString_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End +%End +%If (Qt_3_0_0 -) + virtual SIP_PYOBJECT readBlock(Q_ULONG) = 0 /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1L; + else if (!PyString_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyString_AS_STRING(buf),PyString_GET_SIZE(buf)); + sipRes = PyString_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End +%End + +%If (- Qt_3_0_0) + virtual int writeBlock(const char * /Array/, + uint /ArraySize/) = 0 /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + virtual Q_LONG writeBlock(const char * /Array/, + Q_ULONG /ArraySize/) = 0 /ReleaseGIL/; +%End + +%If (- Qt_3_0_0) + virtual SIP_PYOBJECT readLine(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp->QIODevice::readLine(buf, a0) : sipCpp->readLine(buf, a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"i",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1; + else if (!PyString_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyString_AS_STRING(buf),PyString_GET_SIZE(buf)); + sipRes = PyString_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End +%End +%If (Qt_3_0_0 -) + virtual SIP_PYOBJECT readLine(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp->QIODevice::readLine(buf, a0) : sipCpp->readLine(buf, a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%VirtualCatcherCode + PyObject *result = sipCallMethod(&sipIsErr,sipMethod,"l",a1); + + if (result != NULL) + { + PyObject *buf; + + sipParseResult(&sipIsErr,sipMethod,result,"O",&buf); + + if (buf == Py_None) + sipRes = -1L; + else if (!PyString_Check(buf)) + { + sipBadCatcherResult(sipMethod); + sipIsErr = 1; + } + else + { + memcpy(a0,PyString_AS_STRING(buf),PyString_GET_SIZE(buf)); + sipRes = PyString_GET_SIZE(buf); + } + + Py_DECREF(buf); + Py_DECREF(result); + } +%End +%End + +%If (Qt_2_00 - Qt_3_0_0) + int writeBlock(const QByteArray &) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + Q_LONG writeBlock(const QByteArray &) /ReleaseGIL/; +%End + +%If (Qt_2_00 - Qt_3_0_0) + QByteArray readAll() /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + virtual QByteArray readAll() /ReleaseGIL/; +%End + + virtual int getch() = 0 /ReleaseGIL/; + virtual int putch(int) = 0 /ReleaseGIL/; + virtual int ungetch(int) = 0; + +protected: + void setFlags(int); + void setType(int); + void setMode(int); + void setState(int); + void setStatus(int); + +private: + QIODevice(const QIODevice &); +}; diff --git a/python/pyqt/sip/qt/qkeycode.sip b/python/pyqt/sip/qt/qkeycode.sip new file mode 100644 index 00000000..72c0a253 --- /dev/null +++ b/python/pyqt/sip/qt/qkeycode.sip @@ -0,0 +1,286 @@ +// This is the SIP interface definition for the key code definitions. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%If (- Qt_2_00) + +%ModuleHeaderCode +#include <qkeycode.h> +%End + +// Accelerator modifiers. +const uint SHIFT; +const uint CTRL; +const uint ALT; +const uint ASCII_ACCEL; + +// Miscellaneous keys. +const int Key_Escape; +const int Key_Tab; +const int Key_Backtab; +const int Key_Backspace; +const int Key_Return; +const int Key_Enter; +const int Key_Insert; +const int Key_Delete; +const int Key_Pause; +const int Key_Print; +const int Key_SysReq; + +// Cursor keys. +const int Key_Home; +const int Key_End; +const int Key_Left; +const int Key_Up; +const int Key_Right; +const int Key_Down; +const int Key_Prior; +const int Key_PageUp; +const int Key_Next; +const int Key_PageDown; + +// Modifiers. +const int Key_Shift; +const int Key_Control; +const int Key_Meta; +const int Key_Alt; +const int Key_CapsLock; +const int Key_NumLock; +const int Key_ScrollLock; + +// Function keys. +const int Key_F1; +const int Key_F2; +const int Key_F3; +const int Key_F4; +const int Key_F5; +const int Key_F6; +const int Key_F7; +const int Key_F8; +const int Key_F9; +const int Key_F10; +const int Key_F11; +const int Key_F12; +const int Key_F13; +const int Key_F14; +const int Key_F15; +const int Key_F16; +const int Key_F17; +const int Key_F18; +const int Key_F19; +const int Key_F20; +const int Key_F21; +const int Key_F22; +const int Key_F23; +const int Key_F24; +const int Key_F25; +const int Key_F26; +const int Key_F27; +const int Key_F28; +const int Key_F29; +const int Key_F30; +const int Key_F31; +const int Key_F32; +const int Key_F33; +const int Key_F34; +const int Key_F35; + +// Extra keys. +const int Key_Super_L; +const int Key_Super_R; +const int Key_Menu; +%If (Qt_1_43 -) +const int Key_Hyper_L; +const int Key_Hyper_R; +%End + +// The 7 bit printable ASCII keys. +const int Key_Space; +const int Key_Exclam; +const int Key_QuoteDbl; +const int Key_NumberSign; +const int Key_Dollar; +const int Key_Percent; +const int Key_Ampersand; +const int Key_Apostrophe; +const int Key_ParenLeft; +const int Key_ParenRight; +const int Key_Asterisk; +const int Key_Plus; +const int Key_Comma; +const int Key_Minus; +const int Key_Period; +const int Key_Slash; +const int Key_0; +const int Key_1; +const int Key_2; +const int Key_3; +const int Key_4; +const int Key_5; +const int Key_6; +const int Key_7; +const int Key_8; +const int Key_9; +const int Key_Colon; +const int Key_Semicolon; +const int Key_Less; +const int Key_Equal; +const int Key_Greater; +const int Key_Question; +const int Key_At; +const int Key_A; +const int Key_B; +const int Key_C; +const int Key_D; +const int Key_E; +const int Key_F; +const int Key_G; +const int Key_H; +const int Key_I; +const int Key_J; +const int Key_K; +const int Key_L; +const int Key_M; +const int Key_N; +const int Key_O; +const int Key_P; +const int Key_Q; +const int Key_R; +const int Key_S; +const int Key_T; +const int Key_U; +const int Key_V; +const int Key_W; +const int Key_X; +const int Key_Y; +const int Key_Z; +const int Key_BracketLeft; +const int Key_Backslash; +const int Key_BracketRight; +const int Key_AsciiCircum; +const int Key_Underscore; +const int Key_QuoteLeft; +const int Key_BraceLeft; +const int Key_Bar; +const int Key_BraceRight; +const int Key_AsciiTilde; + +// Latin 1 codes. +const int Key_nobreakspace; +const int Key_exclamdown; +const int Key_cent; +const int Key_sterling; +const int Key_currency; +const int Key_yen; +const int Key_brokenbar; +const int Key_section; +const int Key_diaeresis; +const int Key_copyright; +const int Key_ordfeminine; +const int Key_guillemotleft; +const int Key_notsign; +const int Key_hyphen; +const int Key_registered; +const int Key_macron; +const int Key_degree; +const int Key_plusminus; +const int Key_twosuperior; +const int Key_threesuperior; +const int Key_acute; +const int Key_mu; +const int Key_paragraph; +const int Key_periodcentered; +const int Key_cedilla; +const int Key_onesuperior; +const int Key_masculine; +const int Key_guillemotright; +const int Key_onequarter; +const int Key_onehalf; +const int Key_threequarters; +const int Key_questiondown; +const int Key_Agrave; +const int Key_Aacute; +const int Key_Acircumflex; +const int Key_Atilde; +const int Key_Adiaeresis; +const int Key_Aring; +const int Key_AE; +const int Key_Ccedilla; +const int Key_Egrave; +const int Key_Eacute; +const int Key_Ecircumflex; +const int Key_Ediaeresis; +const int Key_Igrave; +const int Key_Iacute; +const int Key_Icircumflex; +const int Key_Idiaeresis; +const int Key_ETH; +const int Key_Ntilde; +const int Key_Ograve; +const int Key_Oacute; +const int Key_Ocircumflex; +const int Key_Otilde; +const int Key_Odiaeresis; +const int Key_multiply; +const int Key_Ooblique; +const int Key_Ugrave; +const int Key_Uacute; +const int Key_Ucircumflex; +const int Key_Udiaeresis; +const int Key_Yacute; +const int Key_THORN; +const int Key_ssharp; +const int Key_agrave; +const int Key_aacute; +const int Key_acircumflex; +const int Key_atilde; +const int Key_adiaeresis; +const int Key_aring; +const int Key_ae; +const int Key_ccedilla; +const int Key_egrave; +const int Key_eacute; +const int Key_ecircumflex; +const int Key_ediaeresis; +const int Key_igrave; +const int Key_iacute; +const int Key_icircumflex; +const int Key_idiaeresis; +const int Key_eth; +const int Key_ntilde; +const int Key_ograve; +const int Key_oacute; +const int Key_ocircumflex; +const int Key_otilde; +const int Key_odiaeresis; +const int Key_division; +const int Key_oslash; +const int Key_ugrave; +const int Key_uacute; +const int Key_ucircumflex; +const int Key_udiaeresis; +const int Key_yacute; +const int Key_thorn; +const int Key_ydiaeresis; + +const int Key_unknown; + +%End diff --git a/python/pyqt/sip/qt/qkeysequence.sip b/python/pyqt/sip/qt/qkeysequence.sip new file mode 100644 index 00000000..c7800f93 --- /dev/null +++ b/python/pyqt/sip/qt/qkeysequence.sip @@ -0,0 +1,119 @@ +// This is the SIP interface definition for QKeySequence. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QKeySequence (Qt v3+)</Title> +<Para> +<Literal>QKeySequence</Literal> is fully implemented including the operators +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>QString()</Literal> and +<Literal>int()</Literal>. A <Literal>QString</Literal> instance or a Python +integer may be used whenever a <Literal>QKeySequence</Literal> can be used. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QKeySequence : Qt +{ +%TypeHeaderCode +#include <qkeysequence.h> +%End + +public: + QKeySequence(); + QKeySequence(const QString &); + QKeySequence(int); +%If (Qt_3_1_0 -) + QKeySequence(int,int,int = 0,int = 0); + + bool operator==(const QKeySequence &) const; + bool operator!=(const QKeySequence &) const; + + uint count() const; + bool isEmpty() const; + Qt::SequenceMatch matches(const QKeySequence &) const; +%End + + int __int__() const; + +%ConvertToTypeCode + // Allow a QString or a Python integer whenever a QKeySequence is + // expected. + + if (sipIsErr == NULL) + { + if (sipCanConvertToInstance(sipPy,sipClass_QKeySequence,SIP_NO_CONVERTORS)) + return 1; + + if (sipCanConvertToInstance(sipPy,sipClass_QString,0)) + return 1; + + PyErr_Clear(); + + PyInt_AsLong(sipPy); + + return !PyErr_Occurred(); + } + + // We do this case before the int case because, otherwise, + // PyInt_AsLong() would achieve the same result but less efficiently. + + if (sipCanConvertToInstance(sipPy,sipClass_QKeySequence,SIP_NO_CONVERTORS)) + { + *sipCppPtr = reinterpret_cast<QKeySequence *>(sipConvertToInstance(sipPy,sipClass_QKeySequence,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; + } + + if (sipCanConvertToInstance(sipPy,sipClass_QString,0)) + { + int state; + QString *s = reinterpret_cast<QString *>(sipConvertToInstance(sipPy,sipClass_QString,0,0,&state,sipIsErr)); + + if (*sipIsErr) + { + sipReleaseInstance(s,sipClass_QString,state); + return 0; + } + + Py_BEGIN_ALLOW_THREADS + *sipCppPtr = new QKeySequence(*s); + Py_END_ALLOW_THREADS + + sipReleaseInstance(s,sipClass_QString,state); + + return sipGetState(sipTransferObj); + } + + int key = PyInt_AsLong(sipPy); + + Py_BEGIN_ALLOW_THREADS + *sipCppPtr = new QKeySequence(key); + Py_END_ALLOW_THREADS + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qlabel.sip b/python/pyqt/sip/qt/qlabel.sip new file mode 100644 index 00000000..62655e6c --- /dev/null +++ b/python/pyqt/sip/qt/qlabel.sip @@ -0,0 +1,157 @@ +// This is the SIP interface definition for QLabel. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLabel</Title> +<Para> +<Literal>QLabel</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QLabel : QFrame +{ +%TypeHeaderCode +#include <qlabel.h> +%End + +public: +%If (- Qt_2_00) + QLabel(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + QLabel(const char *,QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + QLabel(QWidget *,const char *,QWidget * /TransferThis/,const char * = 0,WFlags = 0); +%End +%If (Qt_2_00 -) + QLabel(QWidget * /TransferThis/,const char * = 0,WFlags = 0); + QLabel(const QString &,QWidget * /TransferThis/,const char * = 0,WFlags = 0); + QLabel(QWidget *,const QString &,QWidget * /TransferThis/,const char * = 0,WFlags = 0); +%End + +%If (- Qt_2_00) + const char *text() const; +%End +%If (Qt_2_00 -) + QString text() const; +%End + QPixmap *pixmap() const; +%If (Qt_3_0_0 -) + QPicture *picture() const; +%End + QMovie *movie() const; + +%If (Qt_2_00 -) + TextFormat textFormat() const; + void setTextFormat(TextFormat); +%End + + int alignment() const; +%If (- Qt_2_00) + void setAlignment(int); +%End +%If (Qt_2_00 -) + virtual void setAlignment(int); +%End +%If (- Qt_2_00) + int margin() const; + void setMargin(int); +%End +%If (Qt_2_00 -) + int indent() const; + void setIndent(int); +%End + + bool autoResize() const; +%If (- Qt_2_00) + void setAutoResize(bool); +%End +%If (Qt_2_00 -) + virtual void setAutoResize(bool); +%End +%If (Qt_2_2_0 -) + bool hasScaledContents() const; + void setScaledContents(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + QSize sizeHint() const; +%If (Qt_2_1_0 -) + QSize minimumSizeHint() const; +%End +%If (- Qt_2_00) + void setBuddy(QWidget *); +%End +%If (Qt_2_00 -) + virtual void setBuddy(QWidget *); +%End + QWidget *buddy() const; +%If (Qt_2_00 - Qt_3_0_0) + void setAutoMask(bool); +%End +%If (Qt_2_00 -) + int heightForWidth(int) const; +%End + +%If (Qt_3_0_0 -) + void setFont(const QFont &); +%End + +public slots: +%If (- Qt_2_00) + void setText(const char *); + void setPixmap(const QPixmap &); +%End +%If (Qt_2_00 -) + virtual void setText(const QString &); + virtual void setPixmap(const QPixmap &); +%End +%If (Qt_3_0_0 -) + virtual void setPicture(const QPicture &); +%End +%If (- Qt_2_00) + void setMovie(const QMovie &); + void setNum(int /Constrained/); + void setNum(double); +%End +%If (Qt_2_00 -) + virtual void setMovie(const QMovie &); + virtual void setNum(int /Constrained/); + virtual void setNum(double); +%End + void clear(); + +protected: + void drawContents(QPainter *); +%If (Qt_2_00 - Qt_3_0_0) + void drawContentsMask(QPainter *); +%End +%If (Qt_2_1_0 -) + void fontChange(const QFont &); +%End +%If (Qt_2_2_0 -) + void resizeEvent(QResizeEvent *); +%End + +private: + QLabel(const QLabel &); +}; diff --git a/python/pyqt/sip/qt/qlayout.sip b/python/pyqt/sip/qt/qlayout.sip new file mode 100644 index 00000000..4270e1ef --- /dev/null +++ b/python/pyqt/sip/qt/qlayout.sip @@ -0,0 +1,597 @@ +// This is the SIP interface definition for QBoxLayout, QGLayoutIterator, +// QGridLayout, QHBoxLayout, QLayout, QLayoutItem, QLayoutIterator, +// QSpacerItem, QVBoxLayout and QWidgetItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLayout</Title> +<Para> +<Literal>QLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QBoxLayout</Title> +<Para> +<Literal>QBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLayoutIterator (Qt v2+)</Title> +<Para> +<Literal>QGLayoutIterator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGridLayout</Title> +<FuncSynopsis> + <FuncDef>bool <Function>findWidget</Function></FuncDef> + <ParamDef>QWidget *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>row</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>w</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result, <Literal>row</Literal> and +<Literal>col</Literal>. (Qt v2+) +</Para> +</Sect2> + +<Sect2><Title>QHBoxLayout</Title> +<Para> +<Literal>QHBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QLayoutItem (Qt v2+)</Title> +<Para> +<Literal>QLayoutItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QLayoutIterator (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>QLayoutItem *<Function>next</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This is a wrapper around the <Literal>QLayoutIterator</Literal> +<Literal>++</Literal> operator. +</Para> +</Sect2> + +<Sect2><Title>QSpacerItem (Qt v2+)</Title> +<Para> +<Literal>QSpacerItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QVBoxLayout</Title> +<Para> +<Literal>QVBoxLayout</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWidgetItem (Qt v2+)</Title> +<Para> +<Literal>QWidgetItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QLayout : QObject +{ +%TypeHeaderCode +#include <qlayout.h> +%End + +public: + enum + { + unlimited = QCOORD_MAX + }; + + int defaultBorder() const; + virtual bool activate(); + void freeze(int,int); + void freeze(); + void setMenuBar(QMenuBar *); + QWidget *mainWidget(); + +protected: + QLayout(QWidget * /TransferThis/,int,int,const char *); + QLayout(int = -1,const char * = 0); + + QGManager *basicManager(); + virtual QChain *mainVerticalChain() = 0; + virtual QChain *mainHorizontalChain() = 0; + virtual void initGM() = 0; + void addChildLayout(QLayout *); + +private: + QLayout(const QLayout &); +}; + +%End + + +%If (Qt_2_00 -) + +class QGLayoutIterator +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + virtual QLayoutItem *next() = 0; + virtual QLayoutItem *current() = 0; + virtual QLayoutItem *takeCurrent() = 0 /TransferBack/; +}; + + +class QLayoutIterator +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + QLayoutIterator(QGLayoutIterator *) /Default/; + QLayoutIterator(const QLayoutIterator &); + + QLayoutItem *next(); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipRes = ++(*sipCpp); + Py_END_ALLOW_THREADS +%End + + QLayoutItem *current(); + QLayoutItem *takeCurrent() /TransferBack/; + void deleteCurrent(); +}; + + +class QLayoutItem +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + QLayoutItem(int = 0 ); + +%ConvertToSubClassCode + // Note that we let the QObject sub-class code handle QLayout and it's + // sub-classes. + if (sipCpp->widget()) + sipClass = sipClass_QWidgetItem; + else if (sipCpp->spacerItem()) + sipClass = sipClass_QSpacerItem; + else + sipClass = NULL; +%End + + virtual QSize sizeHint() const = 0; + virtual QSize minimumSize() const = 0; + virtual QSize maximumSize() const = 0; + virtual QSizePolicy::ExpandData expanding() const = 0; + virtual void setGeometry(const QRect &) = 0; + virtual QRect geometry() const = 0; + virtual bool isEmpty() const = 0; + virtual bool hasHeightForWidth() const; + virtual int heightForWidth(int) const; + virtual void invalidate(); + + virtual QWidget *widget(); + virtual QLayoutIterator iterator(); + virtual QLayout *layout(); + virtual QSpacerItem *spacerItem(); + + int alignment() const; + virtual void setAlignment(int); +}; + + +class QSpacerItem : QLayoutItem +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + QSpacerItem(int,int,QSizePolicy::SizeType = QSizePolicy::Minimum, + QSizePolicy::SizeType = QSizePolicy::Minimum); + + void changeSize(int,int,QSizePolicy::SizeType = QSizePolicy::Minimum, + QSizePolicy::SizeType = QSizePolicy::Minimum); + QSize sizeHint() const; + QSize minimumSize() const; + QSize maximumSize() const; + QSizePolicy::ExpandData expanding() const; + bool isEmpty() const; + void setGeometry(const QRect &); + QRect geometry() const; + QSpacerItem *spacerItem(); +}; + + +class QWidgetItem : QLayoutItem +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + QWidgetItem(QWidget *); + + QSize sizeHint() const; + QSize minimumSize() const; + QSize maximumSize() const; + QSizePolicy::ExpandData expanding() const; + bool isEmpty() const; + void setGeometry(const QRect &) ; + QRect geometry() const; + virtual QWidget *widget(); + + bool hasHeightForWidth() const; + int heightForWidth(int) const; +}; + + +class QLayout : QObject, QLayoutItem +{ +%TypeHeaderCode +#include <qabstractlayout.h> +%End + +public: + enum ResizeMode { + FreeResize, + Minimum, + Fixed, +%If (Qt_3_1_0 -) + Auto +%End + }; + + QLayout(QWidget * /TransferThis/,int = 0,int = -1,const char * = 0); + QLayout(QLayout * /TransferThis/,int = -1,const char * = 0); + QLayout(int = -1,const char * = 0); + + int margin() const; + int spacing() const; + + virtual void setMargin(int); + virtual void setSpacing(int); + +%If (- Qt_3_1_0) + enum { + unlimited + }; +%End + +%If (Qt_3_0_0 -) + int defaultBorder() const; + void freeze(int,int); + void freeze(); +%End + + void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + + virtual void setMenuBar(QMenuBar *); + QMenuBar *menuBar() const; + + QWidget *mainWidget(); + bool isTopLevel() const; + + virtual void setAutoAdd(bool); + bool autoAdd() const; + +%If (Qt_2_1_0 -) + void invalidate(); +%End + QRect geometry() const; + bool activate(); + + void add(QWidget *); + virtual void addItem(QLayoutItem * /Transfer/) = 0; + +%If (Qt_3_1_0 -) + void remove(QWidget *); + void removeItem(QLayoutItem * /TransferBack/); +%End + + QSizePolicy::ExpandData expanding() const; + QSize minimumSize() const; + QSize maximumSize() const; + void setGeometry(const QRect &) = 0; + QLayoutIterator iterator() = 0; + bool isEmpty() const; + + int totalHeightForWidth(int) const; + QSize totalMinimumSize() const; + QSize totalMaximumSize() const; + QSize totalSizeHint() const; + QLayout *layout(); + +%If (Qt_2_1_0 -) + bool supportsMargin() const; +%End + +%If (Qt_2_2_0 -) + void setEnabled(bool); + bool isEnabled() const; +%End + +protected: + bool eventFilter(QObject *,QEvent *); +%If (Qt_3_0_0 -) + void childEvent(QChildEvent *); +%End + void addChildLayout(QLayout *); + void deleteAllItems(); + +%If (Qt_2_1_0 -) + void setSupportsMargin(bool); + QRect alignmentRect(const QRect &) const; +%End + +private: + QLayout(const QLayout &); +}; + +%End + + +class QGridLayout : QLayout +{ +%TypeHeaderCode +#include <qlayout.h> +%End + +public: +%If (- Qt_2_1_0) + QGridLayout(QWidget * /TransferThis/,int,int,int = 0,int = -1,const char * = 0); + QGridLayout(int,int,int = -1,const char * = 0); +%End +%If (Qt_2_00 - Qt_2_1_0) + QGridLayout(QLayout * /TransferThis/,int,int,int = -1,const char * = 0); +%End +%If (Qt_2_1_0 -) + QGridLayout(QWidget * /TransferThis/,int = 1,int = 1,int = 0,int = -1,const char * = 0); + QGridLayout(int = 1,int = 1,int = -1,const char * = 0); + QGridLayout(QLayout * /TransferThis/,int = 1,int = 1,int = -1,const char * = 0); +%End + +%If (Qt_2_00 -) + QSize sizeHint() const; + QSize minimumSize() const; + QSize maximumSize() const; +%End + +%If (- Qt_2_00) + void setRowStretch(int,int); + void setColStretch(int,int); +%End +%If (Qt_2_00 -) + virtual void setRowStretch(int,int); + virtual void setColStretch(int,int); +%End +%If (Qt_2_1_0 -) + int rowStretch(int) const; + int colStretch(int) const; +%End + +%If (Qt_3_2_0 -) + void setRowSpacing(int,int); + void setColSpacing(int,int); + int rowSpacing(int) const; + int colSpacing(int) const; +%End + + int numRows() const; + int numCols() const; +%If (Qt_2_1_0 -) + QRect cellGeometry(int,int) const; +%End + +%If (Qt_2_00 -) + bool hasHeightForWidth() const; + int heightForWidth(int) const; +%If (Qt_3_1_0 -) + int minimumHeightForWidth(int) const; +%End + + QSizePolicy::ExpandData expanding() const; + void invalidate(); + + void addItem(QLayoutItem * /Transfer/); +%End +%If (Qt_2_1_0 -) + void addItem(QLayoutItem * /Transfer/,int,int); +%End +%If (Qt_2_00 -) + void addMultiCell(QLayoutItem * /Transfer/,int,int,int,int,int = 0); +%End + + void addWidget(QWidget *,int,int,int = 0); + void addMultiCellWidget(QWidget *,int,int,int,int,int = 0); + void addLayout(QLayout * /Transfer/,int,int); +%If (Qt_2_2_0 -) + void addMultiCellLayout(QLayout * /Transfer/,int,int,int,int,int = 0); +%End + void addRowSpacing(int,int); + void addColSpacing(int,int); + void expand(int,int); + +%If (Qt_2_00 -) + enum Corner { + TopLeft, + TopRight, + BottomLeft, + BottomRight + }; + + void setOrigin(Corner); +%End +%If (Qt_3_0_0 -) + Corner origin() const; +%End +%If (Qt_2_00 -) + QLayoutIterator iterator(); + void setGeometry(const QRect &); +%End + +protected: +%If (- Qt_2_00) + QChain *mainVerticalChain(); + QChain *mainHorizontalChain(); + void initGM(); +%End + +%If (Qt_2_00 -) + bool findWidget(QWidget *,int *,int *); + void add(QLayoutItem * /Transfer/,int,int); +%End + +private: + QGridLayout(const QGridLayout &); +}; + + +class QBoxLayout : QLayout +{ +%TypeHeaderCode +#include <qlayout.h> +%End + +public: + enum Direction { + LeftToRight, + RightToLeft, + TopToBottom, + BottomToTop, + Down = TopToBottom, + Up = BottomToTop + }; + + QBoxLayout(QWidget * /TransferThis/,Direction,int = 0,int = -1,const char * = 0); +%If (Qt_2_00 -) + QBoxLayout(QLayout * /TransferThis/,Direction,int = -1,const char * = 0); +%End + QBoxLayout(Direction,int = -1,const char * = 0); + + Direction direction() const; +%If (Qt_2_1_0 -) + void setDirection(Direction); +%End + void addSpacing(int); + void addStretch(int = 0); +%If (- Qt_2_00) + void addWidget(QWidget *,int = 0,int = AlignCenter); +%End + void addLayout(QLayout * /Transfer/,int = 0); + void addStrut(int); +%If (Qt_2_00 -) + void addItem(QLayoutItem * /Transfer/); + void addWidget(QWidget *,int = 0,int = 0); +%If (Qt_2_1_0 -) + void insertSpacing(int,int); + void insertStretch(int,int = 0); + void insertWidget(int,QWidget *,int = 0,int = 0); + void insertLayout(int,QLayout * /Transfer/,int = 0); + int findWidget(QWidget *); +%End + bool setStretchFactor(QWidget *,int); + QSize sizeHint() const; + QSize minimumSize() const; + QSize maximumSize() const; + bool hasHeightForWidth() const; + int heightForWidth(int) const; +%If (Qt_3_1_0 -) + int minimumHeightForWidth(int) const; +%End + + QSizePolicy::ExpandData expanding() const; + void invalidate(); + QLayoutIterator iterator(); + void setGeometry(const QRect &); +%End + +protected: +%If (- Qt_2_00) + QChain *mainVerticalChain(); + QChain *mainHorizontalChain(); + void initGM(); +%End +%If (Qt_2_1_0 -) + void insertItem(int,QLayoutItem * /Transfer/); +%End + +private: + QBoxLayout(const QBoxLayout &); +}; + + +class QHBoxLayout : QBoxLayout +{ +%TypeHeaderCode +#include <qlayout.h> +%End + +public: + QHBoxLayout(QWidget * /TransferThis/,int = 0,int = -1,const char * = 0); +%If (Qt_2_00 -) + QHBoxLayout(QLayout * /TransferThis/,int = -1,const char * = 0); +%End + QHBoxLayout(int = -1,const char * = 0); + +private: +%If (Qt_3_1_0 -) + QHBoxLayout(const QHBoxLayout &); +%End +}; + + +class QVBoxLayout : QBoxLayout +{ +%TypeHeaderCode +#include <qlayout.h> +%End + +public: + QVBoxLayout(QWidget * /TransferThis/,int = 0,int = -1,const char * = 0); +%If (Qt_2_00 -) + QVBoxLayout(QLayout * /TransferThis/,int = -1,const char * = 0); +%End + QVBoxLayout(int = -1,const char * = 0); + +private: +%If (Qt_3_1_0 -) + QVBoxLayout(const QVBoxLayout &); +%End +}; diff --git a/python/pyqt/sip/qt/qlcdnumber.sip b/python/pyqt/sip/qt/qlcdnumber.sip new file mode 100644 index 00000000..ae250fd8 --- /dev/null +++ b/python/pyqt/sip/qt/qlcdnumber.sip @@ -0,0 +1,137 @@ +// This is the SIP interface definition for QLCDNumber. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLCDNumber</Title> +<Para> +<Literal>QLCDNumber</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QLCDNumber : QFrame +{ +%TypeHeaderCode +#include <qlcdnumber.h> +%End + +public: + QLCDNumber(QWidget * /TransferThis/ = 0,const char * = 0); + QLCDNumber(uint,QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_00) + enum Mode { + HEX, + DEC, + OCT, + BIN + }; +%End +%If (Qt_2_00 -) + enum Mode { + Hex, HEX = Hex, + Dec, DEC = Dec, + Oct, OCT = Oct, + Bin, BIN = Bin + }; +%End + + enum SegmentStyle { + Outline, + Filled, + Flat + }; + + bool smallDecimalPoint() const; + + int numDigits() const; +%If (- Qt_2_00) + void setNumDigits(int); +%End +%If (Qt_2_00 -) + virtual void setNumDigits(int); +%End + + bool checkOverflow(int /Constrained/) const; + bool checkOverflow(double) const; + + Mode mode() const; +%If (- Qt_2_00) + void setMode(Mode); +%End +%If (Qt_2_00 -) + virtual void setMode(Mode); +%End + + SegmentStyle segmentStyle() const; +%If (- Qt_2_00) + void setSegmentStyle(SegmentStyle); +%End +%If (Qt_2_00 -) + virtual void setSegmentStyle(SegmentStyle); +%End + + double value() const; + int intValue() const; + + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +public slots: +%If (- Qt_2_00) + void display(const char *); +%End +%If (Qt_2_00 -) + void display(const QString &); +%End + void display(int /Constrained/); + void display(double); +%If (- Qt_2_00) + void setHexMode(); + void setDecMode(); + void setOctMode(); + void setBinMode(); + void setSmallDecimalPoint(bool); +%End +%If (Qt_2_00 -) + virtual void setHexMode(); + virtual void setDecMode(); + virtual void setOctMode(); + virtual void setBinMode(); + virtual void setSmallDecimalPoint(bool); +%End + +signals: + void overflow(); + +protected: +%If (- Qt_2_00) + void resizeEvent(QResizeEvent *); +%End + void drawContents(QPainter *); + +private: + QLCDNumber(const QLCDNumber &); +}; diff --git a/python/pyqt/sip/qt/qlibrary.sip b/python/pyqt/sip/qt/qlibrary.sip new file mode 100644 index 00000000..cb9813ad --- /dev/null +++ b/python/pyqt/sip/qt/qlibrary.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for QLibrary. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLibrary (Qt v3+)</Title> +<Para> +<Literal>QLibrary</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QLibrary +{ +%TypeHeaderCode +#include <qlibrary.h> +%End + +public: + QLibrary(const QString &); + + void *resolve(const char *); + static void *resolve(const QString &,const char *); + + bool load(); + virtual bool unload(); + bool isLoaded() const; + + bool autoUnload() const; + void setAutoUnload(bool); + + QString library() const; + +private: + QLibrary(const QLibrary &); +}; + +%End diff --git a/python/pyqt/sip/qt/qlineedit.sip b/python/pyqt/sip/qt/qlineedit.sip new file mode 100644 index 00000000..47bd3fa0 --- /dev/null +++ b/python/pyqt/sip/qt/qlineedit.sip @@ -0,0 +1,427 @@ +// This is the SIP interface definition for QLineEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLineEdit</Title> +<FuncSynopsis> + <FuncDef>int <Function>characterAt</Function></FuncDef> + <ParamDef>int <Parameter>xpos</Parameter></ParamDef> + <ParamDef>QChar *<Parameter>chr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>xpos</Literal> parameter and returns the int +result and the <Literal>chr</Literal> value as a tuple. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>start</Parameter></ParamDef> + <ParamDef>int *<Parameter>end</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns the bool result and the +<Literal>start</Literal> and <Literal>end</Literal> values as a tuple. +(Qt v3+) +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QLineEdit : QFrame +{ +%TypeHeaderCode +#include <qlineedit.h> +%End + +public: + QLineEdit(QWidget * /TransferThis/,const char * = 0); + QLineEdit(const QString &,QWidget * /TransferThis/,const char * = 0); +%If (Qt_3_2_0 -) + QLineEdit(const QString &,const QString &,QWidget * /TransferThis/, + const char * = 0); +%End + + QString text() const; + + QString displayText() const; + + int maxLength() const; + + bool frame() const; + + enum EchoMode { + Normal, + NoEcho, + Password + }; + + EchoMode echoMode() const; + + bool isReadOnly() const; + + const QValidator *validator() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + int cursorPosition() const; + // Obsolete. + bool validateAndSet(const QString &,int,int,int); + + int alignment() const; + + void cursorForward(bool,int = 1); + void cursorBackward(bool,int = 1); + void cursorWordForward(bool); + void cursorWordBackward(bool); + void backspace(); + void del() /PyName=delChar/; + void home(bool); + void end(bool); + +%If (Qt_3_2_0 -) + bool isModified() const; + void clearModified(); +%End + + // Obsolete. + bool edited() const; + // Obsolete. + void setEdited(bool); + + bool hasSelectedText() const; + QString selectedText() const; +%If (Qt_3_2_0 -) + int selectionStart() const; +%End + + bool isUndoAvailable() const; + bool isRedoAvailable() const; + + bool dragEnabled() const; + +%If (Qt_3_2_0 -) + QString inputMask() const; + void setInputMask(const QString &); + bool hasAcceptableInput() const; +%End + +public slots: + virtual void setText(const QString &); + virtual void selectAll(); + virtual void deselect(); + virtual void clearValidator(); + virtual void insert(const QString &); + virtual void clear(); + virtual void undo(); + virtual void redo(); + virtual void setMaxLength(int); + virtual void setFrame(bool); + virtual void setEchoMode(EchoMode); + virtual void setReadOnly(bool); + virtual void setValidator(const QValidator *); + virtual void setFont(const QFont &); + virtual void setPalette(const QPalette &); + virtual void setSelection(int,int); + virtual void setCursorPosition(int); + virtual void setAlignment(int); +%If (Qt_CLIPBOARD) + virtual void cut(); + virtual void copy() const; + virtual void paste(); +%End + virtual void setDragEnabled(bool); + +signals: + void textChanged(const QString &); + void returnPressed(); +%If (Qt_3_1_0 -) + void lostFocus(); +%End + void selectionChanged(); + +protected: + bool event(QEvent *); + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + void imStartEvent(QIMEvent *); + void imComposeEvent(QIMEvent *); + void imEndEvent(QIMEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void resizeEvent(QResizeEvent *); + void drawContents(QPainter *); +%If (Qt_DRAGANDDROP) + void dragEnterEvent(QDragEnterEvent *); + void dragMoveEvent(QDragMoveEvent *); + void dragLeaveEvent(QDragLeaveEvent *); + void dropEvent(QDropEvent *); +%End + void contextMenuEvent(QContextMenuEvent *); + virtual QPopupMenu *createPopupMenu() /Factory/; + void windowActivationChange(bool); + +public: + // These appeared in v3.0.2 but defined as incompatible 3.0 addons, + // until v3.1.0. v3.2.0 then defined them as internal and obsolete. +%If (Qt_3_1_0 -) + void setPasswordChar(QChar); + QChar passwordChar() const; +%End + + // Obsolete. + SIP_PYTUPLE characterAt(int) const; +%MethodCode + int res; + QChar *chr; + + Py_BEGIN_ALLOW_THREADS + chr = new QChar(); + res = sipCpp -> characterAt(a0,chr); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(iB)",res,chr,sipClass_QChar,NULL); +%End + + // Obsolete. + bool getSelection(int *,int *); + +private: + QLineEdit(const QLineEdit &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QLineEdit : QWidget +{ +%TypeHeaderCode +#include <qlineedit.h> +%End + +public: +%If (- Qt_2_00) + QLineEdit(QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QLineEdit(QWidget * /TransferThis/,const char * = 0); + QLineEdit(const QString &,QWidget * /TransferThis/,const char * = 0); +%End + +%If (- Qt_2_00) + const char *text() const; +%End +%If (Qt_2_00 -) + QString text() const; + + QString displayText() const; +%End + +%If (- Qt_2_00) + void setMaxLength(int); +%End +%If (Qt_2_00 -) + virtual void setMaxLength(int); +%End + int maxLength() const; + +%If (- Qt_2_00) + void setFrame(bool); +%End +%If (Qt_2_00 -) + virtual void setFrame(bool); +%End + bool frame() const; + + enum EchoMode { + Normal, + NoEcho, + Password + }; + +%If (- Qt_2_00) + void setEchoMode(EchoMode); +%End +%If (Qt_2_00 -) + virtual void setEchoMode(EchoMode); +%End + EchoMode echoMode() const; + +%If (Qt_2_1_0 -) + void setReadOnly(bool); +%End +%If (Qt_2_1_0 -) + bool isReadOnly() const; +%End + +%If (- Qt_2_00) + void setValidator(QValidator *); + QValidator *validator() const; +%End +%If (Qt_2_00 -) + virtual void setValidator(QValidator *); +%End +%If (Qt_2_00 -) + const QValidator *validator() const; +%End + + QSize sizeHint() const; +%If (Qt_2_00 -) + QSize minimumSizeHint() const; +%End +%If (Qt_2_00 -) + QSizePolicy sizePolicy() const; +%End + +%If (- Qt_2_00) + void setCursorPosition(int); +%End +%If (Qt_2_00 -) + virtual void setCursorPosition(int); +%End + int cursorPosition() const; +%If (- Qt_2_00) + bool validateAndSet(const char *,int,int,int); +%End +%If (Qt_2_00 -) + bool validateAndSet(const QString &,int,int,int); +%End + +%If (Qt_2_00 -) + int alignment() const; +%End + +%If (Qt_2_00 -) + void cursorLeft(bool,int = 1); + void cursorRight(bool,int = 1); + void cursorWordForward(bool); + void cursorWordBackward(bool); + void backspace(); + void del() /PyName=delChar/; + void home(bool); + void end(bool); + + void setEdited(bool); + bool edited() const; +%End + +%If (Qt_2_00 -) + bool hasMarkedText() const; + QString markedText() const; +%End + +%If (Qt_CLIPBOARD) + void cut(); + void copy() const; + void paste(); +%End + +%If (- Qt_2_00) + void setEnabled(bool); + void setFont(const QFont &); + void setPalette(const QPalette &); + void setSelection(int,int); +%End +%If (Qt_2_00 -) + virtual void setEnabled(bool); + virtual void setFont(const QFont &); + virtual void setPalette(const QPalette &); + virtual void setSelection(int,int); + + void setAlignment(int); +%End + +public slots: +%If (- Qt_2_00) + void setText(const char *); +%End +%If (Qt_2_00 -) + virtual void setText(const QString &); +%End + void selectAll(); + void deselect(); + void clearValidator(); +%If (- Qt_2_00) + void insert(const char *); +%End +%If (Qt_2_00 -) + void insert(const QString &); +%End + void clear(); + +signals: +%If (- Qt_2_00) + void textChanged(const char *); +%End +%If (Qt_2_00 -) + void textChanged(const QString &); +%End + void returnPressed(); + +protected: +%If (Qt_2_2_0 -) + bool event(QEvent *); +%End + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + void leaveEvent(QEvent *); + void repaintArea(int,int); +%If (- Qt_2_00) + void timerEvent(QTimerEvent *); + bool event(QEvent *); + bool hasMarkedText() const; + QString markedText() const; +%End +%If (Qt_2_00 -) +%If (Qt_DRAGANDDROP) + void dragEnterEvent(QDragEnterEvent *); + void dropEvent(QDropEvent *); +%End +%End + +private: + QLineEdit(const QLineEdit &); +}; + +%End diff --git a/python/pyqt/sip/qt/qlist.sip b/python/pyqt/sip/qt/qlist.sip new file mode 100644 index 00000000..8b5750ca --- /dev/null +++ b/python/pyqt/sip/qt/qlist.sip @@ -0,0 +1,111 @@ +// This is the SIP interface definition for all types based on the QList +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QList<type> (Qt v2)</Title> +<Para> +Types based on the <Literal>QList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 - Qt_3_0_0) + +template<Type> +%MappedType QList<Type> +{ +%TypeHeaderCode +#include <qlist.h> +%End + +%ConvertFromTypeCode + Type *tb; + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (tb = sipCpp -> first(); tb != NULL; tb = sipCpp -> next()) + { + PyObject *tbobj; + + if ((tbobj = sipConvertFromInstance(tb,sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,tbobj) < 0) + { + Py_XDECREF(tbobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0)) + return 0; + + return 1; + } + + QList<Type> *ql = new QList<Type>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + ql -> append(reinterpret_cast<Type *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0,0,0,sipIsErr))); + + if (*sipIsErr) + { + delete ql; + + return 0; + } + } + + *sipCppPtr = ql; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qlistbox.sip b/python/pyqt/sip/qt/qlistbox.sip new file mode 100644 index 00000000..0027e8f2 --- /dev/null +++ b/python/pyqt/sip/qt/qlistbox.sip @@ -0,0 +1,571 @@ +// This is the SIP interface definition for QListBox, QListBoxItem, +// QListBoxPixmap and QListBoxText. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QListBox</Title> +<FuncSynopsis> + <FuncDef>bool <Function>itemYPos</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int *<Parameter>yPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>index</Literal> parameter and returns a tuple +containing the <Literal>bool</Literal> result and <Literal>yPos</Literal>. +(Qt v1.x) +</Para> +</Sect2> + +<Sect2><Title>QListBoxItem</Title> +<Para> +<Literal>QListBoxItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListBoxPixmap</Title> +<Para> +<Literal>QListBoxPixmap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListBoxText</Title> +<Para> +<Literal>QListBoxText</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +%ModuleHeaderCode +#include <qlistbox.h> +%End + +// List box item types. +const int LBI_Undefined; +const int LBI_Text; +const int LBI_Pixmap; +const int LBI_UserDefined; + + +class QListBox : QTableView +{ +%TypeHeaderCode +#include <qlistbox.h> +%End + +public: + QListBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + void setFont(const QFont &); + uint count() const; + void insertStrList(const QStrList *,int = -1); +// void insertStrList(const char **,int = -1,int = -1); + void insertItem(const QListBoxItem * /Transfer/,int = -1); + void insertItem(const char *,int = -1); + void insertItem(const QPixmap &,int = -1); + void inSort(const QListBoxItem *); + void inSort(const char *); + void removeItem(int); + void clear(); + const char *text(int) const; + const QPixmap *pixmap(int) const; + void changeItem(const QListBoxItem * /Transfer/,int); + void changeItem(const char *,int); + void changeItem(const QPixmap &,int); + bool autoUpdate() const; + void setAutoUpdate(bool); + int numItemsVisible() const; + void setFixedVisibleLines(int); + int currentItem() const; + void setCurrentItem(int); + void centerCurrentItem(); + int topItem() const; + void setTopItem(int); + void setBottomItem(int); + bool dragSelect() const; + void setDragSelect(bool); + bool autoScroll() const; + void setAutoScroll(bool); + bool autoScrollBar() const; + void setAutoScrollBar(bool); + bool scrollBar() const; + void setScrollBar(bool); + bool autoBottomScrollBar() const; + void setAutoBottomScrollBar(bool); + bool bottomScrollBar() const; + void setBottomScrollBar(bool); + bool smoothScrolling() const; + void setSmoothScrolling(bool); + int itemHeight() const; + int itemHeight(int) const; + long maxItemWidth() const; + bool isMultiSelection() const; + void setMultiSelection(bool); + void setSelected(int,bool); + bool isSelected(int) const; + QSize sizeHint() const; + +public slots: + void clearSelection(); + +signals: + void highlighted(int); + void selected(int); + void highlighted(const char *); + void selected(const char *); + void selectionChanged(); + +protected: + QListBoxItem *item(int) const; + bool itemVisible(int); + int cellHeight(int = 0); + void paintCell(QPainter *,int,int); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void resizeEvent(QResizeEvent *); + void timerEvent(QTimerEvent *); + int findItem(int) const; + bool itemYPos(int,int *) const; + void updateItem(int,bool = 1); + void clearList(); + void updateCellWidth(); + void toggleCurrentItem(); + +private: + QListBox(const QListBox &); +}; + +%End + +%If (Qt_2_00 -) + +class QListBox : QScrollView +{ +%TypeHeaderCode +#include <qlistbox.h> +%End + +public: + QListBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void setFont(const QFont &); + + uint count() const; + + void insertStringList(const QStringList &,int = -1); + void insertStrList(const QStrList *,int = -1); +// void insertStrList(const QStrList &,int = -1); +// void insertStrList(const char **,int = -1,int = -1); + + void insertItem(const QListBoxItem * /Transfer/,int = -1); +%If (Qt_2_1_0 -) + void insertItem(const QListBoxItem * /Transfer/,const QListBoxItem *); +%End + void insertItem(const QString &,int = -1); + void insertItem(const QPixmap &,int = -1); +%If (Qt_2_1_0 -) + void insertItem(const QPixmap &,const QString &,int = -1); +%End + + void removeItem(int); + +%If (- Qt_3_0_0) + void clear(); +%End + + QString text(int) const; + const QPixmap *pixmap(int) const; + + void changeItem(const QListBoxItem * /Transfer/,int); + void changeItem(const QString &,int); + void changeItem(const QPixmap &,int); +%If (Qt_2_1_0 -) + void changeItem(const QPixmap &,const QString &,int); +%End + + void takeItem(const QListBoxItem * /TransferBack/); + + int numItemsVisible() const; + + int currentItem() const; +%If (Qt_2_1_0 -) + QString currentText() const; +%End + virtual void setCurrentItem(int); + virtual void setCurrentItem(QListBoxItem *); + void centerCurrentItem(); + int topItem() const; + virtual void setTopItem(int); + virtual void setBottomItem(int); + + long maxItemWidth() const; + +%If (- Qt_2_1_0) + enum SelectionMode { + Single, + Multi, + Extended + }; +%End +%If (Qt_2_1_0 -) + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; +%End + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + void setMultiSelection(bool); + bool isMultiSelection() const; + + virtual void setSelected(QListBoxItem *,bool); + void setSelected(int,bool); + bool isSelected(int) const; + bool isSelected(QListBoxItem *) const; +%If (Qt_3_1_0 -) + QListBoxItem *selectedItem() const; +%End + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + QListBoxItem *item(int) const; + int index(const QListBoxItem *) const; +%If (Qt_2_1_0 - Qt_3_0_0) + QListBoxItem *findItem(const QString &) const; +%End +%If (Qt_3_0_0 -) + QListBoxItem *findItem(const QString &, + ComparisonFlags = BeginsWith) const; +%End + + void triggerUpdate(bool); + + bool itemVisible(int); + bool itemVisible(const QListBoxItem *); + + enum LayoutMode { + FixedNumber, + FitToWidth, + FitToHeight = FitToWidth, + Variable + }; + + virtual void setColumnMode(LayoutMode); + virtual void setColumnMode(int); + virtual void setRowMode(LayoutMode); + virtual void setRowMode(int); + + LayoutMode columnMode() const; + LayoutMode rowMode() const; + + int numColumns() const; + int numRows() const; + + bool variableWidth() const; + virtual void setVariableWidth(bool); + + bool variableHeight() const; + virtual void setVariableHeight(bool); + + void viewportPaintEvent(QPaintEvent *); + + int itemHeight(int = 0) const; + QListBoxItem *itemAt(QPoint) const; + + QRect itemRect(QListBoxItem *) const; + +%If (Qt_2_1_0 -) + QListBoxItem *firstItem() const; + + void sort(bool = 1); +%End + +public slots: +%If (Qt_3_0_0 -) + void clear(); +%End + virtual void ensureCurrentVisible(); + virtual void clearSelection(); +%If (Qt_2_1_0 - Qt_3_0_0) + void selectAll(bool); + void invertSelection(); +%End +%If (Qt_3_0_0 -) + virtual void selectAll(bool); + virtual void invertSelection(); +%End + +signals: + void highlighted(int); + void selected(int); + void highlighted(const QString &); + void selected(const QString &); + void highlighted(QListBoxItem *); + void selected(QListBoxItem *); + + void selectionChanged(); +%If (Qt_2_1_0 -) + void selectionChanged(QListBoxItem *); + void currentChanged(QListBoxItem *); + void clicked(QListBoxItem *); + void clicked(QListBoxItem *,const QPoint &); + void pressed(QListBoxItem *); + void pressed(QListBoxItem *,const QPoint &); + + void doubleClicked(QListBoxItem *); + void returnPressed(QListBoxItem *); + void rightButtonClicked(QListBoxItem *,const QPoint &); + void rightButtonPressed(QListBoxItem *,const QPoint &); + void mouseButtonPressed(int,QListBoxItem *,const QPoint &); + void mouseButtonClicked(int,QListBoxItem *,const QPoint &); +%End + +%If (Qt_3_0_0 -) + void contextMenuRequested(QListBoxItem *,const QPoint &); +%End + +%If (Qt_2_1_0 -) + void onItem(QListBoxItem *); + void onViewport(); +%End + +protected: +%If (- Qt_3_0_0) + void viewportMousePressEvent(QMouseEvent *); + void viewportMouseReleaseEvent(QMouseEvent *); + void viewportMouseDoubleClickEvent(QMouseEvent *); + void viewportMouseMoveEvent(QMouseEvent *); +%End + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +%If (Qt_3_0_0 -) + void contentsContextMenuEvent(QContextMenuEvent *); +%End + + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void resizeEvent(QResizeEvent *); + void showEvent(QShowEvent *); + +%If (Qt_3_0_0 -) + bool eventFilter(QObject *,QEvent *); +%End + + void updateItem(int); + void updateItem(QListBoxItem *); + + virtual void paintCell(QPainter *,int,int); + + void toggleCurrentItem(); +%If (Qt_2_2_0 -) + bool isRubberSelecting() const; +%End + + void doLayout() const; + +%If (Qt_3_0_0 -) + void windowActivationChange(bool); +%End + +protected slots: +%If (Qt_2_1_0 -) + void clearInputString(); +%End + +private: + QListBox(const QListBox &); +}; + +%End + + +class QListBoxItem +{ +%TypeHeaderCode +#include <qlistbox.h> +%End + +public: +%If (- Qt_2_00) + QListBoxItem(); +%End +%If (Qt_2_00 -) + QListBoxItem(QListBox * /TransferThis/ = 0); +%End +%If (Qt_2_1_0 -) + QListBoxItem(QListBox * /TransferThis/,QListBoxItem *); +%End + +%If (- Qt_2_00) + virtual const char *text() const; +%End +%If (Qt_2_00 -) + virtual QString text() const; +%End + virtual const QPixmap *pixmap() const; + +%If (- Qt_2_00) + virtual int height(const QListBox *) const = 0; + virtual int width(const QListBox *) const = 0; +%End +%If (Qt_2_00 -) + virtual int height(const QListBox *) const; + virtual int width(const QListBox *) const; +%End + +%If (Qt_2_00 - Qt_3_0_0) + bool selected() const; +%End +%If (Qt_2_1_0 - Qt_3_0_0) + bool current() const; +%End +%If (Qt_3_0_0 -) + bool isSelected() const; + bool isCurrent() const; +%End + +%If (Qt_2_00 -) + QListBox *listBox() const; +%End + +%If (Qt_2_1_0 -) + void setSelectable(bool); + bool isSelectable() const; + + QListBoxItem *next() const; + QListBoxItem *prev() const; +%End + +%If (Qt_3_0_0 -) + virtual int rtti() const; +%End + +protected: + virtual void paint(QPainter *) = 0; +%If (- Qt_2_00) + void setText(const char *); +%End +%If (Qt_2_00 -) + virtual void setText(const QString &); +%End +%If (Qt_2_1_0 -) + void setCustomHighlighting(bool); +%End + +private: + QListBoxItem(const QListBoxItem &); +}; + +class QListBoxText : QListBoxItem +{ +%TypeHeaderCode +#include <qlistbox.h> +%End + +public: +%If (- Qt_2_00) + QListBoxText(const char * = 0); +%End +%If (Qt_2_00 -) + QListBoxText(QListBox * /TransferThis/, + const QString & = QString::null); + QListBoxText(const QString & = QString::null); +%End +%If (Qt_2_1_0 -) + QListBoxText(QListBox * /TransferThis/,const QString &,QListBoxItem *); +%End + +%If (- Qt_2_00) + void paint(QPainter *); +%End + int height(const QListBox *) const; + int width(const QListBox *) const; + +%If (Qt_3_0_0 -) + int rtti() const; +%End + +protected: +%If (Qt_2_00 -) + void paint(QPainter *); +%End + +private: + QListBoxText(const QListBoxText &); +}; + +class QListBoxPixmap : QListBoxItem +{ +%TypeHeaderCode +#include <qlistbox.h> +%End + +public: +%If (Qt_2_00 -) + QListBoxPixmap(QListBox * /TransferThis/,const QPixmap &); +%End + QListBoxPixmap(const QPixmap &); +%If (Qt_2_1_0 -) + QListBoxPixmap(QListBox * /TransferThis/,const QPixmap &, + QListBoxItem *); + QListBoxPixmap(QListBox * /TransferThis/,const QPixmap &, + const QString &); + QListBoxPixmap(const QPixmap &,const QString &); + QListBoxPixmap(QListBox * /TransferThis/,const QPixmap &, + const QString &,QListBoxItem *); +%End + + const QPixmap *pixmap() const; +%If (Qt_2_00 -) + int height(const QListBox *) const; + int width(const QListBox *) const; +%End + +%If (Qt_3_0_0 -) + int rtti() const; +%End + +protected: + void paint(QPainter *); +%If (- Qt_2_00) + int height(const QListBox *) const; + int width(const QListBox *) const; +%End + +private: + QListBoxPixmap(const QListBoxPixmap &); +}; diff --git a/python/pyqt/sip/qt/qlistview.sip b/python/pyqt/sip/qt/qlistview.sip new file mode 100644 index 00000000..2028d1e0 --- /dev/null +++ b/python/pyqt/sip/qt/qlistview.sip @@ -0,0 +1,770 @@ +// This is the SIP interface definition for QListView, QListViewItem, +// QCheckListItem and QListViewItemIterator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QListView</Title> +<Para> +<Literal>QListView</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>QListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QListViewItem</Title> +<Para> +<Literal>QListViewItem</Literal> is fully implemented. +</Para> +<Para> +Note that to remove a child <Literal>QListViewItem</Literal> you must first +call <Literal>takeItem()</Literal> and then <Literal>del()</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QCheckListItem</Title> +<Para> +<Literal>QCheckListItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QListViewItemIterator (Qt v2+)</Title> +<Para> +<Literal>QListViewItemIterator</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QListViewItem +{ +%TypeHeaderCode +#include <qlistview.h> +%End + +public: + QListViewItem(QListView * /TransferThis/); + QListViewItem(QListViewItem * /TransferThis/); + QListViewItem(QListView * /TransferThis/,QListViewItem *); + QListViewItem(QListViewItem * /TransferThis/,QListViewItem *); + + QListViewItem(QListView * /TransferThis/, + const char *,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0); + + QListViewItem(QListViewItem * /TransferThis/, + const char *,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0); + + QListViewItem(QListView * /TransferThis/,QListViewItem *, + const char *,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0); + + QListViewItem(QListViewItem * /TransferThis/,QListViewItem *, + const char *,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0, + const char * = 0,const char * = 0); + + virtual void insertItem(QListViewItem * /Transfer/); + virtual void removeItem(QListViewItem * /TransferBack/); + int height() const; + virtual void invalidateHeight(); + int totalHeight() const; + virtual int width(const QFontMetrics &,const QListView *,int) const; + void widthChanged(int = -1) const; + int depth() const; + virtual void setText(int,const char *); + virtual const char *text(int) const; + virtual void setPixmap(int,const QPixmap &); + virtual const QPixmap *pixmap(int) const; + virtual const char *key(int,bool) const; + virtual void sortChildItems(int,bool); + int childCount() const; + bool isOpen() const; + virtual void setOpen(bool); + virtual void setup(); + virtual void setSelected(bool); + bool isSelected() const; + virtual void paintCell(QPainter *,const QColorGroup &,int,int,int); + virtual void paintBranches(QPainter *,const QColorGroup &,int,int,int, + GUIStyle); + virtual void paintFocus(QPainter *,const QColorGroup &,const QRect &); + QListViewItem *firstChild() const; + QListViewItem *nextSibling() const; + QListViewItem *parent() const; + QListViewItem *itemAbove(); + QListViewItem *itemBelow(); + int itemPos() const; + QListView *listView() const; + virtual void setSelectable(bool); + bool isSelectable() const; + virtual void setExpandable(bool); + bool isExpandable(); + void repaint() const; + +protected: + virtual void enforceSortOrder() const; + virtual void setHeight(int); + virtual void activate(); +}; + +%End + +%If (Qt_2_00 -) + +class QListViewItem : Qt +{ +%TypeHeaderCode +#include <qlistview.h> +%End + +public: + QListViewItem(QListView * /TransferThis/); + QListViewItem(QListViewItem * /TransferThis/); + QListViewItem(QListView * /TransferThis/,QListViewItem *); + QListViewItem(QListViewItem * /TransferThis/,QListViewItem *); + + QListViewItem(QListView * /TransferThis/, + QString,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null); + + QListViewItem(QListViewItem * /TransferThis/, + QString,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null); + + QListViewItem(QListView * /TransferThis/,QListViewItem *, + QString,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null); + + QListViewItem(QListViewItem * /TransferThis/,QListViewItem *, + QString,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null, + QString = QString::null,QString = QString::null); + + virtual void insertItem(QListViewItem * /Transfer/); + virtual void takeItem(QListViewItem * /TransferBack/); + + int height() const; + virtual void invalidateHeight(); + int totalHeight() const; + virtual int width(const QFontMetrics &,const QListView *,int) const; + void widthChanged(int = -1) const; + int depth() const; + + virtual void setText(int,const QString &); + virtual QString text(int) const; + + virtual void setPixmap(int,const QPixmap &); + virtual const QPixmap *pixmap(int) const; + + virtual QString key(int,bool) const; +%If (Qt_3_0_0 -) + virtual int compare(QListViewItem *,int,bool) const; +%End + virtual void sortChildItems(int,bool); + + int childCount() const; + + bool isOpen() const; + virtual void setOpen(bool); + virtual void setup(); + + virtual void setSelected(bool); + bool isSelected() const; + + virtual void paintCell(QPainter *,const QColorGroup &,int,int,int); +%If (- Qt_3_0_0) + virtual void paintBranches(QPainter *,const QColorGroup &,int,int,int, + GUIStyle); +%End +%If (Qt_3_0_0 -) + virtual void paintBranches(QPainter *,const QColorGroup &,int,int,int); +%End + virtual void paintFocus(QPainter *,const QColorGroup &,const QRect &); + + QListViewItem *firstChild() const; + QListViewItem *nextSibling() const; + QListViewItem *parent() const; + + QListViewItem *itemAbove(); + QListViewItem *itemBelow(); + + int itemPos() const; + + QListView *listView() const; + + virtual void setSelectable(bool); + bool isSelectable() const; + + virtual void setExpandable(bool); + bool isExpandable(); + + void repaint() const; + +%If (Qt_2_1_0 - Qt_3_0_0) + void sort(); +%End +%If (Qt_3_0_0 -) + virtual void sort(); +%End +%If (Qt_2_2_0 -) + void moveItem(QListViewItem *); +%End + +%If (Qt_3_0_0 -) + virtual void setDragEnabled(bool); + virtual void setDropEnabled(bool); + bool dragEnabled() const; + bool dropEnabled() const; + virtual bool acceptDrop(const QMimeSource *) const; + + void setVisible(bool); + bool isVisible() const; + + virtual void setRenameEnabled(int,bool); + bool renameEnabled(int) const; + virtual void startRename(int); + + virtual void setEnabled(bool); + bool isEnabled() const; + + virtual int rtti() const; + + virtual void setMultiLinesEnabled(bool); + bool multiLinesEnabled() const; +%End + +protected: + virtual void enforceSortOrder() const; + virtual void setHeight(int); + virtual void activate(); + +%If (Qt_2_1_0 -) + bool activatedPos(QPoint &); +%End +%If (Qt_3_0_0 -) + virtual void dropped(QDropEvent *); + virtual void dragEntered(); + virtual void dragLeft(); + virtual void okRename(int); + virtual void cancelRename(int); + + void ignoreDoubleClick(); +%End +}; + +%End + + +class QListView : QScrollView +{ +%TypeHeaderCode +#include <qlistview.h> +%End + +public: +%If (Qt_2_2_0 - Qt_3_0_0) + QListView(QWidget * /TransferThis/,const char *,WFlags); +%End +%If (- Qt_3_0_0) + QListView(QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_3_0_0 -) + QListView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + + int treeStepSize() const; + virtual void setTreeStepSize(int); + + virtual void insertItem(QListViewItem * /Transfer/); +%If (Qt_2_00 -) + virtual void takeItem(QListViewItem * /TransferBack/); +%End + +%If (- Qt_3_0_0) + virtual void clear(); +%End + QHeader *header() const; + +%If (- Qt_2_00) + virtual int addColumn(const char *,int = -1); + virtual void setColumnText(int,const char *); + const char *columnText(int) const; +%End +%If (Qt_2_00 -) + virtual int addColumn(const QString &,int = -1); + virtual int addColumn(const QIconSet &,const QString &,int = -1); +%If (Qt_2_1_0 -) + void removeColumn(int); +%End + virtual void setColumnText(int,const QString &); + virtual void setColumnText(int,const QIconSet &,const QString &); + QString columnText(int) const; +%End + virtual void setColumnWidth(int,int); + int columnWidth(int) const; + + enum WidthMode + { + Manual, + Maximum + }; + + virtual void setColumnWidthMode(int,WidthMode); + WidthMode columnWidthMode(int) const; +%If (Qt_2_1_0 -) + int columns() const; +%End + + virtual void setColumnAlignment(int,int); + int columnAlignment(int) const; + + void show(); + + QListViewItem *itemAt(const QPoint &) const; + QRect itemRect(const QListViewItem *) const; + int itemPos(const QListViewItem *); + + void ensureItemVisible(const QListViewItem *); + + void repaintItem(const QListViewItem *) const; + + virtual void setMultiSelection(bool); + bool isMultiSelection() const; + +%If (Qt_2_1_0 -) + enum SelectionMode { + Single, + Multi, + Extended, + NoSelection + }; + + void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; +%End + +%If (Qt_2_1_0 -) + virtual void clearSelection(); +%End + virtual void setSelected(QListViewItem *,bool); +%If (Qt_3_2_0 -) + void setSelectionAnchor(QListViewItem *); +%End + bool isSelected(QListViewItem *) const; +%If (Qt_2_1_0 -) + QListViewItem *selectedItem() const; +%End + virtual void setOpen(QListViewItem *,bool); + bool isOpen(QListViewItem *) const; + + virtual void setCurrentItem(QListViewItem *); + QListViewItem *currentItem() const; + + QListViewItem *firstChild() const; +%If (Qt_3_0_0 -) + QListViewItem *lastItem() const; +%End + + int childCount() const; + + virtual void setAllColumnsShowFocus(bool); + bool allColumnsShowFocus() const; + + virtual void setItemMargin(int); + int itemMargin() const; + + virtual void setRootIsDecorated(bool); + bool rootIsDecorated() const; + + virtual void setSorting(int,bool = 1); +%If (Qt_3_1_0 -) + int sortColumn() const; +%End +%If (Qt_3_2_0 -) + void setSortColumn(int); + SortOrder sortOrder() const; + void setSortOrder(SortOrder); +%End +%If (Qt_3_0_0 -) + virtual void sort(); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void sort(); +%End + +%If (- Qt_2_00) + void setStyle(GUIStyle); + void setFont(const QFont &); + void setPalette(const QPalette &); +%End +%If (Qt_2_00 -) + virtual void setFont(const QFont &); + virtual void setPalette(const QPalette &); +%End + + bool eventFilter(QObject *,QEvent *); + + QSize sizeHint() const; +%If (Qt_2_00 -) + QSize minimumSizeHint() const; +%End + +%If (Qt_2_1_0 -) + void setShowSortIndicator(bool); + bool showSortIndicator() const; +%End +%If (Qt_3_0_0 -) + virtual void setShowToolTips(bool); + bool showToolTips() const; + + enum ResizeMode { + NoColumn, + AllColumns, + LastColumn + }; + + virtual void setResizeMode(ResizeMode); + ResizeMode resizeMode() const; + + QListViewItem *findItem(const QString &,int, + ComparisonFlags = ExactMatch | CaseSensitive) const; + + enum RenameAction { + Accept, + Reject + }; + + virtual void setDefaultRenameAction(RenameAction); + RenameAction defaultRenameAction() const; + bool isRenaming() const; +%End + +%If (Qt_3_2_0 -) + void hideColumn(int); +%End + +public slots: +%If (Qt_3_0_0 -) + virtual void clear(); +%End +%If (Qt_2_1_0 -) + void invertSelection(); + void selectAll(bool); + void setContentsPos(int,int); +%End + void triggerUpdate(); +%If (Qt_3_2_0 -) + void adjustColumn(int); +%End + +signals: + void selectionChanged(); + void selectionChanged(QListViewItem *); + void currentChanged(QListViewItem *); +%If (Qt_2_1_0 -) + void clicked(QListViewItem *); + void clicked(QListViewItem *,const QPoint &,int); + void pressed(QListViewItem *); + void pressed(QListViewItem *,const QPoint &,int); +%End + + void doubleClicked(QListViewItem *); +%If (Qt_3_2_0 -) + void doubleClicked(QListViewItem *,const QPoint &,int); +%End + void returnPressed(QListViewItem *); +%If (Qt_3_0_0 -) + void spacePressed(QListViewItem *); +%End + void rightButtonClicked(QListViewItem *,const QPoint &,int); + void rightButtonPressed(QListViewItem *,const QPoint &,int); +%If (Qt_2_1_0 -) + void mouseButtonPressed(int,QListViewItem *,const QPoint &,int); + void mouseButtonClicked(int,QListViewItem *,const QPoint &,int); +%End + +%If (Qt_3_0_0 -) + void contextMenuRequested(QListViewItem *,const QPoint &,int); +%End + +%If (Qt_2_1_0 -) + void onItem(QListViewItem *); + void onViewport(); + + void expanded(QListViewItem *); + void collapsed(QListViewItem *); +%End +%If (Qt_3_0_0 -) + void dropped(QDropEvent *); + void itemRenamed(QListViewItem *,int,const QString &); + void itemRenamed(QListViewItem *,int); +%End + +protected: +%If (- Qt_2_00) + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); +%End +%If (Qt_2_00 -) + void contentsMousePressEvent(QMouseEvent *); + void contentsMouseReleaseEvent(QMouseEvent *); + void contentsMouseMoveEvent(QMouseEvent *); + void contentsMouseDoubleClickEvent(QMouseEvent *); +%End +%If (Qt_3_0_0 -) + void contentsContextMenuEvent(QContextMenuEvent *); + void contentsDragEnterEvent(QDragEnterEvent *); + void contentsDragMoveEvent(QDragMoveEvent *); + void contentsDragLeaveEvent(QDragLeaveEvent *); + void contentsDropEvent(QDropEvent *); + virtual QDragObject *dragObject(); + virtual void startDrag(); +%End + + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + + void keyPressEvent(QKeyEvent *); + + void resizeEvent(QResizeEvent *); +%If (Qt_3_0_0 -) + void viewportResizeEvent(QResizeEvent *); +%End + +%If (Qt_2_00 -) + void showEvent(QShowEvent *); +%End + + void drawContentsOffset(QPainter *,int,int,int,int,int,int); + + virtual void paintEmptyArea(QPainter *,const QRect &); +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End +%If (- Qt_3_0_0) + void enabledChange(bool); +%End +%If (Qt_3_0_0 -) + void windowActivationChange(bool); +%End + +protected slots: + void updateContents(); +%If (Qt_2_00 -) + void doAutoScroll(); +%End + +private: +%If (Qt_2_1_0 -) + QListView(const QWidget &); +%End +}; + + +class QCheckListItem : QListViewItem +{ +%TypeHeaderCode +#include <qlistview.h> +%End + +public: + enum Type { + RadioButton, + CheckBox, + Controller, +%If (Qt_3_2_0 -) + RadioButtonController, + CheckBoxController, +%End + }; + +%If (Qt_3_2_0 -) + enum ToggleState { + Off, + NoChange, + On + }; +%End + +%If (Qt_3_2_0 -) + QCheckListItem(QCheckListItem * /TransferThis/,const QString &, + Type = RadioButtonController); + QCheckListItem(QCheckListItem * /TransferThis/,QListViewItem *, + const QString &,Type = RadioButtonController); + QCheckListItem(QListViewItem * /TransferThis/,const QString &, + Type = RadioButtonController); + QCheckListItem(QListViewItem * /TransferThis/,QListViewItem *, + const QString &,Type = RadioButtonController); + QCheckListItem(QListView * /TransferThis/,const QString &, + Type = RadioButtonController); + QCheckListItem(QListView * /TransferThis/,QListViewItem *, + const QString &,Type = RadioButtonController); +%End +%If (Qt_2_00 - Qt_3_2_0) + QCheckListItem(QCheckListItem * /TransferThis/,const QString &, + Type = Controller); +%If (Qt_3_1_0 -) + QCheckListItem(QCheckListItem * /TransferThis/,QListViewItem *, + const QString &,Type = Controller); +%End + QCheckListItem(QListViewItem * /TransferThis/,const QString &, + Type = Controller); +%If (Qt_3_1_0 -) + QCheckListItem(QListViewItem * /TransferThis/,QListViewItem *, + const QString &,Type = Controller); +%End + QCheckListItem(QListView * /TransferThis/,const QString &, + Type = Controller); +%If (Qt_3_1_0 -) + QCheckListItem(QListView * /TransferThis/,QListViewItem *, + const QString &,Type = Controller); +%End +%End +%If (Qt_2_00 -) + QCheckListItem(QListViewItem * /TransferThis/,const QString &, + const QPixmap &); + QCheckListItem(QListView * /TransferThis/,const QString &, + const QPixmap &); +%End +%If (- Qt_2_00) + QCheckListItem(QCheckListItem * /TransferThis/,const char *, + Type = Controller); + QCheckListItem(QListView * /TransferThis/,const char *, + Type = Controller); + QCheckListItem(QListViewItem * /TransferThis/,const char *, + const QPixmap &); + QCheckListItem(QListView * /TransferThis/,const char *, + const QPixmap &); +%End + + void paintCell(QPainter *,const QColorGroup &,int,int,int); +%If (Qt_2_00 -) + virtual void paintFocus(QPainter *,const QColorGroup &,const QRect &); +%End + int width(const QFontMetrics &,const QListView *,int) const; + void setup(); + +%If (- Qt_2_00) + void setOn(bool); +%End +%If (Qt_2_00 -) + virtual void setOn(bool); +%End + bool isOn() const; + Type type() const; +%If (- Qt_2_00) + const char *text() const; + const char *text(int) const; +%End +%If (Qt_2_00 -) + QString text() const; + QString text(int) const; +%End + +%If (Qt_3_2_0 -) + void setTristate(bool); + bool isTristate() const; + ToggleState state() const; + void setState(ToggleState); +%End + +%If (Qt_3_0_0 -) + int rtti() const; +%End + +protected: +%If (- Qt_3_0_0) + void paintBranches(QPainter *,const QColorGroup &,int,int,int,GUIStyle); +%End + void activate(); + void turnOffChild(); + virtual void stateChange(bool); +}; + + +%If (Qt_2_00 -) + +class QListViewItemIterator +{ +%TypeHeaderCode +#include <qlistview.h> +%End + +public: +%If (Qt_3_2_0 -) + enum IteratorFlag { + Visible, + Invisible, + Selected, + Unselected, + Selectable, + NotSelectable, + DragEnabled, + DragDisabled, + DropEnabled, + DropDisabled, + Expandable, + NotExpandable, + Checked, + NotChecked + }; +%End + + QListViewItemIterator(); + QListViewItemIterator(QListViewItem *); +%If (Qt_3_2_0 -) + QListViewItemIterator(QListViewItem *,int); +%End + + QListViewItemIterator(const QListViewItemIterator &); + QListViewItemIterator(QListView *); +%If (Qt_3_2_0 -) + QListViewItemIterator(QListView *,int); +%End + + QListViewItemIterator &operator+=(int); + QListViewItemIterator &operator-=(int); + + QListViewItem *current() const; +}; + +%End diff --git a/python/pyqt/sip/qt/qlocale.sip b/python/pyqt/sip/qt/qlocale.sip new file mode 100644 index 00000000..71f3e6db --- /dev/null +++ b/python/pyqt/sip/qt/qlocale.sip @@ -0,0 +1,537 @@ +// This is the SIP interface definition for QLocale. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLocale (Qt v3.3+)</Title> +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>Q_ULONG <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_3_3_0 -) + +class QLocale +{ +%TypeHeaderCode +#include <qlocale.h> +%End + +public: + enum Language { + C, + Abkhazian, + Afan, + Afar, + Afrikaans, + Albanian, + Amharic, + Arabic, + Armenian, + Assamese, + Aymara, + Azerbaijani, + Bashkir, + Basque, + Bengali, + Bhutani, + Bihari, + Bislama, + Breton, + Bulgarian, + Burmese, + Byelorussian, + Cambodian, + Catalan, + Chinese, + Corsican, + Croatian, + Czech, + Danish, + Dutch, + English, + Esperanto, + Estonian, + Faroese, + FijiLanguage, + Finnish, + French, + Frisian, + Gaelic, + Galician, + Georgian, + German, + Greek, + Greenlandic, + Guarani, + Gujarati, + Hausa, + Hebrew, + Hindi, + Hungarian, + Icelandic, + Indonesian, + Interlingua, + Interlingue, + Inuktitut, + Inupiak, + Irish, + Italian, + Japanese, + Javanese, + Kannada, + Kashmiri, + Kazakh, + Kinyarwanda, + Kirghiz, + Korean, + Kurdish, + Kurundi, + Laothian, + Latin, + Latvian, + Lingala, + Lithuanian, + Macedonian, + Malagasy, + Malay, + Malayalam, + Maltese, + Maori, + Marathi, + Moldavian, + Mongolian, + NauruLanguage, + Nepali, + Norwegian, + Occitan, + Oriya, + Pashto, + Persian, + Polish, + Portuguese, + Punjabi, + Quechua, + RhaetoRomance, + Romanian, + Russian, + Samoan, + Sangho, + Sanskrit, + Serbian, + SerboCroatian, + Sesotho, + Setswana, + Shona, + Sindhi, + Singhalese, + Siswati, + Slovak, + Slovenian, + Somali, + Spanish, + Sundanese, + Swahili, + Swedish, + Tagalog, + Tajik, + Tamil, + Tatar, + Telugu, + Thai, + Tibetan, + Tigrinya, + TongaLanguage, + Tsonga, + Turkish, + Turkmen, + Twi, + Uigur, + Ukrainian, + Urdu, + Uzbek, + Vietnamese, + Volapuk, + Welsh, + Wolof, + Xhosa, + Yiddish, + Yoruba, + Zhuang, + Zulu, + LastLanguage + }; + + enum Country { + AnyCountry, + Afghanistan, + Albania, + Algeria, + AmericanSamoa, + Andorra, + Angola, + Anguilla, + Antarctica, + AntiguaAndBarbuda, + Argentina, + Armenia, + Aruba, + Australia, + Austria, + Azerbaijan, + Bahamas, + Bahrain, + Bangladesh, + Barbados, + Belarus, + Belgium, + Belize, + Benin, + Bermuda, + Bhutan, + Bolivia, + BosniaAndHerzegowina, + Botswana, + BouvetIsland, + Brazil, + BritishIndianOceanTerritory, + BruneiDarussalam, + Bulgaria, + BurkinaFaso, + Burundi, + Cambodia, + Cameroon, + Canada, + CapeVerde, + CaymanIslands, + CentralAfricanRepublic, + Chad, + Chile, + China, + ChristmasIsland, + CocosIslands, + Colombia, + Comoros, + DemocraticRepublicOfCongo, + PeoplesRepublicOfCongo, + CookIslands, + CostaRica, + IvoryCoast, + Croatia, + Cuba, + Cyprus, + CzechRepublic, + Denmark, + Djibouti, + Dominica, + DominicanRepublic, + EastTimor, + Ecuador, + Egypt, + ElSalvador, + EquatorialGuinea, + Eritrea, + Estonia, + Ethiopia, + FalklandIslands, + FaroeIslands, + FijiCountry, + Finland, + France, + MetropolitanFrance, + FrenchGuiana, + FrenchPolynesia, + FrenchSouthernTerritories, + Gabon, + Gambia, + Georgia, + Germany, + Ghana, + Gibraltar, + Greece, + Greenland, + Grenada, + Guadeloupe, + Guam, + Guatemala, + Guinea, + GuineaBissau, + Guyana, + Haiti, + HeardAndMcDonaldIslands, + Honduras, + HongKong, + Hungary, + Iceland, + India, + Indonesia, + Iran, + Iraq, + Ireland, + Israel, + Italy, + Jamaica, + Japan, + Jordan, + Kazakhstan, + Kenya, + Kiribati, + DemocraticRepublicOfKorea, + RepublicOfKorea, + Kuwait, + Kyrgyzstan, + Lao, + Latvia, + Lebanon, + Lesotho, + Liberia, + LibyanArabJamahiriya, + Liechtenstein, + Lithuania, + Luxembourg, + Macau, + Macedonia, + Madagascar, + Malawi, + Malaysia, + Maldives, + Mali, + Malta, + MarshallIslands, + Martinique, + Mauritania, + Mauritius, + Mayotte, + Mexico, + Micronesia, + Moldova, + Monaco, + Mongolia, + Montserrat, + Morocco, + Mozambique, + Myanmar, + Namibia, + NauruCountry, + Nepal, + Netherlands, + NetherlandsAntilles, + NewCaledonia, + NewZealand, + Nicaragua, + Niger, + Nigeria, + Niue, + NorfolkIsland, + NorthernMarianaIslands, + Norway, + Oman, + Pakistan, + Palau, + PalestinianTerritory, + Panama, + PapuaNewGuinea, + Paraguay, + Peru, + Philippines, + Pitcairn, + Poland, + Portugal, + PuertoRico, + Qatar, + Reunion, + Romania, + RussianFederation, + Rwanda, + SaintKittsAndNevis, + StLucia, + StVincentAndTheGrenadines, + Samoa, + SanMarino, + SaoTomeAndPrincipe, + SaudiArabia, + Senegal, + Seychelles, + SierraLeone, + Singapore, + Slovakia, + Slovenia, + SolomonIslands, + Somalia, + SouthAfrica, + SouthGeorgiaAndTheSouthSandwichIslands, + Spain, + SriLanka, + StHelena, + StPierreAndMiquelon, + Sudan, + Suriname, + SvalbardAndJanMayenIslands, + Swaziland, + Sweden, + Switzerland, + SyrianArabRepublic, + Taiwan, + Tajikistan, + Tanzania, + Thailand, + Togo, + Tokelau, + TongaCountry, + TrinidadAndTobago, + Tunisia, + Turkey, + Turkmenistan, + TurksAndCaicosIslands, + Tuvalu, + Uganda, + Ukraine, + UnitedArabEmirates, + UnitedKingdom, + UnitedStates, + UnitedStatesMinorOutlyingIslands, + Uruguay, + Uzbekistan, + Vanuatu, + VaticanCityState, + Venezuela, + VietNam, + BritishVirginIslands, + USVirginIslands, + WallisAndFutunaIslands, + WesternSahara, + Yemen, + Yugoslavia, + Zambia, + Zimbabwe, + LastCountry + }; + + QLocale(); + QLocale(const QString &); + QLocale(Language,Country = AnyCountry); + QLocale(const QLocale &); + + Language language() const; + Country country() const; + QString name() const; + + short toShort(const QString &,bool * = 0) const; + ushort toUShort(const QString &,bool * = 0) const; + int toInt(const QString &,bool * = 0) const; + uint toUInt(const QString &,bool * = 0) const; + Q_LONG toLong(const QString &,bool * = 0) const; + Q_ULONG toULong(const QString &,bool * = 0) const; + //Q_LLONG toLongLong(const QString &,bool * = 0) const; + //Q_ULLONG toULongLong(const QString &,bool * = 0) const; + float toFloat(const QString &,bool * = 0) const; + double toDouble(const QString &,bool * = 0) const; + + //QString toString(short) const; + //QString toString(ushort) const; + QString toString(int /Constrained/) const; + //QString toString(uint) const; + //QString toString(Q_LONG) const; + //QString toString(Q_ULONG) const; + //QString toString(Q_LLONG) const; + //QString toString(Q_ULLONG) const; + //QString toString(float,char = 'g',int = 6) const; + QString toString(double,char = 'g',int = 6) const; + + static QString languageToString(Language); + static QString countryToString(Country); + static void setDefault(const QLocale &); + + static QLocale c(); + static QLocale system(); +}; + +%End diff --git a/python/pyqt/sip/qt/qmainwindow.sip b/python/pyqt/sip/qt/qmainwindow.sip new file mode 100644 index 00000000..11a2f120 --- /dev/null +++ b/python/pyqt/sip/qt/qmainwindow.sip @@ -0,0 +1,289 @@ +// This is the SIP interface definition for QMainWindow. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMainWindow</Title> +<FuncSynopsis> + <FuncDef>QTextStream &<Function>operator<<</Function></FuncDef> + <ParamDef>QTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>const QMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>operator>></Function></FuncDef> + <ParamDef>QTextStream &<Parameter></Parameter></ParamDef> + <ParamDef>QMainWindow &<Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +This operator is fully implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getLocation</Function></FuncDef> + <ParamDef>QToolBar *<Parameter>tb</Parameter></ParamDef> + <ParamDef>ToolBarDock &<Parameter>dock</Parameter></ParamDef> + <ParamDef>int &<Parameter>index</Parameter></ParamDef> + <ParamDef>bool &<Parameter>nl</Parameter></ParamDef> + <ParamDef>int &<Parameter>extraOffset</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>tb</Literal> parameter and returns a tuple of the +result, <Literal>dock</Literal>, <Literal>index</Literal>, +<Literal>nl</Literal> and <Literal>extraOffset</Literal> values. (Qt v2.1.0+) +</Para> + +<FuncSynopsis> + <FuncDef>QList<QToolBar> <Function>toolBars</Function></FuncDef> + <ParamDef>ToolBarDock <Parameter>dock</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>QToolBar</Literal> instances. (Qt v2.1.0+) +</Para> +</Sect2> +%End + + +class QMainWindow : QWidget +{ +%TypeHeaderCode +#include <qmainwindow.h> +%End + +public: +%If (- Qt_2_00) + QMainWindow(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End +%If (Qt_2_00 -) + QMainWindow(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = WType_TopLevel); +%End + + QMenuBar *menuBar() const; + QStatusBar *statusBar() const; + QToolTipGroup *toolTipGroup() const; + virtual void setCentralWidget(QWidget *); + QWidget *centralWidget() const; + +%If (- Qt_2_1_0) + enum ToolBarDock { + Unmanaged, + TornOff, + Top, + Bottom, + Right, + Left + }; +%End +%If (Qt_2_1_0 - Qt_3_0_0) + enum ToolBarDock { + Unmanaged, + TornOff, + Top, + Bottom, + Right, + Left, + Minimized + }; +%End + +%If (- Qt_2_00) + void setDockEnabled(ToolBarDock,bool); + void addToolBar(QToolBar *,const char *,ToolBarDock = Top,bool = 0); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setDockEnabled(ToolBarDock,bool); + void addToolBar(QToolBar *,ToolBarDock = Top,bool = 0); + void addToolBar(QToolBar *,const QString &,ToolBarDock = Top,bool = 0); + void moveToolBar(QToolBar *,ToolBarDock = Top); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void setDockEnabled(QToolBar *,ToolBarDock,bool); + bool isDockEnabled(QToolBar *,ToolBarDock) const; + void moveToolBar(QToolBar *,ToolBarDock,bool,int,int = -1); + bool toolBarsMovable() const; +%End +%If (Qt_3_0_0 -) + virtual void setDockEnabled(Dock,bool); +%End +%If (- Qt_3_0_0) + bool isDockEnabled(ToolBarDock) const; + void removeToolBar(QToolBar *); +%End +%If (Qt_3_0_0 -) + bool isDockEnabled(Dock) const; + bool isDockEnabled(QDockArea *) const; + virtual void setDockEnabled(QDockWindow *,Dock,bool); + bool isDockEnabled(QDockWindow *,Dock) const; + bool isDockEnabled(QDockWindow *,QDockArea *) const; + + virtual void addDockWindow(QDockWindow *,Dock = DockTop,bool = 0); + virtual void addDockWindow(QDockWindow *,const QString &, + Dock = DockTop,bool = 0); + virtual void moveDockWindow(QDockWindow *,Dock = DockTop); + virtual void moveDockWindow(QDockWindow *,Dock,bool,int,int = -1); + virtual void removeDockWindow(QDockWindow *); +%End + + void show(); +%If (Qt_3_1_0 -) + void hide(); +%End +%If (Qt_2_1_0 -) + QSize sizeHint() const; + QSize minimumSizeHint() const; +%End + + bool rightJustification() const; + bool usesBigPixmaps() const; +%If (Qt_2_1_0 -) + bool usesTextLabel() const; +%End +%If (Qt_3_0_0 -) + bool dockWindowsMovable() const; +%End +%If (Qt_2_1_0 -) + bool opaqueMoving() const; +%End + + bool eventFilter(QObject *,QEvent *); + +%If (Qt_3_0_0 -) + bool getLocation(QDockWindow *,Dock &,int &,bool &,int &) const; +%End +%If (Qt_2_1_0 - Qt_3_0_0) + bool getLocation(QToolBar *,ToolBarDock &,int &,bool &,int &) const; +%End + +%If (Qt_2_1_0 - Qt_3_0_0) + QList<QToolBar> toolBars(ToolBarDock) const; +%End +%If (Qt_3_0_0 -) + QPtrList<QDockWindow> dockWindows(Dock) const; + QPtrList<QDockWindow> dockWindows() const; + void lineUpDockWindows(bool = 0); +%End + +%If (Qt_2_1_0 -) + void lineUpToolBars(bool = 0); + bool isDockMenuEnabled() const; +%End + +%If (Qt_3_0_0 -) + bool hasDockWindow(QDockWindow *); + QPtrList<QToolBar> toolBars(Dock) const; + + // The following one is in Qt3 but not documented. + //virtual QDockArea *dockingArea(const QPoint &); + QDockArea *leftDock() const; + QDockArea *rightDock() const; + QDockArea *topDock() const; + QDockArea *bottomDock() const; + + virtual bool isCustomizable() const; + + bool appropriate(QDockWindow *) const; + + enum DockWindows { + OnlyToolBars, + NoToolBars, + AllDockWindows + }; + + QPopupMenu *createDockWindowMenu(DockWindows = AllDockWindows) const; +%End + +public slots: +%If (- Qt_2_00) + void setRightJustification(bool); + void setUsesBigPixmaps(bool); +%End +%If (Qt_2_00 -) + virtual void setRightJustification(bool); + virtual void setUsesBigPixmaps(bool); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void setUsesTextLabel(bool); + void setToolBarsMovable(bool); + void setOpaqueMoving(bool); + void setDockMenuEnabled(bool); +%End +%If (Qt_3_0_0 -) + virtual void setUsesTextLabel(bool); + virtual void setDockWindowsMovable(bool); + virtual void setOpaqueMoving(bool); + virtual void setDockMenuEnabled(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + void whatsThis(); +%End +%If (Qt_3_0_0 -) + virtual void whatsThis(); + virtual void setAppropriate(QDockWindow *,bool); + virtual void customize(); +%End + +signals: + void pixmapSizeChanged(bool); +%If (Qt_2_1_0 -) + void usesTextLabelChanged(bool); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void startMovingToolBar(QToolBar *); + void endMovingToolBar(QToolBar *); + void toolBarPositionChanged(QToolBar *); +%End +%If (Qt_3_0_0 -) + void dockWindowPositionChanged(QDockWindow *); +%End + +protected slots: +%If (- Qt_2_00) + void setUpLayout(); +%End +%If (Qt_2_00 -) + virtual void setUpLayout(); +%End +%If (Qt_3_0_0 -) + virtual bool showDockMenu(const QPoint &); + void menuAboutToShow(); +%End + +protected: + void paintEvent(QPaintEvent *); +%If (Qt_2_00 -) + void childEvent(QChildEvent *); +%End + bool event(QEvent *); +%If (Qt_2_00 - Qt_3_0_0) + void resizeEvent(QResizeEvent *); +%End +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End + +private: +%If (Qt_2_00 -) + QMainWindow(const QMainWindow &); +%End +}; diff --git a/python/pyqt/sip/qt/qmemarray.sip b/python/pyqt/sip/qt/qmemarray.sip new file mode 100644 index 00000000..d3e371ca --- /dev/null +++ b/python/pyqt/sip/qt/qmemarray.sip @@ -0,0 +1,92 @@ +// This is the SIP interface definition for all types based on the QMemArray +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMemArray<type> (Qt v3+)</Title> +<Para> +Types based on the <Literal>QMemArray</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +%MappedType QMemArray<int> +{ +%TypeHeaderCode +#include <qmemarray.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *l; + + // Create the list. + if ((l = PyList_New(sipCpp -> size())) == NULL) + return NULL; + + // Get it. + for (uint i = 0; i < sipCpp -> size(); ++i) + if (PyList_SetItem(l,i,PyInt_FromLong((long)sipCpp -> at(i))) < 0) + { + Py_DECREF(l); + + return NULL; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of integers to a QMemArray<int> on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QMemArray<int> *qma = new QMemArray<int>(PyList_GET_SIZE(sipPy)); + + PyErr_Clear(); + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + (*qma)[i] = (int)PyInt_AsLong(PyList_GET_ITEM(sipPy,i)); + + if (PyErr_Occurred() != NULL) + { + delete qma; + *sipIsErr = 1; + + return 0; + } + } + + *sipCppPtr = qma; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qmenubar.sip b/python/pyqt/sip/qt/qmenubar.sip new file mode 100644 index 00000000..5f614582 --- /dev/null +++ b/python/pyqt/sip/qt/qmenubar.sip @@ -0,0 +1,118 @@ +// This is the SIP interface definition for QMenuBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMenuBar</Title> +<Para> +<Literal>QMenuBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QMenuBar : QFrame, QMenuData +{ +%TypeHeaderCode +#include <qmenubar.h> +%End + +public: + QMenuBar(QWidget * /TransferThis/ = 0,const char * = 0); + + void updateItem(int); + + void show(); + void hide(); + + bool eventFilter(QObject *,QEvent *); + + int heightForWidth(int) const; + + enum Separator { + Never = 0, + InWindowsStyle = 1 + }; + + Separator separator() const; +%If (- Qt_2_00) + void setSeparator(Separator); +%End +%If (Qt_2_00 -) + virtual void setSeparator(Separator); +%End + +%If (Qt_2_1_0 -) + void setDefaultUp(bool); + bool isDefaultUp() const; +%End + +%If (Qt_2_00 -) + bool customWhatsThis() const; +%End + +%If (Qt_2_1_0 -) + QSize sizeHint() const; + QSize minimumSize() const; + QSize minimumSizeHint() const; +%End + +%If (Qt_2_2_0 -) + void activateItemAt(int); +%End + +signals: + void activated(int); + void highlighted(int); + +protected: + void drawContents(QPainter *); + void fontChange(const QFont &); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); +%If (Qt_2_1_0 -) + void focusInEvent(QFocusEvent *); +%End +%If (Qt_2_00 -) + void focusOutEvent(QFocusEvent *); +%End + void resizeEvent(QResizeEvent *); + void leaveEvent(QEvent *); + void menuContentsChanged(); + void menuStateChanged(); +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End +%If (Qt_3_0_0 -) + int itemAtPos(const QPoint &); + void hidePopups(); + QRect itemRect(int); +%End + +private: + void menuInsPopup(QPopupMenu *); + void menuDelPopup(QPopupMenu *); + void frameChanged(); + + QMenuBar(const QMenuBar &); +}; diff --git a/python/pyqt/sip/qt/qmenudata.sip b/python/pyqt/sip/qt/qmenudata.sip new file mode 100644 index 00000000..ac5dab0b --- /dev/null +++ b/python/pyqt/sip/qt/qmenudata.sip @@ -0,0 +1,291 @@ +// This is the SIP interface definition for QMenuData, QCustomMenuItem and +// QMenuItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMenuData</Title> +<FuncSynopsis> + <FuncDef>QMenuItem *<Function>findItem</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>QMenuData **<Parameter>parent</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QCustomMenuItem (Qt v2.1+)</Title> +<Para> +<Literal>QCustomMenuItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMenuItem</Title> +<Para> +<Literal>QMenuItem</Literal> is an internal Qt class. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +// Even though this is an internal class, uic for Qt v3.1.0 generates code that +// uses it. +class QMenuItem +{ +%TypeHeaderCode +#include <qmenudata.h> +%End + +public: + QMenuItem(); + + void setText(const QString &); + +private: + QMenuItem(const QMenuItem &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QMenuItem; + +%End + + +class QMenuData +{ +%TypeHeaderCode +#include <qmenudata.h> +%End + +public: + QMenuData(); + + uint count(); + +%If (- Qt_2_00) + int insertItem(const char *,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int = 0); + int insertItem(const QPixmap &,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int = 0); + int insertItem(const QPixmap &,const char *,SIP_RXOBJ_CON, + SIP_SLOT_CON(int),int = 0); + int insertItem(const char *,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int,int, + int = -1); + int insertItem(const QPixmap &,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int,int, + int = -1); + int insertItem(const QPixmap&,const char *,SIP_RXOBJ_CON,SIP_SLOT_CON(int), + int,int,int = -1); +%End +%If (Qt_2_00 - Qt_3_0_0) + int insertItem(const QString &,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int = 0, + int = -1,int = -1); + int insertItem(const QIconSet &,const QString &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int),int = 0,int = -1,int = -1); + int insertItem(const QPixmap &,SIP_RXOBJ_CON,SIP_SLOT_CON(int),int = 0, + int = -1,int = -1); + int insertItem(const QIconSet &,const QPixmap &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int),int = 0,int = -1,int = -1); +%End +%If (Qt_3_0_0 -) + int insertItem(const QString &,SIP_RXOBJ_CON,SIP_SLOT_CON(int), + const QKeySequence & = QKeySequence(0),int = -1, + int = -1); + int insertItem(const QIconSet &,const QString &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int), + const QKeySequence & = QKeySequence(0),int = -1, + int = -1); + int insertItem(const QPixmap &,SIP_RXOBJ_CON,SIP_SLOT_CON(int), + const QKeySequence & = QKeySequence(0),int = -1, + int = -1); + int insertItem(const QIconSet &,const QPixmap &,SIP_RXOBJ_CON, + SIP_SLOT_CON(int), + const QKeySequence & = QKeySequence(0),int = -1, + int = -1); +%End + +%If (- Qt_2_00) + int insertItem(const char *,int = -1,int = -1); + int insertItem(const char *,QPopupMenu *,int = -1,int = -1); + int insertItem(const QPixmap &,const char *,int = -1,int = -1); + int insertItem(const QPixmap &,const char *,QPopupMenu *,int = -1, + int = -1); +%End +%If (Qt_2_00 -) + int insertItem(const QString &,int = -1,int = -1); + int insertItem(const QIconSet &,const QString &,int = -1,int = -1); + + int insertItem(const QString &,QPopupMenu *,int = -1,int = -1); + int insertItem(const QIconSet &,const QString &,QPopupMenu *,int = -1, + int = -1); +%End + + int insertItem(const QPixmap &,int = -1,int = -1); +%If (Qt_2_00 -) + int insertItem(const QIconSet &,const QPixmap &,int = -1,int = -1); +%End + int insertItem(const QPixmap &,QPopupMenu *,int = -1,int = -1); +%If (Qt_2_00 -) + int insertItem(const QIconSet &,const QPixmap &,QPopupMenu *,int = -1, + int = -1); +%End + +%If (Qt_2_1_0 -) + int insertItem(QWidget * /Transfer/,int = -1,int = -1); + int insertItem(const QIconSet &,QCustomMenuItem * /Transfer/,int = -1, + int = -1); + int insertItem(QCustomMenuItem * /Transfer/,int = -1,int = -1); +%End + +%If (Qt_2_1_0 -) + int insertSeparator(int = -1); +%End +%If (- Qt_2_1_0) + void insertSeparator(int = -1); +%End + + void removeItem(int); + void removeItemAt(int); + void clear(); + +%If (- Qt_3_0_0) + int accel(int) const; + void setAccel(int,int); +%End +%If (Qt_3_0_0 -) + QKeySequence accel(int) const; + void setAccel(const QKeySequence &,int); +%End + +%If (- Qt_2_00) + const char *text(int) const; +%End +%If (Qt_2_00 -) + QIconSet *iconSet(int) const; + QString text(int) const; +%End + QPixmap *pixmap(int) const; + +%If (Qt_2_00 -) + void setWhatsThis(int,const QString &); + QString whatsThis(int) const; +%End + +%If (- Qt_2_00) + void changeItem(const char *,int); + void changeItem(const QPixmap &,int); + void changeItem(const QPixmap &,const char *,int); +%End +%If (Qt_2_00 -) + void changeItem(int,const QString &); + void changeItem(int,const QPixmap &); + void changeItem(int,const QIconSet &,const QString &); + void changeItem(int,const QIconSet &,const QPixmap &); +%End + +%If (Qt_3_0_0 -) + bool isItemActive(int) const; +%End + + bool isItemEnabled(int) const; + void setItemEnabled(int,bool); + + bool isItemChecked(int) const; + void setItemChecked(int,bool); + +%If (Qt_3_1_0 -) + bool isItemVisible(int) const; + void setItemVisible(int,bool); +%End + + virtual void updateItem(int); + + int indexOf(int) const; + int idAt(int) const; +%If (- Qt_2_00) + void setId(int,int); +%End +%If (Qt_2_00 -) + virtual void setId(int,int); +%End + + bool connectItem(int,SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + bool disconnectItem(int,SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); + +%If (Qt_2_1_0 -) + bool setItemParameter(int,int); + int itemParameter(int) const; +%End + + QMenuItem *findItem(int) const; +// QMenuItem *findItem(int,QMenuData **) const; +%If (Qt_3_0_0 -) +// Not documented in the Qt3 API (the similar findPopup() was internal in +// Qt2). +// QMenuItem *findItem(QPopupMenu *,int * = 0) const; +%End + +%If (Qt_2_2_0 - Qt_3_0_0) + void activateItemAt(int); +%End +%If (Qt_3_0_0 -) + virtual void activateItemAt(int); +%End + +protected: + virtual void menuContentsChanged(); + virtual void menuStateChanged(); + virtual void menuInsPopup(QPopupMenu *); + virtual void menuDelPopup(QPopupMenu *); +%If (- Qt_3_0_0) +// Documented as internal in the Qt2 API. +// QMenuItem *findPopup(QPopupMenu *,int * = 0); +%End + +private: + QMenuData(const QMenuData &); +}; + + +%If (Qt_2_1_0 -) + +class QCustomMenuItem : Qt +{ +%TypeHeaderCode +#include <qmenudata.h> +%End + +public: + QCustomMenuItem(); + + virtual bool fullSpan() const; + virtual bool isSeparator() const; + virtual void setFont(const QFont &); + virtual void paint(QPainter *,const QColorGroup &,bool,bool,int,int, + int,int) = 0; + virtual QSize sizeHint() = 0; +}; + +%End diff --git a/python/pyqt/sip/qt/qmessagebox.sip b/python/pyqt/sip/qt/qmessagebox.sip new file mode 100644 index 00000000..16e635e3 --- /dev/null +++ b/python/pyqt/sip/qt/qmessagebox.sip @@ -0,0 +1,204 @@ +// This is the SIP interface definition for QMessageBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMessageBox</Title> +<Para> +<Literal>QMessageBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_MESSAGEBOX) + +class QMessageBox : QDialog +{ +%TypeHeaderCode +#include <qmessagebox.h> +%End + +public: + enum Icon { + NoIcon, + Information, + Warning, + Critical, +%If (Qt_3_2_0 -) + Question, +%End + }; + + QMessageBox(QWidget * /TransferThis/ = 0,const char * = 0); +%If (- Qt_2_00) + QMessageBox(const char *,const char *,Icon,int,int,int, + QWidget * /TransferThis/ = 0,const char * = 0,bool = 1, + WFlags = 0); +%End +%If (Qt_2_00 -) + QMessageBox(const QString &,const QString &,Icon,int,int,int, + QWidget * /TransferThis/ = 0,const char * = 0,bool = 1, + WFlags = WStyle_DialogBorder); +%End + + enum { + Ok, + Cancel, + Yes, + No, + Abort, + Retry, + Ignore, +%If (Qt_3_2_0 -) + YesAll, + NoAll, +%End + ButtonMask, + Default, + Escape, + FlagMask + }; + +%If (- Qt_2_00) + static int information(QWidget *,const char *,const char *,int,int = 0, + int = 0) /ReleaseGIL/; + static int information(QWidget *,const char *,const char *, + const char * = "OK",const char * = 0, + const char * = 0,int = 0,int = -1) /ReleaseGIL/; + + static int warning(QWidget *,const char *,const char *,int,int, + int = 0) /ReleaseGIL/; + static int warning(QWidget *,const char *,const char *, + const char * = "OK",const char * = 0, + const char * = 0,int = 0,int = -1) /ReleaseGIL/; + + static int critical(QWidget *,const char *,const char *,int,int, + int = 0) /ReleaseGIL/; + static int critical(QWidget *,const char *,const char *, + const char * = "OK",const char * = 0, + const char * = 0,int = 0,int = -1) /ReleaseGIL/; + + static void about(QWidget *,const char *,const char *) /ReleaseGIL/; + static void aboutQt(QWidget *,const char * = 0) /ReleaseGIL/; + + const char *text() const; + void setText(const char *); +%End +%If (Qt_2_00 -) + static int information(QWidget *,const QString &,const QString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int information(QWidget *,const QString &,const QString &, + const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null, + int = 0,int = -1) /ReleaseGIL/; + +%If (Qt_3_2_0 -) + static int question(QWidget *,const QString &,const QString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int question(QWidget *,const QString &,const QString &, + const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null, + int = 0,int = -1) /ReleaseGIL/; +%End + + static int warning(QWidget *,const QString &,const QString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int warning(QWidget *,const QString &,const QString &, + const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null,int = 0, + int = -1) /ReleaseGIL/; + + static int critical(QWidget *,const QString &,const QString &,int, + int = 0,int = 0) /ReleaseGIL/; + static int critical(QWidget *,const QString &,const QString &, + const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null,int = 0, + int = -1) /ReleaseGIL/; + + static void about(QWidget *,const QString &, + const QString &) /ReleaseGIL/; + static void aboutQt(QWidget *, + const QString & = QString::null) /ReleaseGIL/; + + QString text() const; + void setText(const QString &); +%End + + Icon icon() const; + + void setIcon(Icon); +%If (Qt_2_00 -) + void setIcon(const QPixmap &); +%End + + const QPixmap *iconPixmap() const; + void setIconPixmap(const QPixmap &); + +%If (- Qt_2_00) + const char *buttonText(int) const; + void setButtonText(int,const char *); +%End +%If (Qt_2_00 -) + QString buttonText(int) const; + void setButtonText(int,const QString &); +%End + + void adjustSize(); + +%If (- Qt_3_0_0) + static QPixmap standardIcon(Icon,GUIStyle); +%End +%If (Qt_3_0_0 -) + static QPixmap standardIcon(Icon); +%End + +%If (Qt_2_1_0 -) + TextFormat textFormat() const; + void setTextFormat(TextFormat); +%End + +%If (- Qt_2_00) + void setStyle(GUIStyle); +%End + +protected: + void resizeEvent(QResizeEvent *); +%If (Qt_3_0_0 -) + void showEvent(QShowEvent *); +%End +%If (Qt_3_2_0 -) + void closeEvent(QCloseEvent *); +%End + void keyPressEvent(QKeyEvent *); +%If (Qt_2_00 -) + void styleChanged(QStyle &); +%End + +private: + QMessageBox(const QMessageBox &); +}; + +%End diff --git a/python/pyqt/sip/qt/qmetaobject.sip b/python/pyqt/sip/qt/qmetaobject.sip new file mode 100644 index 00000000..5cf77037 --- /dev/null +++ b/python/pyqt/sip/qt/qmetaobject.sip @@ -0,0 +1,170 @@ +// This is the SIP interface definition for QMetaObject and QMetaProperty. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMetaObject</Title> +<FuncSynopsis> + <FuncDef>int <Function>numClassInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QClassInfo *<Function>classInfo</Function> const</FuncDef> + <ParamDef>bool <Parameter>super</Parameter> = FALSE</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QMetaProperty</Title> +<Para> +<Literal>QMetaProperty</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QMetaObject +{ +%TypeHeaderCode +#include <qmetaobject.h> +%End + +public: + const char *className() const; + const char *superClassName() const; + QMetaObject *superClass() const; + +%If (Qt_2_1_0 -) + bool inherits(const char *) const; + + int numSlots(bool = 0) const; + int numSignals(bool = 0) const; + + QStrList slotNames(bool = 0) const; + QStrList signalNames(bool = 0) const; + + //int numClassInfo(bool = 0) const; + //QClassInfo *classInfo(int,bool = 0) const; + const char *classInfo(const char *,bool = 0) const; + +%If (Qt_PROPERTIES) +%If (Qt_3_0_0 -) + const QMetaProperty *property(int,bool = 0) const; + int findProperty(const char *,bool = 0) const; + int numProperties(bool = 0) const; +%End +%If (- Qt_3_0_0) + const QMetaProperty *property(const char *,bool = 0) const; +%End + + QStrList propertyNames(bool = 0) const; +%End +%End + +private: + QMetaObject(const QMetaObject &); +}; + + +%If (Qt_PROPERTIES) +%If (Qt_2_1_0 -) + +class QMetaProperty +{ +%TypeHeaderCode +#include <qmetaobject.h> +%End + +public: + const char *type() const; + const char *name() const; + +%If (Qt_2_2_0 -) + bool writable() const; +%End +%If (- Qt_3_0_0) + bool writeable() const; +%End + bool isValid() const; + + bool isSetType() const; + bool isEnumType() const; + QStrList enumKeys() const; + + int keyToValue(const char *) const; + const char *valueToKey(int) const; + int keysToValue(const QStrList &) const; + QStrList valueToKeys(int) const; + +%If (Qt_3_1_0 -) + bool designable(QObject * = 0) const; + bool scriptable(QObject * = 0) const; + bool stored(QObject * = 0) const; +%End +%If (Qt_3_0_0 - Qt_3_1_0) + bool designable(QObject *) const; + bool scriptable(QObject *) const; + bool stored(QObject *) const; +%End + +%If (Qt_3_0_0 -) + bool reset(QObject *) const; +%End + +%If (- Qt_3_0_0) + bool stored(QObject *) const; + bool designable() const; + + enum Specification { + Unspecified, + Class, + Reference, + Pointer, + ConstCharStar + }; + + enum Flags { + UnresolvedEnum, + UnresolvedSet, + UnresolvedEnumOrSet, + UnresolvedStored, + UnresolvedDesignable, + NotDesignable, + NotStored, +%If (Qt_2_2_0 -) + StdSet, +%End + }; + + bool testFlags(uint) const; + void setFlags(uint); + void clearFlags(uint); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qmime.sip b/python/pyqt/sip/qt/qmime.sip new file mode 100644 index 00000000..cb5abd80 --- /dev/null +++ b/python/pyqt/sip/qt/qmime.sip @@ -0,0 +1,104 @@ +// This is the SIP interface definition for the Qt v2+ QMimeSource, +// QMimeSourceFactory and QWindowsMime classes. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMimeSource (Qt v2+)</Title> +<Para> +<Literal>QMimeSource</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMimeSourceFactory (Qt v2+)</Title> +<Para> +<Literal>QMimeSourceFactory</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QWindowsMime (Qt v3+)</Title> +<Para> +<Literal>QWindowsMime</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QMimeSource +{ +%TypeHeaderCode +#include <qmime.h> +%End + +public: +%If (Qt_3_0_0 -) + QMimeSource(); +%End + + virtual const char *format(int = 0) const = 0; + virtual bool provides(const char *) const; + virtual QByteArray encodedData(const char *) const = 0; +%If (Qt_3_0_0 -) + int serialNumber() const; +%End +}; + + +class QMimeSourceFactory +{ +%TypeHeaderCode +#include <qmime.h> +%End + +public: + QMimeSourceFactory(); + + static QMimeSourceFactory *defaultFactory(); + static void setDefaultFactory(QMimeSourceFactory * /Transfer/); +%If (Qt_3_0_0 -) + static QMimeSourceFactory *takeDefaultFactory() /TransferBack/; + static void addFactory(QMimeSourceFactory *); + static void removeFactory(QMimeSourceFactory *); +%End + + virtual const QMimeSource *data(const QString &) const; + virtual QString makeAbsolute(const QString &,const QString &) const; + const QMimeSource *data(const QString &,const QString &) const; + + virtual void setText(const QString &,const QString &); + virtual void setImage(const QString &,const QImage &); + virtual void setPixmap(const QString &,const QPixmap &); + virtual void setData(const QString &,QMimeSource * /Transfer/); + virtual void setFilePath(const QStringList &); +%If (Qt_2_1_0 -) + virtual QStringList filePath() const; + void addFilePath(const QString &); +%End + virtual void setExtensionType(const QString &,const char *); +}; + +%End + + +%If (Qt_3_0_0 -) +%End diff --git a/python/pyqt/sip/qt/qmotifplusstyle.sip b/python/pyqt/sip/qt/qmotifplusstyle.sip new file mode 100644 index 00000000..18aaa3e0 --- /dev/null +++ b/python/pyqt/sip/qt/qmotifplusstyle.sip @@ -0,0 +1,150 @@ +// This is the SIP interface definition for QMotifPlusStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMotifPlusStyle (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_STYLE_MOTIFPLUS) +%If (Qt_2_2_0 -) + +class QMotifPlusStyle : QMotifStyle +{ +%TypeHeaderCode +#include <qmotifplusstyle.h> +%End + +public: +%If (- Qt_3_0_5) + QMotifPlusStyle(bool = 0); +%End +%If (Qt_3_0_5 -) + QMotifPlusStyle(bool = 1); +%End + + void polish(QPalette &); + void polish(QWidget *); + void unPolish(QWidget *); + + void polish(QApplication *); + void unPolish(QApplication *); + +%If (- Qt_3_0_0) + void polishPopupMenu(QPopupMenu *); + int defaultFrameWidth() const; + void drawArrow(QPainter *,ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0); + void drawMenuBarItem(QPainter *,int,int,int,int,QMenuItem *, + QColorGroup &,bool,bool); + void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool,bool,int,int,int,int); + void drawPushButton(QPushButton *,QPainter *); + void drawButton(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + + void getButtonShift(int &,int &); + + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &,int, + bool = 0,bool = 1); + QSize indicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); + QSize exclusiveIndicatorSize() const; + void drawPanel(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + int = 1,const QBrush * = 0); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint,uint); + void drawTab(QPainter *,const QTabBar *,QTab *,bool); + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); +%End +%If (Qt_3_0_0 -) + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + QRect subRect(SubRect,const QWidget *) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + QRect querySubControlMetrics(ComplexControl,const QWidget *, + SubControl, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + int styleHint(StyleHint,const QWidget *, + const QStyleOption & = QStyleOption(), + QStyleHintReturn * = 0) const; +%End + +protected: + bool eventFilter(QObject *,QEvent *); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qmotifstyle.sip b/python/pyqt/sip/qt/qmotifstyle.sip new file mode 100644 index 00000000..d749745b --- /dev/null +++ b/python/pyqt/sip/qt/qmotifstyle.sip @@ -0,0 +1,168 @@ +// This is the SIP interface definition for QMotifStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMotifStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) +%If (Qt_STYLE_MOTIF) + +class QMotifStyle : QCommonStyle +{ +%TypeHeaderCode +#include <qmotifstyle.h> +%End + +public: + QMotifStyle(bool = 0); + + void setUseHighlightColors(bool); + bool useHighlightColors() const; + + void polish(QPalette &); + void polish(QWidget *); + void polish(QApplication *); + +%If (- Qt_3_0_0) + void drawButton(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawFocusRect(QPainter *,const QRect &,const QColorGroup &, + const QColor * =0,bool = 0); + +%If (Qt_2_1_0 -) + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); +%End + + void drawPushButton(QPushButton *,QPainter *); + void drawArrow(QPainter *,ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0); + QSize indicatorSize() const; + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &,int, + bool = 0,bool = 1); + QSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); + void drawExclusiveIndicatorMask(QPainter *,int,int,int,int,bool); + + void tabbarMetrics(const QTabBar *,int &,int &,int &); + + void drawTab(QPainter *,const QTabBar *,QTab *,bool); + void drawTabMask(QPainter *,const QTabBar *,QTab *,bool); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint,uint); + int sliderLength() const; + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); + int splitterWidth() const; + void drawSplitter(QPainter *,int,int,int,int,const QColorGroup &, + Orientation); + void drawCheckMark(QPainter *,int,int,int,int,const QColorGroup &,bool, + bool); + void polishPopupMenu(QPopupMenu *); + int extraPopupMenuItemWidth(bool,int,QMenuItem *,const QFontMetrics &); + int popupMenuItemHeight(bool,QMenuItem *,const QFontMetrics &); + void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool,bool,int,int,int,int); +%End +%If (Qt_3_0_0 -) + void polishPopupMenu(QPopupMenu *); + + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + QRect querySubControlMetrics(ComplexControl,const QWidget *,SubControl, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + QSize sizeFromContents(ContentsType,const QWidget *,const QSize &, + const QStyleOption & = QStyleOption()) const; + + QRect subRect(SubRect,const QWidget *) const; + + QPixmap stylePixmap(StylePixmap,const QWidget * = 0, + const QStyleOption & = QStyleOption()) const; + + int styleHint(StyleHint,const QWidget *, + const QStyleOption & = QStyleOption(), + QStyleHintReturn * = 0) const; +%End + +private: +%If (Qt_3_0_0 -) + QMotifStyle(const QMotifStyle &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qmovie.sip b/python/pyqt/sip/qt/qmovie.sip new file mode 100644 index 00000000..ba4f3e92 --- /dev/null +++ b/python/pyqt/sip/qt/qmovie.sip @@ -0,0 +1,109 @@ +// This is the SIP interface definition for QMovie. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMovie</Title> +<FuncSynopsis> + <FuncDef><Function>QMovie</Function></FuncDef> + <ParamDef>QDataSource *<Parameter>src</Parameter></ParamDef> + <ParamDef>int <Parameter>bufsize</Parameter> = 1024</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>pushData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>data</Parameter></ParamDef> + <ParamDef>int <Parameter>length</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>length</Literal> is derived from <Literal>data</Literal> and not +passed as a parameter. (Qt v2.2.0+) +</Para> +</Sect2> +%End + + +class QMovie +{ +%TypeHeaderCode +#include <qmovie.h> +%End + +public: + QMovie(); +%If (Qt_2_2_0 -) + QMovie(int); +%End +// QMovie(QDataSource *,int = 1024); +%If (- Qt_2_00) + QMovie(const char *,int = 1024); +%End +%If (Qt_2_00 -) + QMovie(const QString &,int = 1024); +%End + QMovie(QByteArray,int = 1024); + QMovie(const QMovie &); + +%If (Qt_2_2_0 -) + int pushSpace() const; + void pushData(const uchar * /Array/,int /ArraySize/); +%End + const QColor &backgroundColor() const; + void setBackgroundColor(const QColor &); + const QRect &getValidRect() const; + const QPixmap &framePixmap() const; +%If (Qt_2_2_0 -) + const QImage &frameImage() const; +%End + bool isNull() const; + int frameNumber() const; + int steps() const; + bool paused() const; + bool finished() const; + bool running() const; + void unpause(); + void pause(); + void step(); + void step(int); + void restart(); + int speed() const; + void setSpeed(int); + void connectResize(SIP_RXOBJ_CON,SIP_SLOT_CON(const QSize &)); + void disconnectResize(SIP_RXOBJ_DIS,SIP_SLOT_DIS(const QSize &)); + void connectUpdate(SIP_RXOBJ_CON,SIP_SLOT_CON(const QRect &)); + void disconnectUpdate(SIP_RXOBJ_DIS,SIP_SLOT_DIS(const QRect &)); + + enum Status { + SourceEmpty = -2, + UnrecognizedFormat = -1, + Paused = 1, + EndOfFrame = 2, + EndOfLoop = 3, + EndOfMovie = 4, + SpeedChanged = 5 + }; + + void connectStatus(SIP_RXOBJ_CON,SIP_SLOT_CON(int)); + void disconnectStatus(SIP_RXOBJ_DIS,SIP_SLOT_DIS(int)); +}; diff --git a/python/pyqt/sip/qt/qmultilinedit.sip b/python/pyqt/sip/qt/qmultilinedit.sip new file mode 100644 index 00000000..1d407bae --- /dev/null +++ b/python/pyqt/sip/qt/qmultilinedit.sip @@ -0,0 +1,374 @@ +// This is the SIP interface definition for QMultiLineEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMultiLineEdit</Title> +<FuncSynopsis> + <FuncDef>void <Function>cursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>getCursorPosition</Function> const</FuncDef> + <ParamDef>int *<Parameter>line</Parameter></ParamDef> + <ParamDef>int *<Parameter>col</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>line</Literal> and +<Literal>col</Literal> values. (Qt v1.x, Qt v2.x) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>getMarkedRegion</Function></FuncDef> + <ParamDef>int *<Parameter>line1</Parameter></ParamDef> + <ParamDef>int *<Parameter>col1</Parameter></ParamDef> + <ParamDef>int *<Parameter>line2</Parameter></ParamDef> + <ParamDef>int *<Parameter>col2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the bool result and the +<Literal>line1</Literal>, <Literal>col1</Literal>, <Literal>line2</Literal> and +<Literal>col2</Literal> values. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QMultiLineEdit : QTextEdit +{ +%TypeHeaderCode +#include <qmultilineedit.h> +%End + +public: + QMultiLineEdit(QWidget * /TransferThis/ = 0,const char * = 0); + + QString textLine(int) const; + int numLines() const; + + virtual void insertLine(const QString &,int = -1); +%If (Qt_3_1_0 -) + virtual void insertAt(const QString &,int,int); + virtual void insertAt(const QString &,int,int,bool); +%End +%If (- Qt_3_1_0) + virtual void insertAt(const QString &,int,int,bool = 0); +%End + virtual void removeLine(int); + +%If (Qt_3_1_0 -) + virtual void setCursorPosition(int,int); + virtual void setCursorPosition(int,int,bool); +%End +%If (- Qt_3_1_0) + virtual void setCursorPosition(int,int,bool = 0); +%End + bool atBeginning() const; + bool atEnd() const; + + void setAlignment(int); + int alignment() const; + + void setEdited(bool); + bool edited() const; + + bool hasMarkedText() const; + QString markedText() const; + + void cursorWordForward(bool); + void cursorWordBackward(bool); + + bool autoUpdate() const; + virtual void setAutoUpdate(bool); + + int totalWidth() const; + int totalHeight() const; + + int maxLines() const; + void setMaxLines(int); + +public slots: + void deselect(); + +protected: + QPoint cursorPoint() const; + virtual void insertAndMark(const QString &,bool); + virtual void newLine(); + virtual void killLine(); + virtual void pageUp(bool = 0); + virtual void pageDown(bool = 0); + virtual void cursorLeft(bool = 0,bool = 1); + virtual void cursorRight(bool = 0,bool = 1); + virtual void cursorUp(bool = 0); + virtual void cursorDown(bool = 0); + virtual void backspace(); + virtual void home(bool = 0); + virtual void end(bool = 0); + bool getMarkedRegion(int *,int *,int *,int *) const; + int lineLength(int) const; + +private: + QMultiLineEdit(const QMultiLineEdit &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QMultiLineEdit : QTableView +{ +%TypeHeaderCode +#include <qmultilinedit.h> +%End + +public: + QMultiLineEdit(QWidget * /TransferThis/ = 0,const char * = 0); + + int numLines() const; + virtual void removeLine(int); + + void cursorPosition(int *,int *) const; + void getCursorPosition(int *,int *) const; + + bool atBeginning() const; + bool atEnd() const; + int maxLineWidth() const; + bool autoUpdate() const; + bool isReadOnly() const; + bool isOverwriteMode() const; + QString text() const; + +%If (- Qt_2_00) + const char *textLine(int) const; + void setFont(const QFont &); + virtual void insertLine(const char *,int = -1); + virtual void insertAt(const char *,int,int); + void setCursorPosition(int,int,bool = 0); + void setFixedVisibleLines(int); + void setAutoUpdate(bool); +%End + +%If (Qt_2_00 -) + QString textLine(int) const; + QSize sizeHint() const; + QSize minimumSizeHint() const; + QSizePolicy sizePolicy() const; + virtual void setFont(const QFont &); + virtual void insertLine(const QString &,int = -1); + virtual void insertAt(const QString &,int,int,bool = 0); + virtual void setCursorPosition(int,int,bool = 0); + virtual void setFixedVisibleLines(int); + void setAlignment(int); + int alignment() const; + virtual void setValidator(const QValidator *); + const QValidator *validator() const; + void setEdited(bool); + bool edited() const; + void cursorWordForward(bool); + void cursorWordBackward(bool); + + enum EchoMode + { + Normal, + NoEcho, + Password + }; + + virtual void setEchoMode(EchoMode); + EchoMode echoMode() const; + virtual void setMaxLineLength(int); + int maxLineLength() const; + virtual void setMaxLines(int); + int maxLines() const; + virtual void setHMargin(int); + int hMargin() const; + virtual void setSelection(int,int,int,int); + virtual void setAutoUpdate(bool); +%End + +%If (Qt_2_1_0 -) + void setMaxLength(int); + int maxLength() const; + + enum WordWrap { + NoWrap, + WidgetWidth, + FixedPixelWidth, + FixedColumnWidth + }; + + void setWordWrap(WordWrap); + WordWrap wordWrap() const; + void setWrapColumnOrWidth(int); + int wrapColumnOrWidth() const; + + enum WrapPolicy { + AtWhiteSpace, + Anywhere + }; + + void setWrapPolicy(WrapPolicy); + WrapPolicy wrapPolicy() const; + void setUndoEnabled(bool); + bool isUndoEnabled() const; + void setUndoDepth(int); + int undoDepth() const; + int length() const; + static void setDefaultTabStop(int); + static int defaultTabStop(); +%End + +public slots: + void clear(); + void deselect(); + void selectAll(); +%If (Qt_CLIPBOARD) + void paste(); +%If (Qt_2_2_0 -) + void pasteSubType(const QCString &); +%End + void cut(); +%End +%If (- Qt_2_00) + void setText(const char *); + void setReadOnly(bool); + void setOverwriteMode(bool); + void append(const char *); + void copyText(); +%End +%If (Qt_2_00 -) + virtual void setText(const QString &); + virtual void setReadOnly(bool); + virtual void setOverwriteMode(bool); + void append(const QString &); +%If (Qt_CLIPBOARD) + void copyText() const; + void copy() const; +%End + void insert(const QString &); +%End +%If (Qt_2_1_0 -) + void undo(); + void redo(); +%End + +signals: + void textChanged(); + void returnPressed(); +%If (Qt_2_1_0 -) + void undoAvailable(bool); + void redoAvailable(bool); +%End +%If (Qt_2_2_0 -) + void copyAvailable(bool); +%End + +protected: + void paintCell(QPainter *,int,int); +%If (Qt_2_2_0 -) + bool event(QEvent *); +%End + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); +%If (Qt_2_00 -) + void wheelEvent(QWheelEvent *); +%End + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + void timerEvent(QTimerEvent *); + void leaveEvent(QEvent *); + void resizeEvent(QResizeEvent *); +%If (Qt_DRAGANDDROP) +%If (Qt_2_00 -) + void dragMoveEvent(QDragMoveEvent *); +%End +%If (Qt_2_1_0 -) + void dragEnterEvent(QDragEnterEvent *); +%End +%If (Qt_2_00 -) + void dropEvent(QDropEvent *); + void dragLeaveEvent(QDragLeaveEvent *); +%End +%End + bool hasMarkedText() const; + QString markedText() const; + int textWidth(int); +%If (- Qt_2_00) + int textWidth(QString *); +%End +%If (Qt_2_00 -) + int textWidth(const QString &); +%End + QPoint cursorPoint() const; +%If (- Qt_2_00) + virtual void insertChar(char); +%End +%If (Qt_2_00 -) + virtual void insert(const QString &,bool); +%End + virtual void newLine(); + virtual void killLine(); + virtual void pageUp(bool = 0); + virtual void pageDown(bool = 0); + virtual void cursorLeft(bool = 0,bool = 1); + virtual void cursorRight(bool = 0,bool = 1); + virtual void cursorUp(bool = 0); + virtual void cursorDown(bool = 0); + virtual void backspace(); + virtual void del() /PyName=delChar/; + virtual void home(bool = 0); + virtual void end(bool = 0); + bool getMarkedRegion(int *,int *,int *,int *) const; + int lineLength(int) const; + QString *getString(int) const; +%If (Qt_2_1_0 -) + bool isEndOfParagraph(int) const; +%End +%If (Qt_2_00 -) + QString stringShown(int) const; + void insertChar(QChar); +%End + +private: + QMultiLineEdit(const QMultiLineEdit &); +}; + +%End diff --git a/python/pyqt/sip/qt/qmutex.sip b/python/pyqt/sip/qt/qmutex.sip new file mode 100644 index 00000000..1f9ff868 --- /dev/null +++ b/python/pyqt/sip/qt/qmutex.sip @@ -0,0 +1,104 @@ +// This is the SIP interface definition for QMutex and QMutexLocker. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QMutex (Qt v2.2+)</Title> +<Para> +<Literal>QMutex</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QMutexLocker (Qt v3.1+)</Title> +<Para> +<Literal>QMutexLocker</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_THREAD_SUPPORT) + +%If (Qt_3_0_0 -) + +class QMutex +{ +%TypeHeaderCode +#include <qmutex.h> +%End + +public: + QMutex(bool = 0); + + void lock() /ReleaseGIL/; + void unlock(); + bool locked(); + bool tryLock(); + +private: + QMutex(const QMutex &); +}; + +%End + + +%If (Qt_2_2_0 - Qt_3_0_0) + +class QMutex : Qt +{ +%TypeHeaderCode +#include <qthread.h> +%End + +public: + QMutex(bool = 0); + + void lock() /ReleaseGIL/; + void unlock(); + bool locked(); + +private: + QMutex(const QMutex &); +}; + +%End + + +%If (Qt_3_1_0 -) + +class QMutexLocker +{ +%TypeHeaderCode +#include <qmutex.h> +%End + +public: + QMutexLocker(QMutex *) /ReleaseGIL/; + + QMutex *mutex() const; + +private: + QMutexLocker(const QMutexLocker &); +}; + +%End + +%End diff --git a/python/pyqt/sip/qt/qnamespace.sip b/python/pyqt/sip/qt/qnamespace.sip new file mode 100644 index 00000000..cddd3b51 --- /dev/null +++ b/python/pyqt/sip/qt/qnamespace.sip @@ -0,0 +1,903 @@ +// This is the SIP interface definition for the Qt v2+ Qt class. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>Qt (Qt v2+)</Title> +<Para> +<Literal>Qt</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class Qt +{ +%TypeHeaderCode +#include <qnamespace.h> +%End + +public: + static const QColor &color0; + static const QColor &color1; + static const QColor &black; + static const QColor &white; + static const QColor &darkGray; + static const QColor &gray; + static const QColor &lightGray; + static const QColor &red; + static const QColor &green; + static const QColor &blue; + static const QColor &cyan; + static const QColor &magenta; + static const QColor &yellow; + static const QColor &darkRed; + static const QColor &darkGreen; + static const QColor &darkBlue; + static const QColor &darkCyan; + static const QColor &darkMagenta; + static const QColor &darkYellow; + + enum ButtonState { + NoButton, + LeftButton, + RightButton, + MidButton, + MouseButtonMask, + ShiftButton, + ControlButton, + AltButton, +%If (Qt_3_0_0 -) + MetaButton, +%End + KeyButtonMask, +%If (Qt_2_2_0 -) + Keypad, +%End + }; + + enum Orientation { + Horizontal, + Vertical + }; + +%If (Qt_3_2_0 -) + enum SortOrder { + Ascending, + Descending + }; +%End + +%If (- Qt_3_0_0) + enum AlignmentFlags { + AlignLeft, + AlignRight, + AlignHCenter, + AlignTop, + AlignBottom, + AlignVCenter, + AlignCenter, + + SingleLine, + DontClip, + ExpandTabs, + ShowPrefix, + WordBreak + }; +%End + +%If (Qt_3_0_0 -) + enum AlignmentFlags { + AlignAuto, + AlignLeft, + AlignRight, + AlignHCenter, + AlignJustify, + AlignHorizontal_Mask, + AlignTop, + AlignBottom, + AlignVCenter, + AlignVertical_Mask, + AlignCenter + }; + + enum TextFlags { + SingleLine, + DontClip, + ExpandTabs, + ShowPrefix, + WordBreak, + BreakAnywhere, + DontPrint, // Internal + NoAccel + }; + + typedef uint WState; + + // WidgetState isn't part of the public API but is used in code + // generated by uic/pyuic, so we implement the minimum required. + enum WidgetState { + WState_Polished + }; +%End + + typedef uint WFlags; + + enum WidgetFlags { + WType_TopLevel, +%If (- Qt_3_0_0) + WType_Modal, +%End +%If (Qt_3_0_0 -) + WType_Dialog, +%End + WType_Popup, + WType_Desktop, + WType_Mask, + + WStyle_Customize, + WStyle_NormalBorder, + WStyle_DialogBorder, + WStyle_NoBorder, + WStyle_Title, + WStyle_SysMenu, + WStyle_Minimize, + WStyle_Maximize, + WStyle_MinMax, + WStyle_Tool, + WStyle_StaysOnTop, +%If (- Qt_3_0_0) + WStyle_Dialog, +%End +%If (- Qt_2_1_0) + WStyle_Reserved2, + WStyle_Reserved3, +%End +%If (Qt_2_1_0 -) + WStyle_ContextHelp, +%End +%If (Qt_2_1_0 - Qt_3_0_0) + WStyle_NoBorderEx, +%End +%If (Qt_3_0_0 -) + WStyle_Reserved, +%End + WStyle_Mask, + + WDestructiveClose, + WPaintDesktop, + WPaintUnclipped, + WPaintClever, + WResizeNoErase, // Obsolete + WMouseNoMask, +%If (- Qt_3_0_0) + WNorthWestGravity, +%End +%If (Qt_3_0_0 -) + WStaticContents, +%End +%If (Qt_2_1_0 -) + WRepaintNoErase, // Obsolete + WX11BypassWM, +%End +%If (Qt_3_0_0 -) + WWinOwnDC, +%End +%If (Qt_2_2_0 -) + WGroupLeader, +%End +%If (Qt_3_0_0 -) + WShowModal, + WNoMousePropagation, + WSubWindow, +%End +%If (Qt_3_1_0 -) + WStyle_Splash, +%End +%If (Qt_3_2_0 -) + WNoAutoErase, +%End + }; + + +%If (Qt_3_3_0 -) + + enum WindowState { + WindowNoState, + WindowMinimized, + WindowMaximized, + WindowFullScreen, + WindowActive + }; + +%End + + enum ImageConversionFlags { + ColorMode_Mask, + AutoColor, + ColorOnly, + MonoOnly, + + AlphaDither_Mask, + ThresholdAlphaDither, + OrderedAlphaDither, + DiffuseAlphaDither, + + Dither_Mask, + DiffuseDither, + OrderedDither, + ThresholdDither, + + DitherMode_Mask, + AutoDither, + PreferDither, + AvoidDither + }; + + enum BGMode { + TransparentMode, + OpaqueMode + }; + +%If (- Qt_3_0_0) + enum PaintUnit { + PixelUnit, + LoMetricUnit, + HiMetricUnit, + LoEnglishUnit, + HiEnglishUnit, + TwipsUnit + }; +%End + + enum GUIStyle { +%If (- Qt_3_0_0) + MacStyle, +%End + WindowsStyle, +%If (- Qt_3_0_0) + Win3Style, + PMStyle, +%End + MotifStyle + }; + +%If (Qt_3_1_0 -) + enum SequenceMatch { + NoMatch, + PartialMatch, + Identical + }; +%End + + enum Modifier { +%If (Qt_3_1_0 -) + META, +%End + SHIFT, + CTRL, + ALT, + MODIFIER_MASK, + UNICODE_ACCEL, + ASCII_ACCEL + }; + + enum Key { + Key_Escape, + Key_Tab, + Key_Backtab, + Key_BackTab, + Key_Backspace, + Key_BackSpace, + Key_Return, + Key_Enter, + Key_Insert, + Key_Delete, + Key_Pause, + Key_Print, + Key_SysReq, +%If (Qt_3_1_0 -) + Key_Clear, +%End + + Key_Home, + Key_End, + Key_Left, + Key_Up, + Key_Right, + Key_Down, + Key_Prior, + Key_PageUp, + Key_Next, + Key_PageDown, + + Key_Shift, + Key_Control, + Key_Meta, + Key_Alt, + Key_CapsLock, + Key_NumLock, + Key_ScrollLock, + + Key_F1, + Key_F2, + Key_F3, + Key_F4, + Key_F5, + Key_F6, + Key_F7, + Key_F8, + Key_F9, + Key_F10, + Key_F11, + Key_F12, + Key_F13, + Key_F14, + Key_F15, + Key_F16, + Key_F17, + Key_F18, + Key_F19, + Key_F20, + Key_F21, + Key_F22, + Key_F23, + Key_F24, + Key_F25, + Key_F26, + Key_F27, + Key_F28, + Key_F29, + Key_F30, + Key_F31, + Key_F32, + Key_F33, + Key_F34, + Key_F35, + + Key_Super_L, + Key_Super_R, + Key_Menu, + Key_Hyper_L, + Key_Hyper_R, +%If (Qt_3_0_0 -) + Key_Help, + Key_Direction_L, + Key_Direction_R, +%End + + Key_Space, + Key_Any, + Key_Exclam, + Key_QuoteDbl, + Key_NumberSign, + Key_Dollar, + Key_Percent, + Key_Ampersand, + Key_Apostrophe, + Key_ParenLeft, + Key_ParenRight, + Key_Asterisk, + Key_Plus, + Key_Comma, + Key_Minus, + Key_Period, + Key_Slash, + Key_0, + Key_1, + Key_2, + Key_3, + Key_4, + Key_5, + Key_6, + Key_7, + Key_8, + Key_9, + Key_Colon, + Key_Semicolon, + Key_Less, + Key_Equal, + Key_Greater, + Key_Question, + Key_At, + Key_A, + Key_B, + Key_C, + Key_D, + Key_E, + Key_F, + Key_G, + Key_H, + Key_I, + Key_J, + Key_K, + Key_L, + Key_M, + Key_N, + Key_O, + Key_P, + Key_Q, + Key_R, + Key_S, + Key_T, + Key_U, + Key_V, + Key_W, + Key_X, + Key_Y, + Key_Z, + Key_BracketLeft, + Key_Backslash, + Key_BracketRight, + Key_AsciiCircum, + Key_Underscore, + Key_QuoteLeft, + Key_BraceLeft, + Key_Bar, + Key_BraceRight, + Key_AsciiTilde, + + Key_nobreakspace, + Key_exclamdown, + Key_cent, + Key_sterling, + Key_currency, + Key_yen, + Key_brokenbar, + Key_section, + Key_diaeresis, + Key_copyright, + Key_ordfeminine, + Key_guillemotleft, + Key_notsign, + Key_hyphen, + Key_registered, + Key_macron, + Key_degree, + Key_plusminus, + Key_twosuperior, + Key_threesuperior, + Key_acute, + Key_mu, + Key_paragraph, + Key_periodcentered, + Key_cedilla, + Key_onesuperior, + Key_masculine, + Key_guillemotright, + Key_onequarter, + Key_onehalf, + Key_threequarters, + Key_questiondown, + Key_Agrave, + Key_Aacute, + Key_Acircumflex, + Key_Atilde, + Key_Adiaeresis, + Key_Aring, + Key_AE, + Key_Ccedilla, + Key_Egrave, + Key_Eacute, + Key_Ecircumflex, + Key_Ediaeresis, + Key_Igrave, + Key_Iacute, + Key_Icircumflex, + Key_Idiaeresis, + Key_ETH, + Key_Ntilde, + Key_Ograve, + Key_Oacute, + Key_Ocircumflex, + Key_Otilde, + Key_Odiaeresis, + Key_multiply, + Key_Ooblique, + Key_Ugrave, + Key_Uacute, + Key_Ucircumflex, + Key_Udiaeresis, + Key_Yacute, + Key_THORN, + Key_ssharp, + Key_agrave, + Key_aacute, + Key_acircumflex, + Key_atilde, + Key_adiaeresis, + Key_aring, + Key_ae, + Key_ccedilla, + Key_egrave, + Key_eacute, + Key_ecircumflex, + Key_ediaeresis, + Key_igrave, + Key_iacute, + Key_icircumflex, + Key_idiaeresis, + Key_eth, + Key_ntilde, + Key_ograve, + Key_oacute, + Key_ocircumflex, + Key_otilde, + Key_odiaeresis, + Key_division, + Key_oslash, + Key_ugrave, + Key_uacute, + Key_ucircumflex, + Key_udiaeresis, + Key_yacute, + Key_thorn, + Key_ydiaeresis, + +%If (Qt_3_1_0 -) + Key_Back, + Key_Forward, + Key_Stop, + Key_Refresh, + + Key_VolumeDown, + Key_VolumeMute, + Key_VolumeUp, + Key_BassBoost, + Key_BassUp, + Key_BassDown, + Key_TrebleUp, + Key_TrebleDown, + + Key_MediaPlay, + Key_MediaStop, + Key_MediaPrev, + Key_MediaNext, + Key_MediaRecord, + + Key_HomePage, + Key_Favorites, + Key_Search, + Key_Standby, + Key_OpenUrl, + + Key_LaunchMail, + Key_LaunchMedia, + Key_Launch0, + Key_Launch1, + Key_Launch2, + Key_Launch3, + Key_Launch4, + Key_Launch5, + Key_Launch6, + Key_Launch7, + Key_Launch8, + Key_Launch9, + Key_LaunchA, + Key_LaunchB, + Key_LaunchC, + Key_LaunchD, + Key_LaunchE, + Key_LaunchF, + + Key_MediaLast, +%End + + Key_unknown + }; + + enum ArrowType { + UpArrow, + DownArrow, + LeftArrow, + RightArrow + }; + + enum RasterOp { + CopyROP, + OrROP, + XorROP, + NotAndROP, + EraseROP, + NotCopyROP, + NotOrROP, + NotXorROP, + AndROP, + NotEraseROP, + NotROP, + ClearROP, + SetROP, + NopROP, + AndNotROP, + OrNotROP, + NandROP, + NorROP, + LastROP + }; + + enum PenStyle { + NoPen, + SolidLine, + DashLine, + DotLine, + DashDotLine, + DashDotDotLine, +%If (Qt_2_1_0 -) + MPenStyle +%End + }; + +%If (Qt_2_1_0 -) + enum PenCapStyle { + FlatCap, + SquareCap, + RoundCap, + MPenCapStyle + }; + + enum PenJoinStyle { + MiterJoin, + BevelJoin, + RoundJoin, + MPenJoinStyle + }; +%End + + enum BrushStyle { + NoBrush, + SolidPattern, + Dense1Pattern, + Dense2Pattern, + Dense3Pattern, + Dense4Pattern, + Dense5Pattern, + Dense6Pattern, + Dense7Pattern, + HorPattern, + VerPattern, + CrossPattern, + BDiagPattern, + FDiagPattern, + DiagCrossPattern, + CustomPattern + }; + +%If (Qt_3_1_0 -) + enum MacintoshVersion { + MV_Unknown, + + MV_9, +%If (Qt_3_2_0 -) + MV_10_DOT_0, +%End + MV_10_DOT_1, + MV_10_DOT_2, +%If (Qt_3_2_0 -) + MV_10_DOT_3, +%End +%If (Qt_3_3_5 -) + MV_10_DOT_4, +%End + +%If (Qt_3_2_0 -) + MV_CHEETAH, + MV_PUMA, +%End + MV_JAGUAR, +%If (Qt_3_2_0 -) + MV_PANTHER, +%End +%If (Qt_3_3_5 -) + MV_TIGER, +%End + }; +%End + + enum WindowsVersion { + WV_32s, + WV_95, + WV_98, +%If (Qt_3_0_0 -) + WV_Me, +%End +%If (Qt_2_1_0 -) + WV_DOS_based, +%End + + WV_NT, +%If (Qt_2_1_0 -) + WV_2000, +%End +%If (Qt_3_0_0 -) + WV_XP, +%End +%If (Qt_3_3_0 -) + WV_2003, +%End +%If (Qt_3_3_6 -) + WV_VISTA, +%End +%If (Qt_2_1_0 -) + WV_NT_based, +%End + +%If (Qt_3_3_0 -) + WV_CE, + WV_CENET, + WV_CE_based, +%End + }; + +%If (Qt_2_2_0 -) + enum UIEffect { + UI_General, + UI_AnimateMenu, + UI_FadeMenu, + UI_AnimateCombo, + UI_AnimateTooltip, + UI_FadeTooltip, +%If (Qt_3_2_0 -) + UI_AnimateToolBox, +%End + }; +%End + +%If (Qt_3_0_0 -) + enum CursorShape { + ArrowCursor, + UpArrowCursor, + CrossCursor, + WaitCursor, + IbeamCursor, + SizeVerCursor, + SizeHorCursor, + SizeBDiagCursor, + SizeFDiagCursor, + SizeAllCursor, + BlankCursor, + SplitVCursor, + SplitHCursor, + PointingHandCursor, + ForbiddenCursor, + WhatsThisCursor, +%If (Qt_3_3_0 -) + BusyCursor, +%End + LastCursor, + BitmapCursor + }; +%End + + static const QCursor &arrowCursor; + static const QCursor &upArrowCursor; + static const QCursor &crossCursor; + static const QCursor &waitCursor; + static const QCursor &ibeamCursor; + static const QCursor &sizeVerCursor; + static const QCursor &sizeHorCursor; + static const QCursor &sizeBDiagCursor; + static const QCursor &sizeFDiagCursor; + static const QCursor &sizeAllCursor; + static const QCursor &blankCursor; + static const QCursor &splitVCursor; + static const QCursor &splitHCursor; + static const QCursor &pointingHandCursor; +%If (Qt_2_1_0 -) + static const QCursor &forbiddenCursor; +%End +%If (Qt_3_0_0 -) + static const QCursor &whatsThisCursor; +%End +%If (Qt_3_3_0 -) + static const QCursor &busyCursor; +%End + + enum TextFormat { + PlainText, + RichText, + AutoText, +%If (Qt_3_1_0 -) + LogText, +%End + }; + +%If (Qt_3_1_0 -) + enum AnchorAttribute { + AnchorName, + AnchorHref + }; +%End + +%If (Qt_3_0_0 -) + enum Dock { + DockUnmanaged, + DockTornOff, + DockTop, + DockBottom, + DockRight, + DockLeft, + DockMinimized + }; + + enum DateFormat { + TextDate, + ISODate, + LocalDate + }; + +%If (Qt_3_1_0 -) + enum TimeSpec { + LocalTime, + UTC + }; +%End + + enum BackgroundMode { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteButton, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBrightText, + PaletteBase, + PaletteBackground, + PaletteShadow, + PaletteHighlight, + PaletteHighlightedText, + PaletteButtonText, + PaletteLink, + PaletteLinkVisited, + X11ParentRelative + }; + + typedef uint ComparisonFlags; + + enum StringComparisonMode { + CaseSensitive, + BeginsWith, + EndsWith, + Contains, + ExactMatch + }; + +%If (Qt_3_2_0 -) + enum Corner { + TopLeft, + TopRight, + BottomLeft, + BottomRight + }; +%End + +%If (WS_X11) + typedef unsigned long HANDLE; +%End +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qnetworkprotocol.sip b/python/pyqt/sip/qt/qnetworkprotocol.sip new file mode 100644 index 00000000..6af512b9 --- /dev/null +++ b/python/pyqt/sip/qt/qnetworkprotocol.sip @@ -0,0 +1,227 @@ +// This is the SIP interface definition for QNetworkOperation, QNetworkProtocol +// and QNetworkProtocolFactoryBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QNetworkOperation (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkOperation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QNetworkProtocol (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkProtocol</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QNetworkProtocolFactoryBase (Qt v2.1+)</Title> +<Para> +<Literal>QNetworkProtocolFactoryBase</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_1_0 -) + +class QNetworkProtocolFactoryBase +{ +%TypeHeaderCode +#include <qnetworkprotocol.h> +%End + +public: + virtual QNetworkProtocol *createObject() = 0 /Factory/; + +}; + + +class QNetworkProtocol : QObject +{ +%TypeHeaderCode +#include <qnetworkprotocol.h> +%End + +public: + enum State { + StWaiting, + StInProgress, + StDone, + StFailed, + StStopped + }; + +%If (- Qt_3_0_0) + enum Operation { + OpListChildren, + OpMkdir, + OpRemove, + OpRename, + OpGet, + OpPut + }; +%End +%If (Qt_3_0_0 -) + enum Operation { + OpListChildren, + OpMkDir, + OpRemove, + OpRename, + OpGet, + OpPut + }; +%End + + enum ConnectionState { + ConHostFound, + ConConnected, + ConClosed + }; + +%If (- Qt_3_0_0) + enum Error { + NoError, + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + ErrLoginIncorrect, + ErrHostNotFound, + ErrListChlidren, + ErrMkdir, + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; +%End +%If (Qt_3_0_0 -) + enum Error { + NoError, + ErrValid, + ErrUnknownProtocol, + ErrUnsupported, + ErrParse, + ErrLoginIncorrect, + ErrHostNotFound, + ErrListChildren, + ErrMkDir, + ErrRemove, + ErrRename, + ErrGet, + ErrPut, + ErrFileNotExisting, + ErrPermissionDenied + }; +%End + + QNetworkProtocol(); + + virtual void setUrl(QUrlOperator *); + + virtual void setAutoDelete(bool,int = 10000); + bool autoDelete() const; + + static void registerNetworkProtocol(const QString &, + QNetworkProtocolFactoryBase *); + static QNetworkProtocol *getNetworkProtocol(const QString &) /Factory/; + static bool hasOnlyLocalFileSystem(); + + virtual int supportedOperations() const; + virtual void addOperation(QNetworkOperation *); + + QUrlOperator *url() const; + QNetworkOperation *operationInProgress() const; + virtual void clearOperationQueue(); + virtual void stop(); + +signals: + void data(const QByteArray &,QNetworkOperation *); + void connectionStateChanged(int,const QString &); + void finished(QNetworkOperation *); + void start(QNetworkOperation *); + void newChildren(const QValueList<QUrlInfo> &,QNetworkOperation *); + void newChild(const QUrlInfo &,QNetworkOperation *); + void createdDirectory(const QUrlInfo &,QNetworkOperation *); + void removed(QNetworkOperation *); + void itemChanged(QNetworkOperation *); + void dataTransferProgress(int,int,QNetworkOperation *); + +protected: + virtual void processOperation(QNetworkOperation *); + virtual void operationListChildren(QNetworkOperation *); + virtual void operationMkDir(QNetworkOperation *); + virtual void operationRemove(QNetworkOperation *); + virtual void operationRename(QNetworkOperation *); + virtual void operationGet(QNetworkOperation *); + virtual void operationPut(QNetworkOperation *); +%If (Qt_3_0_0 -) + virtual void operationPutChunk(QNetworkOperation *); +%End + virtual bool checkConnection(QNetworkOperation *); + +private: +%If (Qt_3_1_0 -) + QNetworkProtocol(const QNetworkProtocol &); +%End +}; + + +class QNetworkOperation : QObject +{ +%TypeHeaderCode +#include <qnetworkprotocol.h> +%End + +public: + QNetworkOperation(QNetworkProtocol::Operation,const QString &, + const QString &,const QString &); + QNetworkOperation(QNetworkProtocol::Operation,const QByteArray &, + const QByteArray &,const QByteArray &); + + void setState(QNetworkProtocol::State); + void setProtocolDetail(const QString &); + void setErrorCode(int); + void setArg(int,const QString &); + void setRawArg(int,const QByteArray &); + + QNetworkProtocol::Operation operation() const; + QNetworkProtocol::State state() const; + QString arg(int) const; + QByteArray rawArg(int) const; + QString protocolDetail() const; + int errorCode() const; + + void free(); + +private: +%If (Qt_3_1_0 -) + QNetworkOperation(const QNetworkOperation &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qobject.sip b/python/pyqt/sip/qt/qobject.sip new file mode 100644 index 00000000..97b3ff88 --- /dev/null +++ b/python/pyqt/sip/qt/qobject.sip @@ -0,0 +1,1369 @@ +// This is the SIP interface definition for QObject. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QObject</Title> +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>disconnect</Function></FuncDef> + <ParamDef>const char *<Parameter>signal</Parameter> = 0</ParamDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>member</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>static bool <Function>disconnect</Function></FuncDef> + <ParamDef>const QObject *<Parameter>sender</Parameter></ParamDef> + <ParamDef>const char *<Parameter>signal</Parameter></ParamDef> + <ParamDef>const QObject *<Parameter>receiver</Parameter></ParamDef> + <ParamDef>const char *<Parameter>member</Parameter></ParamDef> +</FuncSynopsis> +<Para> +At the moment PyQt does not support the full behaviour of the corresponding Qt +method. In particular, specifying None (ie. 0 in C++) for the +<Literal>signal</Literal> and <Literal>receiver</Literal> parameters is not yet +supported. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QObject : Qt +{ +%TypeHeaderCode +#include <qobject.h> +#include <qapplication.h> +%End + +public: + QObject(QObject * /TransferThis/ = 0,const char * = 0); + +%ConvertToSubClassCode + static struct class_graph { + char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QWidget, &sipClass_QWidget, 25, 1}, +#if QT_VERSION >= 0x030100 && defined(SIP_FEATURE_Qt_ASSISTANTCLIENT) + {sipName_QAssistantClient, &sipClass_QAssistantClient, -1, 2}, +#else + {NULL, NULL, -1, 2}, +#endif + {sipName_QSessionManager, &sipClass_QSessionManager, -1, 3}, + {sipName_QTranslator, &sipClass_QTranslator, -1, 4}, +#if QT_VERSION >= 0x030000 + {sipName_QProcess, &sipClass_QProcess, -1, 5}, +#else + {NULL, NULL, -1, 5}, +#endif + {sipName_QToolTipGroup, &sipClass_QToolTipGroup, -1, 6}, +#if defined(SIP_FEATURE_Qt_FILEDIALOG) + {sipName_QFileIconProvider, &sipClass_QFileIconProvider, -1, 7}, +#else + {NULL, NULL, -1, 7}, +#endif +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_ACTION) + {sipName_QAction, &sipClass_QAction, 89, 8}, +#else + {NULL, NULL, -1, 8}, +#endif +#if QT_VERSION >= 0x030000 + {sipName_QObjectCleanupHandler, &sipClass_QObjectCleanupHandler, -1, 9}, +#else + {NULL, NULL, -1, 9}, +#endif + {sipName_QTimer, &sipClass_QTimer, -1, 10}, + {sipName_QLayout, &sipClass_QLayout, 90, 11}, +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_NETWORKPROTOCOL) + {sipName_QUrlOperator, &sipClass_QUrlOperator, -1, 12}, +#else + {NULL, NULL, -1, 12}, +#endif + {sipName_QStyleSheet, &sipClass_QStyleSheet, -1, 13}, + {sipName_QValidator, &sipClass_QValidator, 94, 14}, +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_NETWORKPROTOCOL) + {sipName_QNetworkOperation, &sipClass_QNetworkOperation, -1, 15}, +#else + {NULL, NULL, -1, 15}, +#endif + {sipName_QAccel, &sipClass_QAccel, -1, 16}, +#if QT_VERSION >= 0x030100 + {sipName_QEventLoop, &sipClass_QEventLoop, -1, 17}, +#else + {NULL, NULL, -1, 17}, +#endif +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_NETWORKPROTOCOL) + {sipName_QNetworkProtocol, &sipClass_QNetworkProtocol, -1, 18}, +#else + {NULL, NULL, -1, 18}, +#endif +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_SOUND) + {sipName_QSound, &sipClass_QSound, -1, 19}, +#else + {NULL, NULL, -1, 19}, +#endif + {sipName_QApplication, &sipClass_QApplication, -1, 20}, + {sipName_QDragObject, &sipClass_QDragObject, 97, 21}, + {sipName_QSocketNotifier, &sipClass_QSocketNotifier, -1, 22}, + {sipName_QStyle, &sipClass_QStyle, 103, 23}, + {sipName_QSignalMapper, &sipClass_QSignalMapper, -1, 24}, +#if defined(SIP_FEATURE_Qt_CLIPBOARD) + {sipName_QClipboard, &sipClass_QClipboard, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QStatusBar, &sipClass_QStatusBar, -1, 26}, +#if defined(SIP_FEATURE_Qt_SIZEGRIP) + {sipName_QSizeGrip, &sipClass_QSizeGrip, -1, 27}, +#else + {NULL, NULL, -1, 27}, +#endif + {sipName_QTabWidget, &sipClass_QTabWidget, -1, 28}, +#if QT_VERSION >= 0x030000 + {sipName_QDateEdit, &sipClass_QDateEdit, -1, 29}, +#else + {NULL, NULL, -1, 29}, +#endif + {sipName_QMainWindow, &sipClass_QMainWindow, -1, 30}, +#if QT_VERSION >= 0x030000 + {sipName_QDateTimeEdit, &sipClass_QDateTimeEdit, -1, 31}, +#else + {NULL, NULL, -1, 31}, +#endif +#if QT_VERSION >= 0x030000 + {sipName_QTimeEdit, &sipClass_QTimeEdit, -1, 32}, +#else + {NULL, NULL, -1, 32}, +#endif + {sipName_QFrame, &sipClass_QFrame, 46, 33}, + {sipName_QScrollBar, &sipClass_QScrollBar, -1, 34}, +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_DIAL) + {sipName_QDial, &sipClass_QDial, -1, 35}, +#else + {NULL, NULL, -1, 35}, +#endif + {sipName_QButton, &sipClass_QButton, 75, 36}, + {sipName_QTabBar, &sipClass_QTabBar, -1, 37}, + {sipName_QDialog, &sipClass_QDialog, 79, 38}, + {sipName_QComboBox, &sipClass_QComboBox, -1, 39}, + {sipName_QHeader, &sipClass_QHeader, -1, 40}, +#if QT_VERSION >= 0x030000 + {sipName_QDockArea, &sipClass_QDockArea, -1, 41}, +#else + {NULL, NULL, -1, 41}, +#endif +#if QT_VERSION >= 0x030200 + {sipName_QSplashScreen, &sipClass_QSplashScreen, -1, 42}, +#else + {NULL, NULL, -1, 42}, +#endif + {sipName_QSlider, &sipClass_QSlider, -1, 43}, + {sipName_QSpinBox, &sipClass_QSpinBox, -1, 44}, +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_WORKSPACE) + {sipName_QWorkspace, &sipClass_QWorkspace, -1, 45}, +#else + {NULL, NULL, -1, 45}, +#endif +#if QT_VERSION >= 0x030000 + {sipName_QDesktopWidget, &sipClass_QDesktopWidget, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QGrid, &sipClass_QGrid, -1, 47}, + {sipName_QLineEdit, &sipClass_QLineEdit, -1, 48}, +#if QT_VERSION >= 0x030200 + {sipName_QToolBox, &sipClass_QToolBox, -1, 49}, +#else + {NULL, NULL, -1, 49}, +#endif + {sipName_QWidgetStack, &sipClass_QWidgetStack, -1, 50}, +#if QT_VERSION >= 0x030000 + {sipName_QDockWindow, &sipClass_QDockWindow, 60, 51}, +#else + {NULL, NULL, -1, 51}, +#endif + {sipName_QMenuBar, &sipClass_QMenuBar, -1, 52}, + {sipName_QLabel, &sipClass_QLabel, -1, 53}, + {sipName_QGroupBox, &sipClass_QGroupBox, 61, 54}, + {sipName_QPopupMenu, &sipClass_QPopupMenu, -1, 55}, +#if defined(SIP_FEATURE_Qt_SPLITTER) + {sipName_QSplitter, &sipClass_QSplitter, -1, 56}, +#else + {NULL, NULL, -1, 56}, +#endif + {sipName_QProgressBar, &sipClass_QProgressBar, -1, 57}, + {sipName_QScrollView, &sipClass_QScrollView, 66, 58}, + {sipName_QHBox, &sipClass_QHBox, 74, 59}, + {sipName_QLCDNumber, &sipClass_QLCDNumber, -1, -1}, + {sipName_QToolBar, &sipClass_QToolBar, -1, -1}, + {sipName_QButtonGroup, &sipClass_QButtonGroup, 64, 62}, + {sipName_QHGroupBox, &sipClass_QHGroupBox, -1, 63}, + {sipName_QVGroupBox, &sipClass_QVGroupBox, -1, -1}, + {sipName_QVButtonGroup, &sipClass_QVButtonGroup, -1, 65}, + {sipName_QHButtonGroup, &sipClass_QHButtonGroup, -1, -1}, +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_ICONVIEW) + {sipName_QIconView, &sipClass_QIconView, -1, 67}, +#else + {NULL, NULL, -1, 67}, +#endif + {sipName_QListView, &sipClass_QListView, -1, 68}, + {sipName_QListBox, &sipClass_QListBox, -1, 69}, +#if QT_VERSION >= 0x030000 + {sipName_QGridView, &sipClass_QGridView, -1, 70}, +#else + {NULL, NULL, -1, 70}, +#endif +#if QT_VERSION >= 0x030000 + {sipName_QTextEdit, &sipClass_QTextEdit, 71, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QTextBrowser, &sipClass_QTextBrowser, -1, 72}, + {sipName_QMultiLineEdit, &sipClass_QMultiLineEdit, -1, 73}, + {sipName_QTextView, &sipClass_QTextView, -1, -1}, + {sipName_QVBox, &sipClass_QVBox, -1, -1}, + {sipName_QToolButton, &sipClass_QToolButton, -1, 76}, + {sipName_QRadioButton, &sipClass_QRadioButton, -1, 77}, + {sipName_QPushButton, &sipClass_QPushButton, -1, 78}, + {sipName_QCheckBox, &sipClass_QCheckBox, -1, -1}, +#if defined(WS_X11) && defined(SIP_FEATURE_Qt_PRINTDIALOG) + {sipName_QPrintDialog, &sipClass_QPrintDialog, -1, 80}, +#else + {NULL, NULL, -1, 80}, +#endif +#if QT_VERSION >= 0x030000 + {sipName_QErrorMessage, &sipClass_QErrorMessage, -1, 81}, +#else + {NULL, NULL, -1, 81}, +#endif +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_INPUTDIALOG) + {sipName_QInputDialog, &sipClass_QInputDialog, -1, 82}, +#else + {NULL, NULL, -1, 82}, +#endif +#if defined(SIP_FEATURE_Qt_MESSAGEBOX) + {sipName_QMessageBox, &sipClass_QMessageBox, -1, 83}, +#else + {NULL, NULL, -1, 83}, +#endif +#if defined(SIP_FEATURE_Qt_WIZARD) + {sipName_QWizard, &sipClass_QWizard, -1, 84}, +#else + {NULL, NULL, -1, 84}, +#endif +#if defined(SIP_FEATURE_Qt_COLORDIALOG) + {sipName_QColorDialog, &sipClass_QColorDialog, -1, 85}, +#else + {NULL, NULL, -1, 85}, +#endif +#if defined(SIP_FEATURE_Qt_FONTDIALOG) + {sipName_QFontDialog, &sipClass_QFontDialog, -1, 86}, +#else + {NULL, NULL, -1, 86}, +#endif +#if defined(SIP_FEATURE_Qt_FILEDIALOG) + {sipName_QFileDialog, &sipClass_QFileDialog, -1, 87}, +#else + {NULL, NULL, -1, 87}, +#endif +#if defined(SIP_FEATURE_Qt_PROGRESSDIALOG) + {sipName_QProgressDialog, &sipClass_QProgressDialog, -1, 88}, +#else + {NULL, NULL, -1, 88}, +#endif +#if defined(SIP_FEATURE_Qt_TABDIALOG) + {sipName_QTabDialog, &sipClass_QTabDialog, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_ACTION) + {sipName_QActionGroup, &sipClass_QActionGroup, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QGridLayout, &sipClass_QGridLayout, -1, 91}, + {sipName_QBoxLayout, &sipClass_QBoxLayout, 92, -1}, + {sipName_QHBoxLayout, &sipClass_QHBoxLayout, -1, 93}, + {sipName_QVBoxLayout, &sipClass_QVBoxLayout, -1, -1}, + {sipName_QDoubleValidator, &sipClass_QDoubleValidator, -1, 95}, + {sipName_QIntValidator, &sipClass_QIntValidator, -1, 96}, +#if QT_VERSION >= 0x030000 + {sipName_QRegExpValidator, &sipClass_QRegExpValidator, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QTextDrag, &sipClass_QTextDrag, -1, 98}, + {sipName_QStoredDrag, &sipClass_QStoredDrag, 101, 99}, +#if QT_VERSION >= 210 && defined(SIP_FEATURE_Qt_ICONVIEW) && defined(SIP_FEATURE_Qt_DRAGANDDROP) + {sipName_QIconDrag, &sipClass_QIconDrag, -1, 100}, +#else + {NULL, NULL, -1, 100}, +#endif + {sipName_QImageDrag, &sipClass_QImageDrag, -1, -1}, +#if QT_VERSION >= 210 + {sipName_QColorDrag, &sipClass_QColorDrag, -1, 102}, +#else + {NULL, NULL, -1, 102}, +#endif + {sipName_QUriDrag, &sipClass_QUriDrag, -1, -1}, + {sipName_QCommonStyle, &sipClass_QCommonStyle, 104, -1}, +#if defined(SIP_FEATURE_Qt_STYLE_WINDOWS) + {sipName_QWindowsStyle, &sipClass_QWindowsStyle, 106, 105}, +#else + {NULL, NULL, -1, 105}, +#endif +#if defined(SIP_FEATURE_Qt_STYLE_MOTIF) + {sipName_QMotifStyle, &sipClass_QMotifStyle, 107, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if defined(SIP_FEATURE_Qt_STYLE_PLATINUM) + {sipName_QPlatinumStyle, &sipClass_QPlatinumStyle, -1, 110}, +#else + {NULL, NULL, -1, 110}, +#endif +#if defined(SIP_FEATURE_Qt_STYLE_CDE) + {sipName_QCDEStyle, &sipClass_QCDEStyle, -1, 108}, +#else + {NULL, NULL, -1, 108}, +#endif +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_STYLE_MOTIFPLUS) + {sipName_QMotifPlusStyle, &sipClass_QMotifPlusStyle, -1, 109}, +#else + {NULL, NULL, -1, 109}, +#endif +#if QT_VERSION >= 220 && defined(SIP_FEATURE_Qt_STYLE_SGI) + {sipName_QSGIStyle, &sipClass_QSGIStyle, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif +#if defined(PYQT_STYLE_WINDOWSXP) + {sipName_QWindowsXPStyle, &sipClass_QWindowsXPStyle, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + // This is really virtual. With the way we are implementing it doesn't + // need to be and has the advantage that the C++ implementation can be + // used in %ConvertToSubClassCode to get the C++ name for Python + // sub-classes. However, it is also means that C++ plugins can't get + // the true (Python) class name. + SIP_PYOBJECT className() const; +%MethodCode + sipRes = sipClassName(sipSelf); +%End + +%If (- Qt_3_0_0) + static QString tr(const char *) /AutoGen=Qt_TRANSLATION/; +%End +%If (Qt_2_2_0 - Qt_2_3_1) + // There was an apparent bug in moc prior to Qt v2.3.1 where this + // method wasn't automatically generated. + + static QString tr(const char *,const char *); +%End +%If (Qt_2_3_1 - Qt_3_0_0) + static QString tr(const char *,const char *) /AutoGen=Qt_TRANSLATION/; +%End +%If (Qt_3_0_0 -) + // Note that tr() and trUtf8() are really static methods. We pretend + // they aren't so that we can use self to get hold of the class name. + // We could mimic moc's behaviour more accurately by creating tr() and + // trUtf8() methods for a Python sub-class instance in the sub-class's + // ctor. + + QString tr(const char *,const char * = 0); +%MethodCode + PyObject *nmobj; + + if ((nmobj = sipClassName(sipSelf)) == NULL) + sipIsErr = 1; + else + { + char *cname = PyString_AsString(nmobj); + + Py_BEGIN_ALLOW_THREADS + + if (cname && qApp) + sipRes = new QString(qApp -> translate(cname,a0,a1,QApplication::DefaultCodec)); + else + sipRes = new QString(QString::fromLatin1(a0)); + + Py_END_ALLOW_THREADS + + Py_DECREF(nmobj); + } +%End + + QString trUtf8(const char *,const char * = 0); +%MethodCode + PyObject *nmobj; + + if ((nmobj = sipClassName(sipSelf)) == NULL) + sipIsErr = 1; + else + { + char *cname = PyString_AsString(nmobj); + + Py_BEGIN_ALLOW_THREADS + + if (cname && qApp) + sipRes = new QString(qApp -> translate(cname,a0,a1,QApplication::UnicodeUTF8)); + else + sipRes = new QString(QString::fromUtf8(a0)); + + Py_END_ALLOW_THREADS + + Py_DECREF(nmobj); + } +%End +%End + virtual QMetaObject *metaObject() const /AutoGen/; + virtual bool event(QEvent *); + virtual bool eventFilter(QObject *,QEvent *); + + bool isA(const char *) const; +%MethodCode + // The Qt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we use the Python type's name. For + // SIP v3 we use the broken Qt behaviour as it's deprecated and + // we want to keep things simple. + +#if SIP_VERSION >= 0x040000 + sipRes = (strcmp(sipSelf -> ob_type -> tp_name,a0) == 0); +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> QObject::isA(a0); + Py_END_ALLOW_THREADS +#endif +%End + + bool inherits(const char *) const; +%MethodCode + // The Qt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we use the Python type's MRO. For + // SIP v3 we use the broken Qt behaviour as it's deprecated and + // we want to keep things simple. + +#if SIP_VERSION >= 0x040000 + PyObject *mro = sipSelf -> ob_type -> tp_mro; + + sipRes = 0; + + for (int i = 0; i < PyTuple_GET_SIZE(mro); ++i) + if (strcmp(((PyTypeObject *)PyTuple_GET_ITEM(mro,i)) -> tp_name,a0) == 0) + { + sipRes = 1; + break; + } +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> QObject::inherits(a0); + Py_END_ALLOW_THREADS +#endif +%End + +%If (- Qt_3_0_0) + QStringList superClasses(bool = 0) const; +%End + const char *name() const; + const char *name(const char *) const; + virtual void setName(const char *); + bool isWidgetType() const; + bool highPriority() const; + bool signalsBlocked() const; + void blockSignals(bool); + int startTimer(int); + void killTimer(int); + void killTimers(); +%If (- Qt_3_0_0) + QObject *child(const char *,const char * = 0); +%End +%If (Qt_3_0_0 -) + QObject *child(const char *,const char * = 0,bool = 1); +%End + const QObjectList *children() const; +%If (Qt_2_1_0 -) + static const QObjectList *objectTrees(); +%End +%If (- Qt_3_0_0) + QObjectList *queryList(char * = 0,char * = 0,bool = 1,bool = 1); +%End + +%If (Qt_3_0_0 -) + QObjectList *queryList(char * = 0,char * = 0,bool = 1,bool = 1) const; +%MethodCode + // The Qt implementation doesn't know anything about Python + // sub-classes. For SIP v4 we get all classes and then use the + // Python type's MRO to weed out those we don't want. For SIP + // v3 we use the broken Qt behaviour as it's deprecated and we + // want to keep things simple. + +#if SIP_VERSION >= 0x040000 + sipRes = sipCpp -> QObject::queryList(0, a1, a2, a3); + + if (a0 && sipRes) + { + QObject *o = sipRes -> first(); + + while (o) + { + bool remove = TRUE; + PyObject *pyo = sipConvertFromInstance(o, sipClass_QObject, 0); + + if (pyo) + { + PyObject *mro = pyo -> ob_type -> tp_mro; + + for (int i = 0; i < PyTuple_GET_SIZE(mro); ++i) + if (strcmp(((PyTypeObject *)PyTuple_GET_ITEM(mro,i)) -> tp_name,a0) == 0) + { + remove = FALSE; + break; + } + + Py_DECREF(pyo); + } + + if (remove) + { + sipRes -> remove(); + o = sipRes -> current(); + } + else + o = sipRes -> next(); + } + } +#else + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> QObject::queryList(a0, a1, a2, a3); + Py_END_ALLOW_THREADS +#endif +%End +%End + + virtual void insertChild(QObject * /Transfer/); + virtual void removeChild(QObject * /TransferBack/); + void installEventFilter(const QObject *); + void removeEventFilter(const QObject *); + + static SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,a3,0); +%End + + static SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,0,0); +%End + + SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_SLOT) const; +%MethodCode + sipRes = sipConnectRx(a0,a1,sipSelf,a2,0); +%End + + static SIP_PYOBJECT disconnect(SIP_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,a3); +%End + + static SIP_PYOBJECT disconnect(SIP_QOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,0); +%End + +// bool disconnect(const char * = 0,const QObject * = 0,const char * = 0); +// bool disconnect(const QObject *,const char * = 0); + void dumpObjectTree(); + void dumpObjectInfo(); + QObject *parent() const; + + void emit(SIP_SIGNAL,SIP_PYTUPLE); +%MethodCode + if (sipEmitSignal(sipSelf,a0,a1) < 0) + sipIsErr = 1; +%End + +%If (Qt_PROPERTIES) +%If (Qt_2_1_0 - Qt_3_0_0) + bool setProperty(const char *,const QVariant &); + QVariant property(const char *) const; +%End +%If (Qt_3_0_0 -) + virtual bool setProperty(const char *,const QVariant &); + virtual QVariant property(const char *) const; +%End +%End + +signals: + void destroyed(); +%If (Qt_3_0_0 -) + void destroyed(QObject *); +%End + +public slots: +%If (Qt_3_0_0 -) + void deleteLater(); +%End + +public: + // This is actually protected, but we never need to call the real + // method. + SIP_PYOBJECT sender(); +%MethodCode + sipRes = sipGetSender(); +%End + +protected: + virtual void timerEvent(QTimerEvent *); + virtual void childEvent(QChildEvent *); +%If (Qt_3_0_0 -) + virtual void customEvent(QCustomEvent *); +%End + +private: + QObject(const QObject &); +}; + + +SIP_PYOBJECT QT_TR_NOOP(SIP_PYOBJECT); +%MethodCode + Py_INCREF(a0); + sipRes = a0; +%End + + +SIP_PYOBJECT QT_TRANSLATE_NOOP(SIP_PYOBJECT,SIP_PYOBJECT); +%MethodCode + Py_INCREF(a1); + sipRes = a1; +%End + +%End + + +%If (- Qt_2_00) + +class QObject +{ +%TypeHeaderCode +#include <qobject.h> +%End + +public: + QObject(QObject * /TransferThis/ = 0,const char * = 0); + +%ConvertToSubClassCode + // The table of Python class objects indexed by their names. The table + // must be sorted by name. + + static sipStringTypeClassMap map[] = { + {sipName_QAccel, &sipClass_QAccel}, + {sipName_QApplication, &sipClass_QApplication}, + {sipName_QBoxLayout, &sipClass_QBoxLayout}, + {sipName_QButton, &sipClass_QButton}, + {sipName_QButtonGroup, &sipClass_QButtonGroup}, + {sipName_QCheckBox, &sipClass_QCheckBox}, +#if defined(SIP_FEATURE_Qt_CLIPBOARD) + {sipName_QClipboard, &sipClass_QClipboard}, +#endif + {sipName_QComboBox, &sipClass_QComboBox}, + {sipName_QDialog, &sipClass_QDialog}, + {sipName_QDoubleValidator, &sipClass_QDoubleValidator}, + {sipName_QDragObject, &sipClass_QDragObject}, +#if defined(SIP_FEATURE_Qt_FILEDIALOG) + {sipName_QFileDialog, &sipClass_QFileDialog}, + {sipName_QFileIconProvider, &sipClass_QFileIconProvider}, +#endif + {sipName_QFrame, &sipClass_QFrame}, + {sipName_QGridLayout, &sipClass_QGridLayout}, + {sipName_QGroupBox, &sipClass_QGroupBox}, + {sipName_QHBoxLayout, &sipClass_QHBoxLayout}, + {sipName_QHeader, &sipClass_QHeader}, + {sipName_QImageDrag, &sipClass_QImageDrag}, + {sipName_QIntValidator, &sipClass_QIntValidator}, + {sipName_QLCDNumber, &sipClass_QLCDNumber}, + {sipName_QLabel, &sipClass_QLabel}, + {sipName_QLayout, &sipClass_QLayout}, + {sipName_QLineEdit, &sipClass_QLineEdit}, + {sipName_QListBox, &sipClass_QListBox}, + {sipName_QListView, &sipClass_QListView}, + {sipName_QMainWindow, &sipClass_QMainWindow}, + {sipName_QMenuBar, &sipClass_QMenuBar}, +#if defined(SIP_FEATURE_Qt_MESSAGEBOX) + {sipName_QMessageBox, &sipClass_QMessageBox}, +#endif + {sipName_QMultiLineEdit, &sipClass_QMultiLineEdit}, + {sipName_QPopupMenu, &sipClass_QPopupMenu}, +#if defined(WS_X11) && defined(SIP_FEATURE_Qt_PRINTDIALOG) + {sipName_QPrintDialog, &sipClass_QPrintDialog}, +#endif + {sipName_QProgressBar, &sipClass_QProgressBar}, +#if defined(SIP_FEATURE_Qt_PROGRESSDIALOG) + {sipName_QProgressDialog, &sipClass_QProgressDialog}, +#endif + {sipName_QPushButton, &sipClass_QPushButton}, + {sipName_QRadioButton, &sipClass_QRadioButton}, + {sipName_QScrollBar, &sipClass_QScrollBar}, + {sipName_QScrollView, &sipClass_QScrollView}, + {sipName_QSlider, &sipClass_QSlider}, + {sipName_QSocketNotifier, &sipClass_QSocketNotifier}, + {sipName_QSpinBox, &sipClass_QSpinBox}, +#if defined(SIP_FEATURE_Qt_SPLITTER) + {sipName_QSplitter, &sipClass_QSplitter}, +#endif + {sipName_QStatusBar, &sipClass_QStatusBar}, + {sipName_QStoredDrag, &sipClass_QStoredDrag}, + {sipName_QTabBar, &sipClass_QTabBar}, + {sipName_QTextDrag, &sipClass_QTextDrag}, + {sipName_QTimer, &sipClass_QTimer}, + {sipName_QToolBar, &sipClass_QToolBar}, + {sipName_QToolButton, &sipClass_QToolButton}, + {sipName_QToolTipGroup, &sipClass_QToolTipGroup}, + {sipName_QVBoxLayout, &sipClass_QVBoxLayout}, + {sipName_QValidator, &sipClass_QValidator}, + {sipName_QWidget, &sipClass_QWidget}, + {sipName_QWidgetStack, &sipClass_QWidgetStack} + }; + + sipClass = sipMapStringToClass(sipCpp -> className(),map,sizeof (map)/sizeof (map[0])); +%End + + static SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,a3,0); +%End + + static SIP_PYOBJECT connect(SIP_QOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipConnectRx(a0,a1,a2,0,0); +%End + + static SIP_PYOBJECT disconnect(SIP_QOBJECT,SIP_SIGNAL,SIP_QOBJECT,SIP_SLOT); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,a3); +%End + + static SIP_PYOBJECT disconnect(SIP_QOBJECT,SIP_SIGNAL,SIP_PYCALLABLE); +%MethodCode + sipRes = sipDisconnectRx(a0,a1,a2,0); +%End + + virtual bool event(QEvent *); + virtual bool eventFilter(QObject *,QEvent *); + const char *tr(const char *) const; + virtual QMetaObject *metaObject() const /AutoGen/; + + // This is actually virtual. However, with the way we are implementing + // it we can ignore it. + SIP_PYOBJECT className() const; +%MethodCode + sipRes = sipClassName(sipSelf); +%End + + bool isA(const char *) const; + bool inherits(const char *) const; + const char *name() const; + const char *name(const char *) const; + void setName(const char *); + bool isWidgetType() const; + bool highPriority() const; + bool signalsBlocked() const; + void blockSignals(bool); + int startTimer(int); + void killTimer(int); + void killTimers(); + const QObjectList *children() const; + QObjectList *queryList(char * = 0,char * = 0,bool = 1,bool = 1); + void insertChild(QObject * /Transfer/); + void removeChild(QObject * /TransferBack/); + void installEventFilter(const QObject *); + void removeEventFilter(const QObject *); +// bool connect(QObject *,const char *,const char *); +// bool disconnect(const char * = 0,const QObject * = 0,const char * = 0); +// bool disconnect(const QObject *,const char * = 0); + void dumpObjectTree(); + void dumpObjectInfo(); + QObject *parent() const; + + void emit(SIP_SIGNAL,SIP_PYTUPLE); +%MethodCode + if (sipEmitSignal(sipSelf,a0,a1) < 0) + sipIsErr = 1; +%End + +signals: + void destroyed(); + +public: + // This is actually protected, but we never need to call the real + // method. + SIP_PYOBJECT sender(); +%MethodCode + sipRes = sipGetSender(); +%End + +protected: + virtual void timerEvent(QTimerEvent *); + +private: + QObject(const QObject &); +}; + +%End + + +SIP_PYOBJECT SLOT(const char *); +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"qt.SLOT() slot name cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyString_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyString_AS_STRING(sipRes); + + *dp++ = '1'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +SIP_PYOBJECT SIGNAL(const char *); +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"qt.SIGNAL() signal cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyString_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyString_AS_STRING(sipRes); + + *dp++ = '2'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +SIP_PYOBJECT PYSIGNAL(const char *); +%MethodCode + if (!a0) + { + PyErr_Format(PyExc_TypeError,"qt.PYSIGNAL() signal cannot be None"); + sipIsErr = 1; + } + else + { + int len = strlen(a0); + + if ((sipRes = PyString_FromStringAndSize(NULL,1 + len)) == NULL) + sipIsErr = 1; + else + { + char *dp = PyString_AS_STRING(sipRes); + + *dp++ = '9'; + + memcpy(dp,a0,len + 1); + } + } +%End + + +// This is Qt support code for SIP v4.4 and later. +%ModuleCode + +#include <qobject.h> +#include <qvariant.h> +#include <qmetaobject.h> +#include <private/qucom_p.h> +#include <private/qucomextra_p.h> + + +// This class is used as a slot on behalf of connections to a Python callable. +// It is derived from QObject but is not run through moc. Instead the normal +// moc-generated methods are handwritten in order to implement a universal +// slot. This requires some knowledge of the internal implementation of +// signals and slots but it is likely that they will only change between major +// Qt versions. +class UniversalSlot : public QObject +{ +public: + UniversalSlot(QObject *qtx, sipSlotConnection *conn, const char **member); + ~UniversalSlot(); + + virtual QMetaObject *metaObject() const + { + return staticMetaObject(); + } + + virtual bool qt_invoke(int, QUObject *args); + static QMetaObject *staticMetaObject(); + + static const QObject *lastSender; + + static UniversalSlot *unislots; + UniversalSlot *nextus, *prevus; + sipSlotConnection conn; + +private: + static QMetaObject *metaObj; +}; + + +// Create a universal slot. Note that this will leak if there is no signal +// transmitter (ie. no parent) - QTimer.singleShot() for example. +UniversalSlot::UniversalSlot(QObject *qtx, sipSlotConnection *connection, const char **member) : QObject() +{ + // Save the connection. + conn = *connection; + + // Detect when the transmitter is destroyed. + if (qtx) + connect(qtx, SIGNAL(destroyed(QObject *)), SLOT(deleteLater())); + + // Return the slot to connect to. + *member = SLOT(unislot()); + + // Add this one to the global list. + nextus = unislots; + + if (nextus) + nextus -> prevus = this; + + prevus = 0; + unislots = this; +} + + +// Destroy a universal slot. +UniversalSlot::~UniversalSlot() +{ + sipFreeConnection(&conn); + + // Remove this one from the global list. + if (nextus) + nextus -> prevus = prevus; + + if (prevus) + prevus -> nextus = nextus; + else + unislots = nextus; +} + + +QMetaObject *UniversalSlot::metaObj = 0; + +#if QT_VERSION >= 0x030100 +static QMetaObjectCleanUp cleanUp_UniversalSlot("UniversalSlot", &UniversalSlot::staticMetaObject); +#else +static QMetaObjectCleanUp cleanUp_UniversalSlot; +#endif + +const QObject *UniversalSlot::lastSender = 0; +UniversalSlot *UniversalSlot::unislots = 0; + + +QMetaObject *UniversalSlot::staticMetaObject() +{ + if (metaObj) + return metaObj; + + // Define a single slot that takes no arguments and so will accept any + // connection. + static const QUMethod slot = {"unislot", 0, 0}; + static const QMetaData slot_tbl[] = { + {"unislot()", &slot, QMetaData::Public} + }; + + metaObj = QMetaObject::new_metaobject( + "UniversalSlot", QObject::staticMetaObject(), + slot_tbl, 1, + 0, 0, +#ifndef QT_NO_PROPERTIES + 0, 0, + 0, 0, +#endif + 0, 0); + + cleanUp_UniversalSlot.setMetaObject(metaObj); + + return metaObj; +} + + +bool UniversalSlot::qt_invoke(int id, QUObject *qargs) +{ + if (id - staticMetaObject()->slotOffset() != 0) + return QObject::qt_invoke(id, qargs); + + bool ok = TRUE; + const sipSignature *psig = conn.sc_signature; + QVariant *qv; + + // Save in case it is asked for later. + lastSender = sender(); + + // If the sender was a QSignal then the single argument will be wrapped + // in a QVariant instance. At the moment we handle int argument as + // that is all that is needed by PyQt (and PyKDE). + if (lastSender -> inherits("QSignal")) + qv = &static_QUType_QVariant.get(qargs + 1); + else + qv = 0; + +#ifdef WITH_THREAD + PyGILState_STATE state = PyGILState_Ensure(); +#endif + + PyObject *argtup = PyTuple_New(psig->sg_nrargs); + + if (!argtup) + ok = FALSE; + else + { + for (int a = 0; a < psig->sg_nrargs; ++a) + { + PyObject *arg; + + ++qargs; + + switch (psig->sg_args[a].atype) + { + case char_sat: + case schar_sat: + case uchar_sat: + arg = PyString_FromStringAndSize((char *)static_QUType_ptr.get(qargs), 1); + break; + + case string_sat: + case sstring_sat: + case ustring_sat: + arg = PyString_FromString((char *)static_QUType_ptr.get(qargs)); + break; + + case short_sat: + arg = PyInt_FromLong(*(short *)static_QUType_ptr.get(qargs)); + break; + + case ushort_sat: + arg = PyLong_FromUnsignedLong(*(unsigned short *)static_QUType_ptr.get(qargs)); + break; + + case int_sat: + if (qv) + arg = PyInt_FromLong(qv -> asInt()); + else + arg = PyInt_FromLong(static_QUType_int.get(qargs)); + break; + + case uint_sat: + arg = PyLong_FromUnsignedLong(*(unsigned *)static_QUType_ptr.get(qargs)); + break; + + case long_sat: + arg = PyLong_FromLong(*(long *)static_QUType_ptr.get(qargs)); + break; + + case ulong_sat: + arg = PyLong_FromUnsignedLong(*(unsigned long *)static_QUType_ptr.get(qargs)); + break; + + case longlong_sat: + arg = PyLong_FromLongLong(*(PY_LONG_LONG *)static_QUType_ptr.get(qargs)); + break; + + case ulonglong_sat: + arg = PyLong_FromUnsignedLongLong(*(unsigned PY_LONG_LONG *)static_QUType_ptr.get(qargs)); + break; + + case float_sat: + arg = PyFloat_FromDouble(*(float *)static_QUType_ptr.get(qargs)); + break; + + case double_sat: + arg = PyFloat_FromDouble(static_QUType_double.get(qargs)); + break; + + case enum_sat: + arg = sipConvertFromNamedEnum(*(int *)static_QUType_ptr.get(qargs), psig->sg_args[a].u.et); + break; + + case bool_sat: + arg = PyInt_FromLong(static_QUType_bool.get(qargs)); + break; + + case void_sat: + arg = sipConvertFromVoidPtr((void *)static_QUType_ptr.get(qargs)); + break; + + case class_sat: + case classp_sat: + arg = sipConvertFromInstance((void *)static_QUType_ptr.get(qargs),psig->sg_args[a].u.wt,0); + break; + + case mtype_sat: + case mtypep_sat: + arg = sipConvertFromMappedType((void *)static_QUType_ptr.get(qargs),psig->sg_args[a].u.mt,0); + break; + + case qvariant_sat: + case qvariantp_sat: + arg = sipConvertFromInstance((void *)&static_QUType_QVariant.get(qargs),sipClass_QVariant,0); + break; + + case pyobject_sat: + arg = (PyObject *)static_QUType_ptr.get(qargs); + break; + + default: + arg = Py_NotImplemented; + Py_INCREF(Py_NotImplemented); + } + + PyTuple_SET_ITEM(argtup, a, arg); + } + + // Dispatch to the real slot. + if (ok && sipEmitToSlot(&conn.sc_slot, argtup) < 0) + ok = FALSE; + + Py_DECREF(argtup); + } + + if (!ok) + PyErr_Print(); + +#ifdef WITH_THREAD + PyGILState_Release(state); +#endif + + return ok; +} + + +// Declare explicit C linkage. +extern "C" +{ + static void *sipQtCreateUniversalSlot(sipWrapper *, sipSlotConnection *, const char **); + static void sipQtDestroyUniversalSlot(void *); + static void *sipQtFindSlot(void *, const char *, PyObject *, const char *, const char **); + static int sipQtConnect(void *, const char *, void *, const char *, int); + static int sipQtDisconnect(void *, const char *, void *, const char *); + static int sipQtSignalsBlocked(void *); + static const void *sipQtGetSender(); + static void sipQtForgetSender(); + static int sipQtSameSignalSlotName(const char *, const char *); + static sipSlotConnection *sipQtFindConnection(void *, void **); +} + + +// Factory function to create a universal slot instance. Returns a pointer to +// the instance or 0 if there was an error. +static void *sipQtCreateUniversalSlot(sipWrapper *tx, sipSlotConnection *conn, const char **member) +{ + QObject *qtx = 0; + + // See if the transmitter is a QObject in which case we will connect + // to it's destroyed signal so that the universal slot can be destroyed + // at the same time. (Note that we used to do this by making the + // universal slot a child of the transmitter. This doesn't work as + // expected because QWidget destroys its children before emitting the + // destroyed signal.) + if (tx && PyObject_TypeCheck(tx, (PyTypeObject *)sipClass_QObject)) + qtx = reinterpret_cast<QObject *>(conn->sc_transmitter); + + return new UniversalSlot(qtx, conn, member); +} + + +// Dispose of a receiver that might be a universal slot. +static void sipQtDestroyUniversalSlot(void *rx) +{ + for (UniversalSlot *us = UniversalSlot::unislots; us; us = us->nextus) + if (us == reinterpret_cast<QObject *>(rx)) + { + delete us; + break; + } +} + + +// Search for the universal slot connected to a particular Qt signal. +static void *sipQtFindSlot(void *tx, const char *sig, PyObject *rxObj, const char *slot, const char **member) +{ + for (UniversalSlot *us = UniversalSlot::unislots; us; us = us->nextus) + if (sipSameConnection(&us->conn, tx, sig, rxObj, slot)) + { + *member = SLOT(unislot()); + return us; + } + + return 0; +} + + +// Connect a Qt signal to a Qt slot. +static int sipQtConnect(void *tx, const char *sig, void *rx, const char *slot, int) +{ + return QObject::connect(reinterpret_cast<QObject *>(tx), sig, + reinterpret_cast<QObject *>(rx), slot); +} + + +// Disconnect a Qt signal from a Qt slot. +static int sipQtDisconnect(void *tx, const char *sig, void *rx, const char *slot) +{ + return QObject::disconnect(reinterpret_cast<QObject *>(tx), sig, + reinterpret_cast<QObject *>(rx), slot); +} + + +// See if signals are currently blocked for a QObject. +static int sipQtSignalsBlocked(void *qobj) +{ + return reinterpret_cast<QObject *>(qobj)->signalsBlocked(); +} + + +// Get the last sender for QObject::sender(). +static const void *sipQtGetSender() +{ + return UniversalSlot::lastSender; +} + + +// Forget the last sender. +static void sipQtForgetSender() +{ + UniversalSlot::lastSender = 0; +} + + +// See if two signal or slot names are the same. +static int sipQtSameSignalSlotName(const char *s1, const char *s2) +{ + // moc formats signal names, so we should first convert the supplied + // string to the same format before comparing them. Instead we just + // compare them as they are, but ignoring all spaces - this will have + // the same result. + do + { + // Skip any spaces. + + while (*s1 == ' ') + ++s1; + + while (*s2 == ' ') + ++s2; + + if (*s1++ != *s2) + return 0; + } + while (*s2++ != '\0'); + + return 1; +} + + +// Return the next connection for a particular transmitter. This will be +// called with the GIL locked. +static sipSlotConnection *sipQtFindConnection(void *tx, void **context) +{ + UniversalSlot *us = *reinterpret_cast<UniversalSlot **>(context); + + if (!us) + us = UniversalSlot::unislots; + + sipSlotConnection *conn = 0; + + while (us) + { + sipSlotConnection *this_conn = &us->conn; + + us = us->nextus; + + if (this_conn->sc_transmitter == tx) + { + conn = this_conn; + break; + } + } + + *context = us; + + return conn; +} + +%End diff --git a/python/pyqt/sip/qt/qobjectcleanuphandler.sip b/python/pyqt/sip/qt/qobjectcleanuphandler.sip new file mode 100644 index 00000000..0828fc7f --- /dev/null +++ b/python/pyqt/sip/qt/qobjectcleanuphandler.sip @@ -0,0 +1,49 @@ +// This is the SIP interface definition for QObjectCleanupHandler. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QObjectCleanupHandler (Qt v3+)</Title> +<Para> +<Literal>QObjectCleanupHandler</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QObjectCleanupHandler : QObject +{ +%TypeHeaderCode +#include <qobjectcleanuphandler.h> +%End + +public: + QObjectCleanupHandler(); + + QObject *add(QObject *); + void remove(QObject *); + bool isEmpty() const; + void clear(); +}; + +%End diff --git a/python/pyqt/sip/qt/qobjectlist.sip b/python/pyqt/sip/qt/qobjectlist.sip new file mode 100644 index 00000000..d9adc9e0 --- /dev/null +++ b/python/pyqt/sip/qt/qobjectlist.sip @@ -0,0 +1,108 @@ +// This is the SIP interface definition for QObjectList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QObjectList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QObjectList</Literal> is the +return type of a function or the type of an argument, a Python list of +<Literal>QObject</Literal> instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType QObjectList +{ +%TypeHeaderCode +#include <qobjectlist.h> +#include "sipqtQObject.h" +%End + +%ConvertFromTypeCode + // Convert the list. + + PyObject *pl; + QObject *obj; + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (QObjectListIt it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_QObject,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of QObject instances to a QObjectList on the + // heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QObject,0)) + return 0; + + return 1; + } + + QObjectList *qol = new QObjectList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + QObject *qobj; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qobj = reinterpret_cast<QObject *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QObject,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete qol; + return 0; + } + + qol -> append(qobj); + } + + *sipCppPtr = qol; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/python/pyqt/sip/qt/qpaintdevice.sip b/python/pyqt/sip/qt/qpaintdevice.sip new file mode 100644 index 00000000..52b78f28 --- /dev/null +++ b/python/pyqt/sip/qt/qpaintdevice.sip @@ -0,0 +1,247 @@ +// This is the SIP interface definition for QPaintDevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPaintDevice</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>cmd</Function></FuncDef> + <ParamDef>int</ParamDef> + <ParamDef>QPainter *</ParamDef> + <ParamDef>QPDevCmdParam *</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qpaintdevice.h> +%End + + +%If (- Qt_2_00) + +// Painter device types. + +const int PDT_UNDEF; +const int PDT_WIDGET; +const int PDT_PIXMAP; +const int PDT_PRINTER; +const int PDT_PICTURE; +const int PDT_MASK; + +// Painter device flags. + +const int PDF_EXTDEV; +const int PDF_PAINTACTIVE; + + +void bitBlt(QPaintDevice *,int,int,const QPaintDevice *,int = 0,int = 0, + int = -1,int = -1,RasterOp = CopyROP,bool = 0); +void bitBlt(QPaintDevice *,int,int,const QImage *,int = 0,int = 0,int = -1, + int = -1,int = 0); +void bitBlt(QPaintDevice *,const QPoint &,const QPaintDevice *, + const QRect & = QRect(0,0,-1,-1),RasterOp = CopyROP,bool = 0); + +%End + +%If (Qt_2_00 -) + +void bitBlt(QPaintDevice *,int,int,const QPaintDevice *,int = 0,int = 0, + int = -1,int = -1,Qt::RasterOp = Qt::CopyROP,bool = 0); +void bitBlt(QPaintDevice *,int,int,const QImage *,int = 0,int = 0,int = -1, + int = -1,int = 0); +void bitBlt(QPaintDevice *,const QPoint &,const QPaintDevice *, + const QRect & = QRect(0,0,-1,-1),Qt::RasterOp = Qt::CopyROP, + bool = 0); + +%End + + +class QPaintDevice +{ +%TypeHeaderCode +#include <qpaintdevice.h> +%End + +public: + int devType() const; + bool isExtDev() const; + bool paintingActive() const; + +%If (Qt_3_0_0 -) + virtual void setResolution(int); + virtual int resolution() const; +%End + +%If (- Qt_2_00) + HANDLE handle() const; +%If (WS_X11) + Display *x11Display() const; + static int x11Screen(); + static int x11Depth(); + static int x11Cells(); + static HANDLE x11Colormap(); + static bool x11DefaultColormap(); + static void *x11Visual(); + static bool x11DefaultVisual(); +%End +%End + +%If (Qt_2_00 -) +%If (WS_X11) +%If (- Qt_3_0_0) + HANDLE handle() const; +%End +%If (Qt_3_0_0 -) + Qt::HANDLE handle() const; + Qt::HANDLE x11RenderHandle() const; +%End + Display *x11Display() const; + int x11Screen() const; + int x11Depth() const; + int x11Cells() const; +%If (- Qt_3_0_0) + HANDLE x11Colormap() const; +%End +%If (Qt_3_0_0 -) + Qt::HANDLE x11Colormap() const; +%End + bool x11DefaultColormap() const; + void *x11Visual() const; + bool x11DefaultVisual() const; + + static Display *x11AppDisplay(); + static int x11AppScreen(); + + static int x11AppDpiX(); + static int x11AppDpiY(); +%If (Qt_2_1_0 -) + static void x11SetAppDpiX(int); + static void x11SetAppDpiY(int); +%End + static int x11AppDepth(); + static int x11AppCells(); +%If (Qt_3_1_0 -) + static Qt::HANDLE x11AppRootWindow(); +%End +%If (Qt_3_0_0 -) + static Qt::HANDLE x11AppColormap(); +%End +%If (- Qt_3_0_0) + static HANDLE x11AppColormap(); +%End + static bool x11AppDefaultColormap(); + static void *x11AppVisual(); + static bool x11AppDefaultVisual(); + +%If (Qt_3_1_0 -) + static int x11AppDepth(int); + static int x11AppCells(int); + static Qt::HANDLE x11AppRootWindow(int); + static Qt::HANDLE x11AppColormap(int); + static void *x11AppVisual(int); + static bool x11AppDefaultColormap(int); + static bool x11AppDefaultVisual(int); + static int x11AppDpiX(int); + static int x11AppDpiY(int); + static void x11SetAppDpiX(int,int); + static void x11SetAppDpiY(int,int); +%End +%End + + enum PDevCmd + { + PdcNOP, + PdcDrawPoint, + PdcDrawFirst, + PdcMoveTo, + PdcLineTo, + PdcDrawLine, + PdcDrawRect, + PdcDrawRoundRect, + PdcDrawEllipse, + PdcDrawArc, + PdcDrawPie, + PdcDrawChord, + PdcDrawLineSegments, + PdcDrawPolyline, + PdcDrawPolygon, +%If (Qt_3_0_0 -) + PdcDrawCubicBezier, +%End +%If (- Qt_3_0_0) + PdcDrawQuadBezier, +%End + PdcDrawText, + PdcDrawTextFormatted, + PdcDrawPixmap, + PdcDrawImage, + PdcDrawText2, + PdcDrawText2Formatted, +%If (Qt_3_2_0 -) + PdcDrawTextItem, +%End + PdcDrawLast, + + PdcBegin, + PdcEnd, + PdcSave, + PdcRestore, + PdcSetdev, + PdcSetBkColor, + PdcSetBkMode, + PdcSetROP, + PdcSetBrushOrigin, + PdcSetFont, + PdcSetPen, + PdcSetBrush, + PdcSetTabStops, + PdcSetTabArray, + PdcSetUnit, + PdcSetVXform, + PdcSetWindow, + PdcSetViewport, + PdcSetWXform, + PdcSetWMatrix, + PdcSaveWMatrix, + PdcRestoreWMatrix, + PdcSetClip, + PdcSetClipRegion, + PdcReservedStart, + PdcReservedStop + }; + +%End + +protected: + QPaintDevice(uint); +// virtual bool cmd(int,QPainter *,QPDevCmdParam *); +// virtual int metric(int) const; +// virtual int fontMet(QFont *,int,const char *,int = 0) const; +// virtual int fontInf(QFont *,int) const; + +private: + QPaintDevice(const QPaintDevice &); +}; diff --git a/python/pyqt/sip/qt/qpaintdevicemetrics.sip b/python/pyqt/sip/qt/qpaintdevicemetrics.sip new file mode 100644 index 00000000..ece93568 --- /dev/null +++ b/python/pyqt/sip/qt/qpaintdevicemetrics.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for QPaintDeviceMetrics. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPaintDeviceMetrics</Title> +<Para> +<Literal>QPaintDeviceMetrics</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QPaintDeviceMetrics +{ +%TypeHeaderCode +#include <qpaintdevicemetrics.h> +%End + +public: + QPaintDeviceMetrics(const QPaintDevice *); + + int width() const; + int height() const; + int widthMM() const; + int heightMM() const; +%If (Qt_2_00 -) + int logicalDpiX() const; + int logicalDpiY() const; +%End +%If (Qt_3_0_0 -) + int physicalDpiX() const; + int physicalDpiY() const; +%End + int numColors() const; + int depth() const; +}; diff --git a/python/pyqt/sip/qt/qpainter.sip b/python/pyqt/sip/qt/qpainter.sip new file mode 100644 index 00000000..f9b1fca1 --- /dev/null +++ b/python/pyqt/sip/qt/qpainter.sip @@ -0,0 +1,676 @@ +// This is the SIP interface definition for QPainter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPainter</Title> +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>QRect <Function>boundingRect</Function></FuncDef> + <ParamDef>const QRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int <Parameter>w</Parameter></ParamDef> + <ParamDef>int <Parameter>h</Parameter></ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>QRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>drawText</Function></FuncDef> + <ParamDef>const QRect&</ParamDef> + <ParamDef>int <Parameter>flags</Parameter></ParamDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>len</Parameter> = -1</ParamDef> + <ParamDef>QRect *<Parameter>br</Parameter> = 0</ParamDef> + <ParamDef>char **<Parameter>intern</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>intern</Literal> parameter is not supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setTabArray</Function></FuncDef> + <ParamDef>int *<Parameter>ta</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of tab stops. +</Para> + +<FuncSynopsis> + <FuncDef>int *<Function>tabArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of tab stops. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +%ModuleHeaderCode +#include <qpainter.h> +%End + +enum BGMode { + TransparentMode, + OpaqueMode +}; + +enum PaintUnit { + PixelUnit, + LoMetricUnit, + HiMetricUnit, + LoEnglishUnit, + HiEnglishUnit, + TwipsUnit +}; + + +class QPainter +{ +%TypeHeaderCode +#include <qpainter.h> +%End + +public: + QPainter(); + QPainter(const QPaintDevice *); + QPainter(const QPaintDevice *,const QWidget *); + + bool begin(const QPaintDevice *); + bool begin(const QPaintDevice *,const QWidget *); + bool end(); + QPaintDevice *device() const; + + static void redirect(QPaintDevice *,QPaintDevice *); +%If (Qt_3_2_0 -) + static QPaintDevice *redirect(QPaintDevice *); +%End + + bool isActive() const; + void flush(); + void save(); + void restore(); + QFontMetrics fontMetrics() const; + QFontInfo fontInfo() const; + const QFont &font() const; + void setFont(const QFont&); + const QPen &pen() const; + void setPen(const QPen &); + void setPen(PenStyle); + void setPen(const QColor &); + const QBrush &brush() const; + void setBrush(const QBrush &); + void setBrush(BrushStyle); + void setBrush(const QColor &); + const QColor &backgroundColor() const; + void setBackgroundColor(const QColor &); + BGMode backgroundMode() const; + void setBackgroundMode(BGMode); + RasterOp rasterOp() const; + void setRasterOp(RasterOp); + const QPoint &brushOrigin() const; + void setBrushOrigin(int,int); + void setBrushOrigin(const QPoint &); + + bool hasViewXForm() const; + bool hasWorldXForm() const; + + void setViewXForm(bool); + QRect window() const; + void setWindow(const QRect &); + void setWindow(int,int,int,int); + QRect viewport() const; + void setViewport(const QRect &); + void setViewport(int,int,int,int); + + void setWorldXForm(bool); + const QWMatrix &worldMatrix() const; + void setWorldMatrix(const QWMatrix &,bool = 0); + + void scale(float,float); + void shear(float,float); + void rotate(float); + + void translate(float,float); + void resetXForm(); + + QPoint xForm(QPoint &) const; + QRect xForm(QRect &) const; + QPointArray xForm(QPointArray &) const; + QPointArray xForm(QPointArray &,int,int) const; + QPoint xFormDev(QPoint &) const; + QRect xFormDev(QRect &) const; + QPointArray xFormDev(QPointArray &) const; + QPointArray xFormDev(QPointArray &,int,int) const; + void setClipping(bool); + bool hasClipping() const; + const QRegion &clipRegion() const; + void setClipRect(const QRect &); + void setClipRect(int,int,int,int); + void setClipRegion(const QRegion &); + void drawPoint(int,int); + void drawPoint(const QPoint &); + void drawPoints(const QPointArray &,int,int = -1); + void moveTo(int,int); + void moveTo(const QPoint &); + void lineTo(int,int); + void lineTo(const QPoint &); + void drawLine(int,int,int,int); + void drawLine(const QPoint &,const QPoint &); + void drawRect(int,int,int,int); + void drawRect(const QRect &); + void drawWinFocusRect(int,int,int,int); + void drawWinFocusRect(int,int,int,int,const QColor &); + void drawWinFocusRect(const QRect &); + void drawWinFocusRect(const QRect &,const QColor &); + void drawRoundRect(int,int,int,int,int,int); + void drawRoundRect(const QRect &,int,int); + void drawEllipse(int,int,int,int); + void drawEllipse(const QRect &); + void drawArc(int,int,int,int,int,int); + void drawArc(const QRect &,int,int); + void drawPie(int,int,int,int,int,int); + void drawPie(const QRect &,int,int); + void drawChord(int,int,int,int,int,int); + void drawChord(const QRect &,int,int); + void drawLineSegments(const QPointArray &,int = 0,int = -1); + void drawPolyline(const QPointArray &,int = 0,int = -1); + void drawPolygon(const QPointArray &,bool = 0,int = 0,int = -1); + void drawQuadBezier(const QPointArray &,int = 0); + void drawPixmap(int,int,const QPixmap &,int = 0,int = 0,int = -1,int = -1); + void drawPixmap(const QPoint &,const QPixmap &,const QRect &); + void drawPixmap(const QPoint &,const QPixmap &); + void drawImage(int,int,const QImage &,int = 0,int = 0,int = -1,int = -1); + void drawImage(const QPoint &,const QImage &,const QRect &); + void drawImage(const QPoint &,const QImage &); + void drawTiledPixmap(int,int,int,int,const QPixmap &,int = 0,int = 0); + void drawTiledPixmap(const QRect &,const QPixmap &,const QPoint &); + void drawTiledPixmap(const QRect &,const QPixmap &); + void drawPicture(const QPicture &); + void fillRect(int,int,int,int,const QBrush &); + void fillRect(const QRect &,const QBrush &); + void eraseRect(int,int,int,int); + void eraseRect(const QRect &); + void drawText(int,int,char *,int = -1); + void drawText(const QPoint &,const char *,int = -1); + void drawText(int,int,int,int,int,const char *,int = -1,QRect * = 0); + void drawText(const QRect &,int,const char *,int = -1,QRect * = 0); + +%If (Qt_3_2_0 -) + void drawTextItem(int,int,const QTextItem &,int = 0); + void drawTextItem(const QPoint &,const QTextItem &,int = 0); +%End + + QRect boundingRect(int,int,int,int,int,const char *,int = -1); + QRect boundingRect(const QRect &,int,const char *,int = -1); + + int tabStops() const; + void setTabStops(int); + + SIP_PYLIST tabArray() const; +%MethodCode + int *tabs; + + Py_BEGIN_ALLOW_THREADS + tabs = sipCpp -> tabArray(); + Py_END_ALLOW_THREADS + + int len = 0; + + if (tabs) + { + int *tp = tabs; + + do + ++len; + while (*tp++ != 0); + } + + if ((sipRes = PyList_New(len)) == NULL) + sipIsErr = 1; + else if (tabs) + { + int *tp = tabs; + + len = 0; + + do + { + if (PyList_SET_ITEM(sipRes,len,PyInt_FromLong((long)*tp)) < 0) + { + Py_DECREF(sipRes); + sipIsErr = 1; + break; + } + + ++len; + } + while (*tp++ != 0); + } +%End + + void setTabArray(SIP_PYLIST); +%MethodCode + int len, *tabs; + + len = PyList_GET_SIZE(a0); + + // Allocate space for the array. Note, this memory is never + // reclaimed. + if ((tabs = (int *)sipMalloc(len * sizeof (int))) == NULL) + sipIsErr = 1; + else + { + // Convert the list. + + int *tp = tabs; + + for (int i = 0; i < len; ++i) + { + *tp++ = (int)PyInt_AsLong(PyList_GET_ITEM(a0,i)); + + if (PyErr_Occurred() != NULL) + { + sipFree((ANY *)tabs); + sipIsErr = 1; + break; + } + } + + if (!sipIsErr) + { + Py_BEGIN_ALLOW_THREADS + sipCpp -> setTabArray(tabs); + Py_END_ALLOW_THREADS + } + } +%End + + HANDLE handle() const; + static void initialize(); + static void cleanup(); + +private: + QPainter(const QPainter &); +}; + +%End + +%If (Qt_2_00 -) + +class QPainter : Qt +{ +%TypeHeaderCode +#include <qpainter.h> +%End + +public: +%If (Qt_3_0_0 -) + enum CoordinateMode { + CoordDevice, + CoordPainter + }; +%End + + QPainter(); +%If (- Qt_3_0_0) + QPainter(const QPaintDevice *); + QPainter(const QPaintDevice *,const QWidget *); +%End +%If (Qt_3_0_0 -) + QPainter(const QPaintDevice *,bool = 0); + QPainter(const QPaintDevice *,const QWidget *,bool = 0); +%End + +%If (- Qt_3_0_0) + bool begin(const QPaintDevice *); + bool begin(const QPaintDevice *,const QWidget *); +%End +%If (Qt_3_0_0 -) + bool begin(const QPaintDevice *,bool = 0); + bool begin(const QPaintDevice *,const QWidget *,bool = 0); +%End + bool end(); + QPaintDevice *device() const; + + static void redirect(QPaintDevice *,QPaintDevice *); + + bool isActive() const; + +%If (Qt_3_0_0 -) + void flush(const QRegion &,CoordinateMode = CoordDevice); +%End + void flush(); + void save(); + void restore(); + + QFontMetrics fontMetrics() const; + QFontInfo fontInfo() const; + + const QFont &font() const; + void setFont(const QFont&); + const QPen &pen() const; + void setPen(const QPen &); + void setPen(PenStyle); + void setPen(const QColor &); + const QBrush &brush() const; + void setBrush(const QBrush &); + void setBrush(BrushStyle); + void setBrush(const QColor &); +%If (Qt_2_1_0 -) + // The omission of this from Qt/Embedded is probably a bug. +%End + + const QColor &backgroundColor() const; + void setBackgroundColor(const QColor &); + BGMode backgroundMode() const; + void setBackgroundMode(BGMode); + RasterOp rasterOp() const; + void setRasterOp(RasterOp); + const QPoint &brushOrigin() const; + void setBrushOrigin(int,int); + void setBrushOrigin(const QPoint &); + + bool hasViewXForm() const; + bool hasWorldXForm() const; + +%If (Qt_TRANSFORMATIONS) + void setViewXForm(bool); + QRect window() const; + void setWindow(const QRect &); + void setWindow(int,int,int,int); + QRect viewport() const; + void setViewport(const QRect &); + void setViewport(int,int,int,int); + + void setWorldXForm(bool); + const QWMatrix &worldMatrix() const; + void setWorldMatrix(const QWMatrix &,bool = 0); + + void saveWorldMatrix(); + void restoreWorldMatrix(); + + void scale(double,double); + void shear(double,double); + void rotate(double); +%End + void translate(double,double); + void resetXForm(); +%If (Qt_3_0_0 -) + double translationX() const; + double translationY() const; +%End + + QPoint xForm(const QPoint &) const; + QRect xForm(const QRect &) const; + QPointArray xForm(const QPointArray &) const; + QPointArray xForm(const QPointArray &,int,int) const; + QPoint xFormDev(const QPoint &) const; + QRect xFormDev(const QRect &) const; + QPointArray xFormDev(const QPointArray &) const; + QPointArray xFormDev(const QPointArray &,int,int) const; + + void setClipping(bool); + bool hasClipping() const; +%If (- Qt_3_0_0) + const QRegion &clipRegion() const; + void setClipRect(const QRect &); + void setClipRect(int,int,int,int); + void setClipRegion(const QRegion &); +%End +%If (Qt_3_0_0 -) + QRegion clipRegion(CoordinateMode = CoordDevice) const; + void setClipRect(const QRect &,CoordinateMode = CoordDevice); + void setClipRect(int,int,int,int,CoordinateMode = CoordDevice); + void setClipRegion(const QRegion &,CoordinateMode = CoordDevice); +%End + + void drawPoint(int,int); + void drawPoint(const QPoint &); + void drawPoints(const QPointArray &,int,int = -1); + void moveTo(int,int); + void moveTo(const QPoint &); + void lineTo(int,int); + void lineTo(const QPoint &); + void drawLine(int,int,int,int); + void drawLine(const QPoint &,const QPoint &); + void drawRect(int,int,int,int); + void drawRect(const QRect &); + void drawWinFocusRect(int,int,int,int); + void drawWinFocusRect(int,int,int,int,const QColor &); + void drawWinFocusRect(const QRect &); + void drawWinFocusRect(const QRect &,const QColor &); +%If (- Qt_3_0_0) + void drawRoundRect(int,int,int,int,int,int); + void drawRoundRect(const QRect &,int,int); +%End +%If (Qt_3_0_0 -) + void drawRoundRect(int,int,int,int,int = 25,int = 25); + void drawRoundRect(const QRect &,int = 25,int = 25); +%End + void drawEllipse(int,int,int,int); + void drawEllipse(const QRect &); + void drawArc(int,int,int,int,int,int); + void drawArc(const QRect &,int,int); + void drawPie(int,int,int,int,int,int); + void drawPie(const QRect &,int,int); + void drawChord(int,int,int,int,int,int); + void drawChord(const QRect &,int,int); + void drawLineSegments(const QPointArray &,int = 0,int = -1); + void drawPolyline(const QPointArray &,int = 0,int = -1); + void drawPolygon(const QPointArray &,bool = 0,int = 0,int = -1); +%If (- Qt_3_0_0) + void drawQuadBezier(const QPointArray &,int = 0); +%End +%If (Qt_3_0_0 -) + void drawConvexPolygon(const QPointArray &,int = 0,int = -1); + void drawCubicBezier(const QPointArray &,int = 0); +%End + void drawPixmap(int,int,const QPixmap &,int = 0,int = 0,int = -1, + int = -1); + void drawPixmap(const QPoint &,const QPixmap &,const QRect &); + void drawPixmap(const QPoint &,const QPixmap &); +%If (Qt_3_0_0 -) + void drawPixmap(const QRect &,const QPixmap &); +%End +%If (- Qt_3_0_0) + void drawImage(int,int,const QImage &,int = 0,int = 0,int = -1, + int = -1); + void drawImage(const QPoint &,const QImage &,const QRect &); + void drawImage(const QPoint &,const QImage &); +%End +%If (Qt_3_0_0 -) + void drawImage(int,int,const QImage &,int = 0,int = 0,int = -1, + int = -1,int = 0); + void drawImage(const QPoint &,const QImage &,const QRect &,int = 0); + void drawImage(const QPoint &,const QImage &,int = 0); + void drawImage(const QRect &,const QImage &); +%End + void drawTiledPixmap(int,int,int,int,const QPixmap &,int = 0,int = 0); + void drawTiledPixmap(const QRect &,const QPixmap &,const QPoint &); + void drawTiledPixmap(const QRect &,const QPixmap &); +%If (Qt_PICTURE) + void drawPicture(const QPicture &); +%If (Qt_3_0_0 -) + void drawPicture(int,int,const QPicture &); + void drawPicture(const QPoint &,const QPicture &); +%End +%End + + void fillRect(int,int,int,int,const QBrush &); + void fillRect(const QRect &,const QBrush &); + void eraseRect(int,int,int,int); + void eraseRect(const QRect &); + +%If (Qt_3_0_0 -) + enum TextDirection { + Auto, + RTL, + LTR + }; +%End + +%If (- Qt_3_0_0) + void drawText(int,int,const QString &,int = -1); + void drawText(const QPoint &,const QString &,int = -1); +%End +%If (Qt_3_0_0 -) + void drawText(int,int,const QString &,int = -1,TextDirection = Auto); + void drawText(const QPoint &,const QString &,int = -1, + TextDirection = Auto); + void drawText(int,int,const QString &,int,int,TextDirection = Auto); + void drawText(const QPoint &,const QString &,int,int, + TextDirection = Auto); +%End + void drawText(int,int,int,int,int,const QString &,int = -1,QRect * = 0); + void drawText(const QRect &,int,const QString &,int = -1,QRect * = 0); + + QRect boundingRect(int,int,int,int,int,const QString &,int = -1); + QRect boundingRect(const QRect &,int,const QString &,int = -1); + int tabStops() const; + void setTabStops(int); + + SIP_PYLIST tabArray() const; +%MethodCode + int *tabs; + + Py_BEGIN_ALLOW_THREADS + tabs = sipCpp -> tabArray(); + Py_END_ALLOW_THREADS + + int len = 0; + + if (tabs) + { + int *tp = tabs; + + do + ++len; + while (*tp++ != 0); + } + + if ((sipRes = PyList_New(len)) == NULL) + sipIsErr = 1; + else if (tabs) + { + int *tp = tabs; + + len = 0; + + do + { + if (PyList_SET_ITEM(sipRes,len,PyInt_FromLong((long)*tp)) < 0) + { + Py_DECREF(sipRes); + sipIsErr = 1; + break; + } + + ++len; + } + while (*tp++ != 0); + } +%End + + void setTabArray(SIP_PYLIST); +%MethodCode + int len, *tabs; + + len = PyList_GET_SIZE(a0); + + // Allocate space for the array. Note, this memory is never + // reclaimed. + if ((tabs = (int *)sipMalloc(len * sizeof (int))) == NULL) + sipIsErr = 1; + else + { + // Convert the list. + + int *tp = tabs; + + for (int i = 0; i < len; ++i) + { + *tp++ = (int)PyInt_AsLong(PyList_GET_ITEM(a0,i)); + + if (PyErr_Occurred() != NULL) + { + sipFree((ANY *)tabs); + sipIsErr = 1; + break; + } + } + + if (!sipIsErr) + { + Py_BEGIN_ALLOW_THREADS + sipCpp -> setTabArray(tabs); + Py_END_ALLOW_THREADS + } + } +%End + +%If (WS_X11) + HANDLE handle() const; +%End + + static void initialize(); + static void cleanup(); + +private: + QPainter(const QPainter &); +}; + +%End diff --git a/python/pyqt/sip/qt/qpair.sip b/python/pyqt/sip/qt/qpair.sip new file mode 100644 index 00000000..6064e222 --- /dev/null +++ b/python/pyqt/sip/qt/qpair.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for all types based on the QPair +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPair<type,type> (Qt v3+)</Title> +<Para> +Types based on the <Literal>QPair</Literal> template are automatically +converted to and from Python tuples of two elements. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +%MappedType QPair<int,int> +{ +%TypeHeaderCode +#include <qpair.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *t; + + // Create the tuple. + + if ((t = PyTuple_New(2)) == NULL) + return NULL; + + // Fill it. + + PyTuple_SET_ITEM(t,0,PyInt_FromLong((long)sipCpp -> first)); + PyTuple_SET_ITEM(t,1,PyInt_FromLong((long)sipCpp -> second)); + + return t; +%End + +%ConvertToTypeCode + // Convert a Python tuple of integers to a QPair<int,int> on the heap. + + if (sipIsErr == NULL) + return (PyTuple_Size(sipPy) == 2); + + PyErr_Clear(); + + int fst = (int)PyInt_AsLong(PyTuple_GET_ITEM(sipPy,0)); + int sec = (int)PyInt_AsLong(PyTuple_GET_ITEM(sipPy,1)); + + if (PyErr_Occurred() != NULL) + { + *sipIsErr = 1; + return 0; + } + + *sipCppPtr = new QPair<int,int>(fst,sec); + + return 1; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qpalette.sip b/python/pyqt/sip/qt/qpalette.sip new file mode 100644 index 00000000..ae7b94ca --- /dev/null +++ b/python/pyqt/sip/qt/qpalette.sip @@ -0,0 +1,102 @@ +// This is the SIP interface definition for QPalette. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPalette</Title> +<Para> +<Literal>QPalette</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +class QPalette +{ +%TypeHeaderCode +#include <qpalette.h> +%End + +public: + QPalette(); + QPalette(const QColor &); +%If (Qt_2_00 -) + QPalette(const QColor &,const QColor &); +%End + QPalette(const QColorGroup &,const QColorGroup &,const QColorGroup &); + QPalette(const QPalette &); + +%If (Qt_2_00 - Qt_2_1_0) + enum ColorGroup { + Normal, + Disabled, + Active, + NColorGroups + }; +%End +%If (Qt_2_1_0 -) + enum ColorGroup { + Normal, + Disabled, + Active, + Inactive, + NColorGroups + }; +%End + +%If (Qt_2_00 -) + const QColor &color(ColorGroup,QColorGroup::ColorRole) const; + const QBrush &brush(ColorGroup,QColorGroup::ColorRole) const; + void setColor(ColorGroup,QColorGroup::ColorRole,const QColor &); + void setBrush(ColorGroup,QColorGroup::ColorRole,const QBrush &); + void setColor(QColorGroup::ColorRole,const QColor &); + void setBrush(QColorGroup::ColorRole,const QBrush &); +%End + + QPalette copy() const; + + const QColorGroup &active() const; + const QColorGroup &disabled() const; +%If (Qt_2_1_0 -) + const QColorGroup &inactive() const; +%End + const QColorGroup &normal() const; + + void setActive(const QColorGroup &); + void setDisabled(const QColorGroup &); +%If (Qt_2_1_0 -) + void setInactive(const QColorGroup &); +%End + void setNormal(const QColorGroup &); + + bool operator==(const QPalette &) const; + bool operator!=(const QPalette &) const; + + bool isCopyOf(const QPalette &); + int serialNumber() const; + +%If (Qt_3_0_0 -) + // These are defined in Qt3, but don't appear in the documentation. + //static QColorGroup::ColorRole foregroundRoleFromMode(Qt::BackgroundMode); + //static QColorGroup::ColorRole backgroundRoleFromMode(Qt::BackgroundMode); +%End +}; diff --git a/python/pyqt/sip/qt/qpen.sip b/python/pyqt/sip/qt/qpen.sip new file mode 100644 index 00000000..f59db981 --- /dev/null +++ b/python/pyqt/sip/qt/qpen.sip @@ -0,0 +1,101 @@ +// This is the SIP interface definition for QPen. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPen</Title> +<Para> +<Literal>QPen</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +enum PenStyle { + NoPen, + SolidLine, + DashLine, + DotLine, + DashDotLine, + DashDotDotLine +}; + + +class QPen +{ +%TypeHeaderCode +#include <qpen.h> +%End + +public: + QPen(); + QPen(PenStyle); + QPen(const QColor &,uint = 0,PenStyle = SolidLine); + QPen(const QPen &); + + PenStyle style() const; + void setStyle(PenStyle); + uint width() const; + void setWidth(uint); + const QColor &color() const; + void setColor(const QColor &); +}; + +%End + +%If (Qt_2_00 -) + +class QPen : Qt +{ +%TypeHeaderCode +#include <qpen.h> +%End + +public: + QPen(); + QPen(PenStyle); + QPen(const QColor &,uint = 0,PenStyle = SolidLine); +%If (Qt_2_1_0 -) + QPen(const QColor &,uint,PenStyle,PenCapStyle,PenJoinStyle); +%End + QPen(const QPen &); + + PenStyle style() const; + void setStyle(PenStyle); + uint width() const; + void setWidth(uint); + const QColor &color() const; + void setColor(const QColor &); +%If (Qt_2_1_0 -) + PenCapStyle capStyle() const; + void setCapStyle(PenCapStyle); + PenJoinStyle joinStyle() const; + void setJoinStyle(PenJoinStyle); +%End + + bool operator==(const QPen &) const; + bool operator!=(const QPen &) const; +}; + +%End diff --git a/python/pyqt/sip/qt/qpicture.sip b/python/pyqt/sip/qt/qpicture.sip new file mode 100644 index 00000000..dbeb3091 --- /dev/null +++ b/python/pyqt/sip/qt/qpicture.sip @@ -0,0 +1,111 @@ +// This is the SIP interface definition for QPicture. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPicture</Title> +<FuncSynopsis> + <FuncDef>const char *<Function>data</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setData</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>uint <Parameter>size</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>size</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +%If (Qt_PICTURE) + +class QPicture : QPaintDevice +{ +%TypeHeaderCode +#include <qpicture.h> +%End + +public: +%If (- Qt_2_00) + QPicture(); +%End +%If (Qt_2_00 - Qt_3_0_0) + QPicture(int = 0); +%End +%If (Qt_3_0_0 -) + QPicture(int = -1); + QPicture(const QPicture &); +%End + + bool isNull() const; + + uint size() const; +// const char *data() const; +%If (- Qt_2_00) + void setData(const char * /Array/,uint /ArraySize/); +%End +%If (Qt_2_00 -) + virtual void setData(const char * /Array/,uint /ArraySize/); +%End + + bool play(QPainter *); + +%If (- Qt_2_00) + bool load(const char *); + bool save(const char *); +%End +%If (Qt_2_00 - Qt_3_0_0) + bool load(const QString &); + bool save(const QString &); +%End +%If (Qt_3_0_0 -) + bool load(QIODevice *,const char * = 0); + bool load(const QString &,const char * = 0); + bool save(QIODevice *,const char * = 0); + bool save(const QString &,const char * = 0); + + QRect boundingRect() const; +%End +%If (Qt_3_1_0 -) + void setBoundingRect(const QRect &); +%End + +protected: +%If (Qt_3_0_0 -) + void detach(); + QPicture copy() const; +%End + +private: +%If (- Qt_3_0_0) + QPicture(const QPicture &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qpixmap.sip b/python/pyqt/sip/qt/qpixmap.sip new file mode 100644 index 00000000..d00cd78f --- /dev/null +++ b/python/pyqt/sip/qt/qpixmap.sip @@ -0,0 +1,288 @@ +// This is the SIP interface definition for QPixmap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPixmap</Title> +<FuncSynopsis> + <FuncDef><Function>QPixmap</Function></FuncDef> + <ParamDef>const char *<Parameter>xpm</Parameter>[]</ParamDef> +</FuncSynopsis> +<Para> +This takes a list of strings as its parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter> = 0</ParamDef> + <ParamDef>ColorMode <Parameter>mode</Parameter> = Auto</ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>buf</Literal> and not passed as +a parameter. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>loadFromData</Function></FuncDef> + <ParamDef>const uchar *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>int <Parameter>conversion_flags</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QPixmap : QPaintDevice +{ +%TypeHeaderCode +#include <qpixmap.h> +%End + +public: + enum ColorMode + { + Auto, + Color, + Mono + }; + + QPixmap(); + QPixmap(int,int,int = -1); + QPixmap(const QSize &,int = -1); + QPixmap(const char *,const char * = 0,ColorMode = Auto); + QPixmap(const char *,const char *,int); + + QPixmap(SIP_PYLIST) [(const char **)]; +%MethodCode + // The Python interface is a list of strings that make up the + // image. + + const char **str; + + if ((str = PyQt_qt_ListToArray(a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQPixmap(str); + Py_END_ALLOW_THREADS + + sipFree((ANY *)str); + } +%End + + QPixmap(const QPixmap &); + + bool isNull() const; + int width() const; + int height() const; + QSize size() const; + QRect rect() const; + int depth() const; + static int defaultDepth(); + void fill(const QColor & = white); + void fill(const QWidget *,int,int); + void fill(const QWidget *,const QPoint &); + void resize(int,int); + void resize(const QSize &); + const QBitmap *mask() const; + void setMask(const QBitmap &); + bool selfMask() const; + QBitmap createHeuristicMask(bool = 1) const; + static QPixmap grabWindow(WId,int = 0,int = 0,int = -1,int = -1); + QPixmap xForm(const QWMatrix &) const; + static QWMatrix trueMatrix(const QWMatrix &,int,int); + QImage convertToImage() const; + bool convertFromImage(const QImage &,ColorMode = Auto); + bool convertFromImage(const QImage &,int); + static const char *imageFormat(const char *); + bool load(const char *,const char * = 0,ColorMode = Auto); + bool load(const char *,const char *,int); + bool loadFromData(const uchar * /Array/,uint /ArraySize/, + const char * = 0,ColorMode = Auto); +// bool loadFromData(const uchar *,uint,const char *,int); + bool loadFromData(QByteArray,const char * = 0,int = 0); + bool save(const char *,const char *) const; + int serialNumber() const; + + enum Optimization + { + NoOptim, + NormalOptim, + BestOptim + }; + + Optimization optimization() const; + void setOptimization(Optimization); + static Optimization defaultOptimization(); + static void setDefaultOptimization(Optimization); + virtual void detach(); + bool isQBitmap() const; + +protected: + QPixmap(int,int,const uchar *,bool); +}; + +%End + +%If (Qt_2_00 -) + +class QPixmap : QPaintDevice, Qt +{ +%TypeHeaderCode +#include <qpixmap.h> +%End + +public: + enum ColorMode + { + Auto, + Color, + Mono + }; + + enum Optimization + { + DefaultOptim, + NoOptim, + MemoryOptim, + NormalOptim, + BestOptim + }; + + QPixmap(); +%If (Qt_3_0_0 -) + QPixmap(const QImage &); +%End + QPixmap(int,int,int = -1,Optimization = DefaultOptim); + QPixmap(const QSize &,int = -1,Optimization = DefaultOptim); + QPixmap(const QString &,const char * = 0,ColorMode = Auto); + QPixmap(const QString &,const char *,int); + + QPixmap(SIP_PYLIST) [(const char **)]; +%MethodCode + // The Python interface is a list of strings that make up the + // image. + + const char **str; + + if ((str = PyQt_qt_ListToArray(a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQPixmap(str); + Py_END_ALLOW_THREADS + + sipFree((ANY *)str); + } +%End + + QPixmap(const QByteArray &); + QPixmap(const QPixmap &); + + bool isNull() const; + int width() const; + int height() const; + QSize size() const; + QRect rect() const; + int depth() const; + static int defaultDepth(); + void fill(const QColor & = Qt::white); + void fill(const QWidget *,int,int); + void fill(const QWidget *,const QPoint &); + void resize(int,int); + void resize(const QSize &); + const QBitmap *mask() const; + void setMask(const QBitmap &); + bool selfMask() const; +%If (Qt_3_1_0 -) + bool hasAlpha() const; +%End +%If (Qt_3_2_0 -) + bool hasAlphaChannel() const; +%End + QBitmap createHeuristicMask(bool = 1) const; +%If (Qt_3_1_0 -) + static QPixmap fromMimeSource(const QString &); +%End + static QPixmap grabWindow(WId,int = 0,int = 0,int = -1,int = -1); +%If (Qt_2_1_0 -) + static QPixmap grabWidget(QWidget *,int = 0,int = 0,int = -1,int = -1); +%End + + QPixmap xForm(const QWMatrix &) const; + static QWMatrix trueMatrix(const QWMatrix &,int,int); + QImage convertToImage() const; + bool convertFromImage(const QImage &,ColorMode = Auto); + bool convertFromImage(const QImage &,int); + static const char *imageFormat(const QString &); + bool load(const QString &,const char * = 0,ColorMode = Auto); + bool load(const QString &,const char *,int); + bool loadFromData(const uchar * /Array/,uint /ArraySize/, + const char * = 0,ColorMode = Auto); +// bool loadFromData(const uchar *,uint,const char *,int); + bool loadFromData(QByteArray,const char * = 0,int = 0); +%If (- Qt_3_0_0) + bool save(const QString &,const char *) const; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + bool save(const QString &,const char *,int) const; +%End +%If (Qt_3_0_0 -) + bool save(const QString &,const char *,int = -1) const; +%End +%If (Qt_3_2_0 -) + bool save(QIODevice *,const char *,int = -1) const; +%End + int serialNumber() const; + Optimization optimization() const; + void setOptimization(Optimization); + static Optimization defaultOptimization(); + static void setDefaultOptimization(Optimization); + virtual void detach(); + bool isQBitmap() const; + +%If (Qt_3_0_0 -) +%If (WS_X11) + static int x11SetDefaultScreen(int); + void x11SetScreen(int); +%End +%End + +protected: + QPixmap(int,int,const uchar *,bool); +}; + +%End + +%If (Qt_3_2_0 -) +void copyBlt(QPixmap *,int,int,const QPixmap *,int = 0,int = 0,int = -1, + int = -1); +%End diff --git a/python/pyqt/sip/qt/qpixmapcache.sip b/python/pyqt/sip/qt/qpixmapcache.sip new file mode 100644 index 00000000..5e8e0664 --- /dev/null +++ b/python/pyqt/sip/qt/qpixmapcache.sip @@ -0,0 +1,53 @@ +// This is the SIP interface definition for QPixmapCache. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPixmapCache (Qt v3+)</Title> +<Para> +<Literal>QPixmapCache</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QPixmapCache +{ +%TypeHeaderCode +#include <qpixmapcache.h> +%End + +public: + static int cacheLimit(); + static void setCacheLimit(int); + static QPixmap *find(const QString &); + static bool find(const QString &,QPixmap &); +// static bool insert(const QString &,QPixmap *); + static bool insert(const QString &,const QPixmap &); +%If (Qt_3_2_0 -) + static void remove(const QString &); +%End + static void clear(); +}; + +%End diff --git a/python/pyqt/sip/qt/qplatinumstyle.sip b/python/pyqt/sip/qt/qplatinumstyle.sip new file mode 100644 index 00000000..5392eea6 --- /dev/null +++ b/python/pyqt/sip/qt/qplatinumstyle.sip @@ -0,0 +1,142 @@ +// This is the SIP interface definition for QPlatinumStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPlatinumStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) +%If (Qt_STYLE_PLATINUM) + +class QPlatinumStyle : QWindowsStyle +{ +%TypeHeaderCode +#include <qplatinumstyle.h> +%End + +public: + QPlatinumStyle(); + +%If (- Qt_3_0_0) + void drawPopupPanel(QPainter *,int,int,int,int,const QColorGroup &, + int = 2,const QBrush * = 0); + void drawButton(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); + QRect buttonRect(int,int,int,int); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawPushButton(QPushButton *,QPainter *); + void drawPushButtonLabel(QPushButton *,QPainter *); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint,uint); + ScrollControl scrollBarPointOver(const QScrollBar *,int,const QPoint &); + QSize indicatorSize() const; + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &,int, + bool = 0,bool = 1); + void drawIndicatorMask(QPainter *,int,int,int,int,int); + QSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); + int sliderLength() const; + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderMask(QPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); + int maximumSliderDragDistance() const; + void drawCheckMark(QPainter *,int,int,int,int,const QColorGroup &, + bool,bool); + void polishPopupMenu(QPopupMenu *); + int extraPopupMenuItemWidth(bool,int,QMenuItem *,const QFontMetrics &); + int popupMenuItemHeight(bool,QMenuItem *,const QFontMetrics &); + void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool,bool,int,int,int,int); +%End +%If (Qt_3_0_0 -) + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + QRect querySubControlMetrics(ComplexControl,const QWidget *,SubControl, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + QRect subRect(SubRect,const QWidget *) const; +%End + +protected: +%If (- Qt_3_0_0) + void drawScrollBarBackground(QPainter *,int,int,int,int, + const QColorGroup &,bool, + const QBrush * = 0); +%End + QColor mixedColor(const QColor &,const QColor &) const; +%If (- Qt_3_0_0) + void drawRiffles(QPainter *,int,int,int,int,const QColorGroup &,bool); +%End +%If (Qt_3_0_0 -) + void drawRiffles(QPainter *,int,int,int,int,const QColorGroup &, + bool) const; +%End + +private: +%If (Qt_3_0_0 -) + QPlatinumStyle(const QPlatinumStyle &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qpoint.sip b/python/pyqt/sip/qt/qpoint.sip new file mode 100644 index 00000000..6dc338fd --- /dev/null +++ b/python/pyqt/sip/qt/qpoint.sip @@ -0,0 +1,103 @@ +// This is the SIP interface definition for QPoint. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPoint</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, unary <Literal>-</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rx</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>ry</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class QPoint +{ +%TypeHeaderCode +#include <qpoint.h> +%End + +public: + QPoint(); + QPoint(int,int); + + bool isNull() const; + int x() const; + int y() const; + void setX(int); + void setY(int); +%If (Qt_2_00 -) + int manhattanLength() const; +%End +// QCOORD &rx(); +// QCOORD &ry(); + + QPoint &operator+=(const QPoint &); + QPoint &operator-=(const QPoint &); + QPoint &operator*=(int /Constrained/); + QPoint &operator*=(double); + QPoint &operator/=(int /Constrained/); + QPoint &operator/=(double); + + int __nonzero__(); +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + // Qt defines the remaining operators as global, rather than part of + // the class, but SIP doesn't support global operators. + bool operator==(const QPoint &); + bool operator!=(const QPoint &); + const QPoint operator+(const QPoint &); + const QPoint operator-(const QPoint &); + const QPoint operator*(int /Constrained/); + const QPoint operator*(double); + + const QPoint __neg__(); +%MethodCode + sipRes = new QPoint(-(*sipCpp)); +%End + + const QPoint operator/(int /Constrained/); + const QPoint operator/(double); +}; diff --git a/python/pyqt/sip/qt/qpointarray.sip b/python/pyqt/sip/qt/qpointarray.sip new file mode 100644 index 00000000..c88b56b6 --- /dev/null +++ b/python/pyqt/sip/qt/qpointarray.sip @@ -0,0 +1,247 @@ +// This is the SIP interface definition for QPointArray. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPointArray</Title> +<FuncSynopsis> + <FuncDef><Function>QPointArray</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>point</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the single parameter <Literal>i</Literal> and returns the +<Literal>x</Literal> and <Literal>y</Literal> values as a tuple. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes two parameters, <Literal>index</Literal> and a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>putPoints</Function></FuncDef> + <ParamDef>int <Parameter>index</Parameter></ParamDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>const QCOORD *<Parameter>points</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single parameter which is a list of points. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setPoints</Function></FuncDef> + <ParamDef>int <Parameter>nPoints</Parameter></ParamDef> + <ParamDef>int <Parameter>firstx</Parameter></ParamDef> + <ParamDef>int <Parameter>firsty</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class QPointArray +{ +%TypeHeaderCode +#include <qpointarray.h> +%End + +%TypeCode +// Convert a list of numbers to an array on QCOORDs on the heap. + +static QCOORD *getPoints(int nrpnts,PyObject *pntlist) +{ + QCOORD *pnts, *pp; + + if ((pnts = (QCOORD *)sipMalloc(nrpnts * sizeof (QCOORD))) == NULL) + return NULL; + + // Convert the list. + + pp = pnts; + + for (int i = 0; i < nrpnts; ++i) + { + *pp++ = (QCOORD)PyInt_AsLong(PyList_GetItem(pntlist,i)); + + if (PyErr_Occurred() != NULL) + { + sipFree((ANY *)pnts); + return NULL; + } + } + + return pnts; +} +%End + +public: + QPointArray(); + QPointArray(int); + QPointArray(const QPointArray &); + QPointArray(const QRect &,bool = 0); + + QPointArray(SIP_PYLIST) [(int,const QCOORD *)]; +%MethodCode + // The Python interface is a list of QCOORDs. + + int nrpnts; + QCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a0); + + if ((pnts = getPoints(nrpnts,a0)) == NULL) + sipIsErr = 1; + else + { + // No wrapper class for QPointArray. + + Py_BEGIN_ALLOW_THREADS + sipCpp = new QPointArray(nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((ANY *)pnts); + } +%End + + QPointArray copy() const; + void translate(int,int); + QRect boundingRect() const; + + void point(uint,int *,int *) const; + // This is hidden by the above. It would probably be better to remove + // the one above, but that would break backwards compatibility. + //QPoint point(uint) const; + void setPoint(uint,int,int); + void setPoint(uint,const QPoint &); + + bool setPoints(SIP_PYLIST); +%MethodCode + int nrpnts; + QCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a0); + + if ((pnts = getPoints(nrpnts,a0)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> setPoints(nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((ANY *)pnts); + } +%End + +// bool setPoints(int,int,int,...); + + bool putPoints(int,SIP_PYLIST); +%MethodCode + int nrpnts; + QCOORD *pnts; + + nrpnts = PyList_GET_SIZE(a1); + + if ((pnts = getPoints(nrpnts,a1)) == NULL) + sipIsErr = 1; + else + { + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp -> putPoints(a0,nrpnts / 2,pnts); + Py_END_ALLOW_THREADS + + sipFree((ANY *)pnts); + } +%End + +// bool putPoints(int,int,int,int,...); +%If (Qt_3_0_0 -) + bool putPoints(int,int,const QPointArray &,int = 0); +%End + +%If (- Qt_2_00) + QPoint at(uint) const; +%End + + void makeArc(int,int,int,int,int,int); + void makeEllipse(int,int,int,int); +%If (Qt_TRANSFORMATIONS) +%If (Qt_2_00 -) + void makeArc(int,int,int,int,int,int,const QWMatrix &); +%End +%End +%If (- Qt_3_0_0) + QPointArray quadBezier() const; +%End +%If (Qt_3_0_0 -) + QPointArray cubicBezier() const; +%End + + // These are actually in QArray, which isn't implemented so pretend + // they are here. + + uint nrefs() const; + bool isEmpty() const; + bool isNull() const; + bool resize(uint); + uint size() const; + bool truncate(uint); + bool fill(const QPoint &,int = -1); +%If (Qt_2_00 -) + QPoint &at(uint) const; +%End +%If (Qt_2_1_0 -) + void sort(); + int bsearch(const QPoint &) const; +%End + int find(const QPoint &,uint = 0) const; + int contains(const QPoint &) const; +}; diff --git a/python/pyqt/sip/qt/qpopupmenu.sip b/python/pyqt/sip/qt/qpopupmenu.sip new file mode 100644 index 00000000..08366b42 --- /dev/null +++ b/python/pyqt/sip/qt/qpopupmenu.sip @@ -0,0 +1,282 @@ +// This is the SIP interface definition for QPopupMenu. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPopupMenu</Title> +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>exec</Function></FuncDef> + <ParamDef>const QPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int <Parameter>indexAtPoint</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>exec_loop</Literal> in Python. +</Para> +<Para> +This method also causes ownership of the underlying C++ menu to be transfered +to Python. This means that the C++ menu will be deleted when the Python +wrapper is garbage collected. Although this is a little inconsistent, it +ensures that the menu is deleted without having to explicity code it using +<Literal>QObject.deleteLater()</Literal> or other techniques. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QPopupMenu : QTableView, QMenuData +{ +%TypeHeaderCode +#include <qpopupmenu.h> +%End + +public: + QPopupMenu(QWidget * /TransferThis/ = 0,const char * = 0); + + void popup(const QPoint &,int = 0); + void updateItem(int); + void setCheckable(bool); + bool isCheckable() const; + void setFont(const QFont &); + void show(); + void hide(); + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the Qt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QPopupMenu::exec(); + Py_END_ALLOW_THREADS +%End + + int exec(const QPoint &,int = 0) /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the Qt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QPopupMenu::exec(*a0,a1); + Py_END_ALLOW_THREADS +%End + + void setActiveItem(int); + int idAt(int) const; +%If (Qt_1_43 -) + int idAt(const QPoint &) const; +%End + +signals: + void activated(int); + void highlighted(int); + void activatedRedirect(int); + void highlightedRedirect(int); + void aboutToShow(); + +protected: + int cellHeight(int); + int cellWidth(int); + void paintCell(QPainter *,int,int); + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + void timerEvent(QTimerEvent *); + +private: + QPopupMenu(const QPopupMenu &); + void menuContentsChanged(); + void menuStateChanged(); + void menuInsPopup(QPopupMenu *); + void menuDelPopup(QPopupMenu *); + void frameChanged(); +}; + +%End + + +%If (Qt_2_00 -) + +class QPopupMenu : QFrame, QMenuData +{ +%TypeHeaderCode +#include <qpopupmenu.h> +%End + +public: + QPopupMenu(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_3_0_5) + void popup(const QPoint &,int = 0); +%End +%If (Qt_3_0_5 -) + void popup(const QPoint &,int = -1); +%End + void updateItem(int); + + virtual void setCheckable(bool); + bool isCheckable() const; + + void setFont(const QFont &); + void show(); + void hide(); + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the Qt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QPopupMenu::exec(); + Py_END_ALLOW_THREADS +%End + + int exec(const QPoint &,int = 0) /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; +%MethodCode + // Transfer ownership back to Python (a modal menu will + // probably have the main window as it's parent). This means + // the Qt menu will be deleted when the Python wrapper is + // garbage collected. Although this is a little inconsistent, + // it saves having to code it explicitly to avoid the memory + // leak. + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipRes = sipCpp->QPopupMenu::exec(*a0,a1); + Py_END_ALLOW_THREADS +%End + + virtual void setActiveItem(int); + QSize sizeHint() const; + + int idAt(int) const; + int idAt(const QPoint &) const; + + bool customWhatsThis() const; + +%If (Qt_2_1_0 -) + int insertTearOffHandle(int = -1,int = -1); +%End + +%If (Qt_2_2_0 -) + void activateItemAt(int); +%End +%If (Qt_3_0_0 -) + QRect itemGeometry(int); +%End + +signals: + void activated(int); + void highlighted(int); + void activatedRedirect(int); + void highlightedRedirect(int); + void aboutToShow(); +%If (Qt_2_2_0 -) + void aboutToHide(); +%End + +protected: + int itemHeight(int) const; + int itemHeight(QMenuItem *) const; + void drawItem(QPainter *,int,QMenuItem *,bool,int,int,int,int); + + void drawContents(QPainter *); + + void closeEvent(QCloseEvent *); + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); +%If (Qt_2_1_0 -) + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); +%End + void timerEvent(QTimerEvent *); +%If (Qt_3_0_0 -) + void leaveEvent(QEvent *); +%End + void styleChange(QStyle &); +%If (Qt_3_1_0 -) + void enabledChange(bool); +%End +%If (Qt_2_1_0 -) + int columns() const; + + bool focusNextPrevChild(bool); +%End + +%If (Qt_3_0_0 -) + int itemAtPos(const QPoint &,bool = 1) const; +%End + +private: + QPopupMenu(const QPopupMenu &); + + void menuContentsChanged(); + void menuStateChanged(); + void menuInsPopup(QPopupMenu *); + void menuDelPopup(QPopupMenu *); + void frameChanged(); +}; + +%End diff --git a/python/pyqt/sip/qt/qprintdialog.sip b/python/pyqt/sip/qt/qprintdialog.sip new file mode 100644 index 00000000..2ead1f98 --- /dev/null +++ b/python/pyqt/sip/qt/qprintdialog.sip @@ -0,0 +1,64 @@ +// This is the SIP interface definition for QPrintDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPrintDialog (X11)</Title> +<Para> +<Literal>QPrintDialog</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (WS_X11) +%If (Qt_PRINTDIALOG) + +class QPrintDialog : QDialog +{ +%TypeHeaderCode +#include <qprintdialog.h> +%End + +public: + QPrintDialog(QPrinter *,QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_3_0_0) + static bool getPrinterSetup(QPrinter *); +%End +%If (Qt_3_0_0 -) + static bool getPrinterSetup(QPrinter *,QWidget * = 0); + static void setGlobalPrintDialog(QPrintDialog *); +%End + + void setPrinter(QPrinter *,bool = 0); + QPrinter *printer() const; + +%If (Qt_2_1_0 -) + void addButton(QPushButton *); +%End + +private: + QPrintDialog(const QPrintDialog &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qprinter.sip b/python/pyqt/sip/qt/qprinter.sip new file mode 100644 index 00000000..b8bf4f9f --- /dev/null +++ b/python/pyqt/sip/qt/qprinter.sip @@ -0,0 +1,256 @@ +// This is the SIP interface definition for QPrinter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPrinter</Title> +<Para> +<Literal>QPrinter</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_PRINTER) + +class QPrinter : QPaintDevice +{ +%TypeHeaderCode +#include <qprinter.h> +%End + +public: +%If (Qt_3_0_0 -) + enum PrinterMode { + ScreenResolution, + PrinterResolution, + HighResolution, + Compatible + }; +%End + +%If (- Qt_3_0_0) + QPrinter(); +%End +%If (Qt_3_0_0 -) + QPrinter(PrinterMode = ScreenResolution); +%End + + enum Orientation { + Portrait, + Landscape + }; + + enum PageSize { + A4, B5, Letter, Legal, Executive, A0, A1, A2, A3, A5, A6, A7, + A8, A9, B0, B1, B10, B2, B3, B4, B6, B7, B8, B9, C5E, Comm10E, + DLE, Folio, Ledger, Tabloid, +%If (Qt_2_3_1 -) + Custom, +%End +%If (Qt_2_00 -) + NPageSize +%End + }; + + enum PageOrder { + FirstPageFirst, + LastPageFirst + }; + + enum ColorMode { + GrayScale, + Color + }; + +%If (Qt_3_0_0 -) + enum PaperSource { + OnlyOne, + Lower, + Middle, + Manual, + Envelope, + EnvelopeManual, + Auto, + Tractor, + SmallFormat, + LargeFormat, + LargeCapacity, + Cassette, + FormSource + }; +%End + +%If (Qt_3_2_0 -) + enum PrintRange { + AllPages, + Selection, + PageRange + }; + + enum PrinterOption { + PrintToFile, + PrintSelection, + PrintPageRange + }; +%End + +%If (- Qt_2_00) + const char *printerName() const; + void setPrinterName(const char *); +%End +%If (Qt_2_00 -) + QString printerName() const; + virtual void setPrinterName(const QString &); +%End + bool outputToFile() const; +%If (- Qt_2_00) + void setOutputToFile(bool); + const char *outputFileName() const; + void setOutputFileName(const char *); + + const char *printProgram() const; + void setPrintProgram(const char *); + + const char *docName() const; + void setDocName(const char *); + const char *creator() const; + void setCreator(const char *); +%End +%If (Qt_2_00 -) + virtual void setOutputToFile(bool); + QString outputFileName() const; + virtual void setOutputFileName(const QString &); + + QString printProgram() const; + virtual void setPrintProgram(const QString &); + + QString printerSelectionOption() const; + virtual void setPrinterSelectionOption(const QString &); + + QString docName() const; + virtual void setDocName(const QString &); + QString creator() const; + virtual void setCreator(const QString &); +%End + + Orientation orientation() const; +%If (- Qt_2_00) + void setOrientation(Orientation); +%End +%If (Qt_2_00 -) + virtual void setOrientation(Orientation); +%End + PageSize pageSize() const; +%If (- Qt_2_00) + void setPageSize(PageSize); + + void setPageOrder(PageOrder); +%End +%If (Qt_2_00 -) + virtual void setPageSize(PageSize); + + virtual void setPageOrder(PageOrder); +%End + PageOrder pageOrder() const; + +%If (Qt_3_0_0 -) + void setResolution(int); + int resolution() const; +%End + +%If (- Qt_2_00) + void setColorMode(ColorMode); +%End +%If (Qt_2_00 -) + virtual void setColorMode(ColorMode); +%End + ColorMode colorMode() const; + +%If (Qt_2_00 -) + virtual void setFullPage(bool); + bool fullPage() const; + QSize margins() const; +%End + +%If (Qt_3_1_0 -) + void setMargins(uint,uint,uint,uint); +// void margins(uint *,uint *,uint *,uint *) const; +%End + + int fromPage() const; + int toPage() const; +%If (- Qt_2_00) + void setFromTo(int,int); +%End +%If (Qt_2_00 -) + virtual void setFromTo(int,int); +%End + int minPage() const; + int maxPage() const; +%If (- Qt_2_00) + void setMinMax(int,int); +%End +%If (Qt_2_00 -) + virtual void setMinMax(int,int); +%End + int numCopies() const; +%If (- Qt_2_00) + void setNumCopies(int); +%End +%If (Qt_2_00 -) + virtual void setNumCopies(int); +%End + +%If (Qt_3_0_0 -) + bool collateCopiesEnabled() const; + void setCollateCopiesEnabled(bool); + + bool collateCopies() const; + void setCollateCopies(bool); +%End + +%If (Qt_3_2_0 -) + PrintRange printRange() const; + void setPrintRange(PrintRange); +%End + + bool newPage(); + bool abort(); + bool aborted() const; + + bool setup(QWidget * = 0); + +%If (Qt_3_0_0 -) + PaperSource paperSource() const; + virtual void setPaperSource(PaperSource); +%End + +%If (Qt_3_2_0 -) + void setOptionEnabled(PrinterOption,bool); + bool isOptionEnabled(PrinterOption); +%End + +private: + QPrinter(const QPrinter &); +}; + +%End diff --git a/python/pyqt/sip/qt/qprocess.sip b/python/pyqt/sip/qt/qprocess.sip new file mode 100644 index 00000000..c02c5120 --- /dev/null +++ b/python/pyqt/sip/qt/qprocess.sip @@ -0,0 +1,112 @@ +// This is the SIP interface definition for QProcess. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QProcess (Qt v3+)</Title> +<Para> +<Literal>QProcess</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QProcess : QObject +{ +%TypeHeaderCode +#include <qprocess.h> +%End + +public: + QProcess(QObject * /TransferThis/ = 0,const char * = 0); + QProcess(const QString &,QObject * /TransferThis/ = 0, + const char * = 0); + QProcess(const QStringList &,QObject * /TransferThis/ = 0, + const char * = 0); + + QStringList arguments() const; + void clearArguments(); + virtual void setArguments(const QStringList &); + virtual void addArgument(const QString &); + QDir workingDirectory() const; + virtual void setWorkingDirectory(const QDir &); + + enum Communication { + Stdin, + Stdout, + Stderr, + DupStderr + }; + + void setCommunication(int); + int communication() const; + + virtual bool start(QStringList * = 0); + virtual bool launch(const QString &, QStringList * = 0 ); + virtual bool launch(const QByteArray &,QStringList * = 0 ); + + bool isRunning() const; + bool normalExit() const; + int exitStatus() const; + + virtual QByteArray readStdout() /ReleaseGIL/; + virtual QByteArray readStderr() /ReleaseGIL/; + bool canReadLineStdout() const; + bool canReadLineStderr() const; + virtual QString readLineStdout() /ReleaseGIL/; + virtual QString readLineStderr() /ReleaseGIL/; + +%If (WS_X11 || WS_MACX || WS_QWS) + typedef long PID; +%End + + PID processIdentifier(); + + void flushStdin(); + +signals: + void readyReadStdout(); + void readyReadStderr(); + void processExited(); + void wroteToStdin(); + void launchFinished(); + +public slots: + void tryTerminate() const; + void kill() const; + + virtual void writeToStdin(const QByteArray &); + virtual void writeToStdin(const QString &); + virtual void closeStdin(); + +protected: + void connectNotify(const char *); + void disconnectNotify(const char *); + +private: +%If (Qt_3_1_0 -) + QProcess(const QProcess &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qprogressbar.sip b/python/pyqt/sip/qt/qprogressbar.sip new file mode 100644 index 00000000..bcf3ad23 --- /dev/null +++ b/python/pyqt/sip/qt/qprogressbar.sip @@ -0,0 +1,95 @@ +// This is the SIP interface definition for QProgressBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QProgressBar</Title> +<Para> +<Literal>QProgressBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QProgressBar : QFrame +{ +%TypeHeaderCode +#include <qprogressbar.h> +%End + +public: + QProgressBar(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + QProgressBar(int,QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + int totalSteps() const; + int progress() const; +%If (Qt_3_0_0 -) + const QString &progressString() const; +%End + + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End +%If (Qt_2_00 -) + QSize minimumSizeHint() const; + + void setCenterIndicator(bool); + bool centerIndicator() const; + + void setIndicatorFollowsStyle(bool); + bool indicatorFollowsStyle() const; +%End + +%If (Qt_3_0_0 -) + bool percentageVisible() const; + void setPercentageVisible(bool); +%End + + void show(); + +public slots: + void reset(); +%If (- Qt_2_00) + void setTotalSteps(int); + void setProgress(int); +%End +%If (Qt_2_00 -) + virtual void setTotalSteps(int); + virtual void setProgress(int); +%End +%If (Qt_3_1_0 -) + void setProgress(int,int); +%End + +protected: + void drawContents(QPainter *); + virtual bool setIndicator(QString &,int,int); +%If (Qt_2_00 - Qt_3_0_0) + void drawContentsMask(QPainter *); +%End +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End + +private: + QProgressBar(const QProgressBar &); +}; diff --git a/python/pyqt/sip/qt/qprogressdialog.sip b/python/pyqt/sip/qt/qprogressdialog.sip new file mode 100644 index 00000000..49630411 --- /dev/null +++ b/python/pyqt/sip/qt/qprogressdialog.sip @@ -0,0 +1,194 @@ +// This is the SIP interface definition for QProgressDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QProgressDialog</Title> +<Para> +<Literal>QProgressDialog</Literal> is fully implemented. +value. +</Para> +</Sect2> +%End + + +%If (Qt_PROGRESSDIALOG) + +%If (Qt_3_0_0 -) + +class QProgressDialog : QDialog +{ +%TypeHeaderCode +#include <qprogressdialog.h> +%End + +public: + QProgressDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + QProgressDialog(const QString &,const QString &,int, + QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void setLabel(QLabel *); + void setCancelButton(QPushButton *); + void setBar(QProgressBar *); + + bool wasCancelled() const; +%If (Qt_3_2_0 -) + bool wasCanceled() const; +%End + + int totalSteps() const; + int progress() const; + + QSize sizeHint() const; + + int minimumDuration() const; + + QString labelText() const; + + void setAutoReset(bool); + bool autoReset() const; + void setAutoClose(bool); + bool autoClose() const; + +public slots: + void cancel(); + void reset(); + void setTotalSteps(int); + void setProgress(int); +%If (Qt_3_1_0 -) + void setProgress(int,int); +%End + void setLabelText(const QString &); + void setCancelButtonText(const QString &); + + void setMinimumDuration(int); + +signals: + void cancelled(); +%If (Qt_3_2_0 -) + void canceled(); +%End + +protected: + void resizeEvent(QResizeEvent *); + void closeEvent(QCloseEvent *); + void styleChange(QStyle &); + void showEvent(QShowEvent *); + +protected slots: + void forceShow(); + +private: + QProgressDialog(const QProgressDialog &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QProgressDialog : QSemiModal +{ +%TypeHeaderCode +#include <qprogressdialog.h> +%End + +public: + QProgressDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); +%If (- Qt_2_00) + QProgressDialog(const char *,const char *,int,QWidget * /TransferThis/ = 0, + const char * = 0,bool = 0,WFlags = 0); +%End +%If (Qt_2_00 -) + QProgressDialog(const QString &,const QString &,int, + QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); +%End + + void setLabel(QLabel *); + void setCancelButton(QPushButton *); + void setBar(QProgressBar *); + + bool wasCancelled() const; + + int totalSteps() const; + int progress() const; + + QSize sizeHint() const; + + int minimumDuration() const; + +%If (Qt_2_1_0 -) + QString labelText() const; + + void setAutoReset(bool); + bool autoReset() const; + void setAutoClose(bool); + bool autoClose() const; +%End + +public slots: + void cancel(); + void reset(); + void setTotalSteps(int); + void setProgress(int); +%If (- Qt_2_00) + void setLabelText(const char *); + void setCancelButtonText(const char *); +%End +%If (Qt_2_00 -) + void setLabelText(const QString &); + void setCancelButtonText(const QString &); +%End + + void setMinimumDuration(int); + +signals: + void cancelled(); + +protected: + void resizeEvent(QResizeEvent *); +%If (- Qt_2_00) + void styleChange(GUIStyle); +%End +%If (Qt_2_00 -) + void closeEvent(QCloseEvent *); + void styleChange(QStyle &); +%End +%If (Qt_2_1_0 -) + void showEvent(QShowEvent *); +%End + +protected slots: +%If (Qt_2_2_0 -) + void forceShow(); +%End + +private: + QProgressDialog(const QProgressDialog &); +}; + +%End + +%End diff --git a/python/pyqt/sip/qt/qptrlist.sip b/python/pyqt/sip/qt/qptrlist.sip new file mode 100644 index 00000000..c49afad8 --- /dev/null +++ b/python/pyqt/sip/qt/qptrlist.sip @@ -0,0 +1,111 @@ +// This is the SIP interface definition for all types based on the QPtrList +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPtrList<type> (Qt v2+)</Title> +<Para> +Types based on the <Literal>QPtrList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +template<Type> +%MappedType QPtrList<Type> +{ +%TypeHeaderCode +#include <qptrlist.h> +%End + +%ConvertFromTypeCode + Type *dw; + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (dw = sipCpp -> first(); dw != NULL; dw = sipCpp -> next()) + { + PyObject *dwobj; + + if ((dwobj = sipConvertFromInstance(dw,sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,dwobj) < 0) + { + Py_XDECREF(dwobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0)) + return 0; + + return 1; + } + + QPtrList<Type> *qpl = new QPtrList<Type>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qpl -> append(reinterpret_cast<Type *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0,0,0,sipIsErr))); + + if (*sipIsErr) + { + delete qpl; + + return 0; + } + } + + *sipCppPtr = qpl; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qpushbutton.sip b/python/pyqt/sip/qt/qpushbutton.sip new file mode 100644 index 00000000..93e6fa07 --- /dev/null +++ b/python/pyqt/sip/qt/qpushbutton.sip @@ -0,0 +1,143 @@ +// This is the SIP interface definition for QPushButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QPushButton</Title> +<Para> +<Literal>QPushButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QPushButton : QButton +{ +%TypeHeaderCode +#include <qpushbutton.h> +%End + +public: +%If (- Qt_2_00) + QPushButton(QWidget * /TransferThis/ = 0,const char * = 0); + QPushButton(const char *,QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QPushButton(QWidget * /TransferThis/,const char * = 0); + QPushButton(const QString &,QWidget * /TransferThis/,const char * = 0); +%End +%If (Qt_2_1_0 -) + QPushButton(const QIconSet &,const QString &,QWidget * /TransferThis/,const char * = 0); +%End + + QSize sizeHint() const; +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + + void move(int,int); + void move(const QPoint &); + void resize(int,int); + void resize(const QSize &); +%If (- Qt_2_00) + void setGeometry(int,int,int,int); + + void setGeometry(const QRect &); + + void setToggleButton(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setGeometry(int,int,int,int); + + virtual void setGeometry(const QRect &); + + virtual void setToggleButton(bool); +%End +%If (Qt_3_0_0 -) + void setGeometry(int,int,int,int); + + void setGeometry(const QRect &); + + void setToggleButton(bool); +%End + + bool autoDefault() const; +%If (- Qt_2_00) + void setAutoDefault(bool); +%End +%If (Qt_2_00 -) + virtual void setAutoDefault(bool); +%End + bool isDefault() const; +%If (- Qt_2_00) + void setDefault(bool); +%End +%If (Qt_2_00 -) + virtual void setDefault(bool); +%End + +%If (- Qt_2_00) + void setIsMenuButton(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setIsMenuButton(bool); +%End +%If (- Qt_3_0_0) + bool isMenuButton() const; +%End + +%If (Qt_2_1_0 -) + void setPopup(QPopupMenu *); + QPopupMenu *popup() const; + + void setIconSet(const QIconSet &); + QIconSet *iconSet() const; +%End + +%If (Qt_2_2_0 -) + void setFlat(bool); + bool isFlat() const; +%End + +public slots: +%If (- Qt_2_00) + void setOn(bool); +%End +%If (Qt_2_00 -) + virtual void setOn(bool); +%End +%If (- Qt_3_0_0) + void toggle(); +%End + +protected: + void drawButton(QPainter *); + void drawButtonLabel(QPainter *); + void focusInEvent(QFocusEvent *); +%If (Qt_2_00 -) + void focusOutEvent(QFocusEvent *); + void resizeEvent(QResizeEvent *); + void updateMask(); +%End + +private: + QPushButton(const QPushButton &); +}; diff --git a/python/pyqt/sip/qt/qradiobutton.sip b/python/pyqt/sip/qt/qradiobutton.sip new file mode 100644 index 00000000..77c00db1 --- /dev/null +++ b/python/pyqt/sip/qt/qradiobutton.sip @@ -0,0 +1,84 @@ +// This is the SIP interface definition for QRadioButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QRadioButton</Title> +<Para> +<Literal>QRadioButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QRadioButton : QButton +{ +%TypeHeaderCode +#include <qradiobutton.h> +%End + +public: +%If (- Qt_2_00) + QRadioButton(QWidget * /TransferThis/ = 0,const char * = 0); + QRadioButton(const char *,QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QRadioButton(QWidget * /TransferThis/,const char * = 0); + QRadioButton(const QString &,QWidget * /TransferThis/,const char * = 0); +%End + + bool isChecked() const; + + QSize sizeHint() const; + +%If (- Qt_2_00) + void setChecked(bool); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setChecked(bool); + QSizePolicy sizePolicy() const; +%End + +public slots: +%If (Qt_3_0_0 -) + virtual void setChecked(bool); +%End + +protected: + bool hitButton(const QPoint &) const; + void drawButton(QPainter *); + void drawButtonLabel(QPainter *); +%If (- Qt_2_00) + void mouseReleaseEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); +%End +%If (Qt_2_00 -) + void updateMask(); + + void resizeEvent(QResizeEvent *); +%End +%If (Qt_2_00 - Qt_3_0_0) + void focusInEvent(QFocusEvent *); +%End + +private: + QRadioButton(const QRadioButton &); +}; diff --git a/python/pyqt/sip/qt/qrangecontrol.sip b/python/pyqt/sip/qt/qrangecontrol.sip new file mode 100644 index 00000000..2c1c3af6 --- /dev/null +++ b/python/pyqt/sip/qt/qrangecontrol.sip @@ -0,0 +1,79 @@ +// This is the SIP interface definition for QRangeControl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QRangeControl</Title> +<Para> +<Literal>QRangeControl</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QRangeControl +{ +%TypeHeaderCode +#include <qrangecontrol.h> +%End + +public: + QRangeControl(); + QRangeControl(int,int,int,int,int); + + int value() const; + void setValue(int); + void addPage(); + void subtractPage(); + void addLine(); + void subtractLine(); + + int minValue() const; + int maxValue() const; + void setRange(int,int); +%If (Qt_3_0_0 -) + void setMinValue(int); + void setMaxValue(int); +%End + + int lineStep() const; + int pageStep() const; + void setSteps(int,int); + +%If (Qt_2_00 -) + int bound(int) const; +%End + +protected: +%If (Qt_2_00 -) + int positionFromValue(int,int) const; + int valueFromPosition(int,int) const; +%End + void directSetValue(int); + int prevValue() const; + + virtual void valueChange(); + virtual void rangeChange(); + virtual void stepChange(); + +private: + QRangeControl(const QRangeControl &); +}; diff --git a/python/pyqt/sip/qt/qrect.sip b/python/pyqt/sip/qt/qrect.sip new file mode 100644 index 00000000..e658baa1 --- /dev/null +++ b/python/pyqt/sip/qt/qrect.sip @@ -0,0 +1,209 @@ +// This is the SIP interface definition for QRect. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QRect</Title> +<Para> +The Python +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>coords</Function></FuncDef> + <ParamDef>int *<Parameter>x1</Parameter></ParamDef> + <ParamDef>int *<Parameter>y1</Parameter></ParamDef> + <ParamDef>int *<Parameter>x2</Parameter></ParamDef> + <ParamDef>int *<Parameter>y2</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>rect</Function></FuncDef> + <ParamDef>int *<Parameter>x</Parameter></ParamDef> + <ParamDef>int *<Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>w</Parameter></ParamDef> + <ParamDef>int *<Parameter>h</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple containing the four values. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rBottom</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rLeft</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rRight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rTop</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. (Qt v2+) +</Para> +</Sect2> +%End + + +class QRect +{ +%TypeHeaderCode +#include <qrect.h> +%End + +public: + QRect(); + QRect(const QPoint &,const QPoint &); + QRect(const QPoint &,const QSize &); + QRect(int,int,int,int); + + bool isNull() const; + bool isEmpty() const; + bool isValid() const; + QRect normalize() const; + + int left() const; + int top() const; + int right() const; + int bottom() const; + +%If (Qt_2_00 -) +// QCOORD &rLeft(); +// QCOORD &rTop(); +// QCOORD &rRight(); +// QCOORD &rBottom(); +%End + + int x() const; + int y() const; + void setLeft(int); + void setTop(int); + void setRight(int); + void setBottom(int); + void setX(int); + void setY(int); + +%If (Qt_3_1_0 -) + void setTopLeft(const QPoint &); + void setBottomRight(const QPoint &); + void setTopRight(const QPoint &); + void setBottomLeft(const QPoint &); +%End + + QPoint topLeft() const; + QPoint bottomRight() const; + QPoint topRight() const; + QPoint bottomLeft() const; + QPoint center() const; + + void rect(int *,int *,int *,int *) const; + void coords(int *,int *,int *,int *) const; + +%If (Qt_3_1_0 -) + void moveLeft(int); + void moveTop(int); + void moveRight(int); + void moveBottom(int); +%End + void moveTopLeft(const QPoint &); + void moveBottomLeft(const QPoint &); + void moveTopRight(const QPoint &); + void moveBottomRight(const QPoint &); + void moveCenter(const QPoint &); + void moveBy(int,int); + + void setRect(int,int,int,int); + void setCoords(int,int,int,int); +%If (Qt_3_0_0 -) + void addCoords(int,int,int,int); +%End + + QSize size() const; + int width() const; + int height() const; + void setWidth(int); + void setHeight(int); + void setSize(const QSize &); + + QRect operator|(const QRect &) const; + QRect operator&(const QRect &) const; + QRect &operator|=(const QRect &); + QRect &operator&=(const QRect &); + + int __nonzero__() const; +%MethodCode + sipRes = sipCpp -> isValid(); +%End + + bool contains(const QPoint &,bool = 0) const; + + int __contains__(const QPoint &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + +%If (Qt_3_1_0 -) + bool contains(int,int) const; + bool contains(int,int,bool) const; +%End +%If (Qt_2_2_0 - Qt_3_1_0) + bool contains(int,int,bool = 0) const; +%End + bool contains(const QRect &,bool = 0) const; + + int __contains__(const QRect &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + QRect unite(const QRect &) const; + QRect intersect(const QRect &) const; + bool intersects(const QRect &) const; + + // Qt defines the remaining operators as global, rather than part of + // the class, but SIP doesn't support global operators. + bool operator==(const QRect &) const; + bool operator!=(const QRect &) const; +}; diff --git a/python/pyqt/sip/qt/qregexp.sip b/python/pyqt/sip/qt/qregexp.sip new file mode 100644 index 00000000..3d1dc403 --- /dev/null +++ b/python/pyqt/sip/qt/qregexp.sip @@ -0,0 +1,139 @@ +// This is the SIP interface definition for QRegExp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QRegExp</Title> +<Para> +The Python <Literal>==</Literal> and <Literal>!=</Literal> operators are +supported. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const char *<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (Qt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>match</Function></FuncDef> + <ParamDef>const QString &<Parameter>str</Parameter></ParamDef> + <ParamDef>int <Parameter>index</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>len</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes <Literal>str</Literal> and <Literal>index</Literal> parameters and +returns a tuple of the <Literal>int</Literal> result and the +<Literal>len</Literal> value. (Qt v2+) +</Para> +</Sect2> +%End + + +class QRegExp +{ +%TypeHeaderCode +#include <qregexp.h> +%End + +public: +%If (Qt_3_1_0 -) + enum CaretMode { + CaretAtZero, + CaretAtOffset, + CaretWontMatch + }; +%End + + QRegExp(); +%If (- Qt_2_00) + QRegExp(const char *,bool = 1,bool = 0); +%End +%If (Qt_2_00 -) + QRegExp(const QString &,bool = 1,bool = 0); +%End + QRegExp(const QRegExp &); + + bool operator==(const QRegExp &) const; + bool operator!=(const QRegExp &) const; + + bool isEmpty() const; + bool isValid() const; +%If (- Qt_2_00) + const char *pattern() const; +%End +%If (Qt_2_00 -) + QString pattern() const; +%End +%If (Qt_2_2_0 -) + void setPattern(const QString &); +%End + bool caseSensitive() const; + void setCaseSensitive(bool); + bool wildcard() const; + void setWildcard(bool); +%If (Qt_3_0_0 -) + bool minimal() const; + void setMinimal(bool); + + bool exactMatch(const QString &) const; +%End + +%If (- Qt_2_00) + int match(const char *,int = 0,int * = 0) const; +%End +%If (Qt_2_00 - Qt_3_0_0) + int match(const QString &,int = 0,int * = 0) const; +%End + +%If (Qt_2_2_0 - Qt_3_0_0) + int find(const QString &,int); +%End + +%If (Qt_3_0_0 -) + int search(const QString &,int = 0) const; +%If (Qt_3_1_0 -) + int search(const QString &,int,CaretMode) const; +%End + int searchRev(const QString &,int = -1) const; +%If (Qt_3_1_0 -) + int searchRev(const QString &,int,CaretMode) const; +%End + int matchedLength() const; +%If (Qt_3_1_0 -) + int numCaptures() const; +%End + QStringList capturedTexts(); + QString cap(int = 0); + int pos(int = 0); +%End +%If (Qt_3_1_0 -) + QString errorString(); + + static QString escape(const QString &); +%End +}; diff --git a/python/pyqt/sip/qt/qregion.sip b/python/pyqt/sip/qt/qregion.sip new file mode 100644 index 00000000..07f166bf --- /dev/null +++ b/python/pyqt/sip/qt/qregion.sip @@ -0,0 +1,126 @@ +// This is the SIP interface definition for QRegion. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QRegion</Title> +<Para> +The Python +<Literal>|</Literal>, <Literal>|=</Literal>, +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>&</Literal>, <Literal>&=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>^</Literal>, <Literal>^=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and +<Literal>__nonzero__</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QArray<QRect> <Function>rects</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setRects</Function></FuncDef> + <ParamDef>QRect *<Parameter>rects</Parameter></ParamDef> + <ParamDef>int <Parameter>num</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2.2+) +</Para> +</Sect2> +%End + + +class QRegion +{ +%TypeHeaderCode +#include <qregion.h> +%End + +public: + enum RegionType + { + Rectangle, + Ellipse + }; + + QRegion(); + QRegion(int,int,int,int,RegionType = Rectangle); + QRegion(const QRect &,RegionType = Rectangle); + QRegion(const QPointArray &,bool = 0); + QRegion(const QRegion &); +%If (Qt_1_43 -) + QRegion(const QBitmap &); +%End + + bool isNull() const; + bool isEmpty() const; + + bool contains(const QPoint &) const; + + int __contains__(const QPoint &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + bool contains(const QRect &) const; + + int __contains__(const QRect &) const; +%MethodCode + sipRes = sipCpp -> contains(*a0); +%End + + void translate(int,int); + + QRegion unite(const QRegion &) const; + QRegion intersect(const QRegion &) const; + QRegion subtract(const QRegion &) const; + QRegion eor(const QRegion &) const; + + QRect boundingRect() const; +// QArray<QRect> rects() const; +%If (Qt_2_2_0 -) +// void setRects(const QRect *,int); +%End + + const QRegion operator|(const QRegion &) const; + const QRegion operator+(const QRegion &) const; + const QRegion operator&(const QRegion &) const; + const QRegion operator-(const QRegion &) const; + const QRegion operator^(const QRegion &) const; + QRegion &operator|=(const QRegion &); + QRegion &operator+=(const QRegion &); + QRegion &operator&=(const QRegion &); + QRegion &operator-=(const QRegion &); + QRegion &operator^=(const QRegion &); + + int __nonzero__() const; +%MethodCode + sipRes = !sipCpp -> isNull(); +%End + + bool operator==(const QRegion &) const; + bool operator!=(const QRegion &) const; +}; diff --git a/python/pyqt/sip/qt/qscrollbar.sip b/python/pyqt/sip/qt/qscrollbar.sip new file mode 100644 index 00000000..20b8e5d1 --- /dev/null +++ b/python/pyqt/sip/qt/qscrollbar.sip @@ -0,0 +1,170 @@ +// This is the SIP interface definition for QScrollBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QScrollBar</Title> +<Para> +<Literal>QScrollBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QScrollBar : QWidget, QRangeControl +{ +%TypeHeaderCode +#include <qscrollbar.h> +%End + +public: +%If (- Qt_2_00) + enum Orientation { + Horizontal, + Vertical + }; +%End + +%If (- Qt_2_00) + QScrollBar(QWidget * /TransferThis/ = 0,const char * = 0); + QScrollBar(Orientation,QWidget * /TransferThis/ = 0,const char * = 0); + QScrollBar(int,int,int,int,int,Orientation, + QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QScrollBar(QWidget * /TransferThis/,const char * = 0); + QScrollBar(Orientation,QWidget * /TransferThis/,const char * = 0); + QScrollBar(int,int,int,int,int,Orientation,QWidget * /TransferThis/, + const char * = 0); +%End + +%If (- Qt_2_00) + void setOrientation(Orientation); +%End +%If (Qt_2_00 -) + virtual void setOrientation(Orientation); +%End + Orientation orientation() const; +%If (- Qt_2_00) + void setTracking(bool); +%End +%If (Qt_2_00 -) + virtual void setTracking(bool); +%End + bool tracking() const; + bool draggingSlider() const; + +%If (Qt_2_00 -) + virtual void setPalette(const QPalette &); +%End +%If (- Qt_2_00) + void setPalette(const QPalette &); +%End +%If (Qt_3_1_0 -) + virtual QSize sizeHint() const; +%End +%If (- Qt_3_1_0) + QSize sizeHint() const; +%End +%If (Qt_3_1_0 -) + virtual void setSizePolicy(QSizePolicy); +%End +%If (Qt_3_2_0 -) + void setSizePolicy(QSizePolicy::SizeType,QSizePolicy::SizeType, + bool = 0); +%End +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_2_1_0 -) + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; +%End +%If (- Qt_3_0_0) + void setValue(int); +%End + +%If (Qt_3_0_0 -) + int sliderStart() const; + QRect sliderRect() const; +%End + +public slots: +%If (Qt_3_0_0 -) + void setValue(int); +%End + +signals: + void valueChanged(int); + void sliderPressed(); + void sliderMoved(int); + void sliderReleased(); + void nextLine(); + void prevLine(); + void nextPage(); + void prevPage(); + +protected: +%If (Qt_2_00 -) + void wheelEvent(QWheelEvent *); +%End + void keyPressEvent(QKeyEvent *); + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +%If (Qt_3_0_0 -) + void contextMenuEvent(QContextMenuEvent *); +%End +%If (Qt_3_0_4 -) + void hideEvent(QHideEvent *); +%End + + void valueChange(); + void stepChange(); + void rangeChange(); + +%If (- Qt_3_0_0) + int sliderStart() const; + QRect sliderRect() const; +%End + +%If (- Qt_2_00) + void timerEvent(QTimerEvent *); +%End + +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End + +private: + QScrollBar(const QScrollBar &); +}; diff --git a/python/pyqt/sip/qt/qscrollview.sip b/python/pyqt/sip/qt/qscrollview.sip new file mode 100644 index 00000000..4d7161f8 --- /dev/null +++ b/python/pyqt/sip/qt/qscrollview.sip @@ -0,0 +1,325 @@ +// This is the SIP interface definition for QScrollView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QScrollView</Title> +<FuncSynopsis> + <FuncDef>void <Function>contentsToViewport</Function></FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int &<Parameter>vx</Parameter></ParamDef> + <ParamDef>int &<Parameter>vy</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>vx</Literal> and <Literal>vy</Literal> +values. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>viewportToContents</Function></FuncDef> + <ParamDef>int <Parameter>vx</Parameter></ParamDef> + <ParamDef>int <Parameter>vy</Parameter></ParamDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>vx</Literal> and <Literal>vy</Literal> parameters and +returns a tuple containing the <Literal>x</Literal> and <Literal>y</Literal> +values. (Qt v2+) +</Para> +</Sect2> +%End + + +class QScrollView : QFrame +{ +%TypeHeaderCode +#include <qscrollview.h> +%End + +public: + QScrollView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + enum ResizePolicy { + Default, + Manual, + AutoOne, +%If (Qt_2_3_0 -) + AutoOneFit, +%End + }; + + virtual void setResizePolicy(ResizePolicy); + ResizePolicy resizePolicy() const; + +%If (Qt_2_1_0 -) + void styleChange(QStyle &); +%End + // The child was reparented when it was added, and it stays that way, + // so we don't transfer it back here. + void removeChild(QWidget *); +%If (- Qt_2_00) + void addChild(QWidget * /Transfer/); + virtual void addChild(QWidget * /Transfer/,int,int); +%End +%If (Qt_2_00 -) + virtual void addChild(QWidget * /Transfer/,int = 0,int = 0); +%End + virtual void moveChild(QWidget *,int,int); + int childX(QWidget *); + int childY(QWidget *); +%If (- Qt_3_0_0) + bool childIsVisible(QWidget *); + void showChild(QWidget *,bool = 1); +%End + + enum ScrollBarMode { + Auto, + AlwaysOff, + AlwaysOn + }; + + ScrollBarMode vScrollBarMode() const; + virtual void setVScrollBarMode(ScrollBarMode); + + ScrollBarMode hScrollBarMode() const; + virtual void setHScrollBarMode(ScrollBarMode); + + QWidget *cornerWidget() const; + virtual void setCornerWidget(QWidget * /Transfer/); + +%If (- Qt_2_00) + QScrollBar *horizontalScrollBar(); + QScrollBar *verticalScrollBar(); + QWidget *viewport(); +%End +%If (Qt_2_00 -) + QScrollBar *horizontalScrollBar() const; + QScrollBar *verticalScrollBar() const; + QWidget *viewport() const; + QWidget *clipper() const; + + int visibleWidth() const; + int visibleHeight() const; +%End + + int contentsWidth() const; + int contentsHeight() const; + int contentsX() const; + int contentsY() const; + + void resize(int,int); + void resize(const QSize &); + void show(); + +%If (Qt_2_00 -) + void updateContents(int,int,int,int); +%End +%If (Qt_2_1_0 -) + void updateContents(const QRect &); +%End +%If (Qt_3_0_0 -) + void updateContents(); +%End +%If (Qt_2_00 -) + void repaintContents(int,int,int,int,bool = 1); +%End +%If (Qt_2_1_0 -) + void repaintContents(const QRect &,bool = 1); +%End +%If (Qt_3_0_0 -) + void repaintContents(bool = 1); +%End + +%If (Qt_2_00 -) + // Note that this wasn't actually const until Qt v3.0.0. + void contentsToViewport(int,int,int &,int &) const; + + // Note that this wasn't actually const until Qt v3.0.0. + void viewportToContents(int,int,int &,int &) const; + +%If (- Qt_3_0_0) + QPoint contentsToViewport(const QPoint &); + QPoint viewportToContents(const QPoint &); +%End +%If (Qt_3_0_0 -) + QPoint contentsToViewport(const QPoint &) const; + QPoint viewportToContents(const QPoint &) const; +%End + void enableClipper(bool); + +%If (Qt_2_2_0 -) + void setStaticBackground(bool); + bool hasStaticBackground() const; +%End + + QSize viewportSize(int,int) const; +%If (Qt_2_1_0 -) + QSize sizeHint() const; +%End +%If (- Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + QSize minimumSizeHint() const; + + void removeChild(QObject * /TransferBack/); +%End + +%If (Qt_3_1_0 -) + bool isHorizontalSliderPressed(); + bool isVerticalSliderPressed(); +%End + +%If (Qt_DRAGANDDROP) +%If (Qt_2_1_0 - Qt_3_0_0) + void setDragAutoScroll(bool); +%End +%If (Qt_3_0_0 -) + virtual void setDragAutoScroll(bool); +%End +%If (Qt_2_1_0 -) + bool dragAutoScroll() const; +%End +%End + +signals: + void contentsMoving(int,int); +%If (Qt_3_1_0 -) + void horizontalSliderPressed(); + void horizontalSliderReleased(); + void verticalSliderPressed(); + void verticalSliderReleased(); +%End + +public slots: + virtual void resizeContents(int,int); + void scrollBy(int,int); +%If (- Qt_2_00) + void setContentsPos(int,int); +%End +%If (Qt_2_00 -) + virtual void setContentsPos(int,int); +%End + void ensureVisible(int,int); + void ensureVisible(int,int,int,int); + void center(int,int); + void center(int,int,float,float); + + void updateScrollBars(); +%If (Qt_2_00 -) + void setEnabled(bool); +%End + +protected: +%If (Qt_2_00 -) + virtual void drawContents(QPainter *,int,int,int,int); +%End + virtual void drawContentsOffset(QPainter *,int,int,int,int,int,int); + +%If (Qt_2_00 -) + virtual void contentsMousePressEvent(QMouseEvent *); + virtual void contentsMouseReleaseEvent(QMouseEvent *); + virtual void contentsMouseDoubleClickEvent(QMouseEvent *); + virtual void contentsMouseMoveEvent(QMouseEvent *); +%If (Qt_DRAGANDDROP) + virtual void contentsDragEnterEvent(QDragEnterEvent *); + virtual void contentsDragMoveEvent(QDragMoveEvent *); + virtual void contentsDragLeaveEvent(QDragLeaveEvent *); + virtual void contentsDropEvent(QDropEvent *); +%End + virtual void contentsWheelEvent(QWheelEvent *); +%End +%If (Qt_3_0_0 -) + virtual void contentsContextMenuEvent(QContextMenuEvent *); +%End + + virtual void viewportPaintEvent(QPaintEvent *); +%If (Qt_2_00 -) + virtual void viewportResizeEvent(QResizeEvent *); +%End + virtual void viewportMousePressEvent(QMouseEvent *); + virtual void viewportMouseReleaseEvent(QMouseEvent *); + virtual void viewportMouseDoubleClickEvent(QMouseEvent *); + virtual void viewportMouseMoveEvent(QMouseEvent *); +%If (Qt_2_00 -) +%If (Qt_DRAGANDDROP) + virtual void viewportDragEnterEvent(QDragEnterEvent *); + virtual void viewportDragMoveEvent(QDragMoveEvent *); + virtual void viewportDragLeaveEvent(QDragLeaveEvent *); + virtual void viewportDropEvent(QDropEvent *); +%End + virtual void viewportWheelEvent(QWheelEvent *); +%End +%If (Qt_3_0_0 -) + virtual void viewportContextMenuEvent(QContextMenuEvent *); +%End + + void frameChanged(); + +%If (- Qt_2_00) + void setMargins(int,int,int,int); +%End +%If (Qt_2_00 -) + virtual void setMargins(int,int,int,int); +%End + int leftMargin() const; + int topMargin() const; + int rightMargin() const; + int bottomMargin() const; + + bool focusNextPrevChild(bool); + +%If (Qt_2_00 -) + virtual void setHBarGeometry(QScrollBar &,int,int,int,int); + virtual void setVBarGeometry(QScrollBar &,int,int,int,int); +%End + + void resizeEvent(QResizeEvent *); +%If (Qt_3_0_0 -) + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseDoubleClickEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +%End +%If (Qt_2_00 -) + void wheelEvent(QWheelEvent *); +%End +%If (Qt_3_0_0 -) + void contextMenuEvent(QContextMenuEvent *); +%End + bool eventFilter(QObject *,QEvent *); + +%If (Qt_3_1_0 -) + void setCachedSizeHint(const QSize &) const; + QSize cachedSizeHint() const; + void fontChange(const QFont &); +%End + +private: + QScrollView(const QScrollView &); + +public: +%If (Qt_3_1_0 -) + void disableSizeHintCaching(); +%End +}; diff --git a/python/pyqt/sip/qt/qsemaphore.sip b/python/pyqt/sip/qt/qsemaphore.sip new file mode 100644 index 00000000..5e1ba408 --- /dev/null +++ b/python/pyqt/sip/qt/qsemaphore.sip @@ -0,0 +1,112 @@ +// This is the SIP interface definition for QSemaphore. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSemaphore (Qt v2.2+)</Title> +<Para> +<Literal>QSemaphore</Literal> is fully implemented. The <Literal>+=</Literal> +and <Literal>-=</Literal> operators have also been implemented, but require +Python v2.0 or later. +</Para> +</Sect2> +%End + + +%If (Qt_THREAD_SUPPORT) + +%If (Qt_3_0_0 -) + +class QSemaphore +{ +%TypeHeaderCode +#include <qsemaphore.h> +%End + +public: + QSemaphore(int); + + int available() const; + int total() const; + + QSemaphore &operator+=(int); +%MethodCode + // Some versions of Qt v3 under Windows have a bug where the += + // operator doesn't work properly (but ++ does). This way we + // make sure that the most common value of n (ie. 1) works + // properly with the buggy version. + + Py_BEGIN_ALLOW_THREADS + if (a0 == 1) + (*sipCpp)++; + else + (*sipCpp) += a0; + Py_END_ALLOW_THREADS +%End + + QSemaphore &operator-=(int); +%MethodCode + // Some versions of Qt v3 under Windows have a bug where the -= + // operator doesn't work properly (but -- does). This way we + // make sure that the most common value of n (ie. 1) works + // properly with the buggy version. + + Py_BEGIN_ALLOW_THREADS + if (a0 == 1) + (*sipCpp)--; + else + (*sipCpp) -= a0; + Py_END_ALLOW_THREADS +%End + + bool tryAccess(int); + +private: + QSemaphore(const QSemaphore &); +}; + +%End + + +%If (Qt_2_2_0 - Qt_3_0_0) + +class QSemaphore : Qt +{ +%TypeHeaderCode +#include <qthread.h> +%End + +public: + QSemaphore(int); + + int available() const; + int total() const; + + QSemaphore &operator+=(int); + QSemaphore &operator-=(int); + +private: + QSemaphore(const QSemaphore &); +}; + +%End + +%End diff --git a/python/pyqt/sip/qt/qsemimodal.sip b/python/pyqt/sip/qt/qsemimodal.sip new file mode 100644 index 00000000..0efc1c83 --- /dev/null +++ b/python/pyqt/sip/qt/qsemimodal.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QSemiModal. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSemiModal (Qt v1, v2)</Title> +<Para> +<Literal>QSemiModal</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_SEMIMODAL) +%If (- Qt_3_0_0) + +class QSemiModal : QWidget +{ +%TypeHeaderCode +#include <qsemimodal.h> +%End + +public: + QSemiModal(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0,WFlags = 0); + + void show(); + void move(int,int); + void move(const QPoint &); + void resize(int,int); + void resize(const QSize &); +%If (- Qt_2_00) + void setGeometry(int,int,int,int); + void setGeometry(const QRect &); +%End +%If (Qt_2_00 -) + virtual void setGeometry(int,int,int,int); + virtual void setGeometry(const QRect &); +%End + +private: + QSemiModal(const QSemiModal &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qsessionmanager.sip b/python/pyqt/sip/qt/qsessionmanager.sip new file mode 100644 index 00000000..92ff03cf --- /dev/null +++ b/python/pyqt/sip/qt/qsessionmanager.sip @@ -0,0 +1,89 @@ +// This is the SIP interface definition for QSessionManager. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSessionManager (Qt v2+)</Title> +<Para> +<Literal>QSessionManager</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QSessionManager : QObject +{ +%TypeHeaderCode +#include <qsessionmanager.h> +%End + +public: + QString sessionId() const; +%If (Qt_3_1_0 -) + QString sessionKey() const; +%End + + bool allowsInteraction(); + bool allowsErrorInteraction(); + void release(); + + void cancel(); + + enum RestartHint { + RestartIfRunning, + RestartAnyway, + RestartImmediately, + RestartNever + }; + + void setRestartHint(RestartHint); + RestartHint restartHint() const; + + void setRestartCommand(const QStringList &); + QStringList restartCommand() const; + void setDiscardCommand(const QStringList &); + QStringList discardCommand() const; + +%If (- Qt_3_0_0) + void setProperty(const QString &,const QString &); + void setProperty(const QString &,const QStringList &); +%End +%If (Qt_3_0_0 -) + void setManagerProperty(const QString &,const QString &); + void setManagerProperty(const QString &,const QStringList &); +%End + + bool isPhase2() const; + void requestPhase2(); + +private: +%If (Qt_3_1_0 -) + QSessionManager(QApplication * /TransferThis/,QString &,QString &); +%End +%If (- Qt_3_1_0) + QSessionManager(QApplication * /TransferThis/,QString &); +%End + ~QSessionManager(); +}; + +%End diff --git a/python/pyqt/sip/qt/qsettings.sip b/python/pyqt/sip/qt/qsettings.sip new file mode 100644 index 00000000..122593e4 --- /dev/null +++ b/python/pyqt/sip/qt/qsettings.sip @@ -0,0 +1,177 @@ +// This is the SIP interface definition for QSettings. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSettings (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>readBoolEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>bool</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>double <Function>readDoubleEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>double <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>double</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QString <Function>readEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const QString &<Parameter>def</Parameter> = QString::null</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QString</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>QStringList <Function>readListEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>const QChar &<Parameter>separator</Parameter></ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>QStringList</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> +<FuncDef>int <Function>readNumEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>int <Parameter>def</Parameter> = 0</ParamDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>ok</Literal> is not passed and the returned value is a tuple of +the <Literal>int</Literal> result and the <Literal>ok</Literal> flag. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>writeEntry</Function></FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> + <ParamDef>bool <Parameter>value</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSettings +{ +%TypeHeaderCode +#include <qsettings.h> +%End + +public: +%If (Qt_3_1_0 -) + enum Format { + Native, + Ini + }; +%End + + enum System { + Unix, + Windows, + Mac + }; + +%If (Qt_3_1_0 -) + enum Scope { + User, + Global + }; +%End + + QSettings(); +%If (Qt_3_1_0 -) + QSettings(Format); +%End + +// bool writeEntry(const QString &,bool); + bool writeEntry(const QString &,int /Constrained/); + bool writeEntry(const QString &,double); +// bool writeEntry(const QString &,const char *); + bool writeEntry(const QString &,const QString &); + bool writeEntry(const QString &,const QStringList &); + bool writeEntry(const QString &,const QStringList &,const QChar &); + + QStringList entryList(const QString &) const; + QStringList subkeyList(const QString &) const; + + QStringList readListEntry(const QString &,bool * = 0); + QStringList readListEntry(const QString &,const QChar &,bool * = 0); + QString readEntry(const QString &,const QString & = QString::null, + bool * = 0); + int readNumEntry(const QString &,int = 0,bool * = 0); + double readDoubleEntry(const QString &,double = 0,bool * = 0); + bool readBoolEntry(const QString &,bool = 0,bool * = 0); + + bool removeEntry(const QString &); + + void insertSearchPath(System,const QString &); + void removeSearchPath(System,const QString &); + +%If (Qt_3_1_0 -) + void setPath(const QString &,const QString &,Scope = Global); + + void beginGroup(const QString &); + void endGroup(); + void resetGroup(); + QString group() const; +%End + +%If (Qt_3_2_0 -) + bool sync(); +%End + +private: + QSettings(const QSettings &); +}; + +%End diff --git a/python/pyqt/sip/qt/qsgistyle.sip b/python/pyqt/sip/qt/qsgistyle.sip new file mode 100644 index 00000000..c2563ea4 --- /dev/null +++ b/python/pyqt/sip/qt/qsgistyle.sip @@ -0,0 +1,157 @@ +// This is the SIP interface definition for QSGIStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSGIStyle (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_STYLE_SGI) +%If (Qt_2_2_0 -) + +class QSGIStyle : QMotifStyle +{ +%TypeHeaderCode +#include <qsgistyle.h> +%End + +public: + QSGIStyle(bool = 0); + + void polish(QWidget *); + void unPolish(QWidget *); + void polish(QApplication *); + void unPolish(QApplication *); + +%If (- Qt_3_0_0) + void polish(QPalette &); + + int defaultFrameWidth() const; + + void drawPanel(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + int = 1,const QBrush * = 0); + void drawSeparator(QPainter *,int,int,int,int,const QColorGroup &, + bool = 1,int = 1,int = 0); + void drawButton(QPainter *,int,int,int,int,const QColorGroup &,bool = 0, + const QBrush * = 0); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawPushButton(QPushButton *,QPainter *); + void drawArrow(QPainter *,ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0); + + QSize indicatorSize() const; + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &,int, + bool = 0,bool = 1); + void drawCheckMark(QPainter *,int,int,int,int,const QColorGroup &, + bool,bool); + void drawIndicatorMask(QPainter *,int,int,int,int,int); + + QSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); + void drawExclusiveIndicatorMask(QPainter *,int,int,int,int,bool); + + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint,uint); + + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderMask(QPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); + void drawSliderGrooveMask(QPainter *,int,int,int,int,QCOORD, + Orientation); + + void drawTab(QPainter *,const QTabBar *,QTab *,bool); + void drawTabMask(QPainter *,const QTabBar *,QTab *,bool); + + int splitterWidth() const; + void drawSplitter(QPainter *,int,int,int,int,const QColorGroup &, + Orientation); + + int popupMenuItemHeight(bool,QMenuItem *,const QFontMetrics &); + void drawPopupPanel(QPainter *,int,int,int,int,const QColorGroup &, + int = 2,const QBrush * = 0); + void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool,bool,int,int,int,int); + void drawMenuBarItem(QPainter *,int,int,int,int,QMenuItem *, + QColorGroup &,bool,bool); +%End +%If (Qt_3_0_0 -) + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + QSize sizeFromContents(ContentsType,const QWidget *,const QSize &, + const QStyleOption & = QStyleOption()) const; + + QRect subRect(SubRect,const QWidget *) const; + + QRect querySubControlMetrics(ComplexControl,const QWidget *, + SubControl, + const QStyleOption & = QStyleOption()) const; +%End + +protected: + bool eventFilter(QObject *,QEvent *); + +private: + QSGIStyle(const QSGIStyle &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qsignalmapper.sip b/python/pyqt/sip/qt/qsignalmapper.sip new file mode 100644 index 00000000..d5877239 --- /dev/null +++ b/python/pyqt/sip/qt/qsignalmapper.sip @@ -0,0 +1,51 @@ +// This is the SIP interface definition for QSignalMapper +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSignalMapper</Title> +<Para> +<Literal>QSignalMapper</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QSignalMapper : QObject +{ +%TypeHeaderCode +#include <qsignalmapper.h> +%End + +public: + QSignalMapper(QObject * /TransferThis/,const char * = 0); + + virtual void setMapping(const QObject *,int); + virtual void setMapping(const QObject *,const QString &); + void removeMappings(const QObject *); + +signals: + void mapped(int); + void mapped(const QString &); + +public slots: + void map(); +}; diff --git a/python/pyqt/sip/qt/qsimplerichtext.sip b/python/pyqt/sip/qt/qsimplerichtext.sip new file mode 100644 index 00000000..7b189c33 --- /dev/null +++ b/python/pyqt/sip/qt/qsimplerichtext.sip @@ -0,0 +1,91 @@ +// This is the SIP interface definition for QSimpleRichText. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSimpleRichText (Qt v2+)</Title> +<Para> +<Literal>QSimpleRichText</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QSimpleRichText +{ +%TypeHeaderCode +#include <qsimplerichtext.h> +%End + +public: + QSimpleRichText(const QString &,const QFont &, + const QString & = QString::null, + const QStyleSheet * = 0); +%If (Qt_2_1_0 -) + QSimpleRichText(const QString &,const QFont &,const QString &, + const QStyleSheet *,const QMimeSourceFactory *, + int = -1,const QColor & = Qt::blue,bool = 1); +%End + +%If (Qt_2_1_0 -) + void setWidth(int); +%End + void setWidth(QPainter *,int); +%If (Qt_3_0_0 -) + void setDefaultFont(const QFont &); +%End + int width() const; + int widthUsed() const; + int height() const; +%If (Qt_2_1_0 -) + void adjustSize(); +%End + +%If (- Qt_3_0_0) + void draw(QPainter *,int,int,const QRegion &,const QPalette &, + const QBrush * = 0) const; + void draw(QPainter *,int,int,const QRegion &,const QColorGroup &, + const QBrush * = 0) const; +%End +%If (Qt_3_0_0 -) + void draw(QPainter *,int,int,const QRect &,const QColorGroup &, + const QBrush * = 0) const; +%End + + QString context() const; +%If (- Qt_3_0_0) + QString anchor(QPainter *,const QPoint &); +%End +%If (Qt_2_1_0 -) + QString anchorAt(const QPoint &) const; + + bool inText(const QPoint &) const; +%End + +private: +%If (Qt_3_0_0 -) + QSimpleRichText(const QSimpleRichText &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qsize.sip b/python/pyqt/sip/qt/qsize.sip new file mode 100644 index 00000000..e85d61dc --- /dev/null +++ b/python/pyqt/sip/qt/qsize.sip @@ -0,0 +1,114 @@ +// This is the SIP interface definition for QSize. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSize</Title> +<Para> +The Python +<Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>-</Literal>, <Literal>-=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, +<Literal>/</Literal>, <Literal>/=</Literal>, +<Literal>==</Literal>, <Literal>!=</Literal> and <Literal>__nonzero__</Literal> +operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rheight</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QCOORD &<Function>rwidth</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class QSize +{ +%TypeHeaderCode +#include <qsize.h> +%End + +public: +%If (Qt_3_1_0 -) + enum ScaleMode { + ScaleFree, + ScaleMin, + ScaleMax + }; +%End + + QSize(); + QSize(int,int); + + bool isNull() const; + bool isEmpty() const; + bool isValid() const; + + int width() const; + int height() const; + void setWidth(int); + void setHeight(int); + void transpose(); + +%If (Qt_3_1_0 -) + void scale(int,int,ScaleMode); + void scale(const QSize &,ScaleMode); +%End + + QSize expandedTo(const QSize &) const; + QSize boundedTo(const QSize &) const; +// QCOORD &rwidth(); +// QCOORD &rheight(); + + QSize &operator+=(const QSize &); + QSize &operator-=(const QSize &); + QSize &operator*=(int /Constrained/); + QSize &operator*=(double); + QSize &operator/=(int /Constrained/); + QSize &operator/=(double); + + int __nonzero__() const; +%MethodCode + sipRes = sipCpp -> isValid(); +%End + + // Qt defines the remaining operators as global, rather than part of + // the class, but SIP doesn't support global operators. + bool operator==(const QSize &) const; + bool operator!=(const QSize &) const; + const QSize operator+(const QSize &) const; + const QSize operator-(const QSize &) const; + const QSize operator*(int /Constrained/) const; + const QSize operator*(double) const; + const QSize operator/(int /Constrained/) const; + const QSize operator/(double) const; +}; diff --git a/python/pyqt/sip/qt/qsizegrip.sip b/python/pyqt/sip/qt/qsizegrip.sip new file mode 100644 index 00000000..af21e943 --- /dev/null +++ b/python/pyqt/sip/qt/qsizegrip.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for QSizeGrip. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSizeGrip (Qt v2+)</Title> +<Para> +<Literal>QSizeGrip</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) +%If (Qt_SIZEGRIP) + +class QSizeGrip : QWidget +{ +%TypeHeaderCode +#include <qsizegrip.h> +%End + +public: + QSizeGrip(QWidget * /TransferThis/,const char * = 0); + + QSize sizeHint() const; +%If (- Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +protected: + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); + +%If (Qt_3_0_0 -) + bool eventFilter(QObject *,QEvent *); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qsizepolicy.sip b/python/pyqt/sip/qt/qsizepolicy.sip new file mode 100644 index 00000000..c26b54af --- /dev/null +++ b/python/pyqt/sip/qt/qsizepolicy.sip @@ -0,0 +1,103 @@ +// This is the SIP interface definition for QSizePolicy. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSizePolicy (Qt v2+)</Title> +<Para> +<Literal>QSizePolicy</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QSizePolicy +{ +%TypeHeaderCode +#include <qsizepolicy.h> +%End + +public: + enum SizeType + { + Fixed, + Minimum, + Maximum, + Preferred, + MinimumExpanding, + Expanding, +%If (Qt_3_0_0 -) + Ignored +%End + }; + + enum ExpandData + { + NoDirection, +%If (Qt_3_0_0 -) + Horizontally, + Vertically, +%End +%If (- Qt_3_0_0) + Horizontal, + Vertical, +%End + BothDirections + }; + + QSizePolicy(); + QSizePolicy(SizeType,SizeType,bool = 0); +%If (Qt_3_0_0 -) + // Note that Qt defines the 2nd and 3rd parameters as uchar, but it's + // really using them as numbers, not characters. + QSizePolicy(SizeType,SizeType,uint,uint,bool = 0); +%End + + SizeType horData() const; + SizeType verData() const; + + bool mayShrinkHorizontally() const; + bool mayShrinkVertically() const; + bool mayGrowHorizontally() const; + bool mayGrowVertically() const; + + ExpandData expanding() const; + + void setHorData(SizeType); + void setVerData(SizeType); + + void setHeightForWidth(bool); + bool hasHeightForWidth() const; + +%If (Qt_3_0_0 -) + uint horStretch() const; + uint verStretch() const; + void setHorStretch(uint); + void setVerStretch(uint); +%End +%If (Qt_3_1_0 -) + void transpose(); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qslider.sip b/python/pyqt/sip/qt/qslider.sip new file mode 100644 index 00000000..9560216c --- /dev/null +++ b/python/pyqt/sip/qt/qslider.sip @@ -0,0 +1,187 @@ +// This is the SIP interface definition for QSlider. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSlider</Title> +<Para> +<Literal>QSlider</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QSlider : QWidget, QRangeControl +{ +%TypeHeaderCode +#include <qslider.h> +%End + +public: +%If (- Qt_2_00) + enum Orientation { + Horizontal, + Vertical + }; +%End + + enum TickSetting { + NoMarks = 0, + Above = 1, + Left = Above, + Below = 2, + Right = Below, + Both = 3 + }; + +%If (- Qt_2_00) + QSlider(QWidget * /TransferThis/ = 0,const char * = 0); + QSlider(Orientation,QWidget * /TransferThis/ = 0,const char * = 0); + QSlider(int,int,int,int,Orientation,QWidget * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_2_00 -) + QSlider(QWidget * /TransferThis/,const char * = 0); + QSlider(Orientation,QWidget * /TransferThis/,const char * = 0); + QSlider(int,int,int,int,Orientation,QWidget * /TransferThis/,const char * = 0); +%End + +%If (- Qt_2_00) + void setOrientation(Orientation); +%End +%If (Qt_2_00 -) + virtual void setOrientation(Orientation); +%End + Orientation orientation() const; +%If (- Qt_2_00) + void setTracking(bool); +%End +%If (Qt_2_00 -) + virtual void setTracking(bool); +%End + bool tracking() const; +%If (- Qt_2_00) + void setPalette(const QPalette &); +%End +%If (Qt_2_00 -) + virtual void setPalette(const QPalette &); +%End + +%If (Qt_3_0_0 -) + int sliderStart() const; +%End + QRect sliderRect() const; + QSize sizeHint() const; +%If (Qt_3_1_0 -) + void setSizePolicy(QSizePolicy); +%End +%If (Qt_3_2_0 -) + void setSizePolicy(QSizePolicy::SizeType,QSizePolicy::SizeType, + bool = 0); +%End +%If (Qt_2_00 -) + QSizePolicy sizePolicy() const; + QSize minimumSizeHint() const; +%End + + virtual void setTickmarks(TickSetting); + TickSetting tickmarks() const; + + virtual void setTickInterval(int); + int tickInterval() const; + +%If (Qt_2_1_0 -) + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + int pageStep() const; + void setLineStep(int); + void setPageStep(int); + int value() const; +%End + +public slots: +%If (- Qt_2_00) + void setValue(int); +%End +%If (Qt_2_00 -) + virtual void setValue(int); +%End + void addStep(); + void subtractStep(); +%If (Qt_3_1_0 -) + void addLine(); + void subtractLine(); +%End + +signals: + void valueChanged(int); + void sliderPressed(); + void sliderMoved(int); + void sliderReleased(); + +protected: + void resizeEvent(QResizeEvent *); + void paintEvent(QPaintEvent *); + + void keyPressEvent(QKeyEvent *); + void mousePressEvent(QMouseEvent *); + void mouseReleaseEvent(QMouseEvent *); + void mouseMoveEvent(QMouseEvent *); +%If (Qt_2_00 -) + void wheelEvent(QWheelEvent *); +%End + void focusInEvent(QFocusEvent *); +%If (Qt_2_00 -) + void focusOutEvent(QFocusEvent *); +%End + +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End + + void valueChange(); + void rangeChange(); + +%If (- Qt_3_0_0) + void drawWinGroove(QPainter *,QCOORD); + void drawTicks(QPainter *,int,int,int = 1) const; + virtual int thickness() const; +%End + +%If (- Qt_2_00) + virtual void paintSlider(QPainter *,const QRect &); +%End +%If (Qt_2_00 - Qt_3_0_0) + void updateMask(); + virtual void paintSlider(QPainter *,const QColorGroup &,const QRect &); + void drawTicks(QPainter *,const QColorGroup &,int,int,int = 1) const; +%End + +private: +%If (Qt_2_00 -) + int positionFromValue(int) const; + int valueFromPosition(int) const; +%End + + QSlider(const QSlider &); +}; diff --git a/python/pyqt/sip/qt/qsocketnotifier.sip b/python/pyqt/sip/qt/qsocketnotifier.sip new file mode 100644 index 00000000..1f1527a7 --- /dev/null +++ b/python/pyqt/sip/qt/qsocketnotifier.sip @@ -0,0 +1,66 @@ +// This is the SIP interface definition for QSocketNotifier. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSocketNotifier</Title> +<Para> +<Literal>QSocketNotifier</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QSocketNotifier : QObject +{ +%TypeHeaderCode +#include <qsocketnotifier.h> +%End + +public: + enum Type { + Read, + Write, + Exception + }; + + QSocketNotifier(int,Type,QObject * /TransferThis/ = 0,const char * = 0); + + int socket() const; + Type type() const; + + bool isEnabled() const; +%If (- Qt_2_00) + void setEnabled(bool); +%End +%If (Qt_2_00 -) + virtual void setEnabled(bool); +%End + +signals: + void activated(int); + +protected: + bool event(QEvent *); + +private: + QSocketNotifier(const QSocketNotifier &); +}; diff --git a/python/pyqt/sip/qt/qsound.sip b/python/pyqt/sip/qt/qsound.sip new file mode 100644 index 00000000..8cdbb1b3 --- /dev/null +++ b/python/pyqt/sip/qt/qsound.sip @@ -0,0 +1,69 @@ +// This is the SIP interface definition for QSound. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSound (Qt v2.2+)</Title> +<Para> +<Literal>QSound</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_SOUND) +%If (Qt_2_2_0 -) + +class QSound : QObject +{ +%TypeHeaderCode +#include <qsound.h> +%End + +public: + QSound(const QString &,QObject * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_3_0_0) + static bool available(); +%End +%If (Qt_3_0_0 -) + static bool isAvailable(); +%End + static void play(const QString &); + +%If (Qt_3_0_0 -) + int loops() const; + int loopsRemaining() const; + void setLoops(int); + QString fileName() const; + + bool isFinished() const; +%End + +public slots: + void play(); +%If (Qt_3_0_0 -) + void stop(); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qspinbox.sip b/python/pyqt/sip/qt/qspinbox.sip new file mode 100644 index 00000000..fad96216 --- /dev/null +++ b/python/pyqt/sip/qt/qspinbox.sip @@ -0,0 +1,268 @@ +// This is the SIP interface definition for QSpinBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSpinBox</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>mapTextToValue</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the modified +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSpinBox : QWidget, QRangeControl +{ +%TypeHeaderCode +#include <qspinbox.h> +%End + +public: + QSpinBox(QWidget * /TransferThis/ = 0,const char * = 0); + QSpinBox(int,int,int = 1,QWidget * /TransferThis/ = 0,const char * = 0); + + QString text() const; + + virtual QString prefix() const; + virtual QString suffix() const; + virtual QString cleanText() const; + + virtual void setSpecialValueText(const QString &); + QString specialValueText() const; + + virtual void setWrapping(bool); + bool wrapping() const; + + enum ButtonSymbols { + UpDownArrows, + PlusMinus + }; + + virtual void setButtonSymbols(ButtonSymbols); + ButtonSymbols buttonSymbols() const; + + virtual void setValidator(const QValidator *); + const QValidator *validator() const; + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + void setLineStep(int); + int value() const; + + QRect upRect() const; + QRect downRect() const; + +public slots: + virtual void setValue(int); + virtual void setPrefix(const QString &); + virtual void setSuffix(const QString &); + virtual void stepUp(); + virtual void stepDown(); + virtual void setEnabled(bool); + virtual void selectAll(); + +signals: + void valueChanged(int); + void valueChanged(const QString &); + +protected: + virtual QString mapValueToText(int); + virtual int mapTextToValue(bool *); + QString currentValueText(); + + virtual void updateDisplay(); + virtual void interpretText(); + + QLineEdit *editor() const; + + virtual void valueChange(); + virtual void rangeChange(); + + bool eventFilter(QObject *,QEvent *); + void resizeEvent(QResizeEvent *); + void wheelEvent(QWheelEvent *); + void leaveEvent(QEvent *); + + void styleChange(QStyle &); + +protected slots: + void textChanged(); + +private: + QSpinBox(const QSpinBox &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QSpinBox : QFrame, QRangeControl +{ +%TypeHeaderCode +#include <qspinbox.h> +%End + +public: + QSpinBox(QWidget * /TransferThis/ = 0,const char * = 0); + QSpinBox(int,int,int = 1,QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_00) + const char *text() const; + + virtual const char *prefix() const; + virtual const char *suffix() const; +%End +%If (Qt_2_00 -) + QString text() const; + + virtual QString prefix() const; + virtual QString suffix() const; +%End + virtual QString cleanText() const; + +%If (- Qt_2_00) + void setSpecialValueText(const char *); + const char *specialValueText() const; + + void setWrapping(bool); +%End +%If (Qt_2_00 -) + virtual void setSpecialValueText(const QString &); + QString specialValueText() const; + + virtual void setWrapping(bool); +%End + bool wrapping() const; + +%If (Qt_2_1_0 -) + enum ButtonSymbols { + UpDownArrows, + PlusMinus + }; +%End + +%If (Qt_2_1_0 -) + void setButtonSymbols(ButtonSymbols); + ButtonSymbols buttonSymbols() const; +%End + +%If (- Qt_2_00) + void setValidator(QValidator *); +%End +%If (Qt_2_00 -) + virtual void setValidator(const QValidator *); + const QValidator *validator() const; +%End + + QSize sizeHint() const; +%If (Qt_2_00 -) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_2_1_0 -) + int minValue() const; + int maxValue() const; + void setMinValue(int); + void setMaxValue(int); + int lineStep() const; + void setLineStep(int); + int value() const; +%End + +public slots: + virtual void setValue(int); +%If (- Qt_2_00) + virtual void setPrefix(const char *); + virtual void setSuffix(const char *); +%End +%If (Qt_2_00 -) + virtual void setPrefix(const QString &); + virtual void setSuffix(const QString &); +%End + virtual void stepUp(); + virtual void stepDown(); +%If (Qt_2_00 -) + virtual void setEnabled(bool); +%End + +signals: + void valueChanged(int); +%If (- Qt_2_00) + void valueChanged(const char *); +%End +%If (Qt_2_00 -) + void valueChanged(const QString &); +%End + +protected: + virtual QString mapValueToText(int); + virtual int mapTextToValue(bool *); + QString currentValueText(); + + virtual void updateDisplay(); + virtual void interpretText(); + + QPushButton *upButton() const; + QPushButton *downButton() const; + + QLineEdit *editor() const; + + virtual void valueChange(); + virtual void rangeChange(); + + bool eventFilter(QObject *,QEvent *); + void resizeEvent(QResizeEvent *); +%If (- Qt_2_00) + void paletteChange(const QPalette &); + void enabledChange(bool); + void fontChange(const QFont &); + void styleChange(GUIStyle); +%End +%If (Qt_2_00 -) + void wheelEvent(QWheelEvent *); + void styleChange(QStyle &); +%End +%If (Qt_2_1_0 -) + void leaveEvent(QEvent *); +%End + +protected slots: + void textChanged(); + +private: + QSpinBox(const QSpinBox &); +}; + +%End diff --git a/python/pyqt/sip/qt/qsplashscreen.sip b/python/pyqt/sip/qt/qsplashscreen.sip new file mode 100644 index 00000000..8277f112 --- /dev/null +++ b/python/pyqt/sip/qt/qsplashscreen.sip @@ -0,0 +1,61 @@ +// This is the SIP interface definition for QSplashScreen. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSplashScreen (Qt v3.2.0+)</Title> +<Para> +<Literal>QSplashScreen</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_2_0 -) + +class QSplashScreen : QWidget +{ +%TypeHeaderCode +#include <qsplashscreen.h> +%End + +public: + QSplashScreen(const QPixmap & = QPixmap(),WFlags = 0); + virtual ~QSplashScreen(); + + void setPixmap(const QPixmap &); + QPixmap *pixmap() const; + void finish(QWidget *); + void repaint(); + +public slots: + void message(const QString &,int = AlignLeft,const QColor & = Qt::black); + void clear(); + +signals: + void messageChanged(const QString &); + +protected: + virtual void drawContents(QPainter *); + void mousePressEvent(QMouseEvent *); +}; + +%End diff --git a/python/pyqt/sip/qt/qsplitter.sip b/python/pyqt/sip/qt/qsplitter.sip new file mode 100644 index 00000000..167f8fc3 --- /dev/null +++ b/python/pyqt/sip/qt/qsplitter.sip @@ -0,0 +1,160 @@ +// This is the SIP interface definition for QSplitter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSplitter</Title> +<FuncSynopsis> + <FuncDef>void <Function>getRange</Function></FuncDef> + <ParamDef>int <Parameter>id</Parameter></ParamDef> + <ParamDef>int *<Parameter>min</Parameter></ParamDef> + <ParamDef>int *<Parameter>max</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>id</Literal> parameter and returns the +<Literal>min</Literal> and <Literal>max</Literal> values as a tuple. (Qt v2+) +</Para> +</Sect2> +%End + + +%If (Qt_SPLITTER) + +class QSplitter : QFrame +{ +%TypeHeaderCode +#include <qsplitter.h> +%End + +public: +%If (- Qt_2_00) + enum Orientation { + Horizontal, + Vertical + }; +%End + + enum ResizeMode { + Stretch, + KeepSize, +%If (Qt_2_1_0 -) + FollowSizeHint, +%End +%If (Qt_3_1_0 -) + Auto +%End + }; + + QSplitter(QWidget * /TransferThis/ = 0,const char * = 0); + QSplitter(Orientation,QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_00) + void setOrientation(Orientation); +%End +%If (Qt_2_00 -) + virtual void setOrientation(Orientation); +%End + Orientation orientation() const; + +%If (Qt_3_2_0 -) + void setChildrenCollapsible(bool); + bool childrenCollapsible() const; + + void setCollapsible(QWidget *,bool); +%End + +%If (- Qt_2_00) + void setResizeMode(QWidget *,ResizeMode); + void setOpaqueResize(bool = 1); +%End +%If (Qt_2_00 -) + virtual void setResizeMode(QWidget *,ResizeMode); + virtual void setOpaqueResize(bool = 1); +%End + bool opaqueResize() const; + + void moveToFirst(QWidget *); + void moveToLast(QWidget *); + + void refresh(); +%If (Qt_2_00 -) + QSize sizeHint() const; + QSize minimumSizeHint() const; +%End +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_2_00 -) + QValueList<int> sizes() const; + void setSizes(QValueList<int>); +%End + +%If (Qt_3_2_0 -) + int handleWidth() const; + void setHandleWidth(int); +%End + +%If (- Qt_2_00) + bool event(QEvent *); +%End + +protected: +%If (Qt_2_00 -) + void childEvent(QChildEvent *); + + bool event(QEvent *); +%End + void resizeEvent(QResizeEvent *); + +%If (- Qt_2_00) + void childInsertEvent(QChildEvent *); + void childRemoveEvent(QChildEvent *); + void layoutHintEvent(QEvent *); + + void moveSplitter(QCOORD); +%End +%If (Qt_2_00 -) + int idAfter(QWidget *) const; + + void moveSplitter(QCOORD,int); +%End + virtual void drawSplitter(QPainter *,QCOORD,QCOORD,QCOORD,QCOORD); +%If (Qt_2_1_0 -) + void styleChange(QStyle &); +%End +%If (- Qt_2_00) + int adjustPos(int); + void setRubberband(int); +%End +%If (Qt_2_00 -) + int adjustPos(int,int); + virtual void setRubberband(int); + void getRange(int,int *,int *); +%End + +private: +%If (Qt_2_1_0 -) + QSplitter(const QSplitter &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qstatusbar.sip b/python/pyqt/sip/qt/qstatusbar.sip new file mode 100644 index 00000000..4e1f7043 --- /dev/null +++ b/python/pyqt/sip/qt/qstatusbar.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for QStatusBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStatusBar</Title> +<Para> +<Literal>QStatusBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QStatusBar : QWidget +{ +%TypeHeaderCode +#include <qstatusbar.h> +%End + +public: + QStatusBar(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_1_0) + void addWidget(QWidget * /Transfer/,int,bool = 0); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + void addWidget(QWidget * /Transfer/,int = 0,bool = 0); +%End +%If (Qt_3_0_0 -) + virtual void addWidget(QWidget * /Transfer/,int = 0,bool = 0); +%End +%If (- Qt_3_0_0) + void removeWidget(QWidget * /TransferBack/); +%End +%If (Qt_3_0_0 -) + virtual void removeWidget(QWidget * /TransferBack/); +%End + +%If (Qt_2_1_0 -) + void setSizeGripEnabled(bool); + bool isSizeGripEnabled() const; +%End + +public slots: +%If (- Qt_2_00) + void message(const char *); + void message(const char *,int); +%End +%If (Qt_2_00 -) + void message(const QString &); + void message(const QString &,int); +%End + void clear(); + +signals: +%If (Qt_3_1_0 -) + void messageChanged(const QString &); +%End + +protected: + void paintEvent(QPaintEvent *); +%If (Qt_2_1_0 -) + void resizeEvent(QResizeEvent *); +%End + + void reformat(); + void hideOrShow(); +%If (Qt_2_1_0 -) + bool event(QEvent *); +%End + +private: +%If (Qt_2_1_0 -) + QStatusBar(const QStatusBar &); +%End +}; diff --git a/python/pyqt/sip/qt/qstring.sip b/python/pyqt/sip/qt/qstring.sip new file mode 100644 index 00000000..21bf0e8c --- /dev/null +++ b/python/pyqt/sip/qt/qstring.sip @@ -0,0 +1,1079 @@ +// This is the SIP interface definition for QChar and QString. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QChar (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>uchar &<Function>cell</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uchar &<Function>row</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QString</Title> +<Para> +A Python string object (or Unicode object) can be used whenever a +<Literal>QString</Literal> can be used. A <Literal>QString</Literal> can be +converted to a Python string object using the Python <Literal>str()</Literal> +function, and to a Python Unicode object using the Python +<Literal>unicode()</Literal> function. +</Para> + +<Para> +The Python <Literal>+</Literal>, <Literal>+=</Literal>, <Literal>*</Literal>, +<Literal>*=</Literal>, <Literal>len</Literal>, <Literal>[]</Literal> +(for reading slices and individual characters), <Literal>in</Literal> and +comparison operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QCharRef <Function>at</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QChar <Function>constref</Function> const</FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QChar &<Function>ref</Function></FuncDef> + <ParamDef>uint <Parameter>i</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2+) +</Para> + +<FuncSynopsis> + <FuncDef>QString &<Function>setUnicodeCodes</Function></FuncDef> + <ParamDef>const ushort *<Parameter>unicode_as_shorts</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v2.1+) +</Para> + +<FuncSynopsis> + <FuncDef>QString &<Function>sprintf</Function></FuncDef> + <ParamDef>const char *<Parameter>format</Parameter></ParamDef> + <ParamDef>...</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>short <Function>toShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>short</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ushort <Function>toUShort</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ushort</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>int <Function>toInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>int</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>uint <Function>toUInt</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>uint</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>toLong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>long</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>ulong <Function>toULong</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>ulong</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>float <Function>toFloat</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>float</Literal> result and the +<Literal>ok</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>double <Function>toDouble</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>double</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QChar +{ +%TypeHeaderCode +#include <qstring.h> +%End + +public: + QChar(); + QChar(char); +// QChar(uchar); + QChar(uchar,uchar); + QChar(const QChar &); +// QChar(ushort); +// QChar(short); +// QChar(uint); + QChar(int); + + static const QChar null; + static const QChar replacement; + static const QChar byteOrderMark; + static const QChar byteOrderSwapped; +%If (Qt_2_2_0 -) + static const QChar nbsp; +%End + +%If (- Qt_3_0_0) + enum Category { + NoCategory, + + Mark_NonSpacing, + Mark_SpacingCombining, + Mark_Enclosing, + + Number_DecimalDigit, + Number_Letter, + Number_Other, + + Separator_Space, + Separator_Line, + Separator_Paragraph, + + Other_Control, + Other_Format, + Other_Surrogate, + Other_PrivateUse, + Other_NotAssigned, + + Letter_Uppercase, + Letter_Lowercase, + Letter_Titlecase, + Letter_Modifier, + Letter_Other, + + Punctuation_Connector, + Punctuation_Dask, + Punctuation_Open, + Punctuation_Close, + Punctuation_InitialQuote, + Punctuation_FinalQuote, + Punctuation_Other, + + Symbol_Math, + Symbol_Currency, + Symbol_Modifier, + Symbol_Other + }; +%End +%If (Qt_3_0_0 -) + enum Category { + NoCategory, + + Mark_NonSpacing, + Mark_SpacingCombining, + Mark_Enclosing, + + Number_DecimalDigit, + Number_Letter, + Number_Other, + + Separator_Space, + Separator_Line, + Separator_Paragraph, + + Other_Control, + Other_Format, + Other_Surrogate, + Other_PrivateUse, + Other_NotAssigned, + + Letter_Uppercase, + Letter_Lowercase, + Letter_Titlecase, + Letter_Modifier, + Letter_Other, + + Punctuation_Connector, + Punctuation_Dash, + Punctuation_Open, + Punctuation_Close, + Punctuation_InitialQuote, + Punctuation_FinalQuote, + Punctuation_Other, + + Symbol_Math, + Symbol_Currency, + Symbol_Modifier, + Symbol_Other + }; +%End + +%If (- Qt_3_0_0) + enum Direction { + DirL, + DirR, + DirEN, + DirES, + DirET, + DirAN, + DirCS, + DirB, + DirS, + DirWS, + DirON + }; +%End +%If (Qt_3_0_0 -) + enum Direction { + DirL, + DirR, + DirEN, + DirES, + DirET, + DirAN, + DirCS, + DirB, + DirS, + DirWS, + DirON, + DirLRE, + DirLRO, + DirAL, + DirRLE, + DirRLO, + DirPDF, + DirNSM, + DirBN + }; +%End + + enum Decomposition { + Single, + Canonical, + Font, + NoBreak, + Initial, + Medial, + Final, + Isolated, + Circle, + Super, + Sub, + Vertical, + Wide, + Narrow, + Small, + Square, + Compat, + Fraction + }; + + enum Joining { + OtherJoining, + Dual, + Right, + Center + }; + +%If (Qt_3_0_0 -) + enum CombiningClass { + Combining_BelowLeftAttached, + Combining_BelowAttached, + Combining_BelowRightAttached, + Combining_LeftAttached, + Combining_RightAttached, + Combining_AboveLeftAttached, + Combining_AboveAttached, + Combining_AboveRightAttached, + + Combining_BelowLeft, + Combining_Below, + Combining_BelowRight, + Combining_Left, + Combining_Right, + Combining_AboveLeft, + Combining_Above, + Combining_AboveRight, + + Combining_DoubleBelow, + Combining_DoubleAbove, + Combining_IotaSubscript + }; +%End + + int digitValue() const; + QChar lower() const; + QChar upper() const; + + Category category() const; + Direction direction() const; + Joining joining() const; + bool mirrored() const; +%If (Qt_2_1_0 -) + QChar mirroredChar() const; +%End +%If (- Qt_3_0_0) + QString decomposition() const; +%End +%If (Qt_3_0_0 -) + const QString &decomposition() const; +%End + Decomposition decompositionTag() const; +%If (Qt_3_0_0 -) + unsigned char combiningClass() const; +%End + + char latin1() const; + ushort unicode() const; + + bool isNull() const; + bool isPrint() const; + bool isPunct() const; + bool isSpace() const; + bool isMark() const; + bool isLetter() const; + bool isNumber() const; +%If (Qt_2_1_0 -) + bool isLetterOrNumber() const; +%End + bool isDigit() const; +%If (Qt_3_0_0 -) + bool isSymbol() const; +%End + +// uchar& cell(); +// uchar& row(); + uchar cell() const; + uchar row() const; +%If (Qt_3_0_0 -) + void setCell(uchar); + void setRow(uchar); +%End + + static bool networkOrdered(); + + bool operator==(char); + bool operator==(QChar); + bool operator!=(QChar); + bool operator!=(char); + bool operator<=(char); + bool operator<=(QChar); + bool operator>=(char); + bool operator>=(QChar); + bool operator<(char); + bool operator<(QChar); + bool operator>(char); + bool operator>(QChar); +}; + + +class QString +{ +%TypeHeaderCode +#include <qstring.h> +%End + +public: + QString(); + QString(QChar); + QString(const QString &); + QString(const QByteArray &); +// QString(const QChar *,uint); +// QString(const char *); + +%If (Qt_2_1_0 -) + // This is how we implement QUrl::operator QString() const. + QString(const QUrl &); +%End + +%If (Qt_3_0_0 -) + // This is how we implement QKeySequence::operator QString() const. + QString(const QKeySequence &); + + // This is how we implement QUuid::operator QString() const. + QString(const QUuid &); +%End + + static const QString null; + + bool isNull() const; + bool isEmpty() const; + uint length() const; + void truncate(uint); +%If (- Qt_3_0_0) + void fill(QChar,int = -1); +%End +%If (Qt_3_0_0 -) + QString &fill(QChar,int = -1); +%End + QString copy() const; + + QString arg(int /Constrained/,int = 0,int = 10) const; + QString arg(double /Constrained/,int = 0,char = 'g',int = -1) const; +%If (Qt_3_2_0 -) +// QString arg(Q_LLONG,int = 0,int = 10) const; +// QString arg(Q_ULLONG,int = 0,int = 10) const; +%End + QString arg(long,int = 0,int = 10) const; + QString arg(ulong,int = 0,int = 10) const; +// QString arg(uint,int = 0,int = 10) const; +// QString arg(short,int = 0,int = 10) const; +// QString arg(ushort,int = 0,int = 10) const; + QString arg(char,int = 0) const; + QString arg(QChar,int = 0) const; + QString arg(const QString&,int = 0) const; +%If (Qt_3_2_0 -) + QString arg(const QString &,const QString &) const; + QString arg(const QString &,const QString &,const QString &) const; + QString arg(const QString &,const QString &,const QString &, + const QString &) const; +%End + +// QString &sprintf(const char *,...); + + int find(QChar,int = 0,bool = 1) const; + int find(char,int = 0,bool = 1) const; + int find(const QString &,int = 0,bool = 1) const; + int find(const QRegExp &,int = 0) const; +// int find(const char *,int = 0) const; + int findRev(QChar,int = -1,bool = 1) const; + int findRev(char,int = -1,bool = 1) const; + int findRev(const QString &,int = -1,bool = 1) const; + int findRev(const QRegExp &,int = -1) const; +// int findRev(const char *,int = -1) const; + int contains(QChar,bool = 1) const; + int contains(char,bool = 1) const; +// int contains(const char *,bool = 1) const; + int contains(const QString &,bool = 1) const; + int contains(const QRegExp &) const; + +%If (Qt_3_0_0 -) + enum SectionFlags { + SectionDefault, + SectionSkipEmpty, + SectionIncludeLeadingSep, + SectionIncludeTrailingSep, + SectionCaseInsensitiveSeps + }; + + QString section(QChar,int,int = 0xffffffff,int = SectionDefault) const; +// QString section(char,int,int = 0xffffffff,int = SectionDefault) const; +// QString section(const char *,int,int = 0xffffffff, +// int = SectionDefault) const; + QString section(const QString &,int,int = 0xffffffff, + int = SectionDefault) const; + QString section(const QRegExp &,int,int = 0xffffffff, + int = SectionDefault) const; +%End + + QString left(uint) const; + QString right(uint) const; + QString mid(uint,uint = 0xffffffff) const; + QString leftJustify(uint,QChar = ' ',bool = 0) const; + QString rightJustify(uint,QChar = ' ',bool = 0) const; + QString lower() const; + QString upper() const; + QString stripWhiteSpace() const; + QString simplifyWhiteSpace() const; + + QString &insert(uint,const QString &); +%If (Qt_3_2_0 -) + QString &insert(uint,const QByteArray &); +// QString &insert(uint,const char *); +%End + QString &insert(uint,QChar *,uint); + QString &insert(uint,QChar); + QString &insert(uint,char); + + QString &append(char); +%If (Qt_2_2_0 -) + QString &append(QChar); +%End + QString &append(const QString &); + QString &prepend(char); +%If (Qt_2_2_0 -) + QString &prepend(QChar); +%End + QString &prepend(const QString &); + QString &remove(uint,uint); +%If (Qt_3_1_0 -) + QString &remove(const QString &); +%If (Qt_3_2_0 -) + QString &remove(const QString &,bool); +%End + QString &remove(QChar); + QString &remove(char); + QString &remove(const QRegExp &); +%End + QString &replace(uint,uint,const QString &); + QString &replace(uint,uint,const QChar *,uint); +%If (Qt_3_1_0 -) + QString &replace(uint,uint,QChar); + QString &replace(uint,uint,char); + QString &replace(QChar,const QString &); +%If (Qt_3_2_0 -) + QString &replace(QChar,const QString &,bool); +%End + QString &replace(char,const QString &); +%If (Qt_3_2_0 -) + QString &replace(char,const QString &,bool); +%End + QString &replace(const QString &,const QString &); +%If (Qt_3_2_0 -) + QString &replace(const QString &,const QString &,bool); +%End +%End + QString &replace(const QRegExp &,const QString &); +%If (Qt_3_1_0 -) + QString &replace(QChar,QChar); +%End + + short toShort(bool * = 0,int = 10) const; + ushort toUShort(bool * = 0,int = 10) const; + int toInt(bool * = 0,int = 10) const; + uint toUInt(bool * = 0,int = 10) const; + long toLong(bool * = 0,int = 10) const; + ulong toULong(bool * = 0,int = 10) const; +%If (Qt_3_2_0 -) +// Q_LLONG toLongLong(bool * = 0,int = 10) const; +// Q_ULLONG toULongLong(bool * = 0,int = 10) const; +%End + float toFloat(bool * = 0) const; + double toDouble(bool * = 0) const; + + QString &setNum(int /Constrained/,int = 10); + QString &setNum(double /Constrained/,char = 'g',int = 6); +// QString &setNum(short,int = 10); +// QString &setNum(ushort,int = 10); +// QString &setNum(uint,int = 10); + QString &setNum(long,int = 10); + QString &setNum(ulong,int = 10); +%If (Qt_3_2_0 -) +// QString &setNum(Q_LLONG,int = 10); +// QString &setNum(Q_ULLONG,int = 10); +%End +// QString &setNum(float,char = 'g',int = 6); + + static QString number(int /Constrained/,int = 10); + static QString number(double /Constrained/,char = 'g',int = 6); + static QString number(long,int = 10); + static QString number(ulong,int = 10); +%If (Qt_3_2_0 -) +// static QString number(Q_LLONG,int = 10); +// static QString number(Q_ULLONG,int = 10); +%End +// static QString number(uint,int = 10); + + void setExpand(uint,QChar); + + QString &operator+=(const QString &); +%If (Qt_3_3_0 -) + QString &operator+=(const QByteArray &); +%End + QString &operator+=(QChar); + //QString &operator+=(char); + + QString operator*(int); +%MethodCode + sipRes = new QString(); + + while (a0-- > 0) + *sipRes += *sipCpp; +%End + + QString &operator*=(int); +%MethodCode + QString orig(*sipCpp); + + sipCpp -> truncate(0); + + while (a0-- > 0) + *sipCpp += orig; +%End + + QChar at(uint) const; +// QCharRef at(uint); +// QChar constref(uint) const; +// QChar &ref(uint); +// const QChar *unicode() const; + const char *ascii() const; +%If (Qt_3_1_0 -) + static QString fromAscii(const char *,int = -1); +%End + const char *latin1() const; + static QString fromLatin1(const char *,int = -1); + QCString utf8() const; + static QString fromUtf8(const char *,int = -1); + QCString local8Bit() const; + static QString fromLocal8Bit(const char *,int = -1); + +%If (Qt_3_1_0 -) +// static QString fromUcs2(const unsigned short *); +// const unsigned short *ucs2() const; +%End + +%If (Qt_2_1_0 -) +// QString &setUnicode(const QChar *,uint); +// QString &setUnicodeCodes(const ushort *,uint); +%End +%If (Qt_3_1_0 -) + QString &setAscii(const char *,int = -1); +%End +%If (Qt_2_1_0 -) + QString &setLatin1(const char *,int = -1); +%End + + int compare(const QString &) const; + static int compare(const QString &,const QString &); + +%If (Qt_3_0_0 -) + int localeAwareCompare(const QString &) const; + static int localeAwareCompare(const QString &,const QString &); +%End + + void compose(); +%If (- Qt_3_0_0) + QChar::Direction basicDirection(); + QString visual(int = 0,int = -1); +%End +%If (Qt_2_2_0 -) + bool startsWith(const QString &) const; +%End +%If (Qt_3_2_0 -) + bool startsWith(const QString &,bool) const; +%End +%If (Qt_3_0_0 -) + bool endsWith(const QString &) const; +%End +%If (Qt_3_2_0 -) + bool endsWith(const QString &,bool) const; +%End + +%If (Qt_3_0_0 -) + void setLength(uint); +%End + +%If (Qt_3_2_0 -) + uint capacity() const; + void reserve(uint); + void squeeze(); +%End + +%If (Qt_3_0_0 -) + bool simpleText() const; + bool isRightToLeft() const; +%End + + bool operator==(const QString &) const; + bool operator!=(const QString &) const; + bool operator<(const QString &) const; + bool operator<=(const QString &) const; + bool operator>(const QString &) const; + bool operator>=(const QString &) const; + + // Force the numeric interpretation so that str + QString gets handled + // as we want. + const QString operator+(const QString &) /Numeric/; + + QString operator[](int) const; +%MethodCode + int len; + + len = sipCpp -> length(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipRes = new QString(sipCpp -> at(a0)); +%End + + QString operator[](SIP_PYSLICE) const; +%MethodCode +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t len, start, stop, step, slicelength, i; +#else + int len, start, stop, step, slicelength, i; +#endif + + len = sipCpp -> length(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + sipRes = new QString(); + + for (i = 0; i < slicelength; ++i) + { + sipRes -> append(sipCpp -> at(start)); + start += step; + } + } +%End + + int __len__() const; +%MethodCode + sipRes = sipCpp -> length(); +%End + + int __contains__(const QString &) const; +%MethodCode + sipRes = (sipCpp -> contains(*a0) > 0); +%End + + SIP_PYOBJECT __unicode__(); +%MethodCode +#if PY_VERSION_HEX >= 0x01060000 + sipRes = QStringToPyUnicode(sipCpp); +#else + Py_INCREF(Py_None); + sipRes = Py_None; +#endif +%End + + SIP_PYOBJECT __str__(); +%MethodCode +#if PY_VERSION_HEX >= 0x01060000 + sipRes = QStringToPyUnicode(sipCpp); +#else + const char *s; + + Py_BEGIN_ALLOW_THREADS + s = *sipCpp; + Py_END_ALLOW_THREADS + + if (s == NULL) + s = ""; + + sipRes = PyString_FromString(s); +#endif +%End + +%TypeCode +#include <qtextcodec.h> + +#if PY_VERSION_HEX >= 0x01060000 +// Convenience function for converting a QString to a Python Unicode object. +static PyObject *QStringToPyUnicode(QString *qs) +{ + PyObject *uobj; + + if ((uobj = PyUnicode_FromUnicode(NULL,qs -> length())) == NULL) + return NULL; + + Py_UNICODE *pyu = PyUnicode_AS_UNICODE(uobj); + + for (uint i = 0; i < qs -> length(); ++i) + *pyu++ = (qs -> at(i)).unicode(); + + return uobj; +} +#endif + +// Convenience function for converting a Python unicode or string object to a +// QString on the heap. +static QString *PyUnicodeStringToQString(PyObject *py) +{ +#if PY_VERSION_HEX >= 0x01060000 + if (PyUnicode_Check(py)) + { + QString *qs = new QString; + +#if defined(Py_UNICODE_WIDE) + PY_UNICODE_TYPE *ucode = PyUnicode_AS_UNICODE(py); + int len = PyUnicode_GET_SIZE(py); + + for (int i = 0; i < len; ++i) + qs->ref(i) = (uint)ucode[i]; +#else + qs -> setUnicodeCodes((ushort *)PyUnicode_AS_UNICODE(py),PyUnicode_GET_SIZE(py)); +#endif + + return qs; + } +#endif + + if (PyString_Check(py)) + return new QString(PyString_AS_STRING(py)); + + return 0; +} +%End + +%ConvertToTypeCode + // Allow a Python string (or a unicode string) whenever a QString is + // expected. + + if (sipIsErr == NULL) + return (PyString_Check(sipPy) || +#if PY_VERSION_HEX >= 0x01060000 + PyUnicode_Check(sipPy) || +#endif + sipCanConvertToInstance(sipPy,sipClass_QString,SIP_NO_CONVERTORS)); + + *sipCppPtr = PyUnicodeStringToQString(sipPy); + + if (*sipCppPtr) + return sipGetState(sipTransferObj); + + *sipCppPtr = reinterpret_cast<QString *>(sipConvertToInstance(sipPy,sipClass_QString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End + +%BIGetReadBufferCode + if (sipSegment != 0) + { + PyErr_SetString(PyExc_SystemError, "accessing non-existent QString segment"); + sipRes = -1; + } + else + { + *sipPtrPtr = (void *)sipCpp->ucs2(); + sipRes = sipCpp->length() * sizeof (ushort); + } +%End + +%BIGetSegCountCode + if (sipLenPtr) + *sipLenPtr = sipCpp->length() * sizeof (ushort); + + sipRes = 1; +%End + +%BIGetCharBufferCode + if (sipSegment != 0) + { + PyErr_SetString(PyExc_SystemError, "accessing non-existent QString segment"); + sipRes = -1; + } + else + { + static QTextCodec *codec = 0; + static bool check_codec = TRUE; + + // For the first time only, try and find a Qt codec that + // corresponds to the default Python codec. If one wasn't + // found then fall back to ASCII (which is actually the codec + // returned by QTextCodec::codecForCStrings()). + if (check_codec) + { + codec = QTextCodec::codecForName(PyUnicode_GetDefaultEncoding()); + check_codec = FALSE; + } + + if (codec) + { + // A Python string is the most convenient method to + // save the encoded version on the heap. + PyObject *encobj = ((sipWrapper *)sipSelf)->user; + QCString enc; + + Py_XDECREF(encobj); + + enc = codec->fromUnicode(*sipCpp); + + if ((encobj = PyString_FromString(enc.data())) != NULL) + { + *sipPtrPtr = (void *)PyString_AS_STRING(encobj); + sipRes = PyString_GET_SIZE(encobj); + + ((sipWrapper *)sipSelf)->user = encobj; + } + else + sipRes = -1; + } + else + { + const char *asc = sipCpp->ascii(); + + *sipPtrPtr = (void *)asc; + sipRes = qstrlen(asc); + } + } +%End +}; + +%End + + +%If (- Qt_2_00) + +class QString : QByteArray +{ +%TypeHeaderCode +#include <qstring.h> +%End + +public: + QString(); + QString(int); + QString(const QString &); + QString(const char *); + QString(const char *,uint); + + bool isNull() const; + bool isEmpty() const; + uint length() const; + bool resize(uint); + bool truncate(uint); + bool fill(char,int = -1); + QString copy() const; +// QString &sprintf(const char *,...); + int find(char,int = 0,bool = 1) const; + int find(const char *,int = 0,bool = 1) const; + int find(const QRegExp &,int = 0) const; + int findRev(char,int = -1,bool = 1) const; + int findRev(const char *,int = -1,bool = 1) const; + int findRev(const QRegExp &,int = -1) const; + int contains(char,bool = 1) const; + int contains(const char *,bool = 1) const; + int contains(const QRegExp &) const; + QString left(uint) const; + QString right(uint) const; + QString mid(uint,uint) const; + QString leftJustify(uint,char = ' ',bool = 0) const; + QString rightJustify(uint,char = ' ',bool = 0) const; + QString lower() const; + QString upper() const; + QString stripWhiteSpace() const; + QString simplifyWhiteSpace() const; + QString &insert(uint,const char *); + QString &insert(uint,char); + QString &append(const char *); + QString &prepend(const char *); + QString &remove(uint,uint); + QString &replace(uint,uint,const char *); + QString &replace(const QRegExp &,const char *); + + short toShort(bool * = 0) const; + ushort toUShort(bool * = 0) const; + int toInt(bool * = 0) const; + uint toUInt(bool * = 0) const; + long toLong(bool * = 0) const; + ulong toULong(bool * = 0) const; + float toFloat(bool * = 0) const; + double toDouble(bool * = 0) const; + + QString &setStr(const char *); +// QString &setNum(short); +// QString &setNum(ushort); + QString &setNum(int /Constrained/); +// QString &setNum(uint); +// QString &setNum(long); +// QString &setNum(ulong); +// QString &setNum(float,char = 'g',int = 6); + QString &setNum(double,char = 'g',int = 6); + bool setExpand(uint,char); + + SIP_PYOBJECT __str__(); +%MethodCode + const char *s; + + Py_BEGIN_ALLOW_THREADS + s = *sipCpp; + Py_END_ALLOW_THREADS + + if (s == NULL) + s = ""; + + sipRes = PyString_FromString(s); +%End + +%ConvertToTypeCode + // Allow a Python string whenever a QString is expected. + + if (sipIsErr == NULL) + return (PyString_Check(sipPy) || + sipCanConvertToInstance(sipPy,sipClass_QString,SIP_NO_CONVERTORS)); + + if (PyString_Check(sipPy)) + { + *sipCppPtr = new QString(PyString_AS_STRING(sipPy)); + + return sipGetState(sipTransferObj); + } + + *sipCppPtr = reinterpret_cast<QString *>(sipConvertToInstance(sipPy,sipClass_QString,sipTransferObj,SIP_NO_CONVERTORS,0,sipIsErr)); + + return 0; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qstringlist.sip b/python/pyqt/sip/qt/qstringlist.sip new file mode 100644 index 00000000..d95034c4 --- /dev/null +++ b/python/pyqt/sip/qt/qstringlist.sip @@ -0,0 +1,247 @@ +// This is the SIP interface definition for QStringList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStringList (Qt v2+)</Title> +<Para> +The Python <Literal>len</Literal>, <Literal>[]</Literal> (for both reading and +writing slices and individual elements), <Literal>del</Literal> (for deleting +slices and individual elements), <Literal>+</Literal>, <Literal>+=</Literal>, +<Literal>*</Literal>, <Literal>*=</Literal>, <Literal>==</Literal>, +<Literal>!=</Literal> and <Literal>in</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>append</Function></FuncDef> + <ParamDef>const QString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> + +<FuncSynopsis> + <FuncDef>Iterator <Function>prepend</Function></FuncDef> + <ParamDef>const QString &<Parameter>x</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This does not return a value. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QStringList +{ +%TypeHeaderCode +#include <qstringlist.h> +%End + +public: + QStringList(); + QStringList(const QStringList &); + QStringList(const QString &); + + void sort(); +%If (Qt_2_1_0 -) + static QStringList fromStrList(const QStrList &); + static QStringList split(const QString &,const QString &,bool = 0); + static QStringList split(const QChar &,const QString &,bool = 0); + static QStringList split(const QRegExp &,const QString &,bool = 0); + QString join(const QString &) const; + QStringList grep(const QString &,bool = 1) const; + QStringList grep(const QRegExp &) const; +%End + +%If (Qt_3_2_0 -) + QStringList &gres(const QString &,const QString &,bool = 1); + QStringList &gres(const QRegExp &,const QString &); +%End + + // These are actually in QValueList, which isn't implemented so + // pretend they are here. + + bool isEmpty() const; + void append(const QString &); + void prepend(const QString &); + void remove(const QString &); + const QString &first() const; + const QString &last() const; + int findIndex(const QString &) const; + uint contains(const QString &) const; + uint count() const; + void clear(); + + int __len__(); +%MethodCode + sipRes = sipCpp -> count(); +%End + + void __setitem__(int,const QString &); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + (*sipCpp)[a0] = *a1; +%End + + void __setitem__(SIP_PYSLICE,const QStringList &); +%MethodCode +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t len, start, stop, step, slicelength, i; +#else + int len, start, stop, step, slicelength, i; +#endif + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + int vlen = a1 -> count(); + + if (vlen != slicelength) + { + sipBadLengthForSlice(vlen,slicelength); + sipIsErr = 1; + } + else + { + QStringList::ConstIterator it = a1 -> begin(); + + for (i = 0; i < slicelength; ++i) + { + (*sipCpp)[start] = *it; + start += step; + ++it; + } + } + } +%End + + void __delitem__(int); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipCpp -> remove(sipCpp -> at(a0)); +%End + + void __delitem__(SIP_PYSLICE); +%MethodCode +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t len, start, stop, step, slicelength, i; +#else + int len, start, stop, step, slicelength, i; +#endif + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + for (i = 0; i < slicelength; ++i) + { + sipCpp -> remove(sipCpp -> at(start)); + start += step - 1; + } +%End + + QString operator[](int); +%MethodCode + int len; + + len = sipCpp -> count(); + + if ((a0 = (int)sipConvertFromSequenceIndex(a0,len)) < 0) + sipIsErr = 1; + else + sipRes = new QString((*sipCpp)[a0]); +%End + + QStringList operator[](SIP_PYSLICE); +%MethodCode +#if PY_VERSION_HEX >= 0x02050000 + Py_ssize_t len, start, stop, step, slicelength, i; +#else + int len, start, stop, step, slicelength, i; +#endif + + len = sipCpp -> count(); + + if (sipConvertFromSliceObject(a0,len,&start,&stop,&step,&slicelength) < 0) + sipIsErr = 1; + else + { + sipRes = new QStringList(); + + for (i = 0; i < slicelength; ++i) + { + (*sipRes) += (*sipCpp)[start]; + start += step; + } + } +%End + + int __contains__(const QString &); +%MethodCode + sipRes = (sipCpp -> findIndex(*a0) >= 0); +%End + + QStringList operator+(const QStringList &); + QStringList &operator+=(const QStringList &); + + QStringList &operator+=(const QString &); + + QStringList operator*(int); +%MethodCode + sipRes = new QStringList(); + + while (a0-- > 0) + *sipRes += *sipCpp; +%End + + QStringList &operator*=(int); +%MethodCode + QStringList orig(*sipCpp); + + sipCpp -> clear(); + + while (a0-- > 0) + *sipCpp += orig; +%End + + bool operator==(const QStringList &); + bool operator!=(const QStringList &); +}; + +%End diff --git a/python/pyqt/sip/qt/qstrlist.sip b/python/pyqt/sip/qt/qstrlist.sip new file mode 100644 index 00000000..189e1343 --- /dev/null +++ b/python/pyqt/sip/qt/qstrlist.sip @@ -0,0 +1,100 @@ +// This is the SIP interface definition for QStrList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStrList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QStrList</Literal> is the +return type of a function or the type of an argument, a Python list of strings +is used instead. +</Para> +</Sect2> +%End + + +%MappedType QStrList +{ +%TypeHeaderCode +#include <qstrlist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of strings. + + char *s; + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (s = sipCpp -> first(); s != NULL; s = sipCpp -> next()) + { + PyObject *ps; + + if ((ps = PyString_FromString(s)) == NULL || PyList_SetItem(l,i,ps) < 0) + { + Py_XDECREF(ps); + Py_DECREF(l); + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of strings to a QStrList on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QStrList *qsl = new QStrList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + char *s; + + if ((s = PyString_AsString(PyList_GET_ITEM(sipPy,i))) == NULL) + { + *sipIsErr = 1; + delete qsl; + + return 0; + } + + qsl -> append(s); + } + + *sipCppPtr = qsl; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/python/pyqt/sip/qt/qstyle.sip b/python/pyqt/sip/qt/qstyle.sip new file mode 100644 index 00000000..23e116c0 --- /dev/null +++ b/python/pyqt/sip/qt/qstyle.sip @@ -0,0 +1,862 @@ +// This is the SIP interface definition for QStyle and QStyleOption. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QScrollBar *<Parameter>b</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Thus takes only the <Literal>b</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>virtual void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> + +<Sect2><Title>QStyleOption (Qt v3+)</Title> +<Para> +<Literal>QStyleOption</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QStyleOption +{ +%TypeHeaderCode +#include <qstyle.h> +%End + +public: + enum StyleOptionDefault { + Default + }; + + QStyleOption(StyleOptionDefault = Default); + +%If (Qt_3_2_0 -) + QStyleOption(int); +%End + QStyleOption(int,int); + QStyleOption(int,int,int,int); + QStyleOption(QMenuItem *); + QStyleOption(QMenuItem *,int); + QStyleOption(QMenuItem *,int,int); + QStyleOption(const QColor &); + QStyleOption(QTab *); + QStyleOption(QListViewItem *); +%If (Qt_3_1_0 -) + QStyleOption(QCheckListItem *); +%End + QStyleOption(Qt::ArrowType); +%If (Qt_3_1_0 -) + QStyleOption(const QRect &); + QStyleOption(QWidget *); +%End + + bool isDefault() const; + +%If (Qt_3_3_0 -) + int day() const; +%End + + int lineWidth() const; + int midLineWidth() const; + int frameShape() const; + int frameShadow() const; + +%If (Qt_3_2_0 -) + int headerSection() const; +%End + QMenuItem* menuItem() const; + int maxIconWidth() const; + int tabWidth() const; + + const QColor& color() const; + + QTab *tab() const; + +%If (Qt_3_1_0 -) + QCheckListItem *checkListItem() const; +%End + QListViewItem *listViewItem() const; + + Qt::ArrowType arrowType() const; +%If (Qt_3_1_0 -) + QRect rect() const; + QWidget *widget() const; +%End +}; + +%End + + +%If (Qt_3_0_0 -) +// Not yet defined in Qt v3Beta5. +class QStyleHintReturn; +%End + + +%If (Qt_2_00 -) + +class QStyle : QObject +{ +%TypeHeaderCode +#include <qstyle.h> +%End + +public: +%If (Qt_3_0_0 -) + QStyle(); +%End + +%If (- Qt_3_0_0) + GUIStyle guiStyle() const; +%End + + virtual void polish(QWidget *); + virtual void unPolish(QWidget *); + + virtual void polish(QApplication *); + virtual void unPolish(QApplication *); + + virtual void polish(QPalette &); + +%If (Qt_3_0_0 -) + virtual void polishPopupMenu(QPopupMenu *) = 0; +%End + +%If (- Qt_3_0_0) + virtual QRect itemRect(QPainter *,int,int,int,int,int,bool, + const QPixmap *,const QString &,int = -1); + + virtual void drawItem(QPainter *,int,int,int,int,int, + const QColorGroup &,bool,const QPixmap *, + const QString &,int = -1,const QColor * = 0); +%End +%If (Qt_3_0_0 -) + virtual QRect itemRect(QPainter *,const QRect &,int,bool, + const QPixmap *,const QString &,int = -1) const; + + virtual void drawItem(QPainter *,const QRect &,int,const QColorGroup &, + bool,const QPixmap *,const QString &,int = -1, + const QColor * = 0) const; +%End + +%If (- Qt_3_0_0) + virtual void drawSeparator(QPainter *,int,int,int,int, + const QColorGroup &,bool = 1,int = 1, + int = 0); + virtual void drawRect(QPainter *,int,int,int,int,const QColor &, + int = 1,const QBrush * = 0); + virtual void drawRectStrong(QPainter *,int,int,int,int, + const QColorGroup &,bool = 0,int = 1, + int = 0,const QBrush * = 0); + virtual void drawButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0) = 0; + virtual QRect buttonRect(int,int,int,int); + virtual void drawButtonMask(QPainter *,int,int,int,int); + virtual void drawBevelButton(QPainter *,int,int,int,int, + const QColorGroup &,bool = 0, + const QBrush * = 0) = 0; +%If (Qt_2_1_0 -) + QRect bevelButtonRect(int,int,int,int); +%End + virtual void drawToolButton(QPainter *,int,int,int,int, + const QColorGroup &,bool = 0, + const QBrush * = 0); +%If (Qt_2_1_0 -) + void drawToolButton(QToolButton *,QPainter *); + QRect toolButtonRect(int,int,int,int); +%End + virtual void drawPanel(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,int = 1,const QBrush * = 0); + virtual void drawPopupPanel(QPainter *,int,int,int,int, + const QColorGroup &,int = 2, + const QBrush * = 0); + virtual void drawArrow(QPainter *,Qt::ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0) = 0; + virtual QSize exclusiveIndicatorSize() const = 0; + virtual void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0, + bool = 1) = 0; + virtual void drawExclusiveIndicatorMask(QPainter *,int,int,int,int, + bool); + virtual QSize indicatorSize() const = 0; + virtual void drawIndicator(QPainter *,int,int,int,int, + const QColorGroup &,int,bool = 0, + bool = 1) = 0; + virtual void drawIndicatorMask(QPainter *,int,int,int,int,int); + virtual void drawFocusRect(QPainter *,const QRect &,const QColorGroup &, + const QColor * = 0,bool = 0) = 0; + virtual void drawComboButton(QPainter *,int,int,int,int, + const QColorGroup &,bool = 0,bool = 0, + bool = 1,const QBrush * = 0) = 0; + virtual QRect comboButtonRect(int,int,int,int) = 0; + virtual QRect comboButtonFocusRect(int,int,int,int) = 0; + virtual void drawComboButtonMask(QPainter *,int,int,int,int) = 0; + virtual void drawPushButton(QPushButton *,QPainter *) = 0; + virtual void drawPushButtonLabel(QPushButton *,QPainter *) = 0; + +%If (Qt_2_1_0 -) + QRect pushButtonContentsRect(QPushButton *); + int menuButtonIndicatorWidth(int); +%End + + virtual void getButtonShift(int &,int &) = 0; + virtual int defaultFrameWidth() const = 0; + virtual void tabbarMetrics(const QTabBar *,int &,int &,int &) = 0; + virtual void drawTab(QPainter *,const QTabBar *,QTab *,bool) = 0; + virtual void drawTabMask(QPainter *,const QTabBar* ,QTab* ,bool) = 0; + + enum ScrollControl + { + AddLine = 0x1, + SubLine = 0x2, + AddPage = 0x4, + SubPage = 0x8, + First = 0x10, + Last = 0x20, + Slider = 0x40, + NoScroll = 0x80 + }; + + virtual void scrollBarMetrics(const QScrollBar *,int &,int &,int &, + int &) = 0; + virtual void drawScrollBarControls(QPainter *,const QScrollBar *,int, + uint,uint) = 0; + virtual ScrollControl scrollBarPointOver(const QScrollBar *,int, + const QPoint &) = 0; + virtual int sliderLength() const = 0; + virtual void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool) = 0; + virtual void drawSliderMask(QPainter *,int,int,int,int,Orientation, + bool,bool) = 0; + virtual void drawSliderGroove(QPainter *,int,int,int,int, + const QColorGroup &,QCOORD, + Orientation) = 0; + virtual void drawSliderGrooveMask(QPainter *,int,int,int,int,QCOORD, + Orientation) = 0; + virtual int maximumSliderDragDistance() const = 0; + virtual int splitterWidth() const = 0; + virtual void drawSplitter(QPainter *,int,int,int,int, + const QColorGroup &,Orientation) = 0; + virtual void drawCheckMark(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool) = 0; + virtual void polishPopupMenu(QPopupMenu *) = 0; + virtual int extraPopupMenuItemWidth(bool,int,QMenuItem *, + const QFontMetrics &) = 0; + virtual int popupSubmenuIndicatorWidth(const QFontMetrics &) = 0; + virtual int popupMenuItemHeight(bool,QMenuItem *, + const QFontMetrics &) = 0; + virtual void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool, bool,int,int,int, + int) = 0; +%If (Qt_2_2_0 -) + virtual void drawMenuBarItem(QPainter *,int,int,int,int,QMenuItem *, + QColorGroup &,bool,bool); +%End +%If (Qt_2_1_0 -) + QSize scrollBarExtent(); + int buttonDefaultIndicatorWidth() const; +%If (Qt_2_2_0 -) + int buttonMargin() const; + int toolBarHandleExtent() const; + int sliderThickness() const; +%End + int toolBarHandleExtend() const; + void drawToolBarHandle(QPainter *,const QRect &,Qt::Orientation,bool, + const QColorGroup &,bool = 0); +%End + +%End + +%If (Qt_3_0_0 -) + enum PrimitiveElement { + PE_ButtonCommand, + PE_ButtonDefault, + PE_ButtonBevel, + PE_ButtonTool, + PE_ButtonDropDown, + + PE_FocusRect, + + PE_ArrowUp, + PE_ArrowDown, + PE_ArrowRight, + PE_ArrowLeft, + + PE_SpinWidgetUp, + PE_SpinWidgetDown, + PE_SpinWidgetPlus, + PE_SpinWidgetMinus, + + PE_Indicator, + PE_IndicatorMask, + PE_ExclusiveIndicator, + PE_ExclusiveIndicatorMask, + + PE_DockWindowHandle, + PE_DockWindowSeparator, + PE_DockWindowResizeHandle, + + PE_Splitter, + + PE_Panel, + PE_PanelPopup, + PE_PanelMenuBar, + PE_PanelDockWindow, + + PE_TabBarBase, + + PE_HeaderSection, + PE_HeaderArrow, + PE_StatusBarSection, + + PE_GroupBoxFrame, + + PE_Separator, + + PE_SizeGrip, + + PE_CheckMark, + + PE_ScrollBarAddLine, + PE_ScrollBarSubLine, + PE_ScrollBarAddPage, + PE_ScrollBarSubPage, + PE_ScrollBarSlider, + PE_ScrollBarFirst, + PE_ScrollBarLast, + + PE_ProgressBarChunk, + +%If (Qt_3_0_1 -) + PE_PanelLineEdit, + PE_PanelTabWidget, + + PE_WindowFrame, +%End +%If (Qt_3_1_0 -) + PE_CheckListController, + PE_CheckListIndicator, + PE_CheckListExclusiveIndicator, + + PE_PanelGroupBox, +%End +%If (Qt_3_0_4 - Qt_3_0_5) + PE_PopupMenuScroller, +%End +%If (Qt_3_3_0 -) + PE_RubberBand, +%End + + PE_CustomBase + }; + + enum StyleFlags { + Style_Default, + Style_Enabled, + Style_Raised, + Style_Sunken, + Style_Off, + Style_NoChange, + Style_On, + Style_Down, + Style_Horizontal, + Style_HasFocus, + Style_Top, + Style_Bottom, + Style_FocusAtBorder, + Style_AutoRaise, + Style_MouseOver, + Style_Up, + Style_Selected, + Style_Active, + Style_ButtonDefault + }; + + typedef uint SFlags; + + virtual void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const = 0; + + enum ControlElement { + CE_PushButton, + CE_PushButtonLabel, + + CE_CheckBox, + CE_CheckBoxLabel, + + CE_RadioButton, + CE_RadioButtonLabel, + + CE_TabBarTab, + CE_TabBarLabel, + + CE_ProgressBarGroove, + CE_ProgressBarContents, + CE_ProgressBarLabel, + + CE_PopupMenuItem, + CE_MenuBarItem, + + CE_ToolButtonLabel, +%If (Qt_3_1_0 -) + CE_MenuBarEmptyArea, +%End +%If (Qt_3_0_5 -) + CE_PopupMenuScroller, +%End +%If (Qt_3_1_0 -) + CE_DockWindowEmptyArea, +%End +%If (Qt_3_2_0 -) + CE_PopupMenuVerticalExtra, + CE_PopupMenuHorizontalExtra, + + CE_ToolBoxTab, + CE_HeaderLabel, +%End + + CE_CustomBase + }; + + virtual void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const = 0; + virtual void drawControlMask(ControlElement,QPainter *,const QWidget *, + const QRect &, + const QStyleOption & = QStyleOption()) const = 0; + + enum SubRect { + SR_PushButtonContents, + SR_PushButtonFocusRect, + + SR_CheckBoxIndicator, + SR_CheckBoxContents, + SR_CheckBoxFocusRect, + + SR_RadioButtonIndicator, + SR_RadioButtonContents, + SR_RadioButtonFocusRect, + + SR_ComboBoxFocusRect, + + SR_SliderFocusRect, + + SR_DockWindowHandleRect, + + SR_ProgressBarGroove, + SR_ProgressBarContents, + SR_ProgressBarLabel, + + SR_ToolButtonContents, + +%If (Qt_3_2_0 -) + SR_DialogButtonAccept, + SR_DialogButtonReject, + SR_DialogButtonApply, + SR_DialogButtonHelp, + SR_DialogButtonAll, + SR_DialogButtonAbort, + SR_DialogButtonIgnore, + SR_DialogButtonRetry, + SR_DialogButtonCustom, + + SR_ToolBoxTabContents, +%End + + SR_CustomBase + }; + + virtual QRect subRect(SubRect,const QWidget *) const = 0; + + enum ComplexControl{ + CC_SpinWidget, + CC_ComboBox, + CC_ScrollBar, + CC_Slider, + CC_ToolButton, + CC_TitleBar, + CC_ListView, + + CC_CustomBase + }; + + enum SubControl { + SC_None, + + SC_ScrollBarAddLine, + SC_ScrollBarSubLine, + SC_ScrollBarAddPage, + SC_ScrollBarSubPage, + SC_ScrollBarFirst, + SC_ScrollBarLast, + SC_ScrollBarSlider, + SC_ScrollBarGroove, + + SC_SpinWidgetUp, + SC_SpinWidgetDown, + SC_SpinWidgetFrame, + SC_SpinWidgetEditField, + SC_SpinWidgetButtonField, + + SC_ComboBoxFrame, + SC_ComboBoxEditField, + SC_ComboBoxArrow, +%If (Qt_3_1_0 -) + SC_ComboBoxListBoxPopup, +%End + + SC_SliderGroove, + SC_SliderHandle, + SC_SliderTickmarks, + + SC_ToolButton, + SC_ToolButtonMenu, + + SC_TitleBarLabel, + SC_TitleBarSysMenu, + SC_TitleBarMinButton, + SC_TitleBarMaxButton, + SC_TitleBarCloseButton, + SC_TitleBarNormalButton, + SC_TitleBarShadeButton, + SC_TitleBarUnshadeButton, + + SC_ListView, + SC_ListViewBranch, + SC_ListViewExpand, + + SC_All + }; + + typedef uint SCFlags; + + virtual void drawComplexControl(ComplexControl,QPainter *, + const QWidget *,const QRect &, + const QColorGroup &, + SFlags = Style_Default, + SCFlags = SC_All,SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const = 0; + virtual void drawComplexControlMask(ComplexControl,QPainter *, + const QWidget *,const QRect &, + const QStyleOption & = QStyleOption()) const = 0; + + virtual QRect querySubControlMetrics(ComplexControl, + const QWidget *,SubControl, + const QStyleOption & = QStyleOption()) const = 0; + virtual SubControl querySubControl(ComplexControl,const QWidget *, + const QPoint &, + const QStyleOption & = QStyleOption()) const = 0; + + enum PixelMetric { + PM_ButtonMargin, + PM_ButtonDefaultIndicator, + PM_MenuButtonIndicator, + PM_ButtonShiftHorizontal, + PM_ButtonShiftVertical, + + PM_DefaultFrameWidth, + PM_SpinBoxFrameWidth, + + PM_MaximumDragDistance, + + PM_ScrollBarExtent, + PM_ScrollBarSliderMin, + + PM_SliderThickness, + PM_SliderControlThickness, + PM_SliderLength, + PM_SliderTickmarkOffset, + PM_SliderSpaceAvailable, + + PM_DockWindowSeparatorExtent, + PM_DockWindowHandleExtent, + PM_DockWindowFrameWidth, + + PM_MenuBarFrameWidth, + + PM_TabBarTabOverlap, + PM_TabBarTabHSpace, + PM_TabBarTabVSpace, + PM_TabBarBaseHeight, + PM_TabBarBaseOverlap, + + PM_ProgressBarChunkWidth, + + PM_SplitterWidth, + PM_TitleBarHeight, + + PM_IndicatorWidth, + PM_IndicatorHeight, + PM_ExclusiveIndicatorWidth, + PM_ExclusiveIndicatorHeight, +%If (Qt_3_0_4 -) + PM_PopupMenuScrollerHeight, +%End +%If (Qt_3_1_0 -) + PM_CheckListButtonSize, +%End +%If (Qt_3_2_0 -) + PM_CheckListControllerSize, + PM_PopupMenuFrameHorizontalExtra, + PM_PopupMenuFrameVerticalExtra, + + PM_DialogButtonsSeparator, + PM_DialogButtonsButtonWidth, + PM_DialogButtonsButtonHeight, + + PM_MDIFrameWidth, + PM_MDIMinimizedWidth, + PM_HeaderMargin, + PM_HeaderMarkSize, + PM_HeaderGripMargin, + PM_TabBarTabShiftHorizontal, + PM_TabBarTabShiftVertical, +%End +%If (Qt_3_3_0 -) + PM_TabBarScrollButtonWidth, + + PM_MenuBarItemSpacing, + PM_ToolBarItemSpacing, +%End + + PM_CustomBase + }; + + virtual int pixelMetric(PixelMetric,const QWidget * = 0) const = 0; + + enum ContentsType { + CT_PushButton, + CT_CheckBox, + CT_RadioButton, + CT_ToolButton, + CT_ComboBox, + CT_Splitter, + CT_DockWindow, + CT_ProgressBar, + CT_PopupMenuItem, +%If (Qt_3_1_0 -) + CT_TabBarTab, + CT_Slider, + CT_Header, + CT_LineEdit, + CT_MenuBar, + CT_SpinBox, +%End +%If (Qt_3_2_0 -) + CT_SizeGrip, + CT_TabWidget, + CT_DialogButtons, +%End + + CT_CustomBase + }; + + virtual QSize sizeFromContents(ContentsType,const QWidget *, + const QSize &, + const QStyleOption & = QStyleOption()) const = 0; + + enum StyleHint { + SH_EtchDisabledText, + + SH_GUIStyle, + + SH_ScrollBar_BackgroundMode, + SH_ScrollBar_MiddleClickAbsolutePosition, + SH_ScrollBar_ScrollWhenPointerLeavesControl, + + SH_TabBar_SelectMouseType, + + SH_TabBar_Alignment, + + SH_Header_ArrowAlignment, + + SH_Slider_SnapToValue, + + SH_Slider_SloppyKeyEvents, + + SH_ProgressDialog_CenterCancelButton, + + SH_ProgressDialog_TextLabelAlignment, + + SH_PrintDialog_RightAlignButtons, + + SH_MainWindow_SpaceBelowMenuBar, + + SH_FontDialog_SelectAssociatedText, + + SH_PopupMenu_AllowActiveAndDisabled, + + SH_PopupMenu_SpaceActivatesItem, + + SH_PopupMenu_SubMenuPopupDelay, + + SH_ScrollView_FrameOnlyAroundContents, + + SH_MenuBar_AltKeyNavigation, + + SH_ComboBox_ListMouseTracking, + + SH_PopupMenu_MouseTracking, + + SH_MenuBar_MouseTracking, + + SH_ItemView_ChangeHighlightOnFocus, + + SH_Widget_ShareActivation, + + SH_Workspace_FillSpaceOnMaximize, + + SH_ComboBox_Popup, + +%If (Qt_3_0_1 -) + SH_TitleBar_NoBorder, + + SH_ScrollBar_StopMouseOverSlider, +%End + +%If (Qt_3_0_2 -) + SH_BlinkCursorWhenTextSelected, + + SH_RichText_FullWidthSelection, +%End + +%If (Qt_3_0_4 -) + SH_PopupMenu_Scrollable, +%End + +%If (Qt_3_1_0 -) + SH_GroupBox_TextLabelVerticalAlignment, + + SH_GroupBox_TextLabelColor, + + SH_PopupMenu_SloppySubMenus, +%End + +%If (Qt_3_2_0 -) + SH_Table_GridLineColor, + + SH_LineEdit_PasswordCharacter, + + SH_DialogButtons_DefaultButton, + + SH_ToolBox_SelectedPageTitleBold, + + SH_TabBar_PreferNoArrows, + + SH_ScrollBar_LeftClickAbsolutePosition, + + SH_ListViewExpand_SelectMouseType, +%End + +%If (Qt_3_3_0 -) + SH_UnderlineAccelerator, + + SH_ToolButton_Uses3D, +%End + + SH_CustomBase + }; + + virtual int styleHint(StyleHint,const QWidget * = 0, + const QStyleOption & = QStyleOption(), + QStyleHintReturn * = 0) const = 0; + + enum StylePixmap { + SP_TitleBarMinButton, + SP_TitleBarMaxButton, + SP_TitleBarCloseButton, + SP_TitleBarNormalButton, + SP_TitleBarShadeButton, + SP_TitleBarUnshadeButton, + SP_DockWindowCloseButton, + SP_MessageBoxInformation, + SP_MessageBoxWarning, + SP_MessageBoxCritical, +%If (Qt_3_2_0 -) + SP_MessageBoxQuestion, +%End + + SP_CustomBase + }; + + virtual QPixmap stylePixmap(StylePixmap,const QWidget * = 0, + const QStyleOption & = QStyleOption()) const = 0; + + static QRect visualRect(const QRect &,const QWidget *); + + static QRect visualRect(const QRect &,const QRect &); +%End + +protected: +%If (Qt_2_1_0 - Qt_3_0_0) + void setScrollBarExtent(int,int = -1); + void setButtonDefaultIndicatorWidth(int); +%End + +private: +%If (- Qt_3_0_0) + QStyle(); + QStyle(GUIStyle); +%End +%If (Qt_2_1_0 -) + QStyle(const QStyle &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qstylefactory.sip b/python/pyqt/sip/qt/qstylefactory.sip new file mode 100644 index 00000000..9249c625 --- /dev/null +++ b/python/pyqt/sip/qt/qstylefactory.sip @@ -0,0 +1,45 @@ +// This is the SIP interface definition for QStyleFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStyleFactory (Qt v3+)</Title> +<Para> +<Literal>QStyleFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QStyleFactory +{ +%TypeHeaderCode +#include <qstylefactory.h> +%End + +public: + static QStringList keys(); + static QStyle *create(const QString &) /Factory/; +}; + +%End diff --git a/python/pyqt/sip/qt/qstylesheet.sip b/python/pyqt/sip/qt/qstylesheet.sip new file mode 100644 index 00000000..c248e568 --- /dev/null +++ b/python/pyqt/sip/qt/qstylesheet.sip @@ -0,0 +1,239 @@ +// This is the SIP interface definition for QStyleSheet and QStyleSheetItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QStyleSheet (Qt v2+)</Title> +<Para> +<Literal>QStyleSheet</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QStyleSheetItem (Qt v2+)</Title> +<Para> +<Literal>QStyleSheetItem</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QStyleSheetItem : Qt +{ +%TypeHeaderCode +#include <qstylesheet.h> +%End + +public: + QStyleSheetItem(QStyleSheet * /TransferThis/,const QString &); + + QString name() const; + + QStyleSheet *styleSheet(); +// const QStyleSheet *styleSheet() const; + + enum AdditionalStyleValues { + Undefined + }; + + enum DisplayMode { + DisplayBlock, + DisplayInline, + DisplayListItem, + DisplayNone + }; + + DisplayMode displayMode() const; + void setDisplayMode(DisplayMode); + + int alignment() const; + void setAlignment(int); + +%If (Qt_3_0_0 -) + enum VerticalAlignment { + VAlignBaseline, + VAlignSub, + VAlignSuper + }; + + VerticalAlignment verticalAlignment() const; + void setVerticalAlignment(VerticalAlignment); +%End + + int fontWeight() const; + void setFontWeight(int); + + int logicalFontSize() const; + void setLogicalFontSize(int); + + int logicalFontSizeStep() const; + void setLogicalFontSizeStep(int); + + int fontSize() const; + void setFontSize(int); + + QString fontFamily() const; + void setFontFamily(const QString &); + + int numberOfColumns() const; + void setNumberOfColumns(int); + + QColor color() const; + void setColor(const QColor &); + + bool fontItalic() const; + void setFontItalic(bool); + bool definesFontItalic() const; + + bool fontUnderline() const; + void setFontUnderline(bool); + bool definesFontUnderline() const; + +%If (Qt_3_0_5 -) + bool fontStrikeOut() const; + void setFontStrikeOut(bool); + bool definesFontStrikeOut() const; +%End + + bool isAnchor() const; + void setAnchor(bool); + +%If (- Qt_2_1_0) + enum WhiteSpaceMode { + WhiteSpaceNormal, + WhiteSpacePre + }; +%End +%If (Qt_2_1_0 -) + enum WhiteSpaceMode { + WhiteSpaceNormal, + WhiteSpacePre, + WhiteSpaceNoWrap + }; +%End + + WhiteSpaceMode whiteSpaceMode() const; + void setWhiteSpaceMode(WhiteSpaceMode); + +%If (- Qt_3_0_0) + enum Margin { + MarginLeft, + MarginRight, + MarginTop, + MarginBottom, + MarginAll, + MarginVertical, + MarginHorizontal + }; +%End +%If (Qt_3_0_0 -) + enum Margin { + MarginLeft, + MarginRight, + MarginTop, + MarginBottom, + MarginFirstLine, + MarginAll, + MarginVertical, + MarginHorizontal + }; +%End + + int margin(Margin) const; + void setMargin(Margin,int); + + enum ListStyle { + ListDisc, + ListCircle, + ListSquare, + ListDecimal, + ListLowerAlpha, + ListUpperAlpha + }; + + ListStyle listStyle() const; + void setListStyle(ListStyle); + + QString contexts() const; + void setContexts(const QString &); + bool allowedInContext(const QStyleSheetItem *) const; + + bool selfNesting() const; + void setSelfNesting(bool); + +%If (Qt_3_0_0 -) + void setLineSpacing(int); + int lineSpacing() const; +%End +}; + + +class QStyleSheet : QObject +{ +%TypeHeaderCode +#include <qstylesheet.h> +%End + +public: + QStyleSheet(QObject * /TransferThis/ = 0,const char * = 0); + + static QStyleSheet *defaultSheet(); + static void setDefaultSheet(QStyleSheet *); + + QStyleSheetItem *item(const QString &); +// const QStyleSheetItem *item(const QString &) const; + + void insert(QStyleSheetItem *); + +%If (- Qt_3_0_0) +// virtual QTextNode *tag(const QString &,const QMap<QString,QString> &, +// const QString &,const QMimeSourceFactory &, +// bool = 0) const; +%End +%If (Qt_3_0_0 -) +// virtual QTextCustomItem *tag(const QString &, +// const QMap<QString,QString> &, +// const QString &, +// const QMimeSourceFactory &,bool, +// QTextDocument *) const; +%End + +%If (Qt_3_0_0 -) + static QString escape(const QString &); + static QString convertFromPlainText(const QString &, + QStyleSheetItem::WhiteSpaceMode = QStyleSheetItem::WhiteSpacePre); +%End +%If (- Qt_3_0_0) + static QString convertFromPlainText(const QString &); +%End + static bool mightBeRichText(const QString &); + + virtual void scaleFont(QFont &,int) const; + virtual void error(const QString &) const; + +private: +%If (Qt_3_1_0 -) + QStyleSheet(const QStyleSheet &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qsyntaxhighlighter.sip b/python/pyqt/sip/qt/qsyntaxhighlighter.sip new file mode 100644 index 00000000..13d24e8d --- /dev/null +++ b/python/pyqt/sip/qt/qsyntaxhighlighter.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QSyntaxHighlighter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSyntaxHighlighter (Qt v3.1+)</Title> +<Para> +<Literal>QSyntaxHighlighter</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_1_0 -) + +class QSyntaxHighlighter : Qt +{ +%TypeHeaderCode +#include <qsyntaxhighlighter.h> +%End + +public: + QSyntaxHighlighter(QTextEdit * /TransferThis/); + + virtual int highlightParagraph(const QString &,int) = 0; + + void setFormat(int,int,const QFont &,const QColor &); + void setFormat(int,int,const QColor &); + void setFormat(int,int,const QFont &); + QTextEdit *textEdit() const; + + void rehighlight(); + +%If (Qt_3_2_0 -) + int currentParagraph() const; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtabbar.sip b/python/pyqt/sip/qt/qtabbar.sip new file mode 100644 index 00000000..dede1bd0 --- /dev/null +++ b/python/pyqt/sip/qt/qtabbar.sip @@ -0,0 +1,264 @@ +// This is the SIP interface definition for QTab and QTabBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTab</Title> +<Para> +<Literal>QTab</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTabBar</Title> +<FuncSynopsis> + <FuncDef>QList<QTab> <Function>tabList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This returns a list of <Literal>QTab</Literal> instances. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QTab : Qt +{ +%TypeHeaderCode +#include <qtabbar.h> +%End + +public: + QTab(); + QTab(const QString &); + QTab(const QIconSet &,const QString & = QString::null); + virtual ~QTab(); + + void setText(const QString &); + QString text() const; + void setIconSet(const QIconSet &); + QIconSet *iconSet() const; + void setRect(const QRect &); + QRect rect() const; + void setEnabled(bool); + bool isEnabled() const; + void setIdentifier(int); + int identifier() const; +}; + +%End + +%If (- Qt_3_0_0) + +class QTab +{ +%TypeHeaderCode +#include <qtabbar.h> +%End + +public: + QTab(); +%If (Qt_2_1_0 -) + QTab(const QString &); + QTab(const QIconSet &,const QString & = QString::null); +%End + virtual ~QTab(); + + QString label; + QRect r; + bool enabled; + int id; + QIconSet *iconset; +}; + +%End + + +class QTabBar : QWidget +{ +%TypeHeaderCode +#include <qtabbar.h> +%End + +public: + QTabBar(QWidget * /TransferThis/ = 0,const char * = 0); + + enum Shape { + RoundedAbove, + RoundedBelow, + TriangularAbove, + TriangularBelow + }; + + Shape shape() const; +%If (- Qt_2_00) + void setShape(Shape); +%End +%If (Qt_2_00 -) + virtual void setShape(Shape); +%End + + void show(); + + virtual int addTab(QTab * /Transfer/); +%If (Qt_2_00 -) + virtual int insertTab(QTab * /Transfer/,int = -1); + virtual void removeTab(QTab *); +%End + +%If (- Qt_2_00) + void setTabEnabled(int,bool); +%End +%If (Qt_2_00 -) + virtual void setTabEnabled(int,bool); +%End + bool isTabEnabled(int) const; + + QSize sizeHint() const; +%If (Qt_2_2_0 -) + QSize minimumSizeHint() const; +%End +%If (Qt_2_00 -) + QSizePolicy sizePolicy() const; +%End + + int currentTab() const; + int keyboardFocusTab() const; + +%If (- Qt_3_0_0) + QTab *tab(int); +%End +%If (Qt_3_0_0 -) + QTab *tab(int) const; + QTab *tabAt(int) const; + int indexOf(int) const; +%End +%If (Qt_2_2_0 -) + int count() const; +%End + +%If (Qt_2_00 -) + virtual void layoutTabs(); +%End +%If (Qt_3_0_0 -) + virtual QTab *selectTab(const QPoint &) const; + + void removeToolTip(int); + void setToolTip(int,const QString &); + QString toolTip(int) const; +%End + +public slots: +%If (- Qt_2_00) + void setCurrentTab(int); + void setCurrentTab(QTab *); +%End +%If (Qt_2_00 -) + virtual void setCurrentTab(int); + virtual void setCurrentTab(QTab *); +%End + +signals: + void selected(int); +%If (Qt_3_2_0 -) + void layoutChanged(); +%End + +protected: + virtual void paint(QPainter *,QTab *,bool) const; +%If (Qt_2_00 -) + virtual void paintLabel(QPainter *,const QRect &,QTab *,bool) const; +%End + +%If (- Qt_3_0_0) + virtual QTab *selectTab(const QPoint &) const; +%End +%If (Qt_2_00 - Qt_3_0_0) + void updateMask(); +%End + +%If (Qt_2_1_0 -) + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); + + void resizeEvent(QResizeEvent *); +%End + void paintEvent(QPaintEvent *); + void mousePressEvent(QMouseEvent *); +%If (Qt_3_0_0 -) + void mouseMoveEvent(QMouseEvent *); +%End + void mouseReleaseEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); +%If (Qt_2_1_0 -) + void styleChange(QStyle &); +%End +%If (Qt_3_0_0 -) + void fontChange(const QFont &); +%End + +%If (Qt_3_1_0 -) + bool event(QEvent *); +%End + + SIP_PYLIST tabList() [QList<QTab> *()]; +%MethodCode + if ((sipRes = PyList_New(0)) == NULL) + sipIsErr = 1; + else + { + QList<QTab> *tl; + QTab *tab; + + Py_BEGIN_ALLOW_THREADS + tl = sipCpp -> sipProtect_tabList(); + Py_END_ALLOW_THREADS + + // Convert the list. + for (QListIterator<QTab> it(*tl); (tab = it.current()) != NULL; ++it) + { + PyObject *inst = sipBuildResult(&sipIsErr,"C",tab,sipClass_QTab,NULL); + + if (sipIsErr) + break; + + int rc = PyList_Append(sipRes,inst); + + Py_DECREF(inst); + + if (rc < 0) + { + sipIsErr = 1; + break; + } + } + + if (sipIsErr) + Py_DECREF(sipRes); + } +%End + +private: +%If (Qt_2_1_0 -) + QTabBar(const QTabBar &); +%End +}; diff --git a/python/pyqt/sip/qt/qtabdialog.sip b/python/pyqt/sip/qt/qtabdialog.sip new file mode 100644 index 00000000..115cf9d7 --- /dev/null +++ b/python/pyqt/sip/qt/qtabdialog.sip @@ -0,0 +1,167 @@ +// This is the SIP interface definition for QTabDialog. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTabDialog</Title> +<Para> +<Literal>QTabDialog</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_TABDIALOG) + +class QTabDialog : QDialog +{ +%TypeHeaderCode +#include <qtabdialog.h> +%End + +public: + QTabDialog(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void show(); + void setFont(const QFont &); + +%If (- Qt_2_00) + void addTab(QWidget *,const char *); +%End +%If (Qt_2_00 -) + void addTab(QWidget *,const QString &); + void addTab(QWidget *,const QIconSet &,const QString &); +%End + void addTab(QWidget *,QTab *); + +%If (Qt_2_00 -) + void insertTab(QWidget *,const QString &,int = -1); + void insertTab(QWidget *,const QIconSet &,const QString &,int = -1); + void insertTab(QWidget *,QTab *,int = -1); + + void changeTab(QWidget *,const QString &); + void changeTab(QWidget *,const QIconSet &,const QString &); +%End + +%If (Qt_2_00 -) + bool isTabEnabled(QWidget *) const; + void setTabEnabled(QWidget *,bool); +%End +%If (- Qt_3_0_0) + bool isTabEnabled(const char *) const; + void setTabEnabled(const char *,bool); +%End + + void showPage(QWidget *); +%If (Qt_2_00 -) + void removePage(QWidget *); + QString tabLabel(QWidget *); +%End +%If (- Qt_2_00) + const char *tabLabel(QWidget *); +%End + +%If (Qt_2_00 -) + QWidget *currentPage() const; +%End + +%If (- Qt_2_00) + void setDefaultButton(const char * = "Defaults"); +%End +%If (Qt_2_00 -) + void setDefaultButton(const QString &); + void setDefaultButton(); +%End + bool hasDefaultButton() const; + +%If (Qt_2_00 -) + void setHelpButton(const QString &); + void setHelpButton(); + bool hasHelpButton() const; +%End + +%If (- Qt_2_00) + void setCancelButton(const char * = "Cancel"); +%End +%If (Qt_2_00 -) + void setCancelButton(const QString &); + void setCancelButton(); +%End + bool hasCancelButton() const; + +%If (- Qt_2_00) + void setApplyButton(const char * = "Apply"); +%End +%If (Qt_2_00 -) + void setApplyButton(const QString &); + void setApplyButton(); +%End + bool hasApplyButton() const; + +%If (- Qt_2_00) + void setOkButton(const char * = "OK"); +%End +%If (Qt_2_00 -) + void setOkButton(const QString &); + void setOkButton(); +%End + bool hasOkButton() const; + +protected: + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); +%If (- Qt_2_00) + void styleChange(GUIStyle); +%End +%If (Qt_2_00 -) + void styleChange(QStyle &); +%End + void setTabBar(QTabBar *); + QTabBar *tabBar() const; + +signals: + void aboutToShow(); + + void applyButtonPressed(); + void cancelButtonPressed(); + void defaultButtonPressed(); +%If (Qt_2_00 -) + void helpButtonPressed(); +%End + +%If (Qt_2_2_0 -) + void currentChanged(QWidget *); +%End +%If (- Qt_2_00) + void selected(const char *); +%End +%If (Qt_2_00 - Qt_3_0_0) + void selected(const QString &); +%End + +private: +%If (Qt_2_1_0 -) + QTabDialog(const QTabDialog &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtableview.sip b/python/pyqt/sip/qt/qtableview.sip new file mode 100644 index 00000000..a2159be7 --- /dev/null +++ b/python/pyqt/sip/qt/qtableview.sip @@ -0,0 +1,185 @@ +// This is the SIP interface definition for QTableView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTableView (Qt 1.x, Qt 2.x)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>colXPos</Function></FuncDef> + <ParamDef>int <Parameter>col</Parameter></ParamDef> + <ParamDef>int *<Parameter>xPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>col</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result and <Literal>xPos</Literal>. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>rowYPos</Function></FuncDef> + <ParamDef>int <Parameter>row</Parameter></ParamDef> + <ParamDef>int *<Parameter>yPos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>row</Literal> parameter and returns a tuple containing +the <Literal>bool</Literal> result and <Literal>yPos</Literal>. +</Para> +</Sect2> +%End + + +%If (Qt_TABLEVIEW) +%If (- Qt_3_0_0) + +%ModuleHeaderCode +#include <qtableview.h> +%End + +const uint Tbl_vScrollBar; +const uint Tbl_hScrollBar; +const uint Tbl_autoVScrollBar; +const uint Tbl_autoHScrollBar; +const uint Tbl_autoScrollBars; + +const uint Tbl_clipCellPainting; +const uint Tbl_cutCellsV; +const uint Tbl_cutCellsH; +const uint Tbl_cutCells; + +const uint Tbl_scrollLastHCell; +const uint Tbl_scrollLastVCell; +const uint Tbl_scrollLastCell; + +const uint Tbl_smoothHScrolling; +const uint Tbl_smoothVScrolling; +const uint Tbl_smoothScrolling; + +const uint Tbl_snapToHGrid; +const uint Tbl_snapToVGrid; +const uint Tbl_snapToGrid; + + +class QTableView : QFrame +{ +%TypeHeaderCode +#include <qtableview.h> +%End + +public: +%If (- Qt_2_00) + void setBackgroundColor(const QColor &); + void setPalette(const QPalette &); +%End +%If (Qt_2_00 -) + virtual void setBackgroundColor(const QColor &); + virtual void setPalette(const QPalette &); +%End + void show(); + void repaint(bool = 1); + void repaint(int,int,int,int,bool = 1); + void repaint(const QRect &,bool = 1); + +protected: + QTableView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + ~QTableView(); + + int numRows() const; + int numCols() const; + int topCell() const; + int leftCell() const; + int xOffset() const; + int yOffset() const; + virtual int cellWidth(int); + virtual int cellHeight(int); + int cellWidth() const; + int cellHeight() const; + virtual int totalWidth(); + virtual int totalHeight(); + uint tableFlags() const; + bool testTableFlags(uint) const; + void clearTableFlags(uint = ~0); + bool autoUpdate() const; + void updateCell(int,int,bool = 1); + QRect cellUpdateRect() const; + QRect viewRect() const; + int lastRowVisible() const; + int lastColVisible() const; + bool rowIsVisible(int) const; + bool colIsVisible(int) const; + const QScrollBar *verticalScrollBar() const; + const QScrollBar *horizontalScrollBar() const; + virtual void paintCell(QPainter *,int,int) = 0; + virtual void setupPainter(QPainter *); + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + int findRow(int) const; + int findCol(int) const; + bool rowYPos(int,int *) const; + bool colXPos(int,int *) const; + int maxXOffset(); + int maxYOffset(); + int maxColOffset(); + int maxRowOffset(); + int minViewX() const; + int minViewY() const; + int maxViewX() const; + int maxViewY() const; + int viewWidth() const; + int viewHeight() const; + void scroll(int,int); + void updateScrollBars(); + void updateTableSize(); + +%If (- Qt_2_00) + void setNumRows(int); + void setNumCols(int); + void setTopCell(int); + void setLeftCell(int); + void setTopLeftCell(int,int); + void setXOffset(int); + void setYOffset(int); + void setOffset(int,int,bool = 1); + void setCellWidth(int); + void setCellHeight(int); + void setTableFlags(uint); + void setAutoUpdate(bool); +%End + +%If (Qt_2_00 -) + virtual void setNumRows(int); + virtual void setNumCols(int); + virtual void setTopCell(int); + virtual void setLeftCell(int); + virtual void setTopLeftCell(int,int); + virtual void setXOffset(int); + virtual void setYOffset(int); + virtual void setOffset(int,int,bool = 1); + virtual void setCellWidth(int); + virtual void setCellHeight(int); + virtual void setTableFlags(uint); + virtual void setAutoUpdate(bool); +%End + +private: + QTableView(const QTableView &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qtabwidget.sip b/python/pyqt/sip/qt/qtabwidget.sip new file mode 100644 index 00000000..2f78472e --- /dev/null +++ b/python/pyqt/sip/qt/qtabwidget.sip @@ -0,0 +1,177 @@ +// This is the SIP interface definition for QTabWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTabWidget (Qt v2+)</Title> +<Para> +<Literal>QTabWidget</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QTabWidget : QWidget +{ +%TypeHeaderCode +#include <qtabwidget.h> +%End + +public: +%If (Qt_3_0_0 -) + QTabWidget(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + QTabWidget(QWidget * /TransferThis/,const char *,WFlags); +%End +%If (- Qt_3_0_0) + QTabWidget(QWidget * /TransferThis/ = 0,const char * = 0); +%End + + // The QWidget is passed to QWidgetStack::addWidget(). +%If (- Qt_3_0_0) + void addTab(QWidget * /Transfer/,const QString &); + void addTab(QWidget * /Transfer/,const QIconSet &,const QString &); + void addTab(QWidget * /Transfer/,QTab *); + + void insertTab(QWidget * /Transfer/,const QString &,int = -1); + void insertTab(QWidget * /Transfer/,const QIconSet &,const QString &, + int = -1); + void insertTab(QWidget * /Transfer/,QTab *,int = -1); +%End +%If (Qt_3_0_0 -) + virtual void addTab(QWidget * /Transfer/,const QString &); + virtual void addTab(QWidget * /Transfer/,const QIconSet &, + const QString &); + virtual void addTab(QWidget * /Transfer/,QTab *); + + virtual void insertTab(QWidget * /Transfer/,const QString &,int = -1); + virtual void insertTab(QWidget * /Transfer/,const QIconSet &, + const QString &,int = -1); + virtual void insertTab(QWidget * /Transfer/,QTab *,int = -1); +%End + + void changeTab(QWidget *,const QString &); + void changeTab(QWidget *,const QIconSet &,const QString &); + + bool isTabEnabled(QWidget *) const; + void setTabEnabled(QWidget *,bool); + +%If (Qt_3_2_0 -) + void setCornerWidget(QWidget *,Qt::Corner = Qt::TopRight); + QWidget *cornerWidget(Qt::Corner = Qt::TopRight) const; +%End + +%If (- Qt_3_0_0) + void showPage(QWidget *); + void removePage(QWidget *); + + QString tabLabel(QWidget *); +%End +%If (Qt_3_0_0 -) + QString tabLabel(QWidget *) const; + void setTabLabel(QWidget *,const QString &); + + QIconSet tabIconSet(QWidget *) const; + void setTabIconSet(QWidget *,const QIconSet &); + + void removeTabToolTip(QWidget *); + void setTabToolTip(QWidget *,const QString &); + QString tabToolTip(QWidget *) const; +%End + + QWidget *currentPage() const; +%If (Qt_3_0_0 -) + QWidget *page(int) const; + QString label(int) const; +%End +%If (Qt_2_2_0 -) + int currentPageIndex() const; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + void setCurrentPage(int); +%End +%If (Qt_3_0_0 -) + int indexOf(QWidget *) const; +%End + + QSize sizeHint() const; + QSize minimumSizeHint() const; + + enum TabPosition { + Top, + Bottom + }; + + TabPosition tabPosition() const; + void setTabPosition(TabPosition); + +%If (Qt_2_2_0 -) + enum TabShape { + Rounded, + Triangular + }; + + TabShape tabShape() const; + void setTabShape(TabShape); +%End + + int margin() const; + void setMargin(int); + +%If (Qt_2_1_0 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_3_0_0 -) + int count() const; +%End + +public slots: +%If (Qt_3_0_0 -) + void setCurrentPage(int); + virtual void showPage(QWidget *); + virtual void removePage(QWidget *); +%End + +protected: + void showEvent(QShowEvent *); + void resizeEvent(QResizeEvent *); + void setTabBar(QTabBar *); + QTabBar *tabBar() const; + void styleChange(QStyle &); + void updateMask(); + bool eventFilter(QObject *,QEvent *); + +signals: +%If (Qt_2_2_0 -) + void currentChanged(QWidget *); +%End + +private: +%If (Qt_2_1_0 -) + QTabWidget(const QTabWidget &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtextbrowser.sip b/python/pyqt/sip/qt/qtextbrowser.sip new file mode 100644 index 00000000..d7f45703 --- /dev/null +++ b/python/pyqt/sip/qt/qtextbrowser.sip @@ -0,0 +1,114 @@ +// This is the SIP interface definition for QTextBrowser. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTextBrowser (Qt v2+)</Title> +<Para> +<Literal>QTextBrowser</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QTextBrowser : QTextEdit +{ +%TypeHeaderCode +#include <qtextbrowser.h> +%End + +public: + QTextBrowser(QWidget * /TransferThis/ = 0,const char * = 0); + + QString source() const; + +public slots: + virtual void setSource(const QString &); + virtual void backward(); + virtual void forward(); + virtual void home(); + virtual void reload(); + void setText(const QString &); + virtual void setText(const QString &,const QString &); + +signals: + void backwardAvailable(bool); + void forwardAvailable(bool); +%If (Qt_3_1_0 -) + void sourceChanged(const QString &); +%End + void highlighted(const QString &); + void linkClicked(const QString &); +%If (Qt_3_1_0 -) + void anchorClicked(const QString &,const QString &); +%End + +protected: + void keyPressEvent(QKeyEvent *); + +private: + QTextBrowser(const QTextBrowser &); +}; + +%End + +%If (Qt_2_00 - Qt_3_0_0) + +class QTextBrowser : QTextView +{ +%TypeHeaderCode +#include <qtextbrowser.h> +%End + +public: + QTextBrowser(QWidget * /TransferThis/ = 0,const char * = 0); + + virtual void setSource(const QString &); + QString source() const; + void setText(const QString &,const QString & = QString::null); + void scrollToAnchor(const QString &); + +public slots: + virtual void backward(); + virtual void forward(); + virtual void home(); + +signals: + void backwardAvailable(bool); + void forwardAvailable(bool); + void highlighted(const QString &); + void textChanged(); + +protected: + void viewportMousePressEvent(QMouseEvent *); + void viewportMouseReleaseEvent(QMouseEvent *); + void viewportMouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); + +private: +%If (Qt_2_1_0 -) + QTextBrowser(const QTextBrowser &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtextcodec.sip b/python/pyqt/sip/qt/qtextcodec.sip new file mode 100644 index 00000000..626e12bf --- /dev/null +++ b/python/pyqt/sip/qt/qtextcodec.sip @@ -0,0 +1,146 @@ +// This is the SIP interface definition for QTextCodec, QTextDecoder and +// QTextEncoder. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTextCodec (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual QCString <Function>fromUnicode</Function></FuncDef> + <ParamDef>const QString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>QCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QTextDecoder (Qt v2+)</Title> +<Para> +<Literal>QTextDecoder</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextEncoder (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>virtual QCString <Function>fromUnicode</Function> = 0</FuncDef> + <ParamDef>const QString &<Parameter>uc</Parameter></ParamDef> + <ParamDef>int &<Parameter>lenInOut</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>QCString</Literal> result and the +updated <Literal>lenInOut</Literal>. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QTextEncoder +{ +%TypeHeaderCode +#include <qtextcodec.h> +%End + +public: + virtual QCString fromUnicode(const QString &,int & /In,Out/) = 0; +}; + + +class QTextDecoder +{ +%TypeHeaderCode +#include <qtextcodec.h> +%End + +public: + virtual QString toUnicode(const char *,int) = 0; +}; + + +class QTextCodec +{ +%TypeHeaderCode +#include <qtextcodec.h> +%End + +public: +%If (Qt_CODECS) + static QTextCodec *loadCharmap(QIODevice *); + static QTextCodec *loadCharmapFile(QString); +%End + static QTextCodec *codecForMib(int); + static QTextCodec *codecForName(const char *,int = 0); + static QTextCodec *codecForContent(const char *,int); + static QTextCodec *codecForIndex(int); + static QTextCodec *codecForLocale(); +%If (Qt_3_0_0 -) + static void setCodecForLocale(QTextCodec *); +%End + +%If (Qt_3_1_0 -) + static QTextCodec *codecForTr(); + static void setCodecForTr(QTextCodec *); + static QTextCodec *codecForCStrings(); + static void setCodecForCStrings(QTextCodec *); +%End + + static void deleteAllCodecs(); + + static const char *locale(); + + virtual const char *name() const = 0; +%If (Qt_3_0_0 -) + virtual const char *mimeName() const; +%End + virtual int mibEnum() const = 0; + + virtual QTextDecoder *makeDecoder() const /Factory/; + virtual QTextEncoder *makeEncoder() const /Factory/; + + virtual QString toUnicode(const char *,int) const; + virtual QCString fromUnicode(const QString &,int & /In,Out/) const; + QCString fromUnicode(const QString &) const; + QString toUnicode(const QByteArray &,int) const; + QString toUnicode(const QByteArray &) const; +%If (Qt_3_0_0 -) + QString toUnicode(const QCString &,int) const; + QString toUnicode(const QCString &) const; +%End + QString toUnicode(const char *) const; + virtual bool canEncode(QChar) const; + virtual bool canEncode(const QString &) const; + + virtual int heuristicContentMatch(const char *,int) const = 0; + virtual int heuristicNameMatch(const char *) const; + +%If (Qt_3_0_0 -) + virtual QByteArray fromUnicode(const QString &,int,int) const; + virtual unsigned short characterFromUnicode(const QString &,int) const; +%End + +protected: + QTextCodec(); +}; + +%End diff --git a/python/pyqt/sip/qt/qtextedit.sip b/python/pyqt/sip/qt/qtextedit.sip new file mode 100644 index 00000000..3576bf31 --- /dev/null +++ b/python/pyqt/sip/qt/qtextedit.sip @@ -0,0 +1,437 @@ +// This is the SIP interface definition for QTextEdit. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTextEdit (Qt v3+)</Title> +<FuncSynopsis> +<FuncDef>int <Function>charAt</Function></FuncDef> + <ParamDef>const QPoint &<Parameter>pos</Parameter></ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>pos</Literal> parameter and returns a tuple of the +value returned via the <Literal>para</Literal> pointer and the int result. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delChar</Literal> in Python. +</Para> + +<FuncSynopsis> +<FuncDef>virtual bool <Function>find</Function></FuncDef> + <ParamDef>const QString &<Parameter>expr</Parameter></ParamDef> + <ParamDef>bool <Parameter>cs</Parameter></ParamDef> + <ParamDef>bool <Parameter>wo</Parameter></ParamDef> + <ParamDef>bool <Parameter>forward</Parameter> = TRUE</ParamDef> + <ParamDef>int *<Parameter>para</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>index</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +If the <Literal>para</Literal> and <Literal>index</Literal> parameters are +omitted then the bool result is returned. If both are supplied (as integers) +then a tuple of the bool result and the modified values of +<Literal>para</Literal> and <Literal>index</Literal> is returned. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getCursorPosition</Function></FuncDef> + <ParamDef>int *<Parameter>para</Parameter></ParamDef> + <ParamDef>int *<Parameter>index</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the values returned via the +<Literal>para</Literal> and <Literal>index</Literal> pointers. +</Para> + +<FuncSynopsis> +<FuncDef>void <Function>getSelection</Function></FuncDef> + <ParamDef>int *<Parameter>paraFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexFrom</Parameter></ParamDef> + <ParamDef>int *<Parameter>paraTo</Parameter></ParamDef> + <ParamDef>int *<Parameter>indexTo</Parameter></ParamDef> + <ParamDef>int <Parameter>selNum</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>selNum</Literal> parameter and returns a tuple of +the <Literal>paraFrom</Literal>, <Literal>indexFrom</Literal>, +<Literal>paraTo</Literal> and <Literal>indexTo</Literal> values. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +// These aren't part of the public API in the Qt3 beta, so define them as +// opaque for the moment. + +class QTextDocument; +class QTextCursor; + + +class QTextEdit : QScrollView +{ +%TypeHeaderCode +#include <qtextedit.h> +%End + +public: + enum WordWrap { + NoWrap, + WidgetWidth, + FixedPixelWidth, + FixedColumnWidth + }; + + enum WrapPolicy { + AtWordBoundary, + Anywhere, + AtWhiteSpace, +%If (Qt_3_1_0 -) + AtWordOrDocumentBoundary +%End + }; + +%If (Qt_3_1_0 -) + enum AutoFormatting { + AutoNone, + AutoBulletList, + AutoAll + }; +%End + + enum KeyboardAction { + ActionBackspace, + ActionDelete, + ActionReturn, + ActionKill, +%If (Qt_3_1_0 -) + ActionWordBackspace, + ActionWordDelete +%End + }; + + enum CursorAction { + MoveBackward, + MoveForward, + MoveWordBackward, + MoveWordForward, + MoveUp, + MoveDown, + MoveLineStart, + MoveLineEnd, + MoveHome, + MoveEnd, + MovePgUp, + MovePgDown + }; + + enum VerticalAlignment { + AlignNormal, + AlignSuperScript, + AlignSubScript + }; + +%If (Qt_3_1_0 -) + enum TextInsertionFlags { + RedoIndentation, + CheckNewLines, + RemoveSelected + }; +%End + + QTextEdit(const QString &,const QString & = QString::null, + QWidget * /TransferThis/ = 0,const char * = 0); + QTextEdit(QWidget * /TransferThis/ = 0,const char * = 0); + + void setPalette(const QPalette &); + + QString text() const; + QString text(int) const; + TextFormat textFormat() const; + QString context() const; + QString documentTitle() const; + + void getSelection(int *,int *,int *,int *,int = 0) const; + + // We implement find() as two separate methods as it's the easiest way + // to handle the somewhat strange Qt interface. + virtual bool find(const QString &,bool,bool,bool = 1); + virtual bool find(const QString &,bool,bool,bool,int * /In,Out/, + int * /In,Out/); + + int paragraphs() const; + int lines() const; + int linesOfParagraph(int) const; + int lineOfChar(int,int); + int length() const; + QRect paragraphRect(int) const; + int paragraphAt(const QPoint &) const; + + // Note that this is handwritten code because the generated code would + // return the values in the (correct but) reverse order. + SIP_PYTUPLE charAt(const QPoint &) const; +%MethodCode + int para, index; + + Py_BEGIN_ALLOW_THREADS + index = sipCpp -> QTextEdit::charAt(*a0,¶); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(ii)",para,index); +%End + + int paragraphLength(int) const; + + QStyleSheet *styleSheet() const; + QMimeSourceFactory *mimeSourceFactory() const; + + QBrush paper() const; + bool linkUnderline() const; + + int heightForWidth(int) const; + + bool hasSelectedText() const; + QString selectedText() const; + bool isUndoAvailable() const; + bool isRedoAvailable() const; + + WordWrap wordWrap() const; + int wrapColumnOrWidth() const; + WrapPolicy wrapPolicy() const; + + int tabStopWidth() const; + + QString anchorAt(const QPoint &); +%If (Qt_3_1_0 -) + QString anchorAt(const QPoint &,AnchorAttribute); +%End + + QSize sizeHint() const; + + bool isReadOnly() const; + + void getCursorPosition(int *,int *) const; + + bool isModified() const; + bool italic() const; + bool bold() const; + bool underline() const; + QString family() const; + int pointSize() const; + QColor color() const; + QFont font() const; +%If (Qt_3_1_0 -) + QFont currentFont() const; +%End + int alignment() const; + int undoDepth() const; + + // These are undocumented and marked as "don't use". + //virtual bool getFormat(int,int,QFont *,QColor *,VerticalAlignment *); + //virtual bool getParagraphFormat(int,QFont *,QColor *, + // VerticalAlignment *,int *, + // QStyleSheetItem::DisplayMode *, + // QStyleSheetItem::ListStyle *, + // int *); + + bool isOverwriteMode() const; + QColor paragraphBackgroundColor(int) const; + + bool isUndoRedoEnabled() const; + bool eventFilter(QObject *,QEvent *); +%If (Qt_3_1_0 -) + bool tabChangesFocus() const; + + // Qt defines the following as uint rather than int because it uses the + // AutoFormatting enum as a set of flags. Because SIP implements enums + // as a subclass of int they are always signed. AutoAll is defined as + // 0xffffffff which Python converts to -1 and then fails to convert it + // to an unsigned. For the moment we just lie to SIP about the type + // and let the compiler handle it. + void setAutoFormatting(int); + int autoFormatting() const; +%End +%If (Qt_3_3_0 -) + QSyntaxHighlighter *syntaxHighlighter() const; +%End + +public slots: + void setEnabled(bool); + virtual void setMimeSourceFactory(QMimeSourceFactory *); + virtual void setStyleSheet(QStyleSheet *); + virtual void scrollToAnchor(const QString &); + virtual void setPaper(const QBrush &); + virtual void setLinkUnderline(bool); + + virtual void setWordWrap(WordWrap); + virtual void setWrapColumnOrWidth(int); + virtual void setWrapPolicy(WrapPolicy); + + virtual void copy(); + virtual void append(const QString &); + + void setText(const QString &); + virtual void setText(const QString &,const QString &); + virtual void setTextFormat(TextFormat); + + virtual void selectAll(bool = 1); + virtual void setTabStopWidth(int); + virtual void zoomIn(int); + virtual void zoomIn(); + virtual void zoomOut(int); + virtual void zoomOut(); + virtual void zoomTo(int); + + virtual void sync(); + virtual void setReadOnly(bool); + + virtual void undo(); + virtual void redo(); + virtual void cut(); + virtual void paste(); + virtual void pasteSubType(const QCString &); + virtual void clear(); + virtual void del() /PyName=delChar/; + virtual void indent(); + virtual void setItalic(bool); + virtual void setBold(bool); + virtual void setUnderline(bool); + virtual void setFamily(const QString &); + virtual void setPointSize(int); + virtual void setColor(const QColor &); + virtual void setFont(const QFont &); + virtual void setVerticalAlignment(VerticalAlignment); + virtual void setAlignment(int); + virtual void setParagType(QStyleSheetItem::DisplayMode, + QStyleSheetItem::ListStyle); + virtual void setCursorPosition(int,int); + virtual void setSelection(int,int,int,int,int = 0); + virtual void setSelectionAttributes(int,const QColor &,bool); + virtual void setModified(bool); + virtual void resetFormat(); + virtual void setUndoDepth(int); +// Marked as internal in the Qt3 beta. +// virtual void setFormat(QTextFormat *,int); + virtual void ensureCursorVisible(); + virtual void placeCursor(const QPoint &,QTextCursor * = 0); + virtual void moveCursor(CursorAction,bool); + virtual void doKeyboardAction(KeyboardAction); + virtual void removeSelectedText(int = 0); + virtual void removeSelection(int = 0); + virtual void setCurrentFont(const QFont &); + virtual void setOverwriteMode(bool); + + virtual void scrollToBottom(); + +%If (Qt_3_1_0 -) + void insert(const QString &,uint = CheckNewLines | RemoveSelected); + virtual void insert(const QString &,bool,bool = 1,bool = 1); +%End +%If (- Qt_3_1_0) + virtual void insert(const QString &,bool = 0,bool = 1,bool = 1); +%End + virtual void insertAt(const QString &,int,int); + virtual void removeParagraph(int); + virtual void insertParagraph(const QString &,int); + + virtual void setParagraphBackgroundColor(int,const QColor &); + virtual void clearParagraphBackground(int); + + virtual void setUndoRedoEnabled(bool); +%If (Qt_3_1_0 -) + void setTabChangesFocus(bool); + + void polish(); +%End +%If (Qt_3_2_0 -) + void setMaxLogLines(int); + int maxLogLines(); +%End + +signals: + void textChanged(); + void selectionChanged(); + void copyAvailable(bool); + void undoAvailable(bool); + void redoAvailable(bool); + void currentFontChanged(const QFont &); + void currentColorChanged(const QColor &); + void currentAlignmentChanged(int); + void currentVerticalAlignmentChanged(VerticalAlignment); + void cursorPositionChanged(QTextCursor *); + void cursorPositionChanged(int,int); + void returnPressed(); + void modificationChanged(bool); +%If (Qt_3_1_0 -) + void clicked(int,int); + void doubleClicked(int,int); +%End + +protected: + void repaintChanged(); + void updateStyles(); + void drawContents(QPainter *,int,int,int,int); + bool event(QEvent *); + void keyPressEvent(QKeyEvent *); + void resizeEvent(QResizeEvent *); + void viewportResizeEvent(QResizeEvent *); + void contentsMousePressEvent(QMouseEvent *); + void contentsMouseMoveEvent(QMouseEvent *); + void contentsMouseReleaseEvent(QMouseEvent *); + void contentsMouseDoubleClickEvent(QMouseEvent *); + void contentsWheelEvent(QWheelEvent *); + void imStartEvent(QIMEvent *); + void imComposeEvent(QIMEvent *); + void imEndEvent(QIMEvent *); + void contentsDragEnterEvent(QDragEnterEvent *); + void contentsDragMoveEvent(QDragMoveEvent *); + void contentsDragLeaveEvent(QDragLeaveEvent *); + void contentsDropEvent(QDropEvent *); + void contentsContextMenuEvent(QContextMenuEvent *); + bool focusNextPrevChild(bool); + QTextDocument *document() const; + QTextCursor *textCursor() const; + void setDocument(QTextDocument *); + virtual QPopupMenu *createPopupMenu(const QPoint &) /Factory/; + virtual QPopupMenu *createPopupMenu() /Factory/; + void drawCursor(bool); + + void windowActivationChange(bool); + +protected slots: + virtual void doChangeInterval(); +%If (Qt_3_1_0 -) + void sliderReleased(); +%End + +private: +%If (Qt_3_1_0 -) + QTextEdit(const QTextEdit &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtextstream.sip b/python/pyqt/sip/qt/qtextstream.sip new file mode 100644 index 00000000..7e8abcdd --- /dev/null +++ b/python/pyqt/sip/qt/qtextstream.sip @@ -0,0 +1,231 @@ +// This is the SIP interface definition for QTextStream, QTextIStream and +// QTextOStream. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTextStream</Title> +<FuncSynopsis> + <FuncDef><Function>QTextStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>readRawBytes</Function></FuncDef> + <ParamDef>char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QTextStream &<Function>writeRawBytes</Function></FuncDef> + <ParamDef>const char *<Parameter>buf</Parameter></ParamDef> + <ParamDef>uint <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextIStream (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QTextIStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> + +<Sect2><Title>QTextOStream (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QTextOStream</Function></FuncDef> + <ParamDef>FILE *<Parameter>fp</Parameter></ParamDef> + <ParamDef>int <Parameter>mode</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + +class QTextStream +{ +%TypeHeaderCode +#include <qtextstream.h> +%End + +public: +%If (Qt_2_00 - Qt_2_2_0) + enum Encoding { + Locale, + Latin1, + Unicode, + UnicodeNetworkOrder, + UnicodeReverse, + RawUnicode + }; +%End +%If (Qt_2_2_0 -) + enum Encoding { + Locale, + Latin1, + Unicode, + UnicodeNetworkOrder, + UnicodeReverse, + RawUnicode, + UnicodeUTF8 + }; +%End + + QTextStream(); + QTextStream(QIODevice *); +%If (Qt_2_00 -) + QTextStream(QString *,int); +%End + QTextStream(QByteArray,int); +// QTextStream(FILE *,int); + +%If (Qt_2_00 -) + void setEncoding(Encoding); + void setCodec(QTextCodec *); +%End +%If (Qt_3_1_0 -) + QTextCodec *codec(); +%End + + QIODevice *device() const; + void setDevice(QIODevice *); + void unsetDevice(); + +%If (Qt_2_00 -) + bool atEnd() const; +%End + bool eof() const; + +// QTextStream &readRawBytes(char *,uint) /ReleaseGIL/; +// QTextStream &writeRawBytes(const char *,uint) /ReleaseGIL/; + + QString readLine() /ReleaseGIL/; +%If (Qt_2_00 -) + QString read() /ReleaseGIL/; + void skipWhiteSpace(); +%End + + enum { + skipws, + left, + right, + internal, + bin, + oct, + dec, + hex, + showbase, + showpoint, + uppercase, + showpos, + scientific, + fixed + }; + + static const int basefield; + static const int adjustfield; + static const int floatfield; + + int flags() const; + int flags(int); + int setf(int); + int setf(int,int); + int unsetf(int); + + void reset(); + + int width() const; + int width(int); + int fill() const; + int fill(int); + int precision() const; + int precision(int); + +%If (Qt_3_0_0 -) + // These are defined in qmainwindow.h as global operators so we have + // to implement them here and pretend they are class operators. + QTextStream &operator<<(const QMainWindow &); + QTextStream &operator>>(QMainWindow &); + + // These are defined in qdockarea.h as global operators so we have + // to implement them here and pretend they are class operators. + QTextStream &operator<<(const QDockArea &); + QTextStream &operator>>(QDockArea &); +%End + +private: + QTextStream(const QTextStream &); +}; + + +%If (Qt_2_00 -) + +class QTextIStream : QTextStream +{ +%TypeHeaderCode +#include <qtextstream.h> +%End + +public: + QTextIStream(QString *); + QTextIStream(QByteArray); +// QTextIStream(FILE *); + +private: +%If (Qt_3_1_0 -) + QTextIStream(const QTextIStream &); +%End +}; + + +class QTextOStream : QTextStream +{ +%TypeHeaderCode +#include <qtextstream.h> +%End + +public: + QTextOStream(QString *); + QTextOStream(QByteArray); +// QTextOStream(FILE *); + +private: +%If (Qt_3_1_0 -) + QTextOStream(const QTextOStream &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtextview.sip b/python/pyqt/sip/qt/qtextview.sip new file mode 100644 index 00000000..d79a34ad --- /dev/null +++ b/python/pyqt/sip/qt/qtextview.sip @@ -0,0 +1,128 @@ +// This is the SIP interface definition for QTextView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTextView (Qt v2+)</Title> +<Para> +<Literal>QTextView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QTextView : QTextEdit +{ +%TypeHeaderCode +#include <qtextview.h> +%End + +public: + QTextView(QWidget * /TransferThis/ = 0,const char * = 0); + QTextView(const QString &,const QString & = QString::null, + QWidget * /TransferThis/ = 0,const char * = 0); + +private: +%If (Qt_3_1_0 -) + QTextView(const QTextView &); +%End +}; + +%End + + +%If (Qt_2_00 - Qt_3_0_0) + +class QTextView : QScrollView +{ +%TypeHeaderCode +#include <qtextview.h> +%End + +public: + QTextView(QWidget * /TransferThis/ = 0,const char * = 0); + QTextView(const QString &,const QString & = QString::null, + QWidget * /TransferThis/ = 0,const char * = 0); + +%If (- Qt_2_1_0) + virtual void setText(const QString &,const QString & = QString::null); +%End +%If (Qt_2_1_0 -) + virtual void setText(const QString &,const QString &); + void setText(const QString &); +%End + virtual QString text() const; + virtual QString context() const; + Qt::TextFormat textFormat() const; + void setTextFormat(Qt::TextFormat); + QStyleSheet *styleSheet() const; + void setStyleSheet(QStyleSheet *); + void setPaper(const QBrush &); + const QBrush &paper(); + void setPaperColorGroup(const QColorGroup &); + const QColorGroup &paperColorGroup() const; + void setLinkColor(const QColor &); + const QColor &linkColor() const; + void setLinkUnderline(bool); + bool linkUnderline() const; + void setMimeSourceFactory(QMimeSourceFactory *); + QMimeSourceFactory *mimeSourceFactory() const; + QString documentTitle() const; + int heightForWidth(int) const; +%If (Qt_2_1_0 -) + void append(const QString &); + bool hasSelectedText() const; + QString selectedText() const; +%End + +public slots: +%If (Qt_2_1_0 -) +%If (Qt_CLIPBOARD) + void copy(); +%End + void selectAll(); +%End + +protected: + void drawContentsOffset(QPainter *,int,int,int,int,int,int); + void resizeEvent(QResizeEvent *); + void viewportResizeEvent(QResizeEvent *); + void viewportMousePressEvent(QMouseEvent *); + void viewportMouseReleaseEvent(QMouseEvent *); + void viewportMouseMoveEvent(QMouseEvent *); + void keyPressEvent(QKeyEvent *); +%If (Qt_2_1_0 -) + void showEvent(QShowEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); +%End +// QRichText &richText() const; + void paletteChange(const QPalette &); + +private: +%If (Qt_2_1_0 -) + QTextView(const QTextView &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qthread.sip b/python/pyqt/sip/qt/qthread.sip new file mode 100644 index 00000000..29966c6b --- /dev/null +++ b/python/pyqt/sip/qt/qthread.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for QThread. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QThread (Qt v2.2+)</Title> +<Para> +<Literal>QThread</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_THREAD_SUPPORT) +%If (Qt_2_2_0 -) + +class QThread : Qt /CreatesThread/ +{ +%TypeHeaderCode +#include <qthread.h> +%End + +public: +%If (- Qt_3_0_0) + static HANDLE currentThread(); +%End +%If (Qt_3_0_0 -) + static Qt::HANDLE currentThread(); +%End + static void postEvent(QObject *,QEvent * /Transfer/) /ReleaseGIL/; +%If (Qt_3_0_0 -) + static void initialize(); + static void cleanup(); +%End + + static void exit() /ReleaseGIL/; + +%If (Qt_3_1_0 -) + QThread(unsigned int); +%End + QThread(); + + bool wait(unsigned long = ULONG_MAX) /ReleaseGIL/; + +%If (Qt_3_2_0 -) + enum Priority { + IdlePriority, + LowestPriority, + LowPriority, + NormalPriority, + HighPriority, + HighestPriority, + TimeCriticalPriority, + InheritPriority + }; + + void start(Priority) /ReleaseGIL/; +%End + void start() /ReleaseGIL/; + +%If (Qt_3_1_0 -) + void terminate(); +%End + + bool finished() const; + bool running() const; + +protected: + virtual void run() = 0 /NewThread/; + + static void sleep(unsigned long) /ReleaseGIL/; + static void msleep(unsigned long) /ReleaseGIL/; + static void usleep(unsigned long) /ReleaseGIL/; + +private: + QThread(const QThread &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qtimer.sip b/python/pyqt/sip/qt/qtimer.sip new file mode 100644 index 00000000..62d20b25 --- /dev/null +++ b/python/pyqt/sip/qt/qtimer.sip @@ -0,0 +1,59 @@ +// This is the SIP interface definition for QTimer. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTimer</Title> +<Para> +<Literal>QTimer</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QTimer : QObject +{ +%TypeHeaderCode +#include <qtimer.h> +%End + +public: + QTimer(QObject * /TransferThis/ = 0,char * = 0); + + bool isActive() const; + int start(int,bool = 0); + void changeInterval(int); + void stop(); + static void singleShot(int,SIP_RXOBJ_CON,SIP_SLOT_CON()); + +%If (Qt_3_1_0 -) + int timerId() const; +%End + +signals: + void timeout(); + +protected: + bool event(QEvent *); + +private: + QTimer(const QTimer &); +}; diff --git a/python/pyqt/sip/qt/qtmod.sip b/python/pyqt/sip/qt/qtmod.sip new file mode 100644 index 00000000..913ff8b6 --- /dev/null +++ b/python/pyqt/sip/qt/qtmod.sip @@ -0,0 +1,282 @@ +// This is the SIP interface definition for the qt module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qt 2 + +%Include versions.sip +%Include copying.sip + + +unsigned PYQT_VERSION; +const char *PYQT_VERSION_STR; + +%ModuleCode +static unsigned PYQT_VERSION = 0x031102; +static const char *PYQT_VERSION_STR = "3.17.2"; +%End + + +// Hook into the VendorID package if it is enabled. +%Feature VendorID + +%If (VendorID) + +%ModuleCode +#include <vendorid.h> +%End + +%PreInitialisationCode + if (!vendorid_check()) + { + PyErr_SetString(PyExc_RuntimeError, "PyQt cannot be used with this Python interpreter"); + return; + } +%End + +%End + + +// Include the interface definitions for each class. + +// These contain enum and type definitions that need to be defined before they +// are used so they do not seem to be classes. + +%Include qglobal.sip +%Include qnamespace.sip +%Include qwindowdefs.sip +%Include qpen.sip + +%Include qpaintdevice.sip + +%Include qpixmap.sip +%Include qbitmap.sip + +%Include qsize.sip +%Include qsizepolicy.sip + +%Include qaccel.sip +%Include qaction.sip +%Include qapplication.sip +%Include qarray.sip +%Include qassistantclient.sip +%Include qbrush.sip +%Include qbutton.sip +%Include qbuttongroup.sip +%Include qbytearray.sip +%Include qcdestyle.sip +%Include qcheckbox.sip +%Include qclipboard.sip +%Include qcolor.sip +%Include qcolordialog.sip +%Include qcolorgroup.sip +%Include qcombobox.sip +%Include qcommonstyle.sip +%Include qcstring.sip +%Include qcursor.sip +%Include qdatastream.sip +%Include qdatetime.sip +%Include qdatetimeedit.sip +%Include qdesktopwidget.sip +%Include qdial.sip +%Include qdialog.sip +%Include qdir.sip +%Include qdockarea.sip +%Include qdockwindow.sip +%Include qdragobject.sip +%Include qdrawutil.sip +%Include qdropsite.sip +%Include qerrormessage.sip +%Include qevent.sip +%Include qeventloop.sip +%Include qfile.sip +%Include qfiledialog.sip +%Include qfileinfo.sip +%Include qfont.sip +%Include qfontdatabase.sip +%Include qfontdialog.sip +%Include qfontinfo.sip +%Include qfontmetrics.sip +%Include qframe.sip +%Include qgmanager.sip +%Include qgrid.sip +%Include qgridview.sip +%Include qgroupbox.sip +%Include qhbox.sip +%Include qhbuttongroup.sip +%Include qheader.sip +%Include qhgroupbox.sip +%Include qiconset.sip +%Include qiconview.sip +%Include qimage.sip +%Include qinputdialog.sip +%Include qinterlacestyle.sip +%Include qiodevice.sip +%Include qkeycode.sip +%Include qkeysequence.sip +%Include qlabel.sip +%Include qlayout.sip +%Include qlcdnumber.sip +%Include qlibrary.sip +%Include qlineedit.sip +%Include qlist.sip +%Include qlistbox.sip +%Include qlistview.sip +%Include qlocale.sip +%Include qmainwindow.sip +%Include qmemarray.sip +%Include qmenubar.sip +%Include qmenudata.sip +%Include qmessagebox.sip +%Include qmetaobject.sip +%Include qmime.sip +%Include qmotifplusstyle.sip +%Include qmotifstyle.sip +%Include qmovie.sip +%Include qmutex.sip +%Include qmultilinedit.sip +%Include qnetworkprotocol.sip +%Include qobject.sip +%Include qobjectcleanuphandler.sip +%Include qobjectlist.sip +%Include qpaintdevicemetrics.sip +%Include qpainter.sip +%Include qpair.sip +%Include qpalette.sip +%Include qpicture.sip +%Include qpixmapcache.sip +%Include qplatinumstyle.sip +%Include qpoint.sip +%Include qpointarray.sip +%Include qpopupmenu.sip +%Include qprintdialog.sip +%Include qprinter.sip +%Include qprocess.sip +%Include qprogressbar.sip +%Include qprogressdialog.sip +%Include qptrlist.sip +%Include qpushbutton.sip +%Include qradiobutton.sip +%Include qrangecontrol.sip +%Include qrect.sip +%Include qregexp.sip +%Include qregion.sip +%Include qscrollbar.sip +%Include qscrollview.sip +%Include qsemaphore.sip +%Include qsemimodal.sip +%Include qsessionmanager.sip +%Include qsettings.sip +%Include qsgistyle.sip +%Include qsignalmapper.sip +%Include qsimplerichtext.sip +%Include qsizegrip.sip +%Include qslider.sip +%Include qsocketnotifier.sip +%Include qsound.sip +%Include qspinbox.sip +%Include qsplashscreen.sip +%Include qsplitter.sip +%Include qstatusbar.sip +%Include qstring.sip +%Include qstringlist.sip +%Include qstrlist.sip +%Include qstyle.sip +%Include qstylefactory.sip +%Include qstylesheet.sip +%Include qsyntaxhighlighter.sip +%Include qtabbar.sip +%Include qtabdialog.sip +%Include qtableview.sip +%Include qtabwidget.sip +%Include qtextbrowser.sip +%Include qtextcodec.sip +%Include qtextedit.sip +%Include qtextstream.sip +%Include qtextview.sip +%Include qthread.sip +%Include qtimer.sip +%Include qtoolbar.sip +%Include qtoolbox.sip +%Include qtoolbutton.sip +%Include qtooltip.sip +%Include qtranslator.sip +%Include qurl.sip +%Include qurlinfo.sip +%Include qurloperator.sip +%Include quuid.sip +%Include qvalidator.sip +%Include qvaluelist.sip +%Include qvariant.sip +%Include qvbox.sip +%Include qvbuttongroup.sip +%Include qvgroupbox.sip +%Include qwaitcondition.sip +%Include qwhatsthis.sip +%Include qwidget.sip +%Include qwidgetlist.sip +%Include qwidgetstack.sip +%Include qwindow.sip +%Include qwindowsstyle.sip +%Include qwindowsxpstyle.sip +%Include qwizard.sip +%Include qwmatrix.sip +%Include qworkspace.sip + + +// The build file templates. + +%Makefile qt.pro.in +# The project file for the qt module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QASSISTANTCLIENT_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qt/qtoolbar.sip b/python/pyqt/sip/qt/qtoolbar.sip new file mode 100644 index 00000000..7143ba0f --- /dev/null +++ b/python/pyqt/sip/qt/qtoolbar.sip @@ -0,0 +1,160 @@ +// This is the SIP interface definition for QToolBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QToolBar</Title> +<Para> +<Literal>QToolBar</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QToolBar : QDockWindow +{ +%TypeHeaderCode +#include <qtoolbar.h> +%End + +public: + QToolBar(const QString &,QMainWindow * /TransferThis/,Dock = DockTop, + bool = 0,const char * = 0); + QToolBar(const QString &,QMainWindow *,QWidget * /TransferThis/, + bool = 0,const char * = 0,WFlags = 0); + QToolBar(QMainWindow * /TransferThis/ = 0,const char * = 0); + + void addSeparator(); + + void show(); + void hide(); + + QMainWindow *mainWindow() const; + + virtual void setStretchableWidget(QWidget *); + + bool event(QEvent *); + + virtual void setLabel(const QString &); + QString label() const; + + virtual void clear(); + + QSize minimumSize() const; + QSize minimumSizeHint() const; + + void setOrientation(Orientation); + void setMinimumSize(int,int); + +protected: + void resizeEvent(QResizeEvent *); + void styleChange(QStyle &); + +private: + QToolBar(const QToolBar &); +}; + +%End + + +%If (- Qt_3_0_0) + +class QToolBar : QWidget +{ +%TypeHeaderCode +#include <qtoolbar.h> +%End + +public: +%If (- Qt_2_00) + QToolBar(const char *,QMainWindow * /TransferThis/, + QMainWindow::ToolBarDock = QMainWindow::Top, + bool = 0,const char * = 0); + QToolBar(const char *,QMainWindow *,QWidget * /TransferThis/,bool = 0, + const char * = 0,WFlags = 0); +%End +%If (Qt_2_00 -) + QToolBar(const QString &,QMainWindow * /TransferThis/, + QMainWindow::ToolBarDock = QMainWindow::Top,bool = 0, + const char * = 0); + QToolBar(const QString &,QMainWindow *,QWidget * /TransferThis/,bool = 0, + const char * = 0,WFlags = 0); +%End + QToolBar(QMainWindow * /TransferThis/ = 0,const char * = 0); + + void addSeparator(); + +%If (- Qt_2_00) + enum Orientation + { + Horizontal, + Vertical + }; +%End + + virtual void setOrientation(Orientation); + Orientation orientation() const; + void show(); + QMainWindow *mainWindow(); + bool event(QEvent *); +%If (- Qt_2_00) + void setStretchableWidget(QWidget *); +%End +%If (Qt_2_00 -) + virtual void setStretchableWidget(QWidget *); + bool eventFilter(QObject *,QEvent *); + virtual void setLabel(const QString &); + QString label() const; +%End +%If (Qt_2_1_0 -) + void hide(); + void setHorizontalStretchable(bool); + void setVerticalStretchable(bool); + bool isHorizontalStretchable() const; + bool isVerticalStretchable() const; + void clear(); + QSize minimumSize() const; + QSize minimumSizeHint() const; +%End + +protected: + void paintEvent(QPaintEvent *); +%If (Qt_2_1_0 -) + void resizeEvent(QResizeEvent *); +%End +%If (Qt_2_3_0 -) + void styleChange(QStyle &); +%End + +signals: +%If (Qt_2_1_0 -) + void orientationChanged(Orientation); +%End + +private: +%If (Qt_2_1_0 -) + QToolBar(const QToolBar &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qtoolbox.sip b/python/pyqt/sip/qt/qtoolbox.sip new file mode 100644 index 00000000..804d7dd2 --- /dev/null +++ b/python/pyqt/sip/qt/qtoolbox.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for QToolBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QToolBox (Qt v3.2.0+)</Title> +<Para> +<Literal>QToolBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_2_0 -) + +class QToolBox : QFrame +{ +%TypeHeaderCode +#include <qtoolbox.h> +%End + +public: + QToolBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + ~QToolBox(); + + int addItem(QWidget * /Transfer/,const QString &); + int addItem(QWidget * /Transfer/,const QIconSet &,const QString &); + int insertItem(int,QWidget * /Transfer/,const QString &); + int insertItem(int,QWidget * /Transfer/,const QIconSet &, + const QString &); + + // On return the QWidget will have the QToolBox as it's parent, so we + // don't transfer ownership back. + int removeItem(QWidget *); + + void setItemEnabled(int,bool); + bool isItemEnabled(int) const; + + void setItemLabel(int,const QString &); + QString itemLabel(int) const; + + void setItemIconSet(int,const QIconSet &); + QIconSet itemIconSet(int) const; + + void setItemToolTip(int,const QString &); + QString itemToolTip(int) const; + + QWidget *currentItem() const; + void setCurrentItem(QWidget *); + + int currentIndex() const; + QWidget *item(int) const; + int indexOf(QWidget *) const; + int count() const; + +public slots: + void setCurrentIndex(int); + +signals: + void currentChanged(int); + +protected: + virtual void itemInserted(int); + virtual void itemRemoved(int); + void showEvent(QShowEvent *); + void frameChanged(); + void styleChange(QStyle &); +}; + +%End diff --git a/python/pyqt/sip/qt/qtoolbutton.sip b/python/pyqt/sip/qt/qtoolbutton.sip new file mode 100644 index 00000000..7de2e90b --- /dev/null +++ b/python/pyqt/sip/qt/qtoolbutton.sip @@ -0,0 +1,199 @@ +// This is the SIP interface definition for QToolButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QToolButton</Title> +<Para> +<Literal>QToolButton</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QToolButton : QButton +{ +%TypeHeaderCode +#include <qtoolbutton.h> +%End + +public: +%If (Qt_3_1_0 -) + enum TextPosition { +%If (Qt_3_2_0 -) + BesideIcon, + BelowIcon, +%End + Right, // Obsolete + Under // Obsolete + }; +%End + +%If (- Qt_2_00) + QToolButton(QWidget * /TransferThis/ = 0,const char * = 0); + QToolButton(const QPixmap &,const char *,const char *,SIP_RXOBJ_CON, + SIP_SLOT_CON(),QToolBar * /TransferThis/,const char * = 0); + QToolButton(QIconSet,const char *,const char *,SIP_RXOBJ_CON, + SIP_SLOT_CON(),QToolBar * /TransferThis/,const char * = 0); +%End +%If (Qt_2_00 -) + QToolButton(QWidget * /TransferThis/,const char * = 0); +%End +%If (Qt_2_00 - Qt_3_0_0) + QToolButton(const QPixmap &,const QString &,const QString &, + SIP_RXOBJ_CON,SIP_SLOT_CON(),QToolBar * /TransferThis/, + const char * = 0); +%End +%If (Qt_2_00 -) + QToolButton(const QIconSet &,const QString &,const QString &, + SIP_RXOBJ_CON,SIP_SLOT_CON(),QToolBar * /TransferThis/, + const char * = 0); +%End +%If (Qt_2_1_0 -) + QToolButton(ArrowType,QWidget * /TransferThis/,const char * = 0); +%End + + QSize sizeHint() const; +%If (Qt_3_0_0 -) + QSize minimumSizeHint() const; +%End +%If (Qt_2_00 - Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + +%If (Qt_2_1_0 - Qt_3_0_0) + void setOnIconSet(const QIconSet &); + void setOffIconSet(const QIconSet &); +%End +%If (- Qt_2_00) + void setIconSet(const QIconSet &); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setIconSet(const QIconSet &,bool = 0); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + QIconSet onIconSet() const; + QIconSet offIconSet() const; +%End +%If (- Qt_2_00) + QIconSet iconSet() const; +%End +%If (Qt_2_00 - Qt_3_0_0) + QIconSet iconSet(bool = 0) const; +%End +%If (Qt_3_0_0 -) + virtual void setIconSet(const QIconSet &); + QIconSet iconSet() const; +%End + + bool usesBigPixmap() const; + bool usesTextLabel() const; +%If (- Qt_2_00) + const char *textLabel() const; +%End +%If (Qt_2_00 -) + QString textLabel() const; +%End + +%If (Qt_2_1_0 -) + void setPopup(QPopupMenu *); + QPopupMenu* popup() const; + + void setPopupDelay(int); + int popupDelay() const; +%End + +%If (Qt_3_0_0 -) + void openPopup(); +%End + +%If (Qt_2_1_0 -) + void setAutoRaise(bool); + bool autoRaise() const; +%End +%If (Qt_3_1_0 -) + TextPosition textPosition() const; +%End + +%If (Qt_3_2_0 -) + void setText(const QString &); +%End + +public slots: + virtual void setUsesBigPixmap(bool); + virtual void setUsesTextLabel(bool); +%If (- Qt_2_00) + virtual void setTextLabel(const char *,bool = 1); +%End +%If (Qt_2_00 - Qt_3_0_0) + virtual void setTextLabel(const QString &,bool = 1); +%End +%If (Qt_3_0_0 -) + virtual void setTextLabel(const QString &,bool); +%End + +%If (- Qt_2_00) + void setToggleButton(bool); +%End +%If (Qt_2_00 -) + virtual void setToggleButton(bool); +%End + +%If (- Qt_2_00) + void setOn(bool); +%End +%If (Qt_2_00 -) + virtual void setOn(bool); +%End + void toggle(); +%If (Qt_3_0_0 -) + // This was actually introduced in Qt v2.1.0 but gives signature + // conflict until Qt v3.0.0. + void setTextLabel(const QString &); +%End +%If (Qt_3_1_0 -) + void setTextPosition(TextPosition); +%End + +protected: +%If (Qt_3_0_0 -) + void mousePressEvent(QMouseEvent *); +%End + void drawButton(QPainter *); + void drawButtonLabel(QPainter *); + + void enterEvent(QEvent *); + void leaveEvent(QEvent *); +%If (Qt_2_1_0 -) + void moveEvent(QMoveEvent *); +%End + + bool uses3D() const; + +%If (Qt_3_0_0 -) + bool eventFilter(QObject *,QEvent *); +%End + +private: +%If (Qt_2_1_0 -) + QToolButton(const QToolButton &); +%End +}; diff --git a/python/pyqt/sip/qt/qtooltip.sip b/python/pyqt/sip/qt/qtooltip.sip new file mode 100644 index 00000000..5dacad7e --- /dev/null +++ b/python/pyqt/sip/qt/qtooltip.sip @@ -0,0 +1,169 @@ +// This is the SIP interface definition for QToolTip and QToolTipGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QToolTip</Title> +<Para> +<Literal>QToolTip</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QToolTipGroup</Title> +<Para> +<Literal>QToolTipGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QToolTipGroup : QObject +{ +%TypeHeaderCode +#include <qtooltip.h> +%End + +public: + QToolTipGroup(QObject * /TransferThis/,const char * = 0); + +%If (Qt_2_00 -) + bool delay() const; +%End +%If (Qt_2_1_0 -) + bool enabled() const; +%End + +public slots: +%If (Qt_2_00 -) + void setDelay(bool); +%End +%If (Qt_2_1_0 -) + void setEnabled(bool); +%End + +signals: +%If (- Qt_2_00) + void showTip(const char *); +%End +%If (Qt_2_00 -) + void showTip(const QString &); +%End + void removeTip(); + +private: + QToolTipGroup(const QToolTipGroup &); +}; + + +%If (- Qt_2_00) + +class QToolTip +{ +%TypeHeaderCode +#include <qtooltip.h> +%End + +public: + QToolTip(QWidget *,QToolTipGroup * = 0); + + static void add(QWidget *,const char *); + static void add(QWidget *,const char *,QToolTipGroup *,const char *); + static void remove(QWidget *); + static void add(QWidget *,const QRect &,const char *); + static void add(QWidget *,const QRect &,const char *,QToolTipGroup *,const char *); + static void remove(QWidget *,const QRect &); + static QFont font(); + static void setFont(const QFont &); + static QPalette palette(); + static void setPalette(const QPalette &); + QWidget *parentWidget() const; + QToolTipGroup *group() const; + +protected: + virtual void maybeTip(const QPoint &) = 0; + void tip(const QRect &,const char *); + void tip(const QRect &,const char *,const char *); + void clear(); +}; + +%End + +%If (Qt_2_00 -) + +class QToolTip : Qt +{ +%TypeHeaderCode +#include <qtooltip.h> +%End + +public: + QToolTip(QWidget *,QToolTipGroup * = 0); + + static void add(QWidget *,const QString &); + static void add(QWidget *,const QString &,QToolTipGroup *, + const QString &); + static void remove(QWidget *); + + static void add(QWidget *,const QRect &,const QString &); + static void add(QWidget *,const QRect &,const QString &, + QToolTipGroup *,const QString &); + static void remove(QWidget *,const QRect &); + +%If (Qt_3_0_0 -) + static QString textFor(QWidget *,const QPoint & = QPoint()); +%End + +%If (Qt_2_1_0 -) + static void hide(); +%End + + static QFont font(); + static void setFont(const QFont &); + static QPalette palette(); + static void setPalette(const QPalette &); + +%If (Qt_3_0_0 -) + static void setGloballyEnabled(bool); + static bool isGloballyEnabled(); +%End +%If (Qt_2_1_0 - Qt_3_0_0) + static void setEnabled(bool); + static bool enabled(); +%End +%If (Qt_3_1_0 -) + static void setWakeUpDelay(int); +%End + + QWidget *parentWidget() const; + QToolTipGroup *group() const; + +protected: + virtual void maybeTip(const QPoint &) = 0; + void tip(const QRect &,const QString &); + void tip(const QRect &,const QString &,const QString &); +%If (Qt_3_1_0 -) + void tip(const QRect &,const QString &,const QRect &); + void tip(const QRect &,const QString &,const QString &,const QRect &); +%End + void clear(); +}; + +%End diff --git a/python/pyqt/sip/qt/qtranslator.sip b/python/pyqt/sip/qt/qtranslator.sip new file mode 100644 index 00000000..08200ad6 --- /dev/null +++ b/python/pyqt/sip/qt/qtranslator.sip @@ -0,0 +1,177 @@ +// This is the SIP interface definition for QTranslator and QTranslatorMessage. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTranslator (Qt v2+)</Title> +<Para> +<Literal>QTranslator</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTranslatorMessage (Qt v2.2+)</Title> +<Para> +<Literal>QTranslatorMessage</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +class QTranslatorMessage +{ +%TypeHeaderCode +#include <qtranslator.h> +%End + +public: + QTranslatorMessage(); + QTranslatorMessage(const char *,const char *,const char *, + const QString & = QString::null); + QTranslatorMessage(QDataStream &); + QTranslatorMessage(const QTranslatorMessage &); + + uint hash() const; + const char *context() const; + const char *sourceText() const; + const char *comment() const; + + void setTranslation(const QString &); + QString translation() const; + + enum Prefix { + NoPrefix, + Hash, + HashContext, + HashContextSourceText, + HashContextSourceTextComment + }; + +%If (- Qt_3_0_0) + void write(QDataStream &,bool, + Prefix = HashContextSourceTextComment) const /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + void write(QDataStream &,bool = 0, + Prefix = HashContextSourceTextComment) const /ReleaseGIL/; +%End + + Prefix commonPrefix(const QTranslatorMessage &) const; +}; + +%End + + +%If (Qt_2_00 -) + +class QTranslator : QObject +{ +%TypeHeaderCode +#include <qtranslator.h> +%End + +public: +%If (Qt_3_2_0 -) + QTranslator(QObject * /TransferThis/ = 0,const char * = 0); +%End +%If (- Qt_3_2_0) + QTranslator(QObject * /TransferThis/,const char * = 0); +%End + +%If (Qt_2_2_0 -) + QString find(const char *,const char *,const char *) const; +%End +%If (- Qt_3_0_0) + virtual QString find(const char *,const char *) const; +%End + +%If (Qt_2_2_0 - Qt_3_0_0) + QTranslatorMessage findMessage(const char *,const char *, + const char *) const; +%End +%If (Qt_3_0_0 - Qt_3_2_0) + virtual QTranslatorMessage findMessage(const char *,const char *, + const char *) const; +%End +%If (Qt_3_2_0 -) + virtual QTranslatorMessage findMessage(const char *,const char *, + const char * = 0) const; +%End + + bool load(const QString &,const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null); +%If (Qt_3_1_0 -) + bool load(const uchar *,int); +%End + + void clear(); + + enum SaveMode { + Everything, + Stripped + }; + + bool save(const QString &,SaveMode = Everything); + +%If (Qt_2_2_0 -) + void insert(const QTranslatorMessage &); +%End +%If (- Qt_3_0_0) + void insert(const char *,const char *,const QString &); +%End +%If (Qt_2_2_0 -) + void remove(const QTranslatorMessage &); +%End +%If (- Qt_3_0_0) + void remove(const char *,const char *); +%End +%If (- Qt_3_0_0) + bool contains(const char *,const char *) const; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + bool contains(const char *,const char *,const char *) const; +%End +%If (Qt_3_0_0 -) + bool contains(const char *,const char *,const char * = 0) const; +%End + +%If (- Qt_3_0_0) + void squeeze(); +%End +%If (Qt_2_2_0 - Qt_3_0_0) + void squeeze(SaveMode); +%End +%If (Qt_3_0_0 -) + void squeeze(SaveMode = Everything); +%End + void unsqueeze(); + +%If (Qt_2_2_0 -) + QValueList<QTranslatorMessage> messages() const; +%End + +private: + QTranslator(const QTranslator &); +}; + +%End diff --git a/python/pyqt/sip/qt/qurl.sip b/python/pyqt/sip/qt/qurl.sip new file mode 100644 index 00000000..7cbe394d --- /dev/null +++ b/python/pyqt/sip/qt/qurl.sip @@ -0,0 +1,114 @@ +// This is the SIP interface definition for QUrl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QUrl (Qt v2.1+)</Title> +<Para> +<Literal>QUrl</Literal> is fully implemented, including the +<Literal>QString()</Literal>, <Literal>==</Literal> and <Literal>!=</Literal> +operators. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 -) + +class QUrl +{ +%TypeHeaderCode +#include <qurl.h> +%End + +public: + QUrl(); + QUrl(const QString &); + QUrl(const QUrl &); + QUrl(const QUrl &,const QString &,bool = 0); + + QString protocol() const; + virtual void setProtocol(const QString &); + + QString user() const; + virtual void setUser(const QString &); + bool hasUser() const; + + QString password() const; + virtual void setPassword(const QString &); + bool hasPassword() const; + + QString host() const; + virtual void setHost(const QString &); + bool hasHost() const; + + int port() const; + virtual void setPort(int); +%If (Qt_3_0_0 -) + bool hasPort() const; +%End + + QString path(bool = 1) const; + virtual void setPath(const QString &); + bool hasPath() const; + + virtual void setEncodedPathAndQuery(const QString &); + QString encodedPathAndQuery(); + + virtual void setQuery(const QString &); + QString query() const; + + QString ref() const; + virtual void setRef(const QString &); + bool hasRef() const; + + bool isValid() const; + bool isLocalFile() const; + + virtual void addPath(const QString &); + virtual void setFileName(const QString &); + + QString fileName() const; + QString dirPath() const; + + bool operator==(const QUrl &) const; + bool operator==(const QString &) const; + + // Qt doesn't implement these, but Python doesn't support C++'s + // default handling of != when == is implemented. + bool operator!=(const QUrl &) const; + bool operator!=(const QString &) const; + + static void decode(QString &); + static void encode(QString &); + + virtual QString toString(bool = 0,bool = 0) const; + + virtual bool cdUp(); + + static bool isRelativeUrl(const QString &); + +protected: + virtual void reset(); + virtual bool parse(const QString &); +}; + +%End diff --git a/python/pyqt/sip/qt/qurlinfo.sip b/python/pyqt/sip/qt/qurlinfo.sip new file mode 100644 index 00000000..7f2d5d3b --- /dev/null +++ b/python/pyqt/sip/qt/qurlinfo.sip @@ -0,0 +1,96 @@ +// This is the SIP interface definition for QUrlInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QUrlInfo (Qt v2.1+)</Title> +<Para> +<Literal>QUrlInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_1_0 -) + +class QUrlInfo +{ +%TypeHeaderCode +#include <qurlinfo.h> +%End + +public: +%If (Qt_3_2_0 -) + enum PermissionSpec { + ReadOwner, WriteOwner, ExeOwner, + ReadGroup, WriteGroup, ExeGroup, + ReadOther, WriteOther, ExeOther + }; +%End + + QUrlInfo(); + QUrlInfo(const QUrlOperator &,const QString &); + QUrlInfo(const QUrlInfo &); + QUrlInfo(const QString &,int,const QString &,const QString &,uint, + const QDateTime &,const QDateTime &,bool,bool,bool,bool,bool, + bool); + QUrlInfo(const QUrl &,int,const QString &,const QString &,uint, + const QDateTime &,const QDateTime &,bool,bool,bool,bool,bool, + bool); + + virtual void setName(const QString &); + virtual void setDir(bool); + virtual void setFile(bool); + virtual void setSymLink(bool); + virtual void setOwner(const QString &); + virtual void setGroup(const QString &); + virtual void setSize(uint); + virtual void setWritable(bool); + virtual void setReadable(bool); + virtual void setPermissions(int); + virtual void setLastModified(const QDateTime &); + +%If (Qt_3_0_0 -) + bool isValid() const; +%End + + QString name() const; + int permissions() const; + QString owner() const; + QString group() const; + uint size() const; + QDateTime lastModified() const; + QDateTime lastRead() const; + bool isDir() const; + bool isFile() const; + bool isSymLink() const; + bool isWritable() const; + bool isReadable() const; + bool isExecutable() const; + + static bool greaterThan(const QUrlInfo &,const QUrlInfo &,int); + static bool lessThan(const QUrlInfo &,const QUrlInfo &,int); + static bool equal(const QUrlInfo &,const QUrlInfo &,int); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qurloperator.sip b/python/pyqt/sip/qt/qurloperator.sip new file mode 100644 index 00000000..b776516f --- /dev/null +++ b/python/pyqt/sip/qt/qurloperator.sip @@ -0,0 +1,115 @@ +// This is the SIP interface definition for QUrlOperator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QUrlOperator (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef>virtual bool <Function>isDir</Function></FuncDef> + <ParamDef>bool *<Parameter>ok</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This returns a tuple of the <Literal>bool</Literal> result and the +<Literal>ok</Literal> value. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_1_0 -) + +class QUrlOperator : QObject, QUrl +{ +%TypeHeaderCode +#include <qurloperator.h> +%End + +public: + QUrlOperator(); + QUrlOperator(const QString &); + QUrlOperator(const QUrlOperator &); + QUrlOperator(const QUrlOperator &,const QString &,bool = 0); + + virtual void setPath(const QString &); + virtual bool cdUp(); + + virtual const QNetworkOperation *listChildren(); + virtual const QNetworkOperation *mkdir(const QString &); + virtual const QNetworkOperation *remove(const QString &); + virtual const QNetworkOperation *rename(const QString &, + const QString &); + virtual const QNetworkOperation *get(const QString & = QString::null); + virtual const QNetworkOperation *put(const QByteArray &, + const QString & = QString::null); +%If (- Qt_3_0_0) + virtual QList<QNetworkOperation> copy(const QString &,const QString &, + bool = 0); +%End +%If (Qt_3_0_0 -) + virtual QPtrList<QNetworkOperation> copy(const QString &, + const QString &,bool = 0, + bool = 1); +%End + virtual void copy(const QStringList &,const QString &,bool = 0); + virtual bool isDir(bool * = 0); + + virtual void setNameFilter(const QString &); + QString nameFilter() const; + + virtual QUrlInfo info(const QString &) const; + + virtual void stop(); + +signals: + void newChildren(const QValueList<QUrlInfo> &,QNetworkOperation *); + void finished(QNetworkOperation *); + void start(QNetworkOperation *); + void createdDirectory(const QUrlInfo &,QNetworkOperation *); + void removed(QNetworkOperation *); + void itemChanged(QNetworkOperation *); + void data(const QByteArray &,QNetworkOperation *); + void dataTransferProgress(int,int,QNetworkOperation *); +%If (- Qt_3_0_0) + void startedNextCopy(const QList<QNetworkOperation> &); +%End +%If (Qt_3_0_0 -) + void startedNextCopy(const QPtrList<QNetworkOperation> &); +%End + void connectionStateChanged(int,const QString &); + +protected: +%If (- Qt_3_0_0) + virtual void reset(); + virtual bool parse(const QString &); +%End +%If (Qt_3_0_0 -) + void reset(); + bool parse(const QString &); +%End + virtual bool checkValid(); + virtual void clearEntries(); + void getNetworkProtocol(); + void deleteNetworkProtocol(); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/quuid.sip b/python/pyqt/sip/qt/quuid.sip new file mode 100644 index 00000000..5836dfb8 --- /dev/null +++ b/python/pyqt/sip/qt/quuid.sip @@ -0,0 +1,87 @@ +// This is the SIP interface definition for QUuid. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QUuid (Qt v3.0+)</Title> +<Para> +<Literal>QUuid</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QUuid +{ +%TypeHeaderCode +#include <quuid.h> +%End + +public: +%If (Qt_3_3_0 -) + enum Variant + { + VarUnknown, + NCS, + DCE, + Microsoft, + Reserved + }; + + enum Version + { + VerUnknown, + Time, + EmbeddedPOSIX, + Name, + Random + }; +%End + + QUuid(); +%If (Qt_3_0_1 -) + QUuid(uint,ushort,ushort,uchar,uchar,uchar,uchar,uchar,uchar,uchar,uchar); +%End +%If (- Qt_3_0_1) + QUuid(ulong,ushort,ushort,uchar,uchar,uchar,uchar,uchar,uchar,uchar,uchar); +%End + QUuid(const QUuid &); + QUuid(const QString &); + + QString toString() const; + bool isNull() const; + + bool operator==(const QUuid &) const; + bool operator!=(const QUuid &) const; + +%If (Qt_3_3_0 -) + bool operator<(const QUuid &) const; + bool operator>(const QUuid &) const; + + static QUuid createUuid(); + QUuid::Variant variant() const; + QUuid::Version version() const; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qvalidator.sip b/python/pyqt/sip/qt/qvalidator.sip new file mode 100644 index 00000000..d3329dbd --- /dev/null +++ b/python/pyqt/sip/qt/qvalidator.sip @@ -0,0 +1,227 @@ +// This is the SIP interface definition for QValidator, QDoubleValidator, +// QIntValidator and QRegExpValidator. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QValidator</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QDoubleValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QIntValidator</Title> +<FuncSynopsis> + <FuncDef>State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> + +<Sect2><Title>QRegExpValidator (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual State <Function>validate</Function></FuncDef> + <ParamDef>QString& <Parameter>input</Parameter></ParamDef> + <ParamDef>int& <Parameter>pos</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The returned value is a tuple of the <Literal>State</Literal> result and the +updated <Literal>pos</Literal>. +</Para> +</Sect2> +%End + + +class QValidator : QObject +{ +%TypeHeaderCode +#include <qvalidator.h> +%End + +public: +%If (- Qt_3_0_0) + QValidator(QWidget * /TransferThis/,const char * = 0); +%End +%If (Qt_3_0_0 -) + QValidator(QObject * /TransferThis/,const char * = 0); +%End + +%If (- Qt_2_1_0) + enum State + { + Invalid, + Valid, + Acceptable + }; +%End +%If (Qt_2_1_0 -) + enum State + { + Invalid, + Intermediate, + Valid = Intermediate, + Acceptable + }; +%End + +%If (Qt_2_00 -) + virtual State validate(QString &,int & /In,Out/) const = 0; + virtual void fixup(QString &) const; +%End +%If (- Qt_2_00) + virtual State validate(QString &,int & /In,Out/) = 0; + virtual void fixup(QString &); +%End + +private: +%If (Qt_2_1_0 -) + QValidator(const QValidator &); +%End +}; + + +class QIntValidator : QValidator +{ +%TypeHeaderCode +#include <qvalidator.h> +%End + +public: +%If (Qt_3_0_0 -) + QIntValidator(QObject * /TransferThis/,const char * = 0); + QIntValidator(int,int,QObject * /TransferThis/,const char * = 0); +%End +%If (- Qt_3_0_0) + QIntValidator(QWidget * /TransferThis/,const char * = 0); + QIntValidator(int,int,QWidget * /TransferThis/,const char * = 0); +%End + +%If (Qt_2_00 -) + QValidator::State validate(QString &,int & /In,Out/) const; +%End +%If (- Qt_2_00) + QValidator::State validate(QString &,int & /In,Out/); +%End + +%If (Qt_2_1_0 -) + void setBottom(int); + void setTop(int); +%End + virtual void setRange(int,int); + + int bottom() const; + int top() const; + +private: +%If (Qt_2_1_0 -) + QIntValidator(const QIntValidator &); +%End +}; + + +class QDoubleValidator : QValidator +{ +%TypeHeaderCode +#include <qvalidator.h> +%End + +public: +%If (Qt_3_0_0 -) + QDoubleValidator(QObject * /TransferThis/,const char * = 0); + QDoubleValidator(double,double,int,QObject * /TransferThis/, + const char * = 0); +%End +%If (- Qt_3_0_0) + QDoubleValidator(QWidget * /TransferThis/,const char * = 0); + QDoubleValidator(double,double,int,QWidget * /TransferThis/, + const char * = 0); +%End + +%If (Qt_2_00 -) + QValidator::State validate(QString &,int & /In,Out/) const; +%End +%If (- Qt_2_00) + QValidator::State validate(QString &,int & /In,Out/); +%End + + virtual void setRange(double,double,int = 0); +%If (Qt_2_1_0 -) + void setBottom(double); + void setTop(double); + void setDecimals(int); +%End + + double bottom() const; + double top() const; + int decimals() const; + +private: +%If (Qt_2_1_0 -) + QDoubleValidator(const QDoubleValidator &); +%End +}; + + +%If (Qt_3_0_0 -) + +class QRegExpValidator : QValidator +{ +%TypeHeaderCode +#include <qvalidator.h> +%End + +public: + QRegExpValidator(QObject * /TransferThis/,const char * = 0); + QRegExpValidator(const QRegExp &,QObject * /TransferThis/, + const char * = 0); + + virtual QValidator::State validate(QString &,int & /In,Out/) const; + + void setRegExp(const QRegExp &); + const QRegExp ®Exp() const; + +private: + QRegExpValidator(const QRegExpValidator &); +}; + +%End diff --git a/python/pyqt/sip/qt/qvaluelist.sip b/python/pyqt/sip/qt/qvaluelist.sip new file mode 100644 index 00000000..732740da --- /dev/null +++ b/python/pyqt/sip/qt/qvaluelist.sip @@ -0,0 +1,181 @@ +// This is the SIP interface definition for all types based on the QValueList +// template. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QValueList<type> (Qt v2+)</Title> +<Para> +Types based on the <Literal>QValueList</Literal> template are automatically +converted to and from Python lists of the type. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 -) + +template<Type> +%MappedType QValueList<Type> +{ +%TypeHeaderCode +#include <qvaluelist.h> +%End + +%ConvertFromTypeCode + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<Type> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new Type(*it),sipClass_Type,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,SIP_NOT_NONE)) + return 0; + + return 1; + } + + QValueList<Type> *qvl = new QValueList<Type>; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int iserr = 0, state; + + // We apply the transfer to the list itself, not the elements. + Type *itm = reinterpret_cast<Type *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_Type,0,SIP_NOT_NONE,&state,&iserr)); + + if (iserr) + { + sipReleaseInstance(itm,sipClass_Type,state); + + *sipIsErr = 1; + delete qvl; + + return 0; + } + + qvl -> append(*itm); + + sipReleaseInstance(itm,sipClass_Type,state); + } + + *sipCppPtr = qvl; + + return sipGetState(sipTransferObj); +%End +}; + +%End + + +%If (Qt_2_00 -) + +%MappedType QValueList<int> +{ +%TypeHeaderCode +#include <qvaluelist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of integers. + + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + for (uint i = 0; i < sipCpp -> count(); ++i) + if (PyList_SetItem(l,i,PyInt_FromLong((long)(*sipCpp)[i])) < 0) + { + Py_DECREF(l); + + return NULL; + } + + return l; +%End + +%ConvertToTypeCode + // Convert a Python list of integers to a QValueList<int> on the heap. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + QValueList<int> *qvl = new QValueList<int>; + + PyErr_Clear(); + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + qvl -> append((int)PyInt_AsLong(PyList_GET_ITEM(sipPy,i))); + + if (PyErr_Occurred() != NULL) + { + delete qvl; + *sipIsErr = 1; + + return 0; + } + } + + *sipCppPtr = qvl; + + return 1; +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qvariant.sip b/python/pyqt/sip/qt/qvariant.sip new file mode 100644 index 00000000..c942c3ef --- /dev/null +++ b/python/pyqt/sip/qt/qvariant.sip @@ -0,0 +1,420 @@ +// This is the SIP interface definition for QVariant. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QVariant (Qt v2.1+)</Title> +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const char *<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QBitArray &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QValueList<QVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QVariant</Function></FuncDef> + <ParamDef>const QMap<QString,QVariant> &<Parameter>val</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QBitArray &<Function>asBitArray</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool &<Function>asBool</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>double &<Function>asDouble</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>int &<Function>asInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueList<QVariant> &<Function>asList</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMap<QString,QVariant> &<Function>asMap</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>uint &<Function>asUInt</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QVariant><Function>listBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QVariant><Function>listEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QMapConstIterator<QString,QVariant><Function>mapFind</Function> const</FuncDef> + <ParamDef>const QString &<Parameter>key</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QString><Function>stringListBegin</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QValueListConstIterator<QString><Function>stringListEnd</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QBitArray <Function>toBitArray</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>const QValueList<QVariant><Function>toList</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>const QMap<QString,QVariant><Function>toMap</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 -) + +class QVariant +{ +%TypeHeaderCode +#include <qvariant.h> +%End + +public: + enum Type { + Invalid, + Map, + List, + String, + StringList, + Font, + Pixmap, + Brush, + Rect, + Size, + Color, + Palette, + ColorGroup, + IconSet, + Point, + Image, + Int, + UInt, + Bool, + Double, + CString, + PointArray, + Region, + Bitmap, + Cursor, +%If (Qt_2_2_0 -) + SizePolicy, +%End +%If (Qt_3_0_0 -) + Date, + Time, + DateTime, + ByteArray, + BitArray, + KeySequence, +%End +%If (Qt_3_1_0 -) + Pen, +%End +%If (Qt_3_2_0 -) + LongLong, + ULongLong, +%End + }; + + QVariant(); + QVariant(const QVariant &); + QVariant(QDataStream &); + + QVariant(const QString &); + QVariant(const QCString &); +// QVariant(const char *); + QVariant(const QStringList &); + QVariant(const QFont &); + QVariant(const QPixmap &); + QVariant(const QImage &); + QVariant(const QBrush &); + QVariant(const QPoint &); + QVariant(const QRect &); + QVariant(const QSize &); + QVariant(const QColor &); + QVariant(const QPalette &); + QVariant(const QColorGroup &); + QVariant(const QIconSet &); + QVariant(const QPointArray &); + QVariant(const QRegion &); + QVariant(const QBitmap &); + QVariant(const QCursor &); +%If (Qt_3_0_0 -) + QVariant(const QDate &); + QVariant(const QTime &); + QVariant(const QDateTime &); + QVariant(const QByteArray &); +// QVariant(const QBitArray &); +%End +// QVariant(const QValueList<QVariant> &); +// QVariant(const QMap<QString,QVariant> &); + QVariant(int /Constrained/); +// QVariant(uint); +%If (Qt_3_2_0 -) +// QVariant(Q_LLONG); +// QVariant(Q_ULLONG); +%End + QVariant(bool,int); + QVariant(double); +%If (Qt_2_2_0 -) + QVariant(QSizePolicy); +%End +%If (Qt_3_0_0 -) + // This must appear after the QString, int and double ctors because + // each of those can be converted automatically to a QKeySequence and + // we want those to take precedence. + QVariant(const QKeySequence &); +%End +%If (Qt_3_1_0 -) + QVariant(const QPen &); +%End + + Type type() const; + const char* typeName() const; + + bool canCast(Type) const; +%If (Qt_3_0_0 -) + bool cast(Type); +%End + + bool isValid() const; +%If (Qt_3_1_0 -) + bool isNull() const; +%End + + void clear(); + + const QString toString() const; + const QCString toCString() const; + const QStringList toStringList() const; + const QFont toFont() const; + const QPixmap toPixmap() const; + const QImage toImage() const; + const QBrush toBrush() const; + const QPoint toPoint() const; + const QRect toRect() const; + const QSize toSize() const; + const QColor toColor() const; + const QPalette toPalette() const; + const QColorGroup toColorGroup() const; + const QIconSet toIconSet() const; + const QPointArray toPointArray() const; + const QBitmap toBitmap() const; + const QRegion toRegion() const; + const QCursor toCursor() const; +%If (Qt_3_0_0 -) + const QDate toDate() const; + const QTime toTime() const; + const QDateTime toDateTime() const; + const QByteArray toByteArray() const; +// const QBitArray toBitArray() const; + const QKeySequence toKeySequence() const; +%End +%If (Qt_3_1_0 -) + const QPen toPen() const; +%End + int toInt() const; + uint toUInt() const; +%If (Qt_3_2_0 -) +// Q_LLONG toLongLong(bool * = 0) const; +// Q_ULLONG toULongLong( bool * = 0) const; +%End + bool toBool() const; + double toDouble() const; +// const QValueList<QVariant> toList() const; +// const QMap<QString,QVariant> toMap() const; +%If (Qt_2_2_0 -) + QSizePolicy toSizePolicy() const; +%End + +// QValueListConstIterator<QVariant> listBegin() const; +// QValueListConstIterator<QVariant> listEnd() const; +// QValueListConstIterator<QString> stringListBegin() const; +// QValueListConstIterator<QString> stringListEnd() const; +// QMapConstIterator<QString,QVariant> mapBegin() const; +// QMapConstIterator<QString,QVariant> mapEnd() const; +// QMapConstIterator<QString,QVariant> mapFind(const QString &) const; + + QString & asString(); + QCString & asCString(); + QStringList & asStringList(); + QFont & asFont(); + QPixmap & asPixmap(); + QImage & asImage(); + QBrush & asBrush(); + QPoint & asPoint(); + QRect & asRect(); + QSize & asSize(); + QColor & asColor(); + QPalette & asPalette(); + QColorGroup & asColorGroup(); + QIconSet & asIconSet(); + QPointArray & asPointArray(); + QBitmap & asBitmap(); + QRegion & asRegion(); + QCursor & asCursor(); +%If (Qt_3_0_0 -) + QDate & asDate(); + QTime & asTime(); + QDateTime & asDateTime(); + QByteArray & asByteArray(); +// QBitArray & asBitArray(); + QKeySequence & asKeySequence(); +%End +%If (Qt_3_1_0 -) + QPen & asPen(); +%End +// int & asInt(); +// uint & asUInt(); +%If (Qt_3_2_0 -) +// Q_LLONG & asLongLong(); +// Q_ULLONG & asULongLong(); +%End +// bool & asBool(); +// double & asDouble(); +// QValueList<QVariant> & asList(); +// QMap<QString,QVariant> & asMap(); +%If (Qt_2_2_0 -) + QSizePolicy & asSizePolicy(); +%End + + void load(QDataStream &); + void save(QDataStream &) const; + + static const char *typeToName(Type); + static Type nameToType(const char *); +}; + +%End diff --git a/python/pyqt/sip/qt/qvbox.sip b/python/pyqt/sip/qt/qvbox.sip new file mode 100644 index 00000000..9f0e8113 --- /dev/null +++ b/python/pyqt/sip/qt/qvbox.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for QVBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QVBox (Qt v2+)</Title> +<Para> +<Literal>QVBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QVBox : QHBox +{ +%TypeHeaderCode +#include <qvbox.h> +%End + +public: +%If (- Qt_3_0_0) + QVBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0, + bool = 1); +%End +%If (Qt_3_0_0 -) + QVBox(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); +%End + +private: +%If (Qt_2_1_0 -) + QVBox(const QVBox &); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qvbuttongroup.sip b/python/pyqt/sip/qt/qvbuttongroup.sip new file mode 100644 index 00000000..9561ed54 --- /dev/null +++ b/python/pyqt/sip/qt/qvbuttongroup.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for QVButtonGroup. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QVButtonGroup (Qt v2+)</Title> +<Para> +<Literal>QVButtonGroup</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QVButtonGroup : QButtonGroup +{ +%TypeHeaderCode +#include <qvbuttongroup.h> +%End + +public: + QVButtonGroup(QWidget * /TransferThis/ = 0,const char * = 0); + QVButtonGroup(const QString &,QWidget * /TransferThis/ = 0,const char * = 0); + +private: + QVButtonGroup(const QVButtonGroup &); +}; + +%End diff --git a/python/pyqt/sip/qt/qvgroupbox.sip b/python/pyqt/sip/qt/qvgroupbox.sip new file mode 100644 index 00000000..06b355e0 --- /dev/null +++ b/python/pyqt/sip/qt/qvgroupbox.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for QVGroupBox. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QVGroupBox (Qt v2+)</Title> +<Para> +<Literal>QVGroupBox</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +class QVGroupBox : QGroupBox +{ +%TypeHeaderCode +#include <qvgroupbox.h> +%End + +public: + QVGroupBox(QWidget * /TransferThis/ = 0,const char * = 0); + QVGroupBox(const QString &,QWidget * /TransferThis/ = 0,const char * = 0); + +private: + QVGroupBox(const QVGroupBox &); +}; + +%End diff --git a/python/pyqt/sip/qt/qwaitcondition.sip b/python/pyqt/sip/qt/qwaitcondition.sip new file mode 100644 index 00000000..5d8d66f2 --- /dev/null +++ b/python/pyqt/sip/qt/qwaitcondition.sip @@ -0,0 +1,81 @@ +// This is the SIP interface definition for QWaitCondition. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWaitCondition (Qt v2.2+)</Title> +<Para> +<Literal>QWaitCondition</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_THREAD_SUPPORT) + +%If (Qt_3_0_0 -) + +class QWaitCondition +{ +%TypeHeaderCode +#include <qwaitcondition.h> +%End + +public: + QWaitCondition(); + + bool wait(unsigned long = ULONG_MAX) /ReleaseGIL/; + bool wait(QMutex *,unsigned long = ULONG_MAX) /ReleaseGIL/; + + void wakeOne(); + void wakeAll(); + +private: + QWaitCondition(const QWaitCondition &); +}; + +%End + + +%If (Qt_2_2_0 - Qt_3_0_0) + +class QWaitCondition : Qt +{ +%TypeHeaderCode +#include <qthread.h> +%End + +public: + QWaitCondition(); + + bool wait(unsigned long = ULONG_MAX) /ReleaseGIL/; + bool wait(QMutex *,unsigned long = ULONG_MAX) /ReleaseGIL/; + + void wakeOne(); + void wakeAll(); + +private: + QWaitCondition(const QWaitCondition &); +}; + +%End + +%End diff --git a/python/pyqt/sip/qt/qwhatsthis.sip b/python/pyqt/sip/qt/qwhatsthis.sip new file mode 100644 index 00000000..b7454497 --- /dev/null +++ b/python/pyqt/sip/qt/qwhatsthis.sip @@ -0,0 +1,97 @@ +// This is the SIP interface definition for QWhatsThis. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWhatsThis</Title> +<Para> +<Literal>QWhatsThis</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QWhatsThis +{ +%TypeHeaderCode +#include <qwhatsthis.h> +%End + +public: + static void add(QWidget *,const char *,bool = 1); + static void add(QWidget *,const QPixmap &,const char *,const char *,bool = 1); + static void remove(QWidget *); + static const char *textFor(QWidget *); + static QToolButton *whatsThisButton(QWidget *); +}; + +%End + +%If (Qt_2_00 -) + +class QWhatsThis : Qt +{ +%TypeHeaderCode +#include <qwhatsthis.h> +%End + +public: + QWhatsThis(QWidget *); + + virtual QString text(const QPoint &); +%If (Qt_3_0_0 -) + virtual bool clicked(const QString &); +%End + +%If (Qt_3_1_0 -) + static void setFont(const QFont &); +%End + + static void add(QWidget *,const QString &); + static void remove(QWidget *); +%If (- Qt_3_0_0) + static QString textFor(QWidget *,const QPoint & = QPoint()); +%End +%If (Qt_3_0_0 -) + static QString textFor(QWidget *,const QPoint & = QPoint(),bool = 0); +%End + + static QToolButton *whatsThisButton(QWidget *); + + static void enterWhatsThisMode(); + static bool inWhatsThisMode(); +%If (- Qt_3_0_0) + static void leaveWhatsThisMode(const QString & = QString::null, + const QPoint & = QCursor::pos()); +%End +%If (Qt_3_0_0 -) + static void leaveWhatsThisMode(const QString & = QString::null, + const QPoint & = QCursor::pos(), + QWidget * = 0); + + static void display(const QString &,const QPoint & = QCursor::pos(), + QWidget * = 0); +%End +}; + +%End diff --git a/python/pyqt/sip/qt/qwidget.sip b/python/pyqt/sip/qt/qwidget.sip new file mode 100644 index 00000000..f515277d --- /dev/null +++ b/python/pyqt/sip/qt/qwidget.sip @@ -0,0 +1,654 @@ +// This is the SIP interface definition for QWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWidget</Title> +<FuncSynopsis> + <FuncDef>QWExtra *<Function>extraData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>QFocusData *<Function>focusData</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>lower</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>lowerW</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>raise</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed to <Literal>raiseW</Literal> in Python. +</Para> +</Sect2> +%End + + +class QWidget : QObject, QPaintDevice +{ +%TypeHeaderCode +#include <qwidget.h> +%End + +public: + QWidget(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + WId winId() const; + bool isTopLevel() const; +%If (Qt_3_0_0 -) + bool isDialog() const; +%End + bool isPopup() const; + bool isDesktop() const; + bool isModal() const; + bool isEnabled() const; + bool isEnabledTo(QWidget *) const; + bool isEnabledToTLW() const; + const QRect &geometry() const; + int x() const; + int y() const; + QPoint pos() const; + QSize size() const; + int width() const; + int height() const; + QRect rect() const; + QRect childrenRect() const; + QSize minimumSize() const; + QSize maximumSize() const; + void setMinimumSize(const QSize &); + void setMaximumSize(const QSize &); + void setMinimumWidth(int); + void setMinimumHeight(int); + void setMaximumWidth(int); + void setMaximumHeight(int); + QSize sizeIncrement() const; + void setSizeIncrement(const QSize &); + void setFixedSize(const QSize &); + void setFixedSize(int,int); + void setFixedWidth(int); + void setFixedHeight(int); + QPoint mapToGlobal(const QPoint &) const; + QPoint mapFromGlobal(const QPoint &) const; + QPoint mapToParent(const QPoint &) const; + QPoint mapFromParent(const QPoint &) const; +%If (Qt_2_2_0 -) + QPoint mapTo(QWidget *,const QPoint &) const; + QPoint mapFrom(QWidget *,const QPoint &) const; +%End + + QWidget *topLevelWidget() const; + + BackgroundMode backgroundMode() const; +%If (- Qt_3_0_0) + const QColor &backgroundColor() const; + virtual void setBackgroundColor(const QColor &); + const QPixmap *backgroundPixmap(); + virtual void setBackgroundPixmap(const QPixmap &); +%End + + const QColor &foregroundColor() const; + +%If (Qt_3_0_0 -) + const QColor &eraseColor() const; + virtual void setEraseColor(const QColor &); + + const QPixmap *erasePixmap() const; + virtual void setErasePixmap(const QPixmap &); +%End + + const QColorGroup &colorGroup() const; + const QPalette &palette() const; +%If (Qt_2_2_0 -) + bool ownPalette() const; +%End + virtual void setPalette(const QPalette &); +%If (Qt_2_1_0 -) + void unsetPalette(); +%End + +%If (Qt_3_0_0 -) + const QColor &paletteForegroundColor() const; + void setPaletteForegroundColor(const QColor &); + + const QColor &paletteBackgroundColor() const; + virtual void setPaletteBackgroundColor(const QColor &); + + const QPixmap *paletteBackgroundPixmap() const; + virtual void setPaletteBackgroundPixmap(const QPixmap &); + + const QBrush &backgroundBrush() const; +%End + +%If (Qt_2_2_0 -) + bool ownFont() const; +%End + virtual void setFont(const QFont &); + QFontMetrics fontMetrics() const; + QFontInfo fontInfo() const; + +%If (- Qt_3_0_0) + enum PropagationMode + { + NoChildren, + AllChildren, + SameFont, + SamePalette = SameFont + }; + + PropagationMode fontPropagation() const; + PropagationMode palettePropagation() const; +%End + + const QCursor &cursor() const; +%If (Qt_2_2_0 -) + bool ownCursor() const; +%End + virtual void setCursor(const QCursor &); + const QPixmap *icon() const; + bool hasMouseTracking() const; +%If (Qt_3_0_0 -) + bool hasMouse() const; +%End + + void clearMask(); + bool isActiveWindow() const; + bool isFocusEnabled() const; + FocusPolicy focusPolicy() const; + bool hasFocus() const; + static void setTabOrder(QWidget *,QWidget *); + QWidget *focusProxy() const; + +%If (Qt_3_2_0 -) + void setInputMethodEnabled(bool); + bool isInputMethodEnabled() const; +%End + + void grabMouse(); + void grabMouse(const QCursor &); + void releaseMouse(); + void grabKeyboard(); + void releaseKeyboard(); + static QWidget *mouseGrabber(); + static QWidget *keyboardGrabber(); + bool isUpdatesEnabled() const; + bool isVisible() const; + bool isVisibleTo(QWidget *) const; + bool isVisibleToTLW() const; + virtual QSize sizeHint() const; +%If (- Qt_3_1_0) + virtual void adjustSize(); +%End + void erase(); + void erase(int,int,int,int); + void erase(const QRect &); + void scroll(int,int); + QWidget *focusWidget() const; + bool acceptDrops() const; +%If (- Qt_3_0_0) + QWidget *parentWidget() const; + bool testWFlags(WFlags) const; +%End +%If (Qt_3_0_0 -) + QWidget *parentWidget(bool = 0) const; + WState testWState(WState) const; + WFlags testWFlags(WFlags) const; +%End + static QWidget *find(WId); + +%If (Qt_3_0_0 -) + QWidget *childAt(int,int,bool = 0) const; + QWidget *childAt(const QPoint &,bool = 0) const; +%End + +%If (Qt_3_3_0 -) + void setWindowOpacity(double); + double windowOpacity() const; +%End + +%If (- Qt_2_00) + GUIStyle style() const; + virtual void setStyle(GUIStyle); + const QRect &frameGeometry() const; + void setMinimumSize(int,int); + void setMaximumSize(int,int); + void setSizeIncrement(int,int); + + enum BackgroundMode + { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteBackground, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBase + }; + + void setBackgroundMode(BackgroundMode); + const QFont &font() const; + void setFontPropagation(PropagationMode); + void setPalettePropagation(PropagationMode); + const char *caption() const; + const char *iconText() const; + void setMask(QBitmap); + void setMask(const QRegion &); + + enum FocusPolicy + { + NoFocus = 0, + TabFocus = 1, + ClickFocus = 2, + StrongFocus = 3 + }; + + void setActiveWindow(); + void setFocusPolicy(FocusPolicy); + void setFocus(); + void clearFocus(); + void setFocusProxy(QWidget *); + virtual bool close(bool = 0); + void recreate(QWidget *,WFlags,const QPoint &,bool = 0); + void drawText(int,int,const char *); + void drawText(const QPoint &,const char *); + void setAcceptDrops(bool); +%End + +%If (Qt_2_00 -) + void setName(const char *); + QStyle &style() const; + void setStyle(QStyle *); +%If (Qt_3_0_0 -) + QStyle *setStyle(const QString &); +%End + QRect frameGeometry() const; + QSize frameSize() const; + QRegion childrenRegion() const; + int minimumWidth() const; + int minimumHeight() const; + int maximumWidth() const; + int maximumHeight() const; + virtual void setMinimumSize(int,int); + virtual void setMaximumSize(int,int); + virtual void setSizeIncrement(int,int); + QSize baseSize() const; + void setBaseSize(const QSize &); + void setBaseSize(int,int); + +%If (- Qt_2_2_0) + enum BackgroundMode + { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteButton, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBrightText, + PaletteBase, + PaletteBackground, + PaletteShadow, + PaletteHighlight, + PaletteHighlightedText + }; +%End +%If (Qt_2_2_0 - Qt_3_0_0) + enum BackgroundMode + { + FixedColor, + FixedPixmap, + NoBackground, + PaletteForeground, + PaletteButton, + PaletteLight, + PaletteMidlight, + PaletteDark, + PaletteMid, + PaletteText, + PaletteBrightText, + PaletteBase, + PaletteBackground, + PaletteShadow, + PaletteHighlight, + PaletteHighlightedText, + PaletteButtonText, + X11ParentRelative + }; +%End + + virtual void setBackgroundMode(BackgroundMode); +%If (Qt_3_0_0 -) + void setBackgroundMode(BackgroundMode,BackgroundMode); +%End + QFont font() const; +%If (- Qt_3_0_0) + void setPalette(const QPalette &,bool); + void setFont(const QFont &,bool); + virtual void setFontPropagation(PropagationMode); + virtual void setPalettePropagation(PropagationMode); +%End + virtual void unsetCursor(); + QString caption() const; + QString iconText() const; + virtual void setMask(const QBitmap &); + virtual void setMask(const QRegion &); + + enum FocusPolicy + { + NoFocus = 0, + TabFocus = 1, + ClickFocus = 2, + StrongFocus = 3, + WheelFocus = 7 + }; + + virtual void setActiveWindow(); + virtual void setFocusPolicy(FocusPolicy); + virtual void setFocusProxy(QWidget *); + virtual bool close(bool); + // Obsolete. + QRect visibleRect() const; + bool isMinimized() const; + virtual QSize minimumSizeHint() const; + virtual QSizePolicy sizePolicy() const; +%If (Qt_2_2_0 -) + bool isHidden() const; + bool isMaximized() const; +%End +%If (Qt_3_1_0 -) + bool isShown() const; + bool isFullScreen() const; +%End + +%If (Qt_3_3_0 -) + uint windowState() const; + void setWindowState(uint); +%End + +%If (Qt_3_0_0 -) + virtual void setSizePolicy(QSizePolicy); +%End +%If (Qt_3_1_0 -) + void setSizePolicy(QSizePolicy::SizeType,QSizePolicy::SizeType, + bool = 0); +%End +%If (Qt_2_2_0 - Qt_3_0_0) + void setSizePolicy(QSizePolicy); +%End + virtual int heightForWidth(int) const; + +%If (Qt_3_2_0 -) + QRegion clipRegion() const; +%End + + QLayout *layout() const; + void updateGeometry(); + + virtual void reparent(QWidget * /GetWrapper/,WFlags,const QPoint &, + bool = 0); +%MethodCode + if (sipCpp -> parent() != a0) + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3); + Py_END_ALLOW_THREADS +%End + +%If (Qt_2_1_0 -) + void reparent(QWidget * /GetWrapper/,const QPoint &,bool = 0); +%MethodCode + if (sipCpp -> parent() != a0) + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipCpp->reparent(a0, *a1, a2); + Py_END_ALLOW_THREADS +%End +%End + + void erase(const QRegion &); + void scroll(int,int,const QRect &); + void drawText(int,int,const QString &); + void drawText(const QPoint &,const QString &); + virtual void setAcceptDrops(bool); + virtual void setAutoMask(bool); + bool autoMask() const; + virtual bool customWhatsThis() const; +%If (- Qt_3_0_0) + bool testWState(uint) const; +%End +%End + +%If (Qt_2_1_0 -) + QRect microFocusHint() const; + void unsetFont(); +%End + +%If (Qt_2_1_0 -) + enum BackgroundOrigin { + WidgetOrigin, + ParentOrigin, +%If (Qt_3_0_0 -) + WindowOrigin, +%End +%If (Qt_3_1_0 -) + AncestorOrigin, +%End + }; +%End + +%If (Qt_2_1_0 - Qt_3_0_0) + void setBackgroundOrigin(BackgroundOrigin); +%End +%If (Qt_3_0_0 -) + virtual void setBackgroundOrigin(BackgroundOrigin); +%End +%If (Qt_2_1_0 -) + BackgroundOrigin backgroundOrigin() const; +%End + +%If (Qt_3_1_0 -) + QPoint backgroundOffset() const; +%End + +public slots: +%If (Qt_3_1_0 -) + virtual void adjustSize(); +%End + virtual void setEnabled(bool); +%If (Qt_2_2_0 -) + void setDisabled(bool); +%End + void update(); + void update(int,int,int,int); + void update(const QRect &); + void repaint(int,int,int,int,bool = 1); + void repaint(const QRect &,bool = 1); + virtual void show(); + virtual void hide(); +%If (Qt_3_1_0 -) + void setShown(bool); + void setHidden(bool); +%End + void raise() /PyName=raiseW/; + void lower() /PyName=lowerW/; + virtual void move(int,int); + void move(const QPoint &); + virtual void resize(int,int); + void resize(const QSize &); + virtual void setGeometry(int,int,int,int); + +%If (- Qt_2_00) + void setCaption(const char *); + void setIcon(const QPixmap &); + void setIconText(const char *); + void setMouseTracking(bool); + void setUpdatesEnabled(bool); + void repaint(bool = 1); + void iconify(); + void setGeometry(const QRect &); +%End + +%If (Qt_2_00 -) + virtual void setCaption(const QString &); + virtual void setIcon(const QPixmap &); + virtual void setIconText(const QString &); + virtual void setMouseTracking(bool); + virtual void setFocus(); + void clearFocus(); + virtual void setUpdatesEnabled(bool); + void repaint(); + void repaint(bool); + void repaint(const QRegion &,bool = 1); + virtual void showMinimized(); + virtual void showMaximized(); + virtual void showNormal(); + virtual void polish(); + bool close(); + virtual void setGeometry(const QRect &); +%End + +%If (Qt_2_1_0 -) + void showFullScreen(); + void constPolish() const; +%End + +protected: + bool event(QEvent *); + virtual void mousePressEvent(QMouseEvent *); + virtual void mouseReleaseEvent(QMouseEvent *); + virtual void mouseDoubleClickEvent(QMouseEvent *); + virtual void mouseMoveEvent(QMouseEvent *); + virtual void keyPressEvent(QKeyEvent *); + virtual void keyReleaseEvent(QKeyEvent *); + virtual void focusInEvent(QFocusEvent *); + virtual void focusOutEvent(QFocusEvent *); + virtual void enterEvent(QEvent *); + virtual void leaveEvent(QEvent *); + virtual void paintEvent(QPaintEvent *); + virtual void moveEvent(QMoveEvent *); + virtual void resizeEvent(QResizeEvent *); + virtual void closeEvent(QCloseEvent *); +%If (Qt_3_0_0 -) + virtual void contextMenuEvent(QContextMenuEvent *); + virtual void imStartEvent(QIMEvent *); + virtual void imComposeEvent(QIMEvent *); + virtual void imEndEvent(QIMEvent *); + virtual void tabletEvent(QTabletEvent *); +%End + virtual void enabledChange(bool); +%If (- Qt_3_0_0) + virtual void backgroundColorChange(const QColor &); + virtual void backgroundPixmapChange(const QPixmap &); +%End + virtual void paletteChange(const QPalette &); + virtual void fontChange(const QFont &); +%If (Qt_3_0_0 -) + virtual void windowActivationChange(bool); + void resetInputContext(); +%End + WFlags getWFlags() const; + void clearWFlags(WFlags); + virtual bool focusNextPrevChild(bool); +// QWExtra *extraData(); +// QFocusData *focusData(); + +%If (- Qt_2_00) + virtual void styleChange(GUIStyle); + void create(WId); + void create(WId,bool,bool); + void destroy(bool,bool); + void setWFlags(WFlags); + void setFRect(const QRect &); + void setCRect(const QRect &); + void setSizeGrip(bool); +%End + +%If (Qt_2_00 -) + virtual void wheelEvent(QWheelEvent *); +%If (Qt_DRAGANDDROP) + virtual void dragEnterEvent(QDragEnterEvent *); + virtual void dragMoveEvent(QDragMoveEvent *); + virtual void dragLeaveEvent(QDragLeaveEvent *); + virtual void dropEvent(QDropEvent *); +%End + virtual void showEvent(QShowEvent *); + virtual void hideEvent(QHideEvent *); +%If (- Qt_3_0_0) + virtual void customEvent(QCustomEvent *); +%End + + + virtual void updateMask(); + + virtual void styleChange(QStyle &); + int metric(int) const; + virtual void create(WId = 0,bool = 1,bool = 1); + virtual void destroy(bool = 1,bool = 1); + uint getWState() const; + virtual void setWState(uint); + void clearWState(uint); + virtual void setWFlags(WFlags); +%If (- Qt_3_0_0) + virtual void setFRect(const QRect &); + virtual void setCRect(const QRect &); +%End + virtual void setKeyCompression(bool); +%If (- Qt_3_0_0) + virtual void setMicroFocusHint(int,int,int,int,bool = 1); +%End +%If (Qt_3_0_0 -) + virtual void setMicroFocusHint(int,int,int,int,bool = 1,QFont * = 0); +%End +%End + +private: + QWidget(const QWidget &); +}; diff --git a/python/pyqt/sip/qt/qwidgetlist.sip b/python/pyqt/sip/qt/qwidgetlist.sip new file mode 100644 index 00000000..7fc67421 --- /dev/null +++ b/python/pyqt/sip/qt/qwidgetlist.sip @@ -0,0 +1,108 @@ +// This is the SIP interface definition for QWidgetList. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWidgetList</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QWidgetList</Literal> is the +return type of a function or the type of an argument, a Python list of +instances is used instead. +</Para> +</Sect2> +%End + + +%MappedType QWidgetList +{ +%TypeHeaderCode +#include <qwidgetlist.h> +#include "sipqtQWidget.h" +%End + +%ConvertFromTypeCode + // Convert the list. + + PyObject *pl; + QWidget *obj; + + if ((pl = PyList_New(0)) == NULL) + return NULL; + + for (QWidgetListIt it(*sipCpp); (obj = it.current()) != NULL; ++it) + { + PyObject *inst; + + if ((inst = sipConvertFromInstance(obj,sipClass_QWidget,sipTransferObj)) == NULL || PyList_Append(pl,inst) < 0) + { + Py_XDECREF(inst); + Py_DECREF(pl); + + return NULL; + } + + Py_DECREF(inst); + } + + return pl; +%End + +%ConvertToTypeCode + // Convert a Python list of QWidget instances to a QWidgetList on the + // heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QWidget,0)) + return 0; + + return 1; + } + + QWidgetList *qwl = new QWidgetList; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + QWidget *qw; + + // We apply the transfer to the list itself, not the elements. + // Note that any temporary element will never be destroyed. + // There is nothing that can be done about this. + qw = reinterpret_cast<QWidget *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QWidget,0,0,0,sipIsErr)); + + if (*sipIsErr) + { + delete qwl; + return 0; + } + + qwl -> append(qw); + } + + *sipCppPtr = qwl; + + return sipGetState(sipTransferObj); +%End +}; diff --git a/python/pyqt/sip/qt/qwidgetstack.sip b/python/pyqt/sip/qt/qwidgetstack.sip new file mode 100644 index 00000000..daf6694a --- /dev/null +++ b/python/pyqt/sip/qt/qwidgetstack.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for QWidgetStack. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWidgetStack</Title> +<Para> +<Literal>QWidgetStack</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +class QWidgetStack : QFrame +{ +%TypeHeaderCode +#include <qwidgetstack.h> +%End + +public: + QWidgetStack(QWidget * /TransferThis/ = 0,const char * = 0); +%If (Qt_3_1_0 -) + QWidgetStack(QWidget * /TransferThis/,const char *,WFlags); +%End + + // The QWidget has it's parent changed to be `this' so it will be + // deleted automatically when `this' is deleted. It stays this way + // even if removeWidget() is called, so it isn't transferred back. +%If (- Qt_3_0_0) + void addWidget(QWidget * /Transfer/,int); +%End +%If (Qt_3_0_0 -) + int addWidget(QWidget * /Transfer/,int = -1); +%End + void removeWidget(QWidget *); + +%If (Qt_2_00 -) + QSize sizeHint() const; + QSize minimumSizeHint() const; +%End + void show(); + + QWidget *widget(int) const; + int id(QWidget *) const; + + QWidget *visibleWidget() const; + +%If (Qt_2_00 -) + void setFrameRect(const QRect &); +%End + +%If (- Qt_2_00) + bool event(QEvent *); +%End + +signals: + void aboutToShow(int); + void aboutToShow(QWidget *); + +public slots: + void raiseWidget(int); + void raiseWidget(QWidget *); + +protected: + void frameChanged(); +%If (- Qt_2_00) + void setChildGeometries(); +%End +%If (Qt_2_00 -) + void resizeEvent(QResizeEvent *); + + virtual void setChildGeometries(); + void childEvent(QChildEvent *); +%End + +private: +%If (Qt_2_1_0 -) + QWidgetStack(const QWidgetStack &); +%End +}; diff --git a/python/pyqt/sip/qt/qwindow.sip b/python/pyqt/sip/qt/qwindow.sip new file mode 100644 index 00000000..4305c426 --- /dev/null +++ b/python/pyqt/sip/qt/qwindow.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for QWindow. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWindow</Title> +<Para> +<Literal>QWindow</Literal> is fully implemented (Qt v1.x). +</Para> +</Sect2> +%End + + +%If (- Qt_2_00) + +class QWindow : QWidget +{ +%TypeHeaderCode +#include <qwindow.h> +%End + +public: + QWindow(QWidget * = 0,const char * = 0,WFlags = 0); + +private: + QWindow(const QWindow &); +}; + +%End diff --git a/python/pyqt/sip/qt/qwindowdefs.sip b/python/pyqt/sip/qt/qwindowdefs.sip new file mode 100644 index 00000000..4638d710 --- /dev/null +++ b/python/pyqt/sip/qt/qwindowdefs.sip @@ -0,0 +1,180 @@ +// This is the SIP interface definition for a variety of constant definitions. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>Qt Constants</Title> +<Para> +All constant values defined by Qt have equivalent constants defined to Python. +</Para> +</Sect2> +%End + + +%ModuleHeaderCode +#include <qwindowdefs.h> +%End + + +%OptionalInclude qwindowdefs_mac.sip +%OptionalInclude qwindowdefs_qws.sip +%OptionalInclude qwindowdefs_win.sip +%OptionalInclude qwindowdefs_x11.sip + + +%If (- Qt_2_00) +typedef short QCOORD; + +const int QCOORD_MIN; +const int QCOORD_MAX; +%End + +%If (Qt_2_00 -) +typedef Q_INT32 QCOORD; + +const QCOORD QCOORD_MIN; +const QCOORD QCOORD_MAX; +%End + + +typedef unsigned QRgb; + +%If (- Qt_3_0_0) +char *qAppName(); +%End +%If (Qt_3_0_0 -) +const char *qAppName(); +%End + + +%If (- Qt_2_00) + +enum GUIStyle { + MacStyle, + WindowsStyle, + Win3Style, + PMStyle, + MotifStyle +}; + + +// Widget state flags. + +typedef uint WFlags; + +const uint WState_Created; +const uint WState_Disabled; +const uint WState_Visible; +const uint WState_DoHide; +const uint WState_ClickToFocus; +const uint WState_TrackMouse; +const uint WState_BlockUpdates; +const uint WState_PaintEvent; + +// Widget type flags. + +const uint WType_TopLevel; +const uint WType_Modal; +const uint WType_Popup; +const uint WType_Desktop; + +// Window style flags. + +const uint WStyle_Customize; +const uint WStyle_NormalBorder; +const uint WStyle_DialogBorder; +const uint WStyle_NoBorder; +const uint WStyle_Title; +const uint WStyle_SysMenu; +const uint WStyle_Minimize; +const uint WStyle_Maximize; +const uint WStyle_MinMax; +const uint WStyle_Tool; +const uint WStyle_Mask; + +// Miscellaneous widget flags. + +const uint WCursorSet; +const uint WDestructiveClose; +const uint WPaintDesktop; +const uint WPaintUnclipped; +const uint WPaintClever; +const uint WConfigPending; +const uint WResizeNoErase; +const uint WRecreated; +const uint WExportFontMetrics; +const uint WExportFontInfo; +const uint WFocusSet; +const uint WState_TabToFocus; + + +enum RasterOp { + CopyROP, + OrROP, + XorROP, + EraseROP, + NotCopyROP, + NotOrROP, + NotXorROP, + NotEraseROP, + NotROP +}; + + +// Text alignment flags. + +const int AlignLeft; +const int AlignRight; +const int AlignHCenter; +const int AlignTop; +const int AlignBottom; +const int AlignVCenter; +const int AlignCenter; + +// Miscellaneous text flags. + +const int SingleLine; +const int DontClip; +const int ExpandTabs; +const int ShowPrefix; +const int WordBreak; +const int GrayText; + +// Image conversion flags. + +const int ColorMode_Mask; +const int AutoColor; +const int ColorOnly; +const int MonoOnly; +const int AlphaDither_Mask; +const int ThresholdAlphaDither; +const int OrderedAlphaDither; +const int DiffuseAlphaDither; +const int Dither_Mask; +const int DiffuseDither; +const int OrderedDither; +const int ThresholdDither; +const int DitherMode_Mask; +const int AutoDither; +const int PreferDither; +const int AvoidDither; + +%End diff --git a/python/pyqt/sip/qt/qwindowdefs_qws.sip b/python/pyqt/sip/qt/qwindowdefs_qws.sip new file mode 100644 index 00000000..53f4b773 --- /dev/null +++ b/python/pyqt/sip/qt/qwindowdefs_qws.sip @@ -0,0 +1,29 @@ +// This is the SIP interface definition for a variety of constant definitions +// for Qt/Embedded. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%If (WS_QWS) + +typedef unsigned WId; +typedef void *HANDLE; + +%End diff --git a/python/pyqt/sip/qt/qwindowdefs_x11.sip b/python/pyqt/sip/qt/qwindowdefs_x11.sip new file mode 100644 index 00000000..4ddfcd42 --- /dev/null +++ b/python/pyqt/sip/qt/qwindowdefs_x11.sip @@ -0,0 +1,48 @@ +// This is the SIP interface definition for a variety of constant definitions +// for X11. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%If (WS_X11) + +%If (- Qt_3_0_0) +typedef unsigned HANDLE; +typedef unsigned WId; +%End + +%If (Qt_3_0_0 -) +typedef unsigned long WId; +%End + +typedef void Display; + +Display *qt_xdisplay(); +int qt_xscreen(); +WId qt_xrootwin(); +%If (Qt_3_1_0 -) +WId qt_xrootwin(int); +%End + +%If (Qt_3_3_0 -) +const char *qAppClass(); +%End + +%End diff --git a/python/pyqt/sip/qt/qwindowsstyle.sip b/python/pyqt/sip/qt/qwindowsstyle.sip new file mode 100644 index 00000000..34be4260 --- /dev/null +++ b/python/pyqt/sip/qt/qwindowsstyle.sip @@ -0,0 +1,192 @@ +// This is the SIP interface definition for QWindowsStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWindowsStyle (Qt v2+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>getButtonShift</Function></FuncDef> + <ParamDef>int &<Parameter>x</Parameter></ParamDef> + <ParamDef>int &<Parameter>y</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>x</Literal> and +<Literal>y</Literal> values. (Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>scrollBarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>sb</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMin</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderMax</Parameter></ParamDef> + <ParamDef>int &<Parameter>sliderLength</Parameter></ParamDef> + <ParamDef>int &<Parameter>buttonDim</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>sb</Literal> parameter and returns a tuple of the +<Literal>sliderMin</Literal>, <Literal>sliderMax</Literal>, +<Literal>sliderLength</Literal> and <Literal>buttonDim</Literal> values. +(Qt v2) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>tabbarMetrics</Function></FuncDef> + <ParamDef>const QTabBar *<Parameter>t</Parameter></ParamDef> + <ParamDef>int &<Parameter>hframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>vframe</Parameter></ParamDef> + <ParamDef>int &<Parameter>overlap</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes only the <Literal>t</Literal> parameter and returns a tuple of the +<Literal>hframe</Literal>, <Literal>vframe</Literal> and +<Literal>overlap</Literal> values. (Qt v2) +</Para> +</Sect2> +%End + + +%If (Qt_STYLE_WINDOWS) +%If (Qt_2_00 -) + +class QWindowsStyle : QCommonStyle +{ +%TypeHeaderCode +#include <qwindowsstyle.h> +%End + +public: + QWindowsStyle(); + +%If (Qt_3_3_0 -) + void polish(QApplication *); + void unPolish(QApplication *); + + void polish(QWidget *); + void unPolish(QWidget *); + + void polish(QPalette &); +%End + +%If (- Qt_3_0_0) + void drawButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawBevelButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,const QBrush * = 0); + void drawFocusRect(QPainter *,const QRect &,const QColorGroup &, + const QColor * = 0,bool = 0); + void drawPushButton(QPushButton *,QPainter *); + + void getButtonShift(int &,int &); + + void drawPanel(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,int = 1,const QBrush * = 0); + void drawPopupPanel(QPainter *,int,int,int,int,const QColorGroup &, + int = 2,const QBrush * = 0); + void drawArrow(QPainter *,ArrowType,bool,int,int,int,int, + const QColorGroup &,bool,const QBrush * = 0); + QSize indicatorSize() const; + void drawIndicator(QPainter *,int,int,int,int,const QColorGroup &, + int,bool = 0,bool = 1); + QSize exclusiveIndicatorSize() const; + void drawExclusiveIndicator(QPainter *,int,int,int,int, + const QColorGroup &,bool,bool = 0,bool = 1); + void drawExclusiveIndicatorMask(QPainter *,int,int,int,int,bool); + void drawComboButton(QPainter *,int,int,int,int,const QColorGroup &, + bool = 0,bool = 0,bool = 1,const QBrush * = 0); + QRect comboButtonRect(int,int,int,int); + QRect comboButtonFocusRect(int,int,int,int); + + void tabbarMetrics(const QTabBar *,int &,int &,int &); + + void drawTab(QPainter *,const QTabBar *,QTab *,bool); + void drawTabMask(QPainter *,const QTabBar *,QTab *,bool); + + void scrollBarMetrics(const QScrollBar *,int &,int &,int &,int &); + + void drawScrollBarControls(QPainter *,const QScrollBar *,int,uint,uint); + int sliderLength() const; + void drawSlider(QPainter *,int,int,int,int,const QColorGroup &, + Orientation,bool,bool); + void drawSliderMask(QPainter *,int,int,int,int,Orientation,bool,bool); + void drawSliderGroove(QPainter *,int,int,int,int,const QColorGroup &, + QCOORD,Orientation); + int maximumSliderDragDistance() const; + int splitterWidth() const; + void drawSplitter(QPainter *,int,int,int,int,const QColorGroup &, + Orientation); + void drawCheckMark(QPainter *,int,int,int,int,const QColorGroup &,bool, + bool); + void polishPopupMenu(QPopupMenu *); + int extraPopupMenuItemWidth(bool,int,QMenuItem *,const QFontMetrics &); + int popupMenuItemHeight(bool,QMenuItem *,const QFontMetrics &); + void drawPopupMenuItem(QPainter *,bool,int,int,QMenuItem *, + const QPalette &,bool,bool,int,int,int,int); +%End +%If (Qt_3_0_0 -) + virtual void polishPopupMenu(QPopupMenu *); + + void drawPrimitive(PrimitiveElement,QPainter *,const QRect &, + const QColorGroup &,SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawControl(ControlElement,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default, + const QStyleOption & = QStyleOption()) const; + + void drawComplexControl(ComplexControl,QPainter *,const QWidget *, + const QRect &,const QColorGroup &, + SFlags = Style_Default,SCFlags = SC_All, + SCFlags = SC_None, + const QStyleOption & = QStyleOption()) const; + + int pixelMetric(PixelMetric,const QWidget * = 0) const; + + QSize sizeFromContents(ContentsType,const QWidget *,const QSize &, + const QStyleOption & = QStyleOption()) const; + + int styleHint(StyleHint,const QWidget *, + const QStyleOption & = QStyleOption(), + QStyleHintReturn * = 0) const; + + QPixmap stylePixmap(StylePixmap,const QWidget * = 0, + const QStyleOption & = QStyleOption()) const; +%End + +%If (Qt_3_1_0 -) + QRect subRect(SubRect,const QWidget *) const; +%End + +protected: +%If (- Qt_3_0_0) + void drawWinShades(QPainter *,int,int,int,int,const QColor &, + const QColor &,const QColor &,const QColor &, + const QBrush *); +%End + +private: +%If (Qt_3_0_0 -) + QWindowsStyle(const QWindowsStyle &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qwindowsxpstyle.sip b/python/pyqt/sip/qt/qwindowsxpstyle.sip new file mode 100644 index 00000000..394bfad0 --- /dev/null +++ b/python/pyqt/sip/qt/qwindowsxpstyle.sip @@ -0,0 +1,31 @@ +// This is the SIP interface definition for QWindowsXPStyle. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWindowsXPStyle (Qt v3.0.1+, Windows)</Title> +<Para> +<Literal>QWindowsXPStyle</Literal> is fully implemented. +</Para> +</Sect2> +%End + + diff --git a/python/pyqt/sip/qt/qwizard.sip b/python/pyqt/sip/qt/qwizard.sip new file mode 100644 index 00000000..c062f65c --- /dev/null +++ b/python/pyqt/sip/qt/qwizard.sip @@ -0,0 +1,122 @@ +// This is the SIP interface definition for QWizard. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWizard (Qt v2+)</Title> +<Para> +<Literal>QWizard</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_WIZARD) +%If (Qt_2_00 -) + +class QWizard : QDialog +{ +%TypeHeaderCode +#include <qwizard.h> +%End + +public: + QWizard(QWidget * /TransferThis/ = 0,const char * = 0,bool = 0, + WFlags = 0); + + void show(); + + void setFont(const QFont &); + + // The QWidget is passed to QWidgetStack::addWidget(). + virtual void addPage(QWidget * /Transfer/, const QString &); +%If (Qt_3_0_0 -) + // The QWidget is passed to QWidgetStack::addWidget(). + virtual void insertPage(QWidget * /Transfer/, const QString &,int); +%End + virtual void removePage(QWidget *); + + QString title(QWidget *) const; +%If (Qt_2_2_0 -) + void setTitle(QWidget *,const QString &); +%End +%If (Qt_3_0_0 -) + QFont titleFont() const; + void setTitleFont(const QFont &); +%End + + virtual void showPage(QWidget *); + + QWidget *currentPage() const; + +%If (Qt_2_1_0 -) + QWidget *page(int) const; + int pageCount() const; +%End +%If (Qt_3_0_0 -) + int indexOf(QWidget *) const; +%End + + virtual bool appropriate(QWidget *) const; + virtual void setAppropriate(QWidget *,bool); + + QPushButton *backButton() const; + QPushButton *nextButton() const; + QPushButton *finishButton() const; + QPushButton *cancelButton() const; + QPushButton *helpButton() const; + + bool eventFilter(QObject *,QEvent *); + +public slots: + virtual void setBackEnabled(QWidget *,bool); + virtual void setNextEnabled(QWidget *,bool); + virtual void setFinishEnabled(QWidget *,bool); + + virtual void setHelpEnabled(QWidget *,bool); + +%If (- Qt_3_0_0) + virtual void setFinish(QWidget *,bool); +%End + +protected slots: + virtual void back(); + virtual void next(); + virtual void help(); + +signals: + void helpClicked(); +%If (Qt_2_2_0 -) + void selected(const QString &); +%End + +protected: + virtual void layOutButtonRow(QHBoxLayout *); + virtual void layOutTitleRow(QHBoxLayout *,const QString &); + +private: +%If (Qt_2_1_0 -) + QWizard(const QWizard &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qt/qwmatrix.sip b/python/pyqt/sip/qt/qwmatrix.sip new file mode 100644 index 00000000..1bb8cdc4 --- /dev/null +++ b/python/pyqt/sip/qt/qwmatrix.sip @@ -0,0 +1,178 @@ +// This is the SIP interface definition for QWMatrix. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWMatrix</Title> +<Para> +The Python <Literal>==</Literal>, <Literal>!=</Literal> and +<Literal>*=</Literal> operators are supported. +</Para> + +<FuncSynopsis> + <FuncDef>QWMatrix <Function>invert</Function> const</FuncDef> + <ParamDef>bool *<Parameter>invertible</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes no parameters and returns a tuple of the <Literal>QWMatrix</Literal> +result and the <Literal>invertible</Literal> value. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>int <Parameter>x</Parameter></ParamDef> + <ParamDef>int <Parameter>y</Parameter></ParamDef> + <ParamDef>int *<Parameter>tx</Parameter></ParamDef> + <ParamDef>int *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>float <Parameter>x</Parameter></ParamDef> + <ParamDef>float <Parameter>y</Parameter></ParamDef> + <ParamDef>float *<Parameter>tx</Parameter></ParamDef> + <ParamDef>float *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (Qt v1.x) +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>map</Function> const</FuncDef> + <ParamDef>double <Parameter>x</Parameter></ParamDef> + <ParamDef>double <Parameter>y</Parameter></ParamDef> + <ParamDef>double *<Parameter>tx</Parameter></ParamDef> + <ParamDef>double *<Parameter>ty</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>x</Literal> and <Literal>y</Literal> parameters and +returns a tuple containing the <Literal>tx</Literal> and <Literal>ty</Literal> +values. (Qt v2+) +</Para> +</Sect2> +%End + + +class QWMatrix +{ +%TypeHeaderCode +#include <qwmatrix.h> +%End + +public: + QWMatrix(); +%If (- Qt_2_00) + QWMatrix(float,float,float,float,float,float); +%End +%If (Qt_2_00 -) + QWMatrix(double,double,double,double,double,double); +%End + + void map(int /Constrained/,int /Constrained/,int *,int *) const; + +%If (Qt_3_0_0 -) + QRect mapRect(const QRect &) const; +%End + + QPoint map(const QPoint &) const; + QRect map(const QRect &); const + QPointArray map(const QPointArray &) const; +%If (Qt_3_1_0 -) + QRegion map(const QRegion &) const; + QRegion mapToRegion(const QRect &) const; + QPointArray mapToPolygon(const QRect &) const; +%End + + void reset(); +%If (Qt_3_0_0 -) + bool isIdentity() const; + + bool isInvertible() const; +%End +%If (Qt_3_1_0 -) + double det() const; +%End + + QWMatrix invert(bool * = 0) const; + + bool operator==(const QWMatrix &) const; + bool operator!=(const QWMatrix &) const; + QWMatrix &operator*=(const QWMatrix &); + +%If (Qt_3_0_0 -) + // These aren't documented but are used in Qt examples. + QPoint operator*(const QPoint &) const; + QRegion operator*(const QRect &) const; + QRegion operator*(const QRegion &) const; + QPointArray operator*(const QPointArray &) const; +%End + +%If (Qt_3_1_0 -) + enum TransformationMode { + Points, + Areas + }; + + static void setTransformationMode(TransformationMode); + static TransformationMode transformationMode(); +%End + +%If (- Qt_2_00) + void setMatrix(float,float,float,float,float,float); + float m11(); + float m12(); + float m21(); + float m22(); + float dx(); + float dy(); + + void map(float,float,float *,float *) const; + + QWMatrix &translate(float,float); + QWMatrix &scale(float,float); + QWMatrix &shear(float,float); + QWMatrix &rotate(float); +%End + +%If (Qt_2_00 -) + void setMatrix(double,double,double,double,double,double); + double m11(); + double m12(); + double m21(); + double m22(); + double dx(); + double dy(); + + void map(double,double,double *,double *) const; + + QWMatrix &translate(double,double); + QWMatrix &scale(double,double); + QWMatrix &shear(double,double); + QWMatrix &rotate(double); +%End +}; diff --git a/python/pyqt/sip/qt/qworkspace.sip b/python/pyqt/sip/qt/qworkspace.sip new file mode 100644 index 00000000..bbc9dfc9 --- /dev/null +++ b/python/pyqt/sip/qt/qworkspace.sip @@ -0,0 +1,101 @@ +// This is the SIP interface definition for QWorkspace. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWorkspace (Qt v2.1+)</Title> +<Para> +<Literal>QWorkspace</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_1_0 -) +%If (Qt_WORKSPACE) + +class QWorkspace : QWidget +{ +%TypeHeaderCode +#include <qworkspace.h> +%End + +public: + QWorkspace(QWidget * /TransferThis/ = 0,const char * = 0); + +%If (Qt_3_2_0 -) + enum WindowOrder { + CreationOrder, + StackingOrder + }; +%End + + QWidget *activeWindow() const; + QWidgetList windowList() const; +%If (Qt_3_2_0 -) + QWidgetList windowList(WindowOrder) const; +%End + +%If (- Qt_3_0_0) + QSizePolicy sizePolicy() const; +%End + QSize sizeHint() const; + +%If (Qt_3_0_0 -) + bool scrollBarsEnabled() const; + void setScrollBarsEnabled(bool); + + void setPaletteBackgroundColor(const QColor &); + void setPaletteBackgroundPixmap(const QPixmap &); +%End + +signals: + void windowActivated(QWidget *); + +public slots: + void cascade(); + void tile(); +%If (Qt_3_2_0 -) + void closeActiveWindow(); + void closeAllWindows(); + void activateNextWindow(); + void activatePrevWindow(); +%End + +protected: +%If (Qt_3_0_0 -) + void styleChange(QStyle &); +%End + void childEvent(QChildEvent *); + void resizeEvent(QResizeEvent *); + bool eventFilter(QObject *,QEvent *); + void showEvent(QShowEvent *); +%If (Qt_3_0_0 -) + void hideEvent(QHideEvent *); + void wheelEvent(QWheelEvent *); +%End + +private: + QWorkspace(const QWorkspace &); +}; + +%End +%End diff --git a/python/pyqt/sip/qt/versions.sip b/python/pyqt/sip/qt/versions.sip new file mode 100644 index 00000000..c662a854 --- /dev/null +++ b/python/pyqt/sip/qt/versions.sip @@ -0,0 +1,88 @@ +// This defines the different versions of Qt that PyQt knows about. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// Specify the releases over time - not all of them, just those that introduce +// something new. +%Timeline {Qt_1_43 + Qt_2_00 Qt_2_1_0 Qt_2_2_0 Qt_2_3_0 Qt_2_3_1 + Qt_3_0_0 Qt_3_0_1 Qt_3_0_2 Qt_3_0_4 Qt_3_0_5 Qt_3_0_6 + Qt_3_1_0 Qt_3_1_1 Qt_3_1_2 + Qt_3_2_0 + Qt_3_3_0 Qt_3_3_5 Qt_3_3_6} + + +// Specify the platforms. +%Platforms {WS_X11 WS_WIN WS_QWS WS_MACX} + + +// Specify the features. +%Feature Qt_THREAD_SUPPORT + +%Feature Qt_ACTION +%Feature Qt_ASSISTANTCLIENT +%Feature Qt_CLIPBOARD +%Feature Qt_CODECS +%Feature Qt_COLORDIALOG +%Feature Qt_DATASTREAM +%Feature Qt_DIAL +%Feature Qt_DNS +%Feature Qt_DOM +%Feature Qt_DRAGANDDROP +%Feature Qt_ICONVIEW +%Feature Qt_IMAGE_TEXT +%Feature Qt_INPUTDIALOG +%Feature Qt_FILEDIALOG +%Feature Qt_FONTDATABASE +%Feature Qt_FONTDIALOG +%Feature Qt_MESSAGEBOX +%Feature Qt_MIMECLIPBOARD +%Feature Qt_NETWORKPROTOCOL +%Feature Qt_NETWORKPROTOCOL_FTP +%Feature Qt_NETWORKPROTOCOL_HTTP +%Feature Qt_PICTURE +%Feature Qt_PRINTDIALOG +%Feature Qt_PRINTER +%Feature Qt_PROGRESSDIALOG +%Feature Qt_PROPERTIES +%Feature Qt_SEMIMODAL +%Feature Qt_SIZEGRIP +%Feature Qt_SOUND +%Feature Qt_SPLITTER +%Feature Qt_STYLE_CDE +%Feature Qt_STYLE_INTERLACE +%Feature Qt_STYLE_MOTIF +%Feature Qt_STYLE_MOTIFPLUS +%Feature Qt_STYLE_PLATINUM +%Feature Qt_STYLE_SGI +%Feature Qt_STYLE_WINDOWS +%Feature Qt_STYLE_WINDOWSXP +%Feature Qt_TABDIALOG +%Feature Qt_TABLE +%Feature Qt_TABLEVIEW +%Feature Qt_TRANSFORMATIONS +%Feature Qt_TRANSLATION +%Feature Qt_WIZARD +%Feature Qt_WORKSPACE + +// On Windows64 Q_LONG is defined as __int64 (which SIP doesn't handle) so +// this feature is disabled. +%Feature Qt_Q_LONG_IS_long diff --git a/python/pyqt/sip/qtaxcontainer/copying.sip b/python/pyqt/sip/qtaxcontainer/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtaxcontainer/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtaxcontainer/qaxbase.sip b/python/pyqt/sip/qtaxcontainer/qaxbase.sip new file mode 100644 index 00000000..fde55e24 --- /dev/null +++ b/python/pyqt/sip/qtaxcontainer/qaxbase.sip @@ -0,0 +1,86 @@ +// This is the SIP interface definition for QAxBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAxBase (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxObject</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>long <Function>queryInterface</Function></FuncDef> + <ParamDef>const QUuid &<Parameter>uuid</Parameter></ParamDef> + <ParamDef>void **<Parameter>iface</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>PropertyBag <Function>propertyBag</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setPropertyBag</Function></FuncDef> + <ParamDef>const PropertyBag &<Parameter>bag</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> + +<FuncSynopsis> + <FuncDef>unsigned long <Function>registerWeakActiveObject</Function></FuncDef> + <ParamDef>const QString &<Parameter>guid</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This is a utility method provided by PyQt to make it easier to use +Mark Hammond's <Literal>win32com</Literal> module to manipulate objects +created by the <Literal>qtaxcontainer</Literal> module. +</Para> +<Para> +The <Literal>RegisterActiveObject()</Literal> COM function is called to +register the <Literal>QAxBase</Literal> instance as a weak object with the +<Literal>guid</Literal> GUID. The revoke handle is returned. +</Para> + +<FuncSynopsis> + <FuncDef>static void <Function>revokeActiveObject</Function></FuncDef> + <ParamDef>unsigned long <Parameter>rhandle</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This is a wrapper around the <Literal>RevokeActiveObject()</Literal> COM +function and is called to revoke the object registered using +<Literal>registerWeakActiveObject()</Literal>. <Literal>rhandle</Literal> is +the revoke handle returned by <Literal>registerWeakActiveObject()</Literal>. +</Para> +</Sect2> +%End + + diff --git a/python/pyqt/sip/qtaxcontainer/qaxobject.sip b/python/pyqt/sip/qtaxcontainer/qaxobject.sip new file mode 100644 index 00000000..0c0b0f88 --- /dev/null +++ b/python/pyqt/sip/qtaxcontainer/qaxobject.sip @@ -0,0 +1,37 @@ +// This is the SIP interface definition for QAxObject. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAxObject (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxObject</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter></ParamDef> + <ParamDef>QObject *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + diff --git a/python/pyqt/sip/qtaxcontainer/qaxwidget.sip b/python/pyqt/sip/qtaxcontainer/qaxwidget.sip new file mode 100644 index 00000000..dbcc7299 --- /dev/null +++ b/python/pyqt/sip/qtaxcontainer/qaxwidget.sip @@ -0,0 +1,37 @@ +// This is the SIP interface definition for QAxWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QAxWidget (Windows, Qt v3+)</Title> +<FuncSynopsis> + <FuncDef><Function>QAxWidget</Function></FuncDef> + <ParamDef>IUnknown *<Parameter>iface</Parameter></ParamDef> + <ParamDef>QWidget *<Parameter>parent</Parameter> = 0</ParamDef> + <ParamDef>const char *<Parameter>name</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not implemented. +</Para> +</Sect2> +%End + + diff --git a/python/pyqt/sip/qtaxcontainer/qtaxcontainermod.sip b/python/pyqt/sip/qtaxcontainer/qtaxcontainermod.sip new file mode 100644 index 00000000..33864f1e --- /dev/null +++ b/python/pyqt/sip/qtaxcontainer/qtaxcontainermod.sip @@ -0,0 +1,32 @@ +// This is the SIP interface definition for the qtaxcontainer module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtaxcontainer 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qaxbase.sip +%Include qaxobject.sip +%Include qaxwidget.sip diff --git a/python/pyqt/sip/qtcanvas/copying.sip b/python/pyqt/sip/qtcanvas/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtcanvas/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtcanvas/qcanvas.sip b/python/pyqt/sip/qtcanvas/qcanvas.sip new file mode 100644 index 00000000..fdd78053 --- /dev/null +++ b/python/pyqt/sip/qtcanvas/qcanvas.sip @@ -0,0 +1,856 @@ +// This is the SIP interface definition for QCanvas, QCanvasEllipse, +// QCanvasItem, QCanvasItemList, QCanvasLine, QCanvasPixmap, +// QCanvasPixmapArray, QCanvasPolygon, QCanvasPolygonalItem, QCanvasRectangle, +// QCanvasSpline, QCanvasSprite, QCanvasText and QCanvasView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QCanvas (Qt v2.2+)</Title> +<Para> +<Literal>QCanvas</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasEllipse (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasEllipse</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasItem (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasItemList (Qt v2.2+)</Title> +<Para> +This class isn't implemented. Whenever a <Literal>QCanvasItemList</Literal> is +the return type of a function or the type of an argument, a Python list of +<Literal>QCanvasItem</Literal> instances is used instead. +</Para> +</Sect2> + +<Sect2><Title>QCanvasLine (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasLine</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPixmap (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPixmap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPixmapArray (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QPixmapArray</Function></FuncDef> + <ParamDef>QList<QPixmap> <Parameter>pixmaps</Parameter></ParamDef> + <ParamDef>QList<QPoint> <Parameter>hotspots</Parameter></ParamDef> +</FuncSynopsis> +<Para> +The <Literal>pixmaps</Literal> argument is a Python list of QPixmap instances, +and the <Literal>hotspots</Literal> argument is a Python list of QPoint +instances. (Qt v2.2.0 - Qt v2.3.1) +</Para> + +<FuncSynopsis> + <FuncDef><Function>QPixmapArray</Function></FuncDef> + <ParamDef>QValueList<QPixmap> <Parameter>pixmaps</Parameter></ParamDef> + <ParamDef>QPointArray <Parameter>hotspots</Parameter> = QPointArray()</ParamDef> +</FuncSynopsis> +<Para> +The <Literal>pixmaps</Literal> argument is a Python list of QPixmap instances. +(Qt v3+) +</Para> +</Sect2> + +<Sect2><Title>QCanvasPolygon (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPolygon</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasPolygonalItem (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasPolygonalItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasRectangle (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasRectangle</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasSpline (Qt v3.0+)</Title> +<Para> +<Literal>QCanvasSpline</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasSprite (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasSprite</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasText (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasText</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCanvasView (Qt v2.2+)</Title> +<Para> +<Literal>QCanvasView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +%MappedType QCanvasItemList +{ +%TypeHeaderCode +#include <qcanvas.h> +#include "sipqtcanvasQCanvasItem.h" +%End + +%ConvertFromTypeCode + // Convert to a Python list of QCanvasItem instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + + for (QCanvasItemList::Iterator it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *ci; + + if ((ci = sipConvertFromInstance(*it,sipClass_QCanvasItem,sipTransferObj)) == NULL || PyList_SetItem(l,i,ci) < 0) + { + Py_XDECREF(ci); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to QCanvasItemList not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +class QCanvasItem : Qt +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasItem(QCanvas * /TransferThis/); + +%ConvertToSubClassCode + Py_BEGIN_ALLOW_THREADS + + // Use the numeric type values for compatibility with Qt v2. + switch (sipCpp -> rtti()) + { + case 1: + sipClass = sipClass_QCanvasSprite; + break; + + case 2: + sipClass = sipClass_QCanvasPolygonalItem; + break; + + case 3: + sipClass = sipClass_QCanvasText; + break; + + case 4: + sipClass = sipClass_QCanvasPolygon; + break; + + case 5: + sipClass = sipClass_QCanvasRectangle; + break; + + case 6: + sipClass = sipClass_QCanvasEllipse; + break; + + case 7: + sipClass = sipClass_QCanvasLine; + break; + +#if QT_VERSION >= 0x030000 + case 8: + sipClass = sipClass_QCanvasSpline; + break; +#endif + + default: + sipClass = 0; + } + + Py_END_ALLOW_THREADS +%End + + double x() const; + double y() const; + double z() const; + + virtual void moveBy(double,double); + void move(double,double); + void setX(double); + void setY(double); + void setZ(double); + + bool animated() const; + virtual void setAnimated(bool); + virtual void setVelocity(double,double); + void setXVelocity(double); + void setYVelocity(double); + double xVelocity() const; + double yVelocity() const; + virtual void advance(int); + + virtual bool collidesWith(const QCanvasItem *) const = 0; + + QCanvasItemList collisions(bool) const; + + virtual void setCanvas(QCanvas * /GetWrapper/); +%MethodCode + if (sipCpp -> canvas() != a0) + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QCanvasItem::setCanvas(a0) : sipCpp->setCanvas(a0); + Py_END_ALLOW_THREADS +%End + + virtual void draw(QPainter &) = 0; + + void show(); + void hide(); + + virtual void setVisible(bool); +%If (- Qt_3_0_0) + bool visible() const; +%End +%If (Qt_3_0_0 -) + bool isVisible() const; +%End + virtual void setSelected(bool); +%If (- Qt_3_0_0) + bool selected() const; +%End +%If (Qt_3_0_0 -) + bool isSelected() const; +%End + virtual void setEnabled(bool); +%If (- Qt_3_0_0) + bool enabled() const; +%End +%If (Qt_3_0_0 -) + bool isEnabled() const; +%End + virtual void setActive(bool); +%If (- Qt_3_0_0) + bool active() const; +%End +%If (Qt_3_0_0 -) + bool isActive() const; +%End + +%If (Qt_3_0_0 -) + enum RttiValues { + Rtti_Item, + Rtti_Sprite, + Rtti_PolygonalItem, + Rtti_Text, + Rtti_Polygon, + Rtti_Rectangle, + Rtti_Ellipse, + Rtti_Line, + Rtti_Spline + }; +%End + + virtual int rtti() const; + + virtual QRect boundingRect() const = 0; + virtual QRect boundingRectAdvanced() const; + + QCanvas *canvas() const; + +protected: +%If (Qt_3_0_0 -) + void update(); +%End + +private: + virtual bool collidesWith(const QCanvasSprite *, + const QCanvasPolygonalItem *, + const QCanvasRectangle *, + const QCanvasEllipse *, + const QCanvasText *) const = 0; +}; + + +class QCanvas : QObject +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvas(QObject * /TransferThis/ = 0,const char * = 0); + QCanvas(int,int); + QCanvas(QPixmap,int,int,int,int); + +%ConvertToSubClassCode + static struct class_graph { + char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QCanvasView, &sipClass_QCanvasView, -1, 1}, + {sipName_QCanvas, &sipClass_QCanvas, -1, -1}, + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + virtual void setTiles(QPixmap,int,int,int,int); + virtual void setBackgroundPixmap(const QPixmap &); + QPixmap backgroundPixmap() const; + + virtual void setBackgroundColor(const QColor &); + QColor backgroundColor() const; + + virtual void setTile(int,int,int); + int tile(int,int) const; + + int tilesHorizontally() const; + int tilesVertically() const; + + int tileWidth() const; + int tileHeight() const; + + virtual void resize(int,int); + int width() const; + int height() const; + QSize size() const; +%If (Qt_3_0_0 -) + QRect rect() const; +%End + bool onCanvas(int,int) const; + bool onCanvas(const QPoint &) const; + bool validChunk(int,int) const; + bool validChunk(const QPoint &) const; + + int chunkSize() const; + virtual void retune(int,int = 100); + + // These next three are marked as internal in the Qt v2.x + // documentation. +// bool sameChunk() const; +// virtual void setChangedChunk(int,int); +// virtual void setChangedChunkContaining(int,int); + virtual void setAllChanged(); + virtual void setChanged(const QRect &); +%If (Qt_3_0_0 -) + virtual void setUnchanged(const QRect &); +%End + + QCanvasItemList allItems(); + QCanvasItemList collisions(const QPoint &) const; + QCanvasItemList collisions(const QRect &) const; + QCanvasItemList collisions(const QPointArray &,const QCanvasItem *, + bool) const; + +%If (Qt_3_0_0 -) + void drawArea(const QRect &,QPainter *,bool = 0); +%End + + virtual void setAdvancePeriod(int); + virtual void setUpdatePeriod(int); + + virtual void setDoubleBuffering(bool); + +signals: + void resized(); + +public slots: + virtual void advance(); + virtual void update(); + +protected: + virtual void drawBackground(QPainter &,const QRect &); + virtual void drawForeground(QPainter &,const QRect &); + +private: +%If (Qt_3_1_0 -) + QCanvas(const QCanvas &); +%End +}; + + +class QCanvasView : QScrollView +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: +%If (- Qt_3_0_0) + QCanvasView(QCanvas * = 0,QWidget * /TransferThis/ = 0, + const char * = 0,WFlags = 0); +%End +%If (Qt_3_0_0 -) + QCanvasView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + QCanvasView(QCanvas *,QWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); +%End + + QCanvas* canvas() const; + void setCanvas(QCanvas *); + +%If (Qt_3_0_0 -) + const QWMatrix &worldMatrix() const; + const QWMatrix &inverseWorldMatrix() const; + bool setWorldMatrix(const QWMatrix &); +%End + +protected: + void drawContents(QPainter *,int,int,int,int); + QSize sizeHint() const; + +private: +%If (Qt_3_1_0 -) + QCanvasView(const QCanvasView &); +%End +}; + + +class QCanvasPixmap : QPixmap +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasPixmap(const QString &); + QCanvasPixmap(const QImage &); +%If (- Qt_3_0_0) + QCanvasPixmap(const QPixmap &,QPoint); +%End +%If (Qt_3_0_0 -) + QCanvasPixmap(const QPixmap &,const QPoint &); +%End + + int offsetX() const; + int offsetY() const; + void setOffset(int,int); + +private: +%If (Qt_3_1_0 -) + QCanvasPixmap(const QCanvasPixmap &); +%End +}; + + +class QCanvasPixmapArray +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasPixmapArray(); + QCanvasPixmapArray(const QString &,int = 0); +%If (- Qt_3_0_0) + QCanvasPixmapArray(QPtrList<QPixmap>,QPtrList<QPoint>); +%End +%If (Qt_3_0_0 -) + QCanvasPixmapArray(QValueList<QPixmap>,QPointArray = QPointArray()); +%End + + bool readPixmaps(const QString &,int = 0) /ReleaseGIL/; + bool readCollisionMasks(const QString &) /ReleaseGIL/; + +%If (Qt_3_0_0 -) + bool isValid() const; +%End + + QCanvasPixmap *image(int) const; + void setImage(int,QCanvasPixmap * /Transfer/); + uint count() const; + +private: +%If (Qt_3_1_0 -) + QCanvasPixmapArray(const QCanvasPixmapArray &); +%End +}; + + +class QCanvasSprite : QCanvasItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasSprite(QCanvasPixmapArray *,QCanvas * /TransferThis/); + + void setSequence(QCanvasPixmapArray *); + + void move(double,double); + virtual void move(double,double,int); + void setFrame(int); + +%If (Qt_3_0_0 -) + enum FrameAnimationType { + Cycle, + Oscillate + }; + + virtual void setFrameAnimation(FrameAnimationType = Cycle,int = 1, + int = 0); +%End + int frame() const; + int frameCount() const; + +%If (- Qt_3_0_0) + virtual int rtti() const; +%End +%If (Qt_3_0_0 -) + int rtti() const; +%End + + bool collidesWith(const QCanvasItem *) const; + + QRect boundingRect() const; + +%If (Qt_3_0_0 -) + int width() const; + int height() const; + + int leftEdge() const; + int topEdge() const; + int rightEdge() const; + int bottomEdge() const; + + int leftEdge(int) const; + int topEdge(int) const; + int rightEdge(int) const; + int bottomEdge(int) const; + QCanvasPixmap *image() const; + virtual QCanvasPixmap *imageAdvanced() const; + QCanvasPixmap *image(int) const; + // This is really virtual, but we want to use the super-class's virtual + // handler. Having to do this is really a SIP bug. + void advance(int); + + void draw(QPainter &); +%End + +protected: +%If (- Qt_3_0_0) + void draw(QPainter &); + int width() const; + int height() const; + int absX() const; + int absY() const; + int absX2() const; + int absY2() const; + int absX(int) const; + int absY(int) const; + int absX2(int) const; + int absY2(int) const; + QCanvasPixmap *image() const; + virtual QCanvasPixmap *imageAdvanced() const; + QCanvasPixmap *image(int) const; +%End + +private: +%If (Qt_3_1_0 -) + QCanvasSprite(const QCanvasSprite &); +%End +}; + + +class QCanvasPolygonalItem : QCanvasItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasPolygonalItem(QCanvas * /TransferThis/); + + bool collidesWith(const QCanvasItem *) const; + + virtual void setPen(QPen); + virtual void setBrush(QBrush); + + QPen pen() const; + QBrush brush() const; + + virtual QPointArray areaPoints() const = 0; + virtual QPointArray areaPointsAdvanced() const; + QRect boundingRect() const; + + int rtti() const; + +protected: + void draw(QPainter &); + virtual void drawShape(QPainter &) = 0; + + bool winding() const; + void setWinding(bool); + +%If (Qt_3_1_0 -) + void invalidate(); + bool isValid() const; +%End +}; + + +class QCanvasRectangle : QCanvasPolygonalItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasRectangle(QCanvas * /TransferThis/); + QCanvasRectangle(const QRect &,QCanvas * /TransferThis/); + QCanvasRectangle(int,int,int,int,QCanvas * /TransferThis/); + + int width() const; + int height() const; + void setSize(int,int); + QSize size() const; + QPointArray areaPoints() const; + QRect rect() const; + + bool collidesWith(const QCanvasItem *) const; + + int rtti() const; + +protected: + void drawShape(QPainter &); + QPointArray chunks() const; +}; + + +class QCanvasPolygon : QCanvasPolygonalItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasPolygon(QCanvas * /TransferThis/); + + void setPoints(QPointArray); + QPointArray points() const; + void moveBy(double,double); + + QPointArray areaPoints() const; + + int rtti() const; + +protected: + void drawShape(QPainter &); +}; + + +%If (Qt_3_0_0 -) + +class QCanvasSpline : QCanvasPolygon +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasSpline(QCanvas * /TransferThis/); + + void setControlPoints(QPointArray,bool = 1); + QPointArray controlPoints() const; + bool closed() const; + + int rtti() const; +}; + +%End + + +class QCanvasLine : QCanvasPolygonalItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasLine(QCanvas * /TransferThis/); + + void setPoints(int,int,int,int); + + QPoint startPoint() const; + QPoint endPoint() const; + + int rtti() const; + + void setPen(QPen); +%If (Qt_3_3_0 -) + void moveBy(double,double); +%End + +protected: + void drawShape(QPainter &); + QPointArray areaPoints() const; +}; + + +class QCanvasEllipse : QCanvasPolygonalItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasEllipse(QCanvas * /TransferThis/); + QCanvasEllipse(int,int,QCanvas * /TransferThis/); + QCanvasEllipse(int,int,int,int,QCanvas * /TransferThis/); + + int width() const; + int height() const; + void setSize(int,int); + void setAngles(int,int); + int angleStart() const; + int angleLength() const; + QPointArray areaPoints() const; + + bool collidesWith(const QCanvasItem *) const; + + int rtti() const; + +protected: + void drawShape(QPainter &); +}; + + +class QCanvasText : QCanvasItem +{ +%TypeHeaderCode +#include <qcanvas.h> +%End + +public: + QCanvasText(QCanvas * /TransferThis/); + QCanvasText(const QString &,QCanvas * /TransferThis/); + QCanvasText(const QString &,QFont,QCanvas * /TransferThis/); + + void setText(const QString &); + void setFont(const QFont &); + void setColor(const QColor &); + QString text() const; + QFont font() const; + QColor color() const; + + void moveBy(double,double); + + int textFlags() const; + void setTextFlags(int); + + QRect boundingRect() const; + + bool collidesWith(const QCanvasItem *) const; + +%If (- Qt_3_0_0) + virtual int rtti() const; +%End +%If (Qt_3_0_0 -) + int rtti() const; +%End + +protected: + virtual void draw(QPainter &); + +private: +%If (Qt_3_1_0 -) + QCanvasText(const QCanvasText &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtcanvas/qtcanvasmod.sip b/python/pyqt/sip/qtcanvas/qtcanvasmod.sip new file mode 100644 index 00000000..1ef22ae5 --- /dev/null +++ b/python/pyqt/sip/qtcanvas/qtcanvasmod.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for the qtcanvas module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtcanvas 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qcanvas.sip + + +// The build file template. + +%Makefile qtcanvas.pro.in +# The project file for the qtcanvas module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtext/copying.sip b/python/pyqt/sip/qtext/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtext/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtext/qextscintilla.sip b/python/pyqt/sip/qtext/qextscintilla.sip new file mode 100644 index 00000000..c03dc56b --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintilla.sip @@ -0,0 +1,411 @@ +// This is the SIP interface definition for QextScintilla. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintilla : QextScintillaBase +{ +%TypeHeaderCode +#include <qextscintilla.h> +%End + +public: + enum { + AiMaintain, + AiOpening, + AiClosing + }; + + enum AutoCompletionSource { + AcsDocument, + AcsAPIs, +%If (QScintilla_1_7 -) + AcsAll, +%End + }; + + enum BraceMatch { + NoBraceMatch, + StrictBraceMatch, + SloppyBraceMatch + }; + +%If (QScintilla_1_4 -) + enum EdgeMode { + EdgeNone, + EdgeLine, + EdgeBackground + }; +%End + + enum EolMode { + EolWindows, + EolUnix, + EolMac + }; + + enum FoldStyle { + NoFoldStyle, + PlainFoldStyle, + CircledFoldStyle, + BoxedFoldStyle, + CircledTreeFoldStyle, + BoxedTreeFoldStyle + }; + + enum MarkerSymbol { + Circle, + Rectangle, + RightTriangle, + SmallRectangle, + RightArrow, + Invisible, + DownTriangle, + Minus, + Plus, + VerticalLine, + BottomLeftCorner, + LeftSideSplitter, + BoxedPlus, + BoxedPlusConnected, + BoxedMinus, + BoxedMinusConnected, + RoundedBottomLeftCorner, + LeftSideRoundedSplitter, + CircledPlus, + CircledPlusConnected, + CircledMinus, + CircledMinusConnected, + Background, + ThreeDots, + ThreeRightArrows + }; + + enum WhitespaceVisibility { + WsInvisible, + WsVisible, + WsVisibleAfterIndent + }; + + enum WrapMode { + WrapNone, + WrapWord, +%If (QScintilla_1_7 -) + WrapCharacter, +%End + }; + +%If (QScintilla_1_7 -) + enum WrapVisualFlag { + WrapFlagNone, + WrapFlagByText, + WrapFlagByBorder, + }; +%End + + QextScintilla(QWidget * /TransferThis/ = 0,const char * = 0, + WFlags = 0); + + bool autoCompletionCaseSensitivity(); +%If (QScintilla_1_7 -) + bool autoCompletionFillupsEnabled(); +%End + bool autoCompletionReplaceWord(); + bool autoCompletionShowSingle(); + AutoCompletionSource autoCompletionSource() const; + int autoCompletionThreshold() const; + bool autoIndent() const; + bool backspaceUnindents(); + void beginUndoAction(); + BraceMatch braceMatching() const; + int callTipsVisible() const; +%If (QScintilla_1_7 -) + void cancelList(); +%End + void clearRegisteredImages(); + void convertEols(EolMode); +%If (QScintilla_1_3 -) + QextScintillaDocument document(); +%End + void endUndoAction(); + +%If (QScintilla_1_4 -) + QColor edgeColor(); + int edgeColumn(); + EdgeMode edgeMode(); +%End + + EolMode eolMode(); + bool eolVisibility(); + +%If (QScintilla_1_7 -) + QColor color() const; + QColor paper() const; +%End + +%If (QScintilla_1_6 -) + virtual bool findFirst(const QString &,bool,bool,bool,bool,bool = 1, + int = -1,int = -1,bool = 1); +%End +%If (- QScintilla_1_6) + virtual bool findFirst(const QString &,bool,bool,bool,bool,bool = 1, + int = -1,int = -1); +%End + virtual bool findNext(); + +%If (QScintilla_1_7 -) + int firstVisibleLine(); +%End + + FoldStyle folding() const; + + void getCursorPosition(int *,int *); + void getSelection(int *,int *,int *,int *); + bool hasSelectedText(); + + int indentation(int); + bool indentationGuides(); + bool indentationsUseTabs(); + int indentationWidth(); + +%If (QScintilla_1_7 -) + bool isCallTipActive(); + bool isListActive(); +%End + bool isModified(); + bool isReadOnly(); + bool isRedoAvailable(); + bool isUndoAvailable(); + bool isUtf8(); + int lineAt(const QPoint &); + int lineLength(int); + int lines(); + int length(); +%If (QScintilla_1_7 -) + QextScintillaLexer *lexer() const; +%End + + bool marginLineNumbers(int); + int marginMarkerMask(int); + bool marginSensitivity(int); + int marginWidth(int); + + int markerDefine(MarkerSymbol,int = -1); + int markerDefine(char,int = -1); + int markerDefine(const QPixmap *,int = -1); + int markerAdd(int,int); + unsigned markersAtLine(int); + void markerDelete(int,int = -1); + void markerDeleteAll(int = -1); + void markerDeleteHandle(int); + int markerLine(int); + int markerFindNext(int,unsigned); + int markerFindPrevious(int,unsigned); +%If (QScintilla_1_3 -) + virtual void recolor(int = 0,int = -1); +%End + void registerImage(int,const QPixmap *); + virtual void replace(const QString &); + void resetFoldMarginColors(); + void setFoldMarginColors(const QColor &,const QColor &); + + void setAutoCompletionAPIs(QextScintillaAPIs * = 0); + void setAutoCompletionFillups(const char *); +%If (QScintilla_1_7 -) + void setAutoCompletionFillupsEnabled(bool); + void setAutoCompletionStartCharacters(const char *); +%End + + void setCallTipsAPIs(QextScintillaAPIs * = 0); + void setCallTipsBackgroundColor(const QColor &); + void setCallTipsForegroundColor(const QColor &); + void setCallTipsHighlightColor(const QColor &); + void setCallTipsVisible(int); + +%If (QScintilla_1_3 -) + void setDocument(const QextScintillaDocument &); +%End + +%If (QScintilla_1_4 -) + void setEdgeColor(const QColor &); + void setEdgeColumn(int); + void setEdgeMode(EdgeMode); +%End + +%If (QScintilla_1_7 -) + virtual void setFont(const QFont &); +%End + + void setMarkerBackgroundColor(const QColor &,int = -1); + void setMarkerForegroundColor(const QColor &,int = -1); + + void setMatchedBraceBackgroundColor(const QColor &); + void setMatchedBraceForegroundColor(const QColor &); + void setUnmatchedBraceBackgroundColor(const QColor &); + void setUnmatchedBraceForegroundColor(const QColor &); + +%If (QScintilla_1_7 -) + void setWrapVisualFlags(WrapVisualFlag, + WrapVisualFlag = QextScintilla::WrapFlagNone, int = 0); +%End + + QString selectedText(); +%If (QScintilla_1_7 -) + void showUserList(int, const QStringList &); +%End + QextScintillaCommandSet *standardCommands() const; + bool tabIndents(); + int tabWidth(); + QString text(); + QString text(int); +%If (QScintilla_1_7 -) + int textHeight(int); +%End + WhitespaceVisibility whitespaceVisibility(); +%If (QScintilla_1_4 -) + WrapMode wrapMode(); +%End + +public slots: + virtual void append(const QString &); +%If (QScintilla_1_7 -) + virtual void autoCompleteFromAll(); +%End + virtual void autoCompleteFromAPIs(); + virtual void autoCompleteFromDocument(); + virtual void callTip(); + virtual void clear(); + virtual void copy(); + virtual void cut(); + + virtual void ensureCursorVisible(); + virtual void ensureLineVisible(int); +%If (QScintilla_1_7 -) + virtual void foldAll(bool = 0); +%End +%If (- QScintilla_1_7) + virtual void foldAll(); +%End + virtual void foldLine(int); + virtual void indent(int); +%If (QScintilla_1_4 -) + virtual void insert(const QString &); +%End + virtual void insertAt(const QString &,int,int); + virtual void moveToMatchingBrace(); + virtual void paste(); + virtual void redo(); + virtual void removeSelectedText(); +%If (QScintilla_1_4 -) + virtual void resetSelectionBackgroundColor(); + virtual void resetSelectionForegroundColor(); +%End + virtual void selectAll(bool = 1); + virtual void selectToMatchingBrace(); + + virtual void setAutoCompletionCaseSensitivity(bool); + virtual void setAutoCompletionReplaceWord(bool); + virtual void setAutoCompletionShowSingle(bool); + virtual void setAutoCompletionSource(AutoCompletionSource); + virtual void setAutoCompletionThreshold(int); + virtual void setAutoIndent(bool); + virtual void setBraceMatching(BraceMatch); + virtual void setBackspaceUnindents(bool); +%If (QScintilla_1_3 -) + virtual void setCaretForegroundColor(const QColor &); + virtual void setCaretLineBackgroundColor(const QColor &); + virtual void setCaretLineVisible(bool); + virtual void setCaretWidth(int); +%End +%If (QScintilla_1_7 -) + virtual void setColor(const QColor &); +%End + virtual void setCursorPosition(int,int); + virtual void setEolMode(EolMode); + virtual void setEolVisibility(bool); + virtual void setFolding(FoldStyle); + + virtual void setIndentation(int,int); + virtual void setIndentationGuides(bool); + virtual void setIndentationGuidesBackgroundColor(const QColor &); + virtual void setIndentationGuidesForegroundColor(const QColor &); + virtual void setIndentationsUseTabs(bool); + virtual void setIndentationWidth(int); + + virtual void setLexer(QextScintillaLexer * = 0); + + virtual void setMarginsBackgroundColor(const QColor &); + virtual void setMarginsFont(const QFont &); + virtual void setMarginsForegroundColor(const QColor &); + + virtual void setMarginLineNumbers(int,bool); + virtual void setMarginMarkerMask(int,int); + virtual void setMarginSensitivity(int,bool); + virtual void setMarginWidth(int,int); + virtual void setMarginWidth(int,const QString &); + + virtual void setModified(bool); +%If (QScintilla_1_7 -) + virtual void setPaper(const QColor &); +%End + virtual void setReadOnly(bool); + virtual void setSelection(int,int,int,int); +%If (QScintilla_1_3 -) + virtual void setSelectionBackgroundColor(const QColor &); + virtual void setSelectionForegroundColor(const QColor &); +%End + virtual void setTabIndents(bool); + virtual void setTabWidth(int); + virtual void setText(const QString &); + virtual void setUtf8(bool); + virtual void setWhitespaceVisibility(WhitespaceVisibility); +%If (QScintilla_1_4 -) + virtual void setWrapMode(WrapMode); +%End + + virtual void undo(); + virtual void unindent(int); + + virtual void zoomIn(int); + virtual void zoomIn(); + virtual void zoomOut(int); + virtual void zoomOut(); + virtual void zoomTo(int); + +signals: + void cursorPositionChanged(int,int); + void copyAvailable(bool); + void marginClicked(int,int,Qt::ButtonState); + void modificationAttempted(); + void modificationChanged(bool); + void selectionChanged(); + void textChanged(); +%If (QScintilla_1_7 -) + void userListActivated(int, const QString &); +%End + +private: + QextScintilla(const QextScintilla &); + +}; diff --git a/python/pyqt/sip/qtext/qextscintillaapis.sip b/python/pyqt/sip/qtext/qextscintillaapis.sip new file mode 100644 index 00000000..ad388fbc --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillaapis.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for QextScintillaAPIs. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaAPIs +{ +%TypeHeaderCode +#include <qextscintillaapis.h> +%End + +public: + QextScintillaAPIs(); + + void add(const QString &); + bool load(const QString &); + void clear(); + +private: + QextScintillaAPIs(const QextScintillaAPIs &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillabase.sip b/python/pyqt/sip/qtext/qextscintillabase.sip new file mode 100644 index 00000000..e14ccf67 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillabase.sip @@ -0,0 +1,1024 @@ +// This is the SIP interface definition for QextScintillaBase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaBase : QWidget +{ +%TypeHeaderCode +#include <qextscintillabase.h> +%End + +public: + enum { + SCI_START, + SCI_OPTIONAL_START, + SCI_LEXER_START, + SCI_ADDTEXT, + SCI_ADDSTYLEDTEXT, + SCI_INSERTTEXT, + SCI_CLEARALL, + SCI_CLEARDOCUMENTSTYLE, + SCI_GETLENGTH, + SCI_GETCHARAT, + SCI_GETCURRENTPOS, + SCI_GETANCHOR, + SCI_GETSTYLEAT, + SCI_REDO, + SCI_SETUNDOCOLLECTION, + SCI_SELECTALL, + SCI_SETSAVEPOINT, + SCI_GETSTYLEDTEXT, + SCI_CANREDO, + SCI_MARKERLINEFROMHANDLE, + SCI_MARKERDELETEHANDLE, + SCI_GETUNDOCOLLECTION, + SCI_GETVIEWWS, + SCI_SETVIEWWS, + SCI_POSITIONFROMPOINT, + SCI_POSITIONFROMPOINTCLOSE, + SCI_GOTOLINE, + SCI_GOTOPOS, + SCI_SETANCHOR, + SCI_GETCURLINE, + SCI_GETENDSTYLED, + SCI_CONVERTEOLS, + SCI_GETEOLMODE, + SCI_SETEOLMODE, + SCI_STARTSTYLING, + SCI_SETSTYLING, + SCI_GETBUFFEREDDRAW, + SCI_SETBUFFEREDDRAW, + SCI_SETTABWIDTH, + SCI_GETTABWIDTH, + SCI_SETCODEPAGE, + SCI_SETUSEPALETTE, + SCI_MARKERDEFINE, + SCI_MARKERSETFORE, + SCI_MARKERSETBACK, + SCI_MARKERADD, + SCI_MARKERDELETE, + SCI_MARKERDELETEALL, + SCI_MARKERGET, + SCI_MARKERNEXT, + SCI_MARKERPREVIOUS, + SCI_MARKERDEFINEPIXMAP, + SCI_SETMARGINTYPEN, + SCI_GETMARGINTYPEN, + SCI_SETMARGINWIDTHN, + SCI_GETMARGINWIDTHN, + SCI_SETMARGINMASKN, + SCI_GETMARGINMASKN, + SCI_SETMARGINSENSITIVEN, + SCI_GETMARGINSENSITIVEN, + SCI_STYLECLEARALL, + SCI_STYLESETFORE, + SCI_STYLESETBACK, + SCI_STYLESETBOLD, + SCI_STYLESETITALIC, + SCI_STYLESETSIZE, + SCI_STYLESETFONT, + SCI_STYLESETEOLFILLED, + SCI_STYLERESETDEFAULT, + SCI_STYLESETUNDERLINE, + SCI_STYLESETCASE, + SCI_STYLESETCHARACTERSET, + SCI_SETSELFORE, + SCI_SETSELBACK, + SCI_SETCARETFORE, + SCI_ASSIGNCMDKEY, + SCI_CLEARCMDKEY, + SCI_CLEARALLCMDKEYS, + SCI_SETSTYLINGEX, + SCI_STYLESETVISIBLE, + SCI_GETCARETPERIOD, + SCI_SETCARETPERIOD, + SCI_SETWORDCHARS, + SCI_BEGINUNDOACTION, + SCI_ENDUNDOACTION, + SCI_INDICSETSTYLE, + SCI_INDICGETSTYLE, + SCI_INDICSETFORE, + SCI_INDICGETFORE, + SCI_SETWHITESPACEFORE, + SCI_SETWHITESPACEBACK, + SCI_SETSTYLEBITS, + SCI_GETSTYLEBITS, + SCI_SETLINESTATE, + SCI_GETLINESTATE, + SCI_GETMAXLINESTATE, + SCI_GETCARETLINEVISIBLE, + SCI_SETCARETLINEVISIBLE, + SCI_GETCARETLINEBACK, + SCI_SETCARETLINEBACK, + SCI_STYLESETCHANGEABLE, + SCI_AUTOCSHOW, + SCI_AUTOCCANCEL, + SCI_AUTOCACTIVE, + SCI_AUTOCPOSSTART, + SCI_AUTOCCOMPLETE, + SCI_AUTOCSTOPS, + SCI_AUTOCSETSEPARATOR, + SCI_AUTOCGETSEPARATOR, + SCI_AUTOCSELECT, + SCI_AUTOCSETCANCELATSTART, + SCI_AUTOCGETCANCELATSTART, + SCI_AUTOCSETFILLUPS, + SCI_AUTOCSETCHOOSESINGLE, + SCI_AUTOCGETCHOOSESINGLE, + SCI_AUTOCSETIGNORECASE, + SCI_AUTOCGETIGNORECASE, + SCI_USERLISTSHOW, + SCI_AUTOCSETAUTOHIDE, + SCI_AUTOCGETAUTOHIDE, + SCI_AUTOCSETDROPRESTOFWORD, + SCI_AUTOCGETDROPRESTOFWORD, + SCI_SETINDENT, + SCI_GETINDENT, + SCI_SETUSETABS, + SCI_GETUSETABS, + SCI_SETLINEINDENTATION, + SCI_GETLINEINDENTATION, + SCI_GETLINEINDENTPOSITION, + SCI_GETCOLUMN, + SCI_SETHSCROLLBAR, + SCI_GETHSCROLLBAR, + SCI_SETINDENTATIONGUIDES, + SCI_GETINDENTATIONGUIDES, + SCI_SETHIGHLIGHTGUIDE, + SCI_GETHIGHLIGHTGUIDE, + SCI_GETLINEENDPOSITION, + SCI_GETCODEPAGE, + SCI_GETCARETFORE, + SCI_GETUSEPALETTE, + SCI_GETREADONLY, + SCI_SETCURRENTPOS, + SCI_SETSELECTIONSTART, + SCI_GETSELECTIONSTART, + SCI_SETSELECTIONEND, + SCI_GETSELECTIONEND, + SCI_SETPRINTMAGNIFICATION, + SCI_GETPRINTMAGNIFICATION, + SCI_SETPRINTCOLOURMODE, + SCI_GETPRINTCOLOURMODE, + SCI_FINDTEXT, + SCI_FORMATRANGE, + SCI_GETFIRSTVISIBLELINE, + SCI_GETLINE, + SCI_GETLINECOUNT, + SCI_SETMARGINLEFT, + SCI_GETMARGINLEFT, + SCI_SETMARGINRIGHT, + SCI_GETMARGINRIGHT, + SCI_GETMODIFY, + SCI_SETSEL, + SCI_GETSELTEXT, + SCI_GETTEXTRANGE, + SCI_HIDESELECTION, + SCI_POINTXFROMPOSITION, + SCI_POINTYFROMPOSITION, + SCI_LINEFROMPOSITION, + SCI_POSITIONFROMLINE, + SCI_LINESCROLL, + SCI_SCROLLCARET, + SCI_REPLACESEL, + SCI_SETREADONLY, + SCI_NULL, + SCI_CANPASTE, + SCI_CANUNDO, + SCI_EMPTYUNDOBUFFER, + SCI_UNDO, + SCI_CUT, + SCI_COPY, + SCI_PASTE, + SCI_CLEAR, + SCI_SETTEXT, + SCI_GETTEXT, + SCI_GETTEXTLENGTH, + SCI_GETDIRECTFUNCTION, + SCI_GETDIRECTPOINTER, + SCI_SETOVERTYPE, + SCI_GETOVERTYPE, + SCI_SETCARETWIDTH, + SCI_GETCARETWIDTH, + SCI_SETTARGETSTART, + SCI_GETTARGETSTART, + SCI_SETTARGETEND, + SCI_GETTARGETEND, + SCI_REPLACETARGET, + SCI_REPLACETARGETRE, + SCI_SEARCHINTARGET, + SCI_SETSEARCHFLAGS, + SCI_GETSEARCHFLAGS, + SCI_CALLTIPSHOW, + SCI_CALLTIPCANCEL, + SCI_CALLTIPACTIVE, + SCI_CALLTIPPOSSTART, + SCI_CALLTIPSETHLT, + SCI_CALLTIPSETBACK, + SCI_CALLTIPSETFORE, + SCI_CALLTIPSETFOREHLT, +%If (QScintilla_1_6 -) + SCI_AUTOCSETMAXWIDTH, + SCI_AUTOCGETMAXWIDTH, + SCI_AUTOCSETMAXHEIGHT, + SCI_AUTOCGETMAXHEIGHT, +%End +%If (QScintilla_1_7 -) + SCI_CALLTIPUSESTYLE, +%End + SCI_VISIBLEFROMDOCLINE, + SCI_DOCLINEFROMVISIBLE, + SCI_SETFOLDLEVEL, + SCI_GETFOLDLEVEL, + SCI_GETLASTCHILD, + SCI_GETFOLDPARENT, + SCI_SHOWLINES, + SCI_HIDELINES, + SCI_GETLINEVISIBLE, + SCI_SETFOLDEXPANDED, + SCI_GETFOLDEXPANDED, + SCI_TOGGLEFOLD, + SCI_ENSUREVISIBLE, + SCI_SETFOLDFLAGS, + SCI_ENSUREVISIBLEENFORCEPOLICY, +%If (QScintilla_1_6 -) + SCI_WRAPCOUNT, +%End + SCI_SETTABINDENTS, + SCI_GETTABINDENTS, + SCI_SETBACKSPACEUNINDENTS, + SCI_GETBACKSPACEUNINDENTS, + SCI_SETMOUSEDWELLTIME, + SCI_GETMOUSEDWELLTIME, + SCI_WORDSTARTPOSITION, + SCI_WORDENDPOSITION, + SCI_SETWRAPMODE, + SCI_GETWRAPMODE, + SCI_SETLAYOUTCACHE, + SCI_GETLAYOUTCACHE, + SCI_SETSCROLLWIDTH, + SCI_GETSCROLLWIDTH, + SCI_TEXTWIDTH, + SCI_SETENDATLASTLINE, + SCI_GETENDATLASTLINE, + SCI_TEXTHEIGHT, + SCI_SETVSCROLLBAR, + SCI_GETVSCROLLBAR, + SCI_APPENDTEXT, + SCI_GETTWOPHASEDRAW, + SCI_SETTWOPHASEDRAW, + SCI_AUTOCGETTYPESEPARATOR, + SCI_AUTOCSETTYPESEPARATOR, + SCI_TARGETFROMSELECTION, + SCI_LINESJOIN, + SCI_LINESSPLIT, + SCI_SETFOLDMARGINCOLOUR, + SCI_SETFOLDMARGINHICOLOUR, + SCI_LINEDOWN, + SCI_LINEDOWNEXTEND, + SCI_LINEUP, + SCI_LINEUPEXTEND, + SCI_CHARLEFT, + SCI_CHARLEFTEXTEND, + SCI_CHARRIGHT, + SCI_CHARRIGHTEXTEND, + SCI_WORDLEFT, + SCI_WORDLEFTEXTEND, + SCI_WORDRIGHT, + SCI_WORDRIGHTEXTEND, + SCI_HOME, + SCI_HOMEEXTEND, + SCI_LINEEND, + SCI_LINEENDEXTEND, + SCI_DOCUMENTSTART, + SCI_DOCUMENTSTARTEXTEND, + SCI_DOCUMENTEND, + SCI_DOCUMENTENDEXTEND, + SCI_PAGEUP, + SCI_PAGEUPEXTEND, + SCI_PAGEDOWN, + SCI_PAGEDOWNEXTEND, + SCI_EDITTOGGLEOVERTYPE, + SCI_CANCEL, + SCI_DELETEBACK, + SCI_TAB, + SCI_BACKTAB, + SCI_NEWLINE, + SCI_FORMFEED, + SCI_VCHOME, + SCI_VCHOMEEXTEND, + SCI_ZOOMIN, + SCI_ZOOMOUT, + SCI_DELWORDLEFT, + SCI_DELWORDRIGHT, + SCI_LINECUT, + SCI_LINEDELETE, + SCI_LINETRANSPOSE, + SCI_LOWERCASE, + SCI_UPPERCASE, + SCI_LINESCROLLDOWN, + SCI_LINESCROLLUP, + SCI_DELETEBACKNOTLINE, + SCI_HOMEDISPLAY, + SCI_HOMEDISPLAYEXTEND, + SCI_LINEENDDISPLAY, + SCI_LINEENDDISPLAYEXTEND, + SCI_MOVECARETINSIDEVIEW, + SCI_LINELENGTH, + SCI_BRACEHIGHLIGHT, + SCI_BRACEBADLIGHT, + SCI_BRACEMATCH, + SCI_GETVIEWEOL, + SCI_SETVIEWEOL, + SCI_GETDOCPOINTER, + SCI_SETDOCPOINTER, + SCI_SETMODEVENTMASK, + SCI_GETEDGECOLUMN, + SCI_SETEDGECOLUMN, + SCI_GETEDGEMODE, + SCI_SETEDGEMODE, + SCI_GETEDGECOLOUR, + SCI_SETEDGECOLOUR, + SCI_SEARCHANCHOR, + SCI_SEARCHNEXT, + SCI_SEARCHPREV, + SCI_LINESONSCREEN, + SCI_USEPOPUP, + SCI_SELECTIONISRECTANGLE, + SCI_SETZOOM, + SCI_GETZOOM, + SCI_CREATEDOCUMENT, + SCI_ADDREFDOCUMENT, + SCI_RELEASEDOCUMENT, + SCI_GETMODEVENTMASK, + SCI_SETFOCUS, + SCI_GETFOCUS, + SCI_SETSTATUS, + SCI_GETSTATUS, + SCI_SETMOUSEDOWNCAPTURES, + SCI_GETMOUSEDOWNCAPTURES, + SCI_SETCURSOR, + SCI_GETCURSOR, + SCI_SETCONTROLCHARSYMBOL, + SCI_GETCONTROLCHARSYMBOL, + SCI_WORDPARTLEFT, + SCI_WORDPARTLEFTEXTEND, + SCI_WORDPARTRIGHT, + SCI_WORDPARTRIGHTEXTEND, + SCI_SETVISIBLEPOLICY, + SCI_DELLINELEFT, + SCI_DELLINERIGHT, + SCI_SETXOFFSET, + SCI_GETXOFFSET, + SCI_CHOOSECARETX, + SCI_GRABFOCUS, + SCI_SETXCARETPOLICY, + SCI_SETYCARETPOLICY, + SCI_LINEDUPLICATE, + SCI_REGISTERIMAGE, + SCI_SETPRINTWRAPMODE, + SCI_GETPRINTWRAPMODE, + SCI_CLEARREGISTEREDIMAGES, + SCI_STYLESETHOTSPOT, + SCI_SETHOTSPOTACTIVEFORE, + SCI_SETHOTSPOTACTIVEBACK, + SCI_SETHOTSPOTACTIVEUNDERLINE, + SCI_PARADOWN, + SCI_PARADOWNEXTEND, + SCI_PARAUP, + SCI_PARAUPEXTEND, +%If (QScintilla_1_1 -) + SCI_POSITIONBEFORE, + SCI_POSITIONAFTER, + SCI_COPYRANGE, + SCI_COPYTEXT, +%End +%If (QScintilla_1_3 -) + SCI_SETSELECTIONMODE, + SCI_GETSELECTIONMODE, + SCI_GETLINESELSTARTPOSITION, + SCI_GETLINESELENDPOSITION, + SCI_LINEDOWNRECTEXTEND, + SCI_LINEUPRECTEXTEND, + SCI_CHARLEFTRECTEXTEND, + SCI_CHARRIGHTRECTEXTEND, + SCI_HOMERECTEXTEND, + SCI_VCHOMERECTEXTEND, + SCI_LINEENDRECTEXTEND, + SCI_PAGEUPRECTEXTEND, + SCI_PAGEDOWNRECTEXTEND, + SCI_STUTTEREDPAGEUP, + SCI_STUTTEREDPAGEUPEXTEND, + SCI_STUTTEREDPAGEDOWN, + SCI_STUTTEREDPAGEDOWNEXTEND, + SCI_WORDLEFTEND, + SCI_WORDLEFTENDEXTEND, + SCI_WORDRIGHTEND, + SCI_WORDRIGHTENDEXTEND, + SCI_SETWHITESPACECHARS, + SCI_SETCHARSDEFAULT, + SCI_AUTOCGETCURRENT, + SCI_ALLOCATE, +%End + SCI_HOMEWRAP, + SCI_HOMEWRAPEXTEND, + SCI_LINEENDWRAP, + SCI_LINEENDWRAPEXTEND, + SCI_VCHOMEWRAP, + SCI_VCHOMEWRAPEXTEND, +%If (QScintilla_1_1 -) + SCI_LINECOPY, +%End +%If (QScintilla_1_6 -) + SCI_FINDCOLUMN, + SCI_GETCARETSTICKY, + SCI_SETCARETSTICKY, + SCI_TOGGLECARETSTICKY, +%End +%If (QScintilla_1_3 -) + SCI_SETWRAPVISUALFLAGS, + SCI_GETWRAPVISUALFLAGS, + SCI_SETWRAPVISUALFLAGSLOCATION, + SCI_GETWRAPVISUALFLAGSLOCATION, + SCI_SETWRAPSTARTINDENT, + SCI_GETWRAPSTARTINDENT, +%End +%If (QScintilla_1_7 -) + SCI_MARKERADDSET, + SCI_SETPASTECONVERTENDINGS + SCI_GETPASTECONVERTENDINGS + SCI_SELECTIONDUPLICATE + SCI_SETCARETLINEBACKALPHA + SCI_GETCARETLINEBACKALPHA + SCI_MARKERSETALPHA, + SCI_GETSELALPHA, + SCI_SETSELALPHA, +%End + SCI_STARTRECORD, + SCI_STOPRECORD, + SCI_SETLEXER, + SCI_GETLEXER, + SCI_COLOURISE, + SCI_SETPROPERTY, + SCI_SETKEYWORDS, + SCI_SETLEXERLANGUAGE, +%If (QScintilla_1_6 -) + SCI_LOADLEXERLIBRARY, + SCI_GETPROPERTY, + SCI_GETPROPERTYEXPANDED, + SCI_GETPROPERTYINT, +%End +%If (QScintilla_1_7 -) + SCI_GETSTYLEBITSNEEDED, +%End + }; + +%If (QScintilla_1_7 -) + enum + { + SC_ALPHA_TRANSPARENT, + SC_ALPHA_OPAQUE, + SC_ALPHA_NOALPHA, + }; +%End + +%If (QScintilla_1_3 -) + enum + { + SC_WRAPVISUALFLAG_NONE, + SC_WRAPVISUALFLAG_END, + SC_WRAPVISUALFLAG_START + }; + + enum + { + SC_WRAPVISUALFLAGLOC_DEFAULT, + SC_WRAPVISUALFLAGLOC_END_BY_TEXT, + SC_WRAPVISUALFLAGLOC_START_BY_TEXT + }; + + enum { + SC_SEL_STREAM, + SC_SEL_RECTANGLE, + SC_SEL_LINES + }; +%End + + enum { + SCWS_INVISIBLE, + SCWS_VISIBLEALWAYS, + SCWS_VISIBLEAFTERINDENT + }; + + enum { + SC_EOL_CRLF, + SC_EOL_CR, + SC_EOL_LF + }; + + enum { + SC_CP_DBCS, + SC_CP_UTF8 + }; + + enum { + SC_MARK_CIRCLE, + SC_MARK_ROUNDRECT, + SC_MARK_ARROW, + SC_MARK_SMALLRECT, + SC_MARK_SHORTARROW, + SC_MARK_EMPTY, + SC_MARK_ARROWDOWN, + SC_MARK_MINUS, + SC_MARK_PLUS, + SC_MARK_VLINE, + SC_MARK_LCORNER, + SC_MARK_TCORNER, + SC_MARK_BOXPLUS, + SC_MARK_BOXPLUSCONNECTED, + SC_MARK_BOXMINUS, + SC_MARK_BOXMINUSCONNECTED, + SC_MARK_LCORNERCURVE, + SC_MARK_TCORNERCURVE, + SC_MARK_CIRCLEPLUS, + SC_MARK_CIRCLEPLUSCONNECTED, + SC_MARK_CIRCLEMINUS, + SC_MARK_CIRCLEMINUSCONNECTED, + SC_MARK_BACKGROUND, + SC_MARK_DOTDOTDOT, + SC_MARK_ARROWS, + SC_MARK_PIXMAP, +%If (QScintilla_1_6 -) + SC_MARK_FULLRECT, +%End + SC_MARK_CHARACTER + }; + + enum { + SC_MARKNUM_FOLDEREND, + SC_MARKNUM_FOLDEROPENMID, + SC_MARKNUM_FOLDERMIDTAIL, + SC_MARKNUM_FOLDERTAIL, + SC_MARKNUM_FOLDERSUB, + SC_MARKNUM_FOLDER, + SC_MARKNUM_FOLDEROPEN, + SC_MASK_FOLDERS + }; + + enum { + SC_MARGIN_SYMBOL, + SC_MARGIN_NUMBER, +%If (QScintilla_1_7 -) + SC_MARGIN_BACK, + SC_MARGIN_FORE, +%End + }; + + enum { + STYLE_DEFAULT, + STYLE_LINENUMBER, + STYLE_BRACELIGHT, + STYLE_BRACEBAD, + STYLE_CONTROLCHAR, + STYLE_INDENTGUIDE, +%If (QScintilla_1_7 -) + STYLE_CALLTIP, +%End + STYLE_LASTPREDEFINED, +%If (QScintilla_1_3 -) + STYLE_MAX +%End + }; + + enum { + SC_CHARSET_ANSI, + SC_CHARSET_DEFAULT, + SC_CHARSET_BALTIC, + SC_CHARSET_CHINESEBIG5, + SC_CHARSET_EASTEUROPE, + SC_CHARSET_GB2312, + SC_CHARSET_GREEK, + SC_CHARSET_HANGUL, + SC_CHARSET_MAC, + SC_CHARSET_OEM, + SC_CHARSET_RUSSIAN, + SC_CHARSET_SHIFTJIS, + SC_CHARSET_SYMBOL, + SC_CHARSET_TURKISH, + SC_CHARSET_JOHAB, + SC_CHARSET_HEBREW, + SC_CHARSET_ARABIC, + SC_CHARSET_VIETNAMESE, + SC_CHARSET_THAI, +%If (QScintilla_1_6 -) + SC_CHARSET_8859_15, +%End + }; + + enum { + SC_CASE_MIXED, + SC_CASE_UPPER, + SC_CASE_LOWER + }; + + enum { + INDIC_MAX, + INDIC_PLAIN, + INDIC_SQUIGGLE, + INDIC_TT, + INDIC_DIAGONAL, + INDIC_STRIKE, +%If (QScintilla_1_2 -) + INDIC_HIDDEN, +%End +%If (QScintilla_1_3 -) + INDIC_BOX, +%End +%If (QScintilla_1_7 -) + INDIC_ROUNDBOX, +%End + INDIC0_MASK, + INDIC1_MASK, + INDIC2_MASK, + INDICS_MASK + }; + + enum { + SC_PRINT_NORMAL, + SC_PRINT_INVERTLIGHT, + SC_PRINT_BLACKONWHITE, + SC_PRINT_COLOURONWHITE, + SC_PRINT_COLOURONWHITEDEFAULTBG + }; + + enum { + SCFIND_WHOLEWORD, + SCFIND_MATCHCASE, + SCFIND_WORDSTART, + SCFIND_REGEXP, + SCFIND_POSIX + }; + + enum { + SC_FOLDLEVELBASE, + SC_FOLDLEVELWHITEFLAG, + SC_FOLDLEVELHEADERFLAG, + SC_FOLDLEVELBOXHEADERFLAG, + SC_FOLDLEVELBOXFOOTERFLAG, + SC_FOLDLEVELCONTRACTED, + SC_FOLDLEVELUNINDENT, + SC_FOLDLEVELNUMBERMASK + }; + + enum + { + SC_FOLDFLAG_BOX, + SC_FOLDFLAG_LINEBEFORE_EXPANDED, + SC_FOLDFLAG_LINEBEFORE_CONTRACTED, + SC_FOLDFLAG_LINEAFTER_EXPANDED, + SC_FOLDFLAG_LINEAFTER_CONTRACTED, + SC_FOLDFLAG_LEVELNUMBERS + }; + + enum { + SC_TIME_FOREVER + }; + + enum { + SC_WRAP_NONE, + SC_WRAP_WORD, +%If (QScintilla_1_6 -) + SC_WRAP_CHAR, +%End + }; + + enum { + SC_CACHE_NONE, + SC_CACHE_CARET, + SC_CACHE_PAGE, + SC_CACHE_DOCUMENT + }; + + enum { + EDGE_NONE, + EDGE_LINE, + EDGE_BACKGROUND + }; + + enum { + SC_CURSORNORMAL, + SC_CURSORWAIT + }; + + enum { + VISIBLE_SLOP, + VISIBLE_STRICT + }; + + enum { + CARET_SLOP, + CARET_STRICT, + CARET_JUMPS, + CARET_EVEN + }; + + enum { + SC_MOD_INSERTTEXT, + SC_MOD_DELETETEXT, + SC_MOD_CHANGESTYLE, + SC_MOD_CHANGEFOLD, + SC_PERFORMED_USER, + SC_PERFORMED_UNDO, + SC_PERFORMED_REDO, +%If (QScintilla_1_6 -) + SC_MULTISTEPUNDOREDO, +%End + SC_LASTSTEPINUNDOREDO, + SC_MOD_CHANGEMARKER, + SC_MOD_BEFOREINSERT, + SC_MOD_BEFOREDELETE, +%If (QScintilla_1_6 -) + SC_MULTILINEUNDOREDO, +%End + SC_MODEVENTMASKALL + }; + + enum { + SCK_DOWN, + SCK_UP, + SCK_LEFT, + SCK_RIGHT, + SCK_HOME, + SCK_END, + SCK_PRIOR, + SCK_NEXT, + SCK_DELETE, + SCK_INSERT, + SCK_ESCAPE, + SCK_BACK, + SCK_TAB, + SCK_RETURN, + SCK_ADD, + SCK_SUBTRACT, + SCK_DIVIDE + }; + + enum { +%If (QScintilla_1_7 -) + SCMOD_NORM, +%End + SCMOD_SHIFT, + SCMOD_CTRL, + SCMOD_ALT + }; + + enum { + SCLEX_CONTAINER, + SCLEX_NULL, + SCLEX_PYTHON, + SCLEX_CPP, + SCLEX_HTML, + SCLEX_XML, + SCLEX_PERL, + SCLEX_SQL, + SCLEX_VB, + SCLEX_PROPERTIES, + SCLEX_ERRORLIST, + SCLEX_MAKEFILE, + SCLEX_BATCH, + SCLEX_LATEX, + SCLEX_LUA, + SCLEX_DIFF, + SCLEX_CONF, + SCLEX_PASCAL, + SCLEX_AVE, + SCLEX_ADA, + SCLEX_LISP, + SCLEX_RUBY, + SCLEX_EIFFEL, + SCLEX_EIFFELKW, + SCLEX_TCL, + SCLEX_NNCRONTAB, + SCLEX_BULLANT, + SCLEX_VBSCRIPT, + SCLEX_ASP, + SCLEX_PHP, + SCLEX_BAAN, + SCLEX_MATLAB, +%If (QScintilla_1_2 -) + SCLEX_SCRIPTOL, +%End + SCLEX_ASM, + SCLEX_CPPNOCASE, + SCLEX_FORTRAN, + SCLEX_F77, + SCLEX_CSS, + SCLEX_POV, +%If (QScintilla_1_1 -) + SCLEX_LOUT, + SCLEX_ESCRIPT, +%End +%If (QScintilla_1_2 -) + SCLEX_PS, + SCLEX_NSIS, + SCLEX_MMIXAL, +%End +%If (QScintilla_1_3 -) + SCLEX_CLW, + SCLEX_CLWNOCASE, + SCLEX_LOT, + SCLEX_YAML, + SCLEX_TEX, + SCLEX_METAPOST, + SCLEX_POWERBASIC, + SCLEX_FORTH, + SCLEX_ERLANG, + SCLEX_OCTAVE, + SCLEX_MSSQL, + SCLEX_VERILOG, + SCLEX_KIX, + SCLEX_GUI4CLI, + SCLEX_SPECMAN, + SCLEX_AU3, + SCLEX_APDL, + SCLEX_BASH, +%End +%If (QScintilla_1_5 -) + SCLEX_ASN1, + SCLEX_VHDL, +%End +%If (QScintilla_1_6 -) + SCLEX_CAML, + SCLEX_BLITZBASIC, + SCLEX_PUREBASIC, + SCLEX_HASKELL, + SCLEX_PHPSCRIPT, + SCLEX_TADS3, + SCLEX_REBOL, + SCLEX_SMALLTALK, + SCLEX_FLAGSHIP, + SCLEX_CSOUND, +%End +%If (QScintilla_1_7 -) + SCLEX_FREEBASIC, + SCLEX_INNOSETUP, + SCLEX_OPAL, + SCLEX_SPICE, +%End + }; + + QextScintillaBase(QWidget * /TransferThis/,const char *, + WFlags = 0); + +%ConvertToSubClassCode + static struct class_graph { + char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QextScintillaLexer, &sipClass_QextScintillaLexer, 3, 1}, + {sipName_QextScintillaBase, &sipClass_QextScintillaBase, 15, 2}, + {sipName_QextScintillaMacro, &sipClass_QextScintillaMacro, -1, -1}, +#if QSCINTILLA_VERSION >= 0x010300 + {sipName_QextScintillaLexerPerl, &sipClass_QextScintillaLexerPerl, -1, 4}, +#else + {NULL, NULL, -1, 4}, +#endif +#if QSCINTILLA_VERSION >= 0x010100 + {sipName_QextScintillaLexerHTML, &sipClass_QextScintillaLexerHTML, -1, 5}, +#else + {NULL, NULL, -1, 5}, +#endif +#if QSCINTILLA_VERSION >= 0x010500 + {sipName_QextScintillaLexerRuby, &sipClass_QextScintillaLexerRuby, -1, 6}, +#else + {NULL, NULL, -1, 6}, +#endif + {sipName_QextScintillaLexerCPP, &sipClass_QextScintillaLexerCPP, 11, 7}, + {sipName_QextScintillaLexerPython, &sipClass_QextScintillaLexerPython, -1, 8}, +#if QSCINTILLA_VERSION >= 0x010100 + {sipName_QextScintillaLexerSQL, &sipClass_QextScintillaLexerSQL, -1, 9}, +#else + {NULL, NULL, -1, 9}, +#endif +#if QSCINTILLA_VERSION >= 0x010400 + {sipName_QextScintillaLexerBash, &sipClass_QextScintillaLexerBash, -1, 10}, +#else + {NULL, NULL, -1, 10}, +#endif +#if QSCINTILLA_VERSION >= 0x010500 + {sipName_QextScintillaLexerLua, &sipClass_QextScintillaLexerLua, -1, -1}, +#else + {NULL, NULL, -1, -1}, +#endif + {sipName_QextScintillaLexerIDL, &sipClass_QextScintillaLexerIDL, -1, 12}, + {sipName_QextScintillaLexerJavaScript, &sipClass_QextScintillaLexerJavaScript, -1, 13}, + {sipName_QextScintillaLexerCSharp, &sipClass_QextScintillaLexerCSharp, -1, 14}, + {sipName_QextScintillaLexerJava, &sipClass_QextScintillaLexerJava, -1, -1}, + {sipName_QextScintilla, &sipClass_QextScintilla, -1, -1}, + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + +%If (QScintilla_1_3 -) + QextScintillaBase *pool(); +%End + + long SendScintilla(unsigned int,unsigned long = 0,long = 0); + long SendScintilla(unsigned int,unsigned long,const char *); + long SendScintilla(unsigned int,const char *); + long SendScintilla(unsigned int,const char *,const char *); + long SendScintilla(unsigned int,long); + //long SendScintilla(unsigned int,int); + long SendScintilla(unsigned int,long,long,char *); + long SendScintilla(unsigned int,unsigned long,const QColor &); + long SendScintilla(unsigned int,const QColor &); + long SendScintilla(unsigned int,unsigned long,QPainter *,const QRect &, + long,long); + long SendScintilla(unsigned int,unsigned long,const QPixmap *); + + virtual QSize sizeHint() const; +%If (QScintilla_1_5 -) + QWidget *viewport() const; +%End + +signals: + void QSCN_SELCHANGED(bool); + + void SCEN_CHANGE(); + +%If (QScintilla_1_6 -) + void SCN_AUTOCSELECTION(const char *,int); +%End + void SCN_CHARADDED(int); + void SCN_CALLTIPCLICK(int); + void SCN_DOUBLECLICK(); + void SCN_DWELLEND(int,int,int); + void SCN_DWELLSTART(int,int,int); + void SCN_HOTSPOTCLICK(int,int); + void SCN_HOTSPOTDOUBLECLICK(int,int); + void SCN_MACRORECORD(unsigned int,unsigned long,long); + void SCN_MARGINCLICK(int,int,int); + void SCN_MODIFIED(int,int,const char *,int,int,int,int,int); + void SCN_MODIFYATTEMPTRO(); + void SCN_NEEDSHOWN(int,int); + void SCN_PAINTED(); + void SCN_SAVEPOINTLEFT(); + void SCN_SAVEPOINTREACHED(); + void SCN_STYLENEEDED(int); + void SCN_UPDATEUI(); + void SCN_USERLISTSELECTION(const char *,int); + void SCN_ZOOM(); + +protected: + bool eventFilter(QObject *,QEvent *); + virtual void keyPressEvent(QKeyEvent *); + virtual void focusInEvent(QFocusEvent *); + virtual void focusOutEvent(QFocusEvent *); + virtual bool focusNextPrevChild(bool); +%If (QScintilla_1_5 -) + virtual void startDrag(); +%End + +private: + QextScintillaBase(const QextScintillaBase &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillacommand.sip b/python/pyqt/sip/qtext/qextscintillacommand.sip new file mode 100644 index 00000000..148fdd67 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillacommand.sip @@ -0,0 +1,44 @@ +// This is the SIP interface definition for QextScintillaCommand. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaCommand +{ +%TypeHeaderCode +#include <qextscintillacommand.h> +%End + +public: + void setKey(int); + void setAlternateKey(int); + int key() const; + int alternateKey() const; + static bool validKey(int); + QString description() const; + +private: + QextScintillaCommand(QextScintilla *,int,int,const char *); + QextScintillaCommand(const QextScintillaCommand &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillacommandset.sip b/python/pyqt/sip/qtext/qextscintillacommandset.sip new file mode 100644 index 00000000..ae1be22c --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillacommandset.sip @@ -0,0 +1,52 @@ +// This is the SIP interface definition for the QextScintillaCommandSet. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaCommandSet +{ +%TypeHeaderCode +#include <qextscintillacommandset.h> +%End + +public: + bool readSettings(QSettings &,const char * = "/Scintilla"); + bool writeSettings(QSettings &,const char * = "/Scintilla"); + +%If (QScintilla_1_4 -) + QPtrList<QextScintillaCommand> &commands(); +%End +%If (- QScintilla_1_4) + const QPtrList<QextScintillaCommand> &commands() const; +%End + +%If (QScintilla_1_4 -) + void clearKeys(); + void clearAlternateKeys(); +%End + +private: + QextScintillaCommandSet(QextScintilla *); + QextScintillaCommandSet(const QextScintillaCommandSet &); +}; diff --git a/python/pyqt/sip/qtext/qextscintilladocument.sip b/python/pyqt/sip/qtext/qextscintilladocument.sip new file mode 100644 index 00000000..91081147 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintilladocument.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for QextScintillaDocument. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_3 -) + +class QextScintillaDocument +{ +%TypeHeaderCode +#include <qextscintilladocument.h> +%End + +public: + QextScintillaDocument(); + virtual ~QextScintillaDocument(); + + QextScintillaDocument(const QextScintillaDocument &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexer.sip b/python/pyqt/sip/qtext/qextscintillalexer.sip new file mode 100644 index 00000000..ed10f463 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexer.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for QextScintillaLexer. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexer : QObject +{ +%TypeHeaderCode +#include <qextscintillalexer.h> +%End + +public: + QextScintillaLexer(QObject * /TransferThis/ = 0,const char * = 0); + + virtual const char *language() const = 0; + virtual const char *lexer() const = 0; + int autoIndentStyle(); + virtual QColor color(int) const; + virtual bool eolFill(int) const; + virtual QFont font(int) const; + virtual const char *keywords(int) const; + virtual QString description(int) const = 0; + virtual QColor paper(int) const; + virtual QFont defaultFont() const; +%If (QScintilla_1_7 -) + virtual QColor defaultColor() const; + virtual QColor defaultPaper() const; +%End + virtual void refreshProperties(); + bool readSettings(QSettings &,const char * = "/Scintilla"); + bool writeSettings(QSettings &,const char * = "/Scintilla") const; + +public slots: + virtual void setAutoIndentStyle(int); + virtual void setColor(const QColor &,int = -1); + virtual void setDefaultFont(const QFont &); +%If (QScintilla_1_7 -) + virtual void setDefaultColor(const QColor &); + virtual void setDefaultPaper(const QColor &); +%End + virtual void setEolFill(bool,int = -1); + virtual void setFont(const QFont &,int = -1); + virtual void setPaper(const QColor &,int = -1); + +signals: + void colorChanged(const QColor &,int); + void eolFillChanged(bool,int); + void fontChanged(const QFont &,int); + void paperChanged(const QColor &,int); + void propertyChanged(const char *,const char *); + +protected: + virtual bool readProperties(QSettings &,const QString &); + virtual bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexer(const QextScintillaLexer &); + +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexerbash.sip b/python/pyqt/sip/qtext/qextscintillalexerbash.sip new file mode 100644 index 00000000..3a4099dc --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerbash.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for QextScintillaLexerBash. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_4 -) + +class QextScintillaLexerBash : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerbash.h> +%End + +public: + enum { + Default, + Error, + Comment, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + Operator, + Identifier, + Scalar, + ParameterExpansion, + Backticks, + HereDocumentDelimiter, + SingleQuotedHereDocument + }; + + QextScintillaLexerBash(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerBash(const QextScintillaLexerBash &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerbatch.sip b/python/pyqt/sip/qtext/qextscintillalexerbatch.sip new file mode 100644 index 00000000..f29f326a --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerbatch.sip @@ -0,0 +1,62 @@ +// This is the SIP interface definition for QextScintillaLexerBatch. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerBatch : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerbatch.h> +%End + +public: + enum { + Default, + Comment, + Keyword, + Label, + HideCommandChar, + ExternalCommand, + Variable, + Operator + }; + + QextScintillaLexerBatch(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + +private: + QextScintillaLexerBatch(const QextScintillaLexerBatch &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexercpp.sip b/python/pyqt/sip/qtext/qextscintillalexercpp.sip new file mode 100644 index 00000000..dab8cf28 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexercpp.sip @@ -0,0 +1,98 @@ +// This is the SIP interface definition for QextScintillaLexerCPP. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerCPP : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexercpp.h> +%End + +public: + enum { +%If (QScintilla_1_1 -) + Default, +%End + WhiteSpace, + Comment, + CommentLine, + CommentDoc, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + UUID, + PreProcessor, + Operator, + Identifier, + UnclosedString, + VerbatimString, + Regex, + CommentLineDoc, + KeywordSet2, + CommentDocKeyword, + CommentDocKeywordError, +%If (QScintilla_1_1 -) + GlobalClass, +%End + }; + + QextScintillaLexerCPP(QObject * /TransferThis/ = 0,const char * = 0, + bool = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); +%If (QScintilla_1_1 -) + bool foldAtElse() const; +%End + bool foldComments() const; + bool foldCompact() const; + bool foldPreprocessor() const; + bool stylePreprocessor() const; + +public slots: +%If (QScintilla_1_1 -) + virtual void setFoldAtElse(bool); +%End + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setFoldPreprocessor(bool); + virtual void setStylePreprocessor(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerCPP(const QextScintillaLexerCPP &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexercsharp.sip b/python/pyqt/sip/qtext/qextscintillalexercsharp.sip new file mode 100644 index 00000000..94442480 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexercsharp.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for QextScintillaLexerCSharp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerCSharp : QextScintillaLexerCPP +{ +%TypeHeaderCode +#include <qextscintillalexercsharp.h> +%End + +public: + QextScintillaLexerCSharp(QObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + +private: + QextScintillaLexerCSharp(const QextScintillaLexerCSharp &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexercss.sip b/python/pyqt/sip/qtext/qextscintillalexercss.sip new file mode 100644 index 00000000..eb02a09c --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexercss.sip @@ -0,0 +1,81 @@ +// This is the SIP interface definition for QextScintillaLexerCSS. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerCSS : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexercss.h> +%End + +public: + enum { + Default, + Tag, + ClassSelector, + PseudoClass, + UnknownPseudoClass, + Operator, + CSS1Property, + UnknownProperty, + Value, + Comment, + IDSelector, + Important, + AtRule, + DoubleQuotedString, + SingleQuotedString, + CSS2Property, + Attribute + }; + + QextScintillaLexerCSS(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerCSS(const QextScintillaLexerCSS &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerdiff.sip b/python/pyqt/sip/qtext/qextscintillalexerdiff.sip new file mode 100644 index 00000000..adfcb779 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerdiff.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QextScintillaLexerDiff. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerDiff : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerdiff.h> +%End + +public: + enum { + Default, + Comment, + Command, + Header, + Position, + LineRemoved, + LineAdded + }; + + QextScintillaLexerDiff(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + QString description(int) const; + +private: + QextScintillaLexerDiff(const QextScintillaLexerDiff &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerhtml.sip b/python/pyqt/sip/qtext/qextscintillalexerhtml.sip new file mode 100644 index 00000000..6b591622 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerhtml.sip @@ -0,0 +1,178 @@ +// This is the SIP interface definition for QextScintillaLexerHTML. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_1 -) + +class QextScintillaLexerHTML : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerhtml.h> +%End + +public: + enum { + Default, + Tag, + UnknownTag, + Attribute, + UnknownAttribute, + HTMLNumber, + HTMLDoubleQuotedString, + HTMLSingleQuotedString, + OtherInTag, + HTMLComment, + Entity, + XMLTagEnd, + XMLStart, + XMLEnd, + Script, + ASPAtStart, + ASPStart, + CDATA, + PHPStart, + HTMLValue, + ASPXCComment, + SGMLDefault, + SGMLCommand, + SGMLParameter, + SGMLDoubleQuotedString, + SGMLSingleQuotedString, + SGMLError, + SGMLSpecial, + SGMLEntity, + SGMLComment, + SGMLParameterComment, + SGMLBlockDefault, + JavaScriptStart, + JavaScriptDefault, + JavaScriptComment, + JavaScriptCommentLine, + JavaScriptCommentDoc, + JavaScriptNumber, + JavaScriptWord, + JavaScriptKeyword, + JavaScriptDoubleQuotedString, + JavaScriptSingleQuotedString, + JavaScriptSymbol, + JavaScriptUnclosedString, + JavaScriptRegex, + ASPJavaScriptStart, + ASPJavaScriptDefault, + ASPJavaScriptComment, + ASPJavaScriptCommentLine, + ASPJavaScriptCommentDoc, + ASPJavaScriptNumber, + ASPJavaScriptWord, + ASPJavaScriptKeyword, + ASPJavaScriptDoubleQuotedString, + ASPJavaScriptSingleQuotedString, + ASPJavaScriptSymbol, + ASPJavaScriptUnclosedString, + ASPJavaScriptRegex, + VBScriptStart, + VBScriptDefault, + VBScriptComment, + VBScriptNumber, + VBScriptKeyword, + VBScriptString, + VBScriptIdentifier, + VBScriptUnclosedString, + ASPVBScriptStart, + ASPVBScriptDefault, + ASPVBScriptComment, + ASPVBScriptNumber, + ASPVBScriptKeyword, + ASPVBScriptString, + ASPVBScriptIdentifier, + ASPVBScriptUnclosedString, + PythonStart, + PythonDefault, + PythonComment, + PythonNumber, + PythonDoubleQuotedString, + PythonSingleQuotedString, + PythonKeyword, + PythonTripleSingleQuotedString, + PythonTripleDoubleQuotedString, + PythonClassName, + PythonFunctionMethodName, + PythonOperator, + PythonIdentifier, + ASPPythonStart, + ASPPythonDefault, + ASPPythonComment, + ASPPythonNumber, + ASPPythonDoubleQuotedString, + ASPPythonSingleQuotedString, + ASPPythonKeyword, + ASPPythonTripleSingleQuotedString, + ASPPythonTripleDoubleQuotedString, + ASPPythonClassName, + ASPPythonFunctionMethodName, + ASPPythonOperator, + ASPPythonIdentifier, + PHPDefault, + PHPDoubleQuotedString, + PHPSingleQuotedString, + PHPKeyword, + PHPNumber, + PHPVariable, + PHPComment, + PHPCommentLine, + PHPDoubleQuotedVariable, + PHPOperator + }; + + QextScintillaLexerHTML(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + bool foldPreprocessor() const; + bool caseSensitiveTags() const; + +public slots: + virtual void setFoldCompact(bool); + virtual void setFoldPreprocessor(bool); + virtual void setCaseSensitiveTags(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerHTML(const QextScintillaLexerHTML &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexeridl.sip b/python/pyqt/sip/qtext/qextscintillalexeridl.sip new file mode 100644 index 00000000..cf1fe5a7 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexeridl.sip @@ -0,0 +1,43 @@ +// This is the SIP interface definition for QextScintillaLexerIDL. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerIDL : QextScintillaLexerCPP +{ +%TypeHeaderCode +#include <qextscintillalexeridl.h> +%End + +public: + QextScintillaLexerIDL(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + QColor color(int) const; + const char *keywords(int) const; + QString description(int) const; + +private: + QextScintillaLexerIDL(const QextScintillaLexerIDL &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexerjava.sip b/python/pyqt/sip/qtext/qextscintillalexerjava.sip new file mode 100644 index 00000000..8db6bd42 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerjava.sip @@ -0,0 +1,41 @@ +// This is the SIP interface definition for QextScintillaLexerJava. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerJava : QextScintillaLexerCPP +{ +%TypeHeaderCode +#include <qextscintillalexerjava.h> +%End + +public: + QextScintillaLexerJava(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *keywords(int) const; + +private: + QextScintillaLexerJava(const QextScintillaLexerJava &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexerjavascript.sip b/python/pyqt/sip/qtext/qextscintillalexerjavascript.sip new file mode 100644 index 00000000..4b3c9a10 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerjavascript.sip @@ -0,0 +1,47 @@ +// This is the SIP interface definition for QextScintillaLexerJavaScript. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerJavaScript : QextScintillaLexerCPP +{ +%TypeHeaderCode +#include <qextscintillalexerjavascript.h> +%End + +public: + QextScintillaLexerJavaScript(QObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + +private: + QextScintillaLexerJavaScript(const QextScintillaLexerJavaScript &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexerlua.sip b/python/pyqt/sip/qtext/qextscintillalexerlua.sip new file mode 100644 index 00000000..fe05ea17 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerlua.sip @@ -0,0 +1,79 @@ +// This is the SIP interface definition for QextScintillaLexerLua. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_5 -) + +class QextScintillaLexerLua : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerlua.h> +%End + +public: + enum { + Default, + Comment, + LineComment, + Number, + Keyword, + String, + Character, + LiteralString, + Preprocessor, + Operator, + Identifier, + UnclosedString, + BasicFunctions, + StringTableMathsFunctions, + CoroutinesIOSystemFacilities + }; + + QextScintillaLexerLua(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + +public slots: + virtual void setFoldCompact(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerLua(const QextScintillaLexerLua &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexermakefile.sip b/python/pyqt/sip/qtext/qextscintillalexermakefile.sip new file mode 100644 index 00000000..83c15b14 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexermakefile.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for QextScintillaLexerMakefile. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerMakefile : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexermakefile.h> +%End + +public: + enum { + Default, + Comment, + Preprocessor, + Variable, + Operator, + Target, + Error + }; + + QextScintillaLexerMakefile(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + QString description(int) const; + QColor paper(int) const; + +private: + QextScintillaLexerMakefile(const QextScintillaLexerMakefile &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerperl.sip b/python/pyqt/sip/qtext/qextscintillalexerperl.sip new file mode 100644 index 00000000..a8db0a11 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerperl.sip @@ -0,0 +1,96 @@ +// This is the SIP interface definition for QextScintillaLexerPerl. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_3 -) + +class QextScintillaLexerPerl : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerperl.h> +%End + +public: + enum { + Default, + Error, + Comment, + POD, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + Operator, + Identifier, + Scalar, + Array, + Hash, + SymbolTable, + Regex, + Substitution, + Backticks, + DataSection, + HereDocumentDelimiter, + SingleQuotedHereDocument, + DoubleQuotedHereDocument, + BacktickHereDocument, + QuotedStringQ, + QuotedStringQQ, + QuotedStringQX, + QuotedStringQR, + QuotedStringQW, +%If (QScintilla_1_6 -) + PODVerbatim, +%End + }; + + QextScintillaLexerPerl(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerPerl(const QextScintillaLexerPerl &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerpov.sip b/python/pyqt/sip/qtext/qextscintillalexerpov.sip new file mode 100644 index 00000000..862e48e8 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerpov.sip @@ -0,0 +1,85 @@ +// This is the SIP interface definition for QextScintillaLexerPOV. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerPOV : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerpov.h> +%End + +public: + enum { + Default, + Comment, + CommentLine, + Number, + Operator, + Identifier, + String, + UnclosedString, + Directive, + BadDirective, + ObjectsCSGAppearance, + TypesModifiersItems, + PredefinedIdentifiers, + PredefinedFunctions, + KeywordSet6, + KeywordSet7, + KeywordSet8 + }; + + QextScintillaLexerPOV(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + bool foldDirectives() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setFoldDirectives(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerPOV(const QextScintillaLexerPOV &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerproperties.sip b/python/pyqt/sip/qtext/qextscintillalexerproperties.sip new file mode 100644 index 00000000..45c52e5f --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerproperties.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for QextScintillaLexerProperties. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerProperties : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerproperties.h> +%End + +public: + enum { + Default, + Comment, + Section, + Assignment, + DefaultValue + }; + + QextScintillaLexerProperties(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + QString description(int) const; + QColor paper(int) const; + + void refreshProperties(); + bool foldCompact() const; + +public slots: + virtual void setFoldCompact(bool); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerProperties(const QextScintillaLexerProperties &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexerpython.sip b/python/pyqt/sip/qtext/qextscintillalexerpython.sip new file mode 100644 index 00000000..3a2bca5b --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerpython.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for QextScintillaLexerPython. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaLexerPython : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerpython.h> +%End + +public: + enum { +%If (QScintilla_1_1 -) + Default, +%End + WhiteSpace, + Comment, + Number, + DoubleQuotedString, + SingleQuotedString, + Keyword, + TripleSingleQuotedString, + TripleDoubleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + CommentBlock, + UnclosedString, +%If (QScintilla_1_7 -) + HighlightedIdentifier, + Decorator, +%End + }; + + enum IndentationWarning { + NoWarning, + Inconsistent, + TabsAfterSpaces, + Spaces, + Tabs + }; + + QextScintillaLexerPython(QObject * /TransferThis/ = 0, + const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; + void refreshProperties(); + + bool foldComments() const; + bool foldQuotes() const; + IndentationWarning indentationWarning() const; + +public slots: + virtual void setFoldComments(bool); + virtual void setFoldQuotes(bool); + virtual void setIndentationWarning(IndentationWarning); + +protected: + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; + +private: + QextScintillaLexerPython(const QextScintillaLexerPython &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillalexerruby.sip b/python/pyqt/sip/qtext/qextscintillalexerruby.sip new file mode 100644 index 00000000..77beba07 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexerruby.sip @@ -0,0 +1,128 @@ +// This is the SIP interface definition for QextScintillaLexerRuby. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_5 -) + +class QextScintillaLexerRuby : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexerruby.h> +%End + +public: +%If (QScintilla_1_7 -) + enum { + Default, + Comment, + POD, + Number, + Keyword, + DoubleQuotedString, + SingleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + Regex, + Global, + Symbol, + ModuleName, + InstanceVariable, + ClassVariable, + Backticks, + DataSection, + HereDocumentDelimiter, + HereDocument, + PercentStringq, + PercentStringQ, + PercentStringx, + PercentStringr, + PercentStringw, + DemotedKeyword, + Stdin, + Stdout, + Stderr + }; +%End +%If (- QScintilla_1_7) + enum { + Default, + WhiteSpace, + Comment, + Number, + DoubleQuotedString, + SingleQuotedString, + Keyword, + TripleDoubleQuotedString, + ClassName, + FunctionMethodName, + Operator, + Identifier, + CommentBlock, + UnclosedString + }; + + enum IndentationWarning { + NoWarning, + Inconsistent, + TabsAfterSpaces, + Spaces, + Tabs + }; +%End + + QextScintillaLexerRuby(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + bool eolFill(int) const; + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; + QColor paper(int) const; +%If (- QScintilla_1_7) + void refreshProperties(); + + IndentationWarning indentationWarning() const; +%End + +public slots: +%If (- QScintilla_1_7) + virtual void setIndentationWarning(IndentationWarning); +%End + +protected: +%If (- QScintilla_1_7) + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; +%End + +private: + QextScintillaLexerRuby(const QextScintillaLexerRuby &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexersql.sip b/python/pyqt/sip/qtext/qextscintillalexersql.sip new file mode 100644 index 00000000..85a5e191 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexersql.sip @@ -0,0 +1,105 @@ +// This is the SIP interface definition for QextScintillaLexerSQL. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_1 -) + +class QextScintillaLexerSQL : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexersql.h> +%End + +public: + enum { + Default, + Comment, +%If (QScintilla_1_6 -) + CommentLine, + CommentDoc, +%End + LineComment, // Obsolete. + Number, + Keyword, +%If (QScintilla_1_6 -) + DoubleQuotedString, +%End + SingleQuotedString, +%If (QScintilla_1_6 -) + PlusKeyword, + PlusPrompt, +%End + Operator, + Identifier, +%If (QScintilla_1_6 -) + PlusComment, + CommentLineHash, + CommentDocKeyword, + CommentDocKeywordError, + KeywordSet5, + KeywordSet6, + KeywordSet7, + KeywordSet8, +%End + }; + + QextScintillaLexerSQL(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; +%If (QScintilla_1_6 -) + bool eolFill(int) const; +%End + QFont font(int) const; + const char *keywords(int) const; + QString description(int) const; +%If (QScintilla_1_6 -) + QColor paper(int) const; + + void refreshProperties(); + bool foldComments() const; + bool foldCompact() const; + bool backslashEscapes() const; +%End + +public slots: +%If (QScintilla_1_6 -) + virtual void setFoldComments(bool); + virtual void setFoldCompact(bool); + virtual void setBackslashEscapes(bool); +%End + +protected: +%If (QScintilla_1_6 -) + bool readProperties(QSettings &,const QString &); + bool writeProperties(QSettings &,const QString &) const; +%End + +private: + QextScintillaLexerSQL(const QextScintillaLexerSQL &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillalexertex.sip b/python/pyqt/sip/qtext/qextscintillalexertex.sip new file mode 100644 index 00000000..668fcd02 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillalexertex.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QextScintillaLexerTeX. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (QScintilla_1_6 -) + +class QextScintillaLexerTeX : QextScintillaLexer +{ +%TypeHeaderCode +#include <qextscintillalexertex.h> +%End + +public: + enum { + Default, + Special, + Group, + Symbol, + Command, + Text + }; + + QextScintillaLexerTeX(QObject * /TransferThis/ = 0,const char * = 0); + + const char *language() const; + const char *lexer() const; + QColor color(int) const; + const char *keywords(int) const; + QString description(int) const; + +private: + QextScintillaLexerTeX(const QextScintillaLexerTeX &); +}; + +%End diff --git a/python/pyqt/sip/qtext/qextscintillamacro.sip b/python/pyqt/sip/qtext/qextscintillamacro.sip new file mode 100644 index 00000000..45615af0 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillamacro.sip @@ -0,0 +1,49 @@ +// This is the SIP interface definition for QextScintillaMacro. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaMacro : QObject +{ +%TypeHeaderCode +#include <qextscintillamacro.h> +%End + +public: + QextScintillaMacro(QextScintilla * /TransferThis/,const char * = 0); + QextScintillaMacro(const QCString &,QextScintilla * /TransferThis/, + const char * = 0); + + void clear(); + bool load(const QCString &); + QCString save() const; + +public slots: + virtual void play(); + virtual void startRecording(); + virtual void endRecording(); + +private: + QextScintillaMacro(const QextScintillaMacro &); +}; diff --git a/python/pyqt/sip/qtext/qextscintillaprinter.sip b/python/pyqt/sip/qtext/qextscintillaprinter.sip new file mode 100644 index 00000000..dce068b6 --- /dev/null +++ b/python/pyqt/sip/qtext/qextscintillaprinter.sip @@ -0,0 +1,45 @@ +// This is the SIP interface definition for QextScintillaPrinter. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +class QextScintillaPrinter : QPrinter +{ +%TypeHeaderCode +#include <qextscintillaprinter.h> +%End + +public: + QextScintillaPrinter(QPrinter::PrinterMode = QPrinter::ScreenResolution); + + virtual void formatPage(QPainter &,bool,QRect &,int); + virtual int printRange(QextScintillaBase *,int = -1,int = -1); + int magnification() const; + virtual void setMagnification(int); + QextScintilla::WrapMode wrapMode() const; + virtual void setWrapMode(QextScintilla::WrapMode); + +private: + QextScintillaPrinter(const QextScintillaPrinter &); +}; diff --git a/python/pyqt/sip/qtext/qtextmod.sip b/python/pyqt/sip/qtext/qtextmod.sip new file mode 100644 index 00000000..06024a64 --- /dev/null +++ b/python/pyqt/sip/qtext/qtextmod.sip @@ -0,0 +1,107 @@ +// This is the SIP interface definition for the qtext module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtext 4 + +%Import qt/qtmod.sip + +%Include copying.sip + + +// The QScintilla versions. +%Timeline {QScintilla_1_1 QScintilla_1_2 QScintilla_1_3 QScintilla_1_4 + QScintilla_1_5 QScintilla_1_6 QScintilla_1_7} + + +const unsigned QSCINTILLA_VERSION; +const char *QSCINTILLA_VERSION_STR; +const char *QSCINTILLA_BUILD; + + +%Include qextscintillaapis.sip +%Include qextscintillabase.sip +%Include qextscintilla.sip +%Include qextscintillacommand.sip +%Include qextscintillacommandset.sip +%Include qextscintilladocument.sip +%Include qextscintillalexer.sip +%Include qextscintillalexerbash.sip +%Include qextscintillalexerbatch.sip +%Include qextscintillalexercpp.sip +%Include qextscintillalexercsharp.sip +%Include qextscintillalexercss.sip +%Include qextscintillalexerdiff.sip +%Include qextscintillalexerhtml.sip +%Include qextscintillalexeridl.sip +%Include qextscintillalexerjava.sip +%Include qextscintillalexerjavascript.sip +%Include qextscintillalexerlua.sip +%Include qextscintillalexermakefile.sip +%Include qextscintillalexerperl.sip +%Include qextscintillalexerpov.sip +%Include qextscintillalexerproperties.sip +%Include qextscintillalexerpython.sip +%Include qextscintillalexerruby.sip +%Include qextscintillalexersql.sip +%Include qextscintillalexertex.sip +%Include qextscintillamacro.sip +%Include qextscintillaprinter.sip + + +// The build file template. + +%Makefile qtext.pro.in +# The project file for the qtext module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ @PYQT_QSCINTILLA_INC@ +DEFINES = @BLX_DEFINES@ QEXTSCINTILLA_DLL +LIBS += @PYQT_QT_MODULE@ @PYQT_QSCINTILLA_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtgl/copying.sip b/python/pyqt/sip/qtgl/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtgl/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtgl/qgl.sip b/python/pyqt/sip/qtgl/qgl.sip new file mode 100644 index 00000000..e08b6a95 --- /dev/null +++ b/python/pyqt/sip/qtgl/qgl.sip @@ -0,0 +1,298 @@ +// This is the SIP interface definition for QGL, QGLContext, QGLFormat and +// QGLWidget. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGL</Title> +<Para> +<Literal>QGL</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLContext</Title> +<Para> +<Literal>QGLContext</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLFormat</Title> +<Para> +<Literal>QGLFormat</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QGLWidget</Title> +<Para> +<Literal>QGLWidget</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_00 -) + +const int QGL_VERSION; +const char *QGL_VERSION_STR; + +const char *qGLVersion(); + + +class QGL +{ +%TypeHeaderCode +#include <qgl.h> +%End + +public: + enum FormatOption { + DoubleBuffer, + DepthBuffer, + Rgba, + AlphaChannel, + AccumBuffer, + StencilBuffer, + StereoBuffers, + DirectRendering, + HasOverlay, + SingleBuffer, + NoDepthBuffer, + ColorIndex, + NoAlphaChannel, + NoAccumBuffer, + NoStencilBuffer, + NoStereoBuffers, + IndirectRendering, + NoOverlay + }; +}; + + +class QGLFormat : QGL +{ +%TypeHeaderCode +#include <qgl.h> +%End + +public: + QGLFormat(); + QGLFormat(int,int = 0); + + bool doubleBuffer() const; + void setDoubleBuffer(bool); + bool depth() const; + void setDepth(bool); + bool rgba() const; + void setRgba(bool); + bool alpha() const; + void setAlpha(bool); + bool accum() const; + void setAccum(bool); + bool stencil() const; + void setStencil(bool); + bool stereo() const; + void setStereo(bool); + bool directRendering() const; + void setDirectRendering(bool); + bool hasOverlay() const; + void setOverlay(bool); + + int plane() const; + void setPlane(int); + + void setOption(FormatOption); + bool testOption(FormatOption) const; + + static QGLFormat defaultFormat(); + static void setDefaultFormat(const QGLFormat &); + + static QGLFormat defaultOverlayFormat(); + static void setDefaultOverlayFormat(const QGLFormat &); + + static bool hasOpenGL(); + static bool hasOpenGLOverlays(); +}; + + +class QGLContext : QGL +{ +%TypeHeaderCode +#include <qgl.h> +%End + +public: + QGLContext(const QGLFormat &,QPaintDevice *); +%If (Qt_3_2_0 -) + QGLContext(const QGLFormat &); +%End + + virtual bool create(const QGLContext * = 0); + bool isValid() const; + bool isSharing() const; + virtual void reset(); + + QGLFormat format() const; +%If (Qt_3_0_0 -) + QGLFormat requestedFormat() const; +%End + virtual void setFormat(const QGLFormat &); + + virtual void makeCurrent(); + virtual void swapBuffers() const; + + QPaintDevice *device() const; + + QColor overlayTransparentColor() const; + + static const QGLContext *currentContext(); + +protected: + virtual bool chooseContext(const QGLContext * = 0); + virtual void doneCurrent(); + +%If (WS_X11) + virtual void *tryVisual(const QGLFormat &,int = 1); + virtual void *chooseVisual(); +%End + + bool deviceIsPixmap() const; + bool windowCreated() const; + void setWindowCreated(bool); + bool initialized() const; + void setInitialized(bool); +%If (Qt_3_1_0 -) + void generateFontDisplayLists(const QFont &,int); +%End + + uint colorIndex(const QColor &) const; +%If (Qt_3_2_0 -) + void setValid(bool); + void setDevice(QPaintDevice *); +%End + +private: + QGLContext(); + QGLContext(const QGLContext &); +}; + + +class QGLWidget : QWidget, QGL +{ +%TypeHeaderCode +#include <qgl.h> +%End + +public: + QGLWidget(QWidget * /TransferThis/ = 0,const char * = 0, + const QGLWidget * = 0,WFlags = 0); +%If (Qt_3_2_0 -) + QGLWidget(QGLContext * /Transfer/,QWidget * /TransferThis/ = 0,const char * = 0, + const QGLWidget * = 0,WFlags = 0); +%End + QGLWidget(const QGLFormat &,QWidget * /TransferThis/ = 0, + const char * = 0,const QGLWidget * = 0,WFlags = 0); + +%ConvertToSubClassCode + sipClass = (sipCpp->inherits(sipName_QGLWidget) ? sipClass_QGLWidget : NULL); +%End + + void qglColor(const QColor &) const; + void qglClearColor(const QColor &) const; + + bool isValid() const; + bool isSharing() const; + virtual void makeCurrent(); +%If (Qt_3_2_0 -) + void doneCurrent(); +%End + + bool doubleBuffer() const; + virtual void swapBuffers(); + + QGLFormat format() const; + + const QGLContext *context() const; + + virtual QPixmap renderPixmap(int = 0,int = 0,bool = 0); +%If (Qt_3_0_0 -) + virtual QImage grabFrameBuffer(bool = 0); +%End + + virtual void makeOverlayCurrent(); + const QGLContext *overlayContext() const; + + static QImage convertToGLFormat(const QImage &); + + void setMouseTracking(bool); + +%If (Qt_3_0_0 -) + virtual void reparent(QWidget * /GetWrapper/,WFlags,const QPoint &, + bool = 0); +%MethodCode + if (sipCpp -> parent() != a0) + if (a0) + sipTransferTo(sipSelf,a0Wrapper); + else + sipTransferBack(sipSelf); + + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QGLWidget::reparent(a0, a1, *a2, a3) : sipCpp->reparent(a0, a1, *a2, a3); + Py_END_ALLOW_THREADS +%End + + const QGLColormap &colormap() const; + void setColormap(const QGLColormap &); +%End + +%If (Qt_3_1_0 -) + void renderText(int,int,const QString &,const QFont & = QFont(), + int = 2000); + void renderText(double,double,double,const QString &, + const QFont & = QFont(),int = 2000); +%End + +public slots: + virtual void updateGL(); + virtual void updateOverlayGL(); + +protected: + virtual void initializeGL(); + virtual void resizeGL(int,int); + virtual void paintGL(); + + virtual void initializeOverlayGL(); + virtual void resizeOverlayGL(int,int); + virtual void paintOverlayGL(); + + void setAutoBufferSwap(bool); + bool autoBufferSwap() const; + + void paintEvent(QPaintEvent *); + void resizeEvent(QResizeEvent *); + + virtual void glInit(); + virtual void glDraw(); + +private: + QGLWidget(const QGLWidget &); +}; + +%End diff --git a/python/pyqt/sip/qtgl/qglcolormap.sip b/python/pyqt/sip/qtgl/qglcolormap.sip new file mode 100644 index 00000000..512897e8 --- /dev/null +++ b/python/pyqt/sip/qtgl/qglcolormap.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QGLColormap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QGLColormap (Qt v3.0+)</Title> +<FuncSynopsis> + <FuncDef>void <Function>setEntries</Function></FuncDef> + <ParamDef>int <Parameter>count</Parameter></ParamDef> + <ParamDef>const QRgb *<Parameter>colors</Parameter></ParamDef> + <ParamDef>int <Parameter>base</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QGLColormap +{ +%TypeHeaderCode +#include <qglcolormap.h> +%End + +public: + QGLColormap(); + QGLColormap(const QGLColormap &); + + bool isEmpty() const; + int size() const; + void detach(); + +// void setEntries(int,const QRgb *,int = 0); + void setEntry(int,QRgb); + void setEntry(int,const QColor &); + QRgb entryRgb(int) const; + QColor entryColor(int) const; + int find(QRgb) const; + int findNearest(QRgb) const; +}; + +%End diff --git a/python/pyqt/sip/qtgl/qtglmod.sip b/python/pyqt/sip/qtgl/qtglmod.sip new file mode 100644 index 00000000..2d6a0181 --- /dev/null +++ b/python/pyqt/sip/qtgl/qtglmod.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for the qtgl module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtgl 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qgl.sip +%Include qglcolormap.sip + + +// The build file template. + +%Makefile qtgl.pro.in +# The project file for the qtgl module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ opengl @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtnetwork/copying.sip b/python/pyqt/sip/qtnetwork/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtnetwork/qdns.sip b/python/pyqt/sip/qtnetwork/qdns.sip new file mode 100644 index 00000000..b91bb9fc --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qdns.sip @@ -0,0 +1,274 @@ +// This is the SIP interface definition for QDns. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDns (Qt v2.2+)</Title> +<Para> +<Literal>QDns</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_DNS) +%If (Qt_2_2_0 -) + +class QDns : QObject +{ +%TypeHeaderCode +#include <qdns.h> +%End + +public: + enum RecordType { + None, + A, + Aaaa, + Mx, + Srv, + Cname, + Ptr, + Txt + }; + + QDns(); + QDns(const QString &,RecordType = A); + QDns(const QHostAddress &,RecordType = A); + + virtual void setLabel(const QString &); + virtual void setLabel(const QHostAddress &); + QString label() const; + + virtual void setRecordType(RecordType = A); + RecordType recordType() const; + + bool isWorking() const; + + QValueList<QHostAddress> addresses() const; + + class MailServer + { + public: + MailServer(const QString & = QString::null,Q_UINT16 = 0); + + QString name; + Q_UINT16 priority; + }; + + QValueList<QDns::MailServer> mailServers() const; + + class Server + { + public: + Server(const QString & = QString::null,Q_UINT16 = 0, + Q_UINT16 = 0,Q_UINT16 = 0); + + QString name; + Q_UINT16 priority; + Q_UINT16 weight; + Q_UINT16 port; + }; + + QValueList<QDns::Server> servers() const; + + QStringList hostNames() const; + + QStringList texts() const; + + QString canonicalName() const; + + QStringList qualifiedNames() const; + +signals: + void resultsReady(); +}; + + +%MappedType QValueList<QHostAddress> +{ +%TypeHeaderCode +#include <qvaluelist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of QHostAddress instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<QHostAddress> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new QHostAddress(*it),sipClass_QHostAddress,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to QValueList<QHostAddress> not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +%MappedType QValueList<QDns::MailServer> +{ +%TypeHeaderCode +#include <qvaluelist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of QDns::MailServer instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<QDns::MailServer> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new QDns::MailServer(*it),sipClass_QDns_MailServer,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to QValueList<QDns::MailServer> not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + + +%MappedType QValueList<QDns::Server> +{ +%TypeHeaderCode +#include <qvaluelist.h> +%End + +%ConvertFromTypeCode + // Convert to a Python list of QDns::Server instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<QDns::Server> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new QDns::Server(*it),sipClass_QDns_Server,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + +%ConvertToTypeCode + // At the moment this will never be called, so provide a null + // implementation. + + if (sipIsErr == NULL) + return PyList_Check(sipPy); + + PyErr_Format(PyExc_TypeError,"Converting to QValueList<QDns::Server> not yet implemented"); + + *sipIsErr = 1; + + return 0; +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qtnetwork/qftp.sip b/python/pyqt/sip/qtnetwork/qftp.sip new file mode 100644 index 00000000..f79ecc12 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qftp.sip @@ -0,0 +1,183 @@ +// This is the SIP interface definition for QFtp. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QFtp (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL_FTP) +%If (Qt_2_2_0 -) + +class QFtp : QNetworkProtocol +{ +%TypeHeaderCode +#include <qftp.h> +%End + +public: + QFtp(); +%If (Qt_3_1_0 -) + QFtp(QObject * /TransferThis/,const char * = 0); +%End + virtual ~QFtp(); + +%If (Qt_3_0_0 -) + int supportedOperations() const; +%End +%If (- Qt_3_0_0) + virtual int supportedOperations() const; +%End + +%If (Qt_3_1_0 -) + enum State { + Unconnected, + HostLookup, + Connecting, + Connected, + LoggedIn, + Closing + }; + + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + NotConnected + }; + + enum Command { + None, + ConnectToHost, + Login, + Close, + List, + Cd, + Get, + Put, + Remove, + Mkdir, + Rmdir, + Rename, + RawCommand + }; + + int connectToHost(const QString &,Q_UINT16 = 21) /ReleaseGIL/; + int login(const QString & = QString::null, + const QString & = QString::null) /ReleaseGIL/; + int close() /ReleaseGIL/; + int list(const QString & = QString::null) /ReleaseGIL/; + int cd(const QString &) /ReleaseGIL/; + int get(const QString &,QIODevice * = 0) /ReleaseGIL/; + int put(const QByteArray &,const QString &) /ReleaseGIL/; + int put(QIODevice *,const QString &) /ReleaseGIL/; + int remove(const QString &) /ReleaseGIL/; + int mkdir(const QString &) /ReleaseGIL/; + int rmdir(const QString &) /ReleaseGIL/; + int rename(const QString &,const QString &) /ReleaseGIL/; + + int rawCommand(const QString &) /ReleaseGIL/; + + unsigned long bytesAvailable() const; + + SIP_PYOBJECT readBlock(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> QFtp::readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + QByteArray readAll() /ReleaseGIL/; + + int currentId() const; + QIODevice* currentDevice() const; + Command currentCommand() const; + bool hasPendingCommands() const; + void clearPendingCommands(); + + State state() const; + + Error error() const; + QString errorString() const; +%End + +public slots: +%If (Qt_3_1_0 -) + void abort(); +%End + +signals: +%If (Qt_3_1_0 -) + void stateChanged(int); + void listInfo(const QUrlInfo &); + void readyRead(); + void dataTransferProgress(int,int); + void rawCommandReply(int,const QString &); + + void commandStarted(int); + void commandFinished(int,bool); + void done(bool); +%End + +protected: + void parseDir(const QString &,QUrlInfo &); + virtual void operationListChildren(QNetworkOperation *); + virtual void operationMkDir(QNetworkOperation *); + virtual void operationRemove(QNetworkOperation *); + virtual void operationRename(QNetworkOperation *); + virtual void operationGet(QNetworkOperation *); + virtual void operationPut(QNetworkOperation *); +}; + +%End +%End diff --git a/python/pyqt/sip/qtnetwork/qhostaddress.sip b/python/pyqt/sip/qtnetwork/qhostaddress.sip new file mode 100644 index 00000000..e2379e2c --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qhostaddress.sip @@ -0,0 +1,99 @@ +// This is the SIP interface definition for QHostAddress. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHostAddress (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef><Function>QHostAddress</Function></FuncDef> + <ParamDef>Q_UINT8 *<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef><Function>QHostAddress</Function></FuncDef> + <ParamDef>const Q_IPV6ADDR &<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>void <Function>setAddress</Function></FuncDef> + <ParamDef>Q_UINT8 *<Parameter>ip6Addr</Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> + +<FuncSynopsis> + <FuncDef>Q_IPV6ADDR <Function>toIPv6Address</Function> const</FuncDef> + <ParamDef><Parameter></Parameter></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +class QHostAddress +{ +%TypeHeaderCode +#include <qhostaddress.h> +%End + +public: + QHostAddress(); + QHostAddress(Q_UINT32); +// QHostAddress(Q_UINT8 *); +%If (Qt_3_3_0 -) + //QHostAddress(const Q_IPV6ADDR &); + // This isn't mentioned in the documentation. + //QHostAddress(const QString &); +%End + QHostAddress(const QHostAddress &); + + void setAddress(Q_UINT32); +// void setAddress(Q_UINT8 *); + bool setAddress(const QString &); + bool isIp4Addr() const; + Q_UINT32 ip4Addr() const; + +%If (Qt_3_3_0 -) + bool isIPv4Address() const; + Q_UINT32 toIPv4Address() const; + bool isIPv6Address() const; + //Q_IPV6ADDR toIPv6Address() const; +%End + + QString toString() const; + +%If (Qt_3_2_0 -) + bool isNull() const; +%End +}; + +%End diff --git a/python/pyqt/sip/qtnetwork/qhttp.sip b/python/pyqt/sip/qtnetwork/qhttp.sip new file mode 100644 index 00000000..fbcc9999 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qhttp.sip @@ -0,0 +1,279 @@ +// This is the SIP interface definition for QHttp, QHttpHeader, +// QHttpRequestHeader and QHttpResponseHeader. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QHttp (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> +</Sect2> + +<Sect2><Title>QHttpHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpHeader</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHttpRequestHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpRequestHeader</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QHttpResponseHeader (Qt v3.1+)</Title> +<Para> +<Literal>QHttpResponseHeader</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL_HTTP) +%If (Qt_3_1_0 -) + +class QHttpHeader +{ +%TypeHeaderCode +#include <qhttp.h> +%End + +public: + QHttpHeader(); + QHttpHeader(const QHttpHeader &); + QHttpHeader(const QString &); + virtual ~QHttpHeader(); + + QString value(const QString &) const; + void setValue(const QString &,const QString &); + void removeValue(const QString &); + + QStringList keys() const; + bool hasKey(const QString &) const; + + bool hasContentLength() const; + uint contentLength() const; + void setContentLength(int); + + bool hasContentType() const; + QString contentType() const; + void setContentType(const QString &); + + virtual QString toString() const; + bool isValid() const; + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; + +protected: + virtual bool parseLine(const QString &,int); + bool parse(const QString &); + void setValid(bool); +}; + + +class QHttpResponseHeader : QHttpHeader +{ +%TypeHeaderCode +#include <qhttp.h> +%End + +public: + QHttpResponseHeader(); + QHttpResponseHeader(const QHttpResponseHeader &); + + int statusCode() const; + QString reasonPhrase() const; + + int majorVersion() const; + int minorVersion() const; + + QString toString() const; + +protected: + bool parseLine(const QString &,int); +}; + + +class QHttpRequestHeader : QHttpHeader +{ +%TypeHeaderCode +#include <qhttp.h> +%End + +public: + QHttpRequestHeader(); + QHttpRequestHeader(const QString &,const QString &,int = 1,int = 1); + QHttpRequestHeader(const QHttpRequestHeader &); + QHttpRequestHeader(const QString &); + + void setRequest(const QString &,const QString &,int = 1,int = 1); + + QString method() const; + QString path() const; + + int majorVersion() const; + int minorVersion() const; + + QString toString() const; + +protected: + bool parseLine(const QString &,int); +}; + +%End + + +%If (Qt_3_0_0 -) + +class QHttp : QNetworkProtocol +{ +%TypeHeaderCode +#include <qhttp.h> +%End + +public: + QHttp(); +%If (Qt_3_1_0 -) + QHttp(QObject * /TransferThis/,const char * = 0); + QHttp(const QString &,Q_UINT16 = 80,QObject * /TransferThis/ = 0, + const char * = 0); + virtual ~QHttp(); +%End + + int supportedOperations() const; + +%If (Qt_3_1_0 -) + enum State { + Unconnected, + HostLookup, + Connecting, + Sending, + Reading, + Connected, + Closing + }; + + enum Error { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + UnexpectedClose, + InvalidResponseHeader, + WrongContentLength, + Aborted + }; + + int setHost(const QString &,Q_UINT16 = 80); + + int get(const QString &,QIODevice * = 0) /ReleaseGIL/; + int post(const QString &,QIODevice *,QIODevice * = 0) /ReleaseGIL/; + int post(const QString &,const QByteArray &, + QIODevice * = 0) /ReleaseGIL/; + int head(const QString &) /ReleaseGIL/; + int request(const QHttpRequestHeader &,QIODevice * = 0, + QIODevice * = 0) /ReleaseGIL/; + int request(const QHttpRequestHeader &,const QByteArray &, + QIODevice * = 0) /ReleaseGIL/; + + int closeConnection(); + + unsigned long bytesAvailable() const; + + SIP_PYOBJECT readBlock(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> QHttp::readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + QByteArray readAll() /ReleaseGIL/; + + int currentId() const; + QIODevice *currentSourceDevice() const; + QIODevice *currentDestinationDevice() const; + QHttpRequestHeader currentRequest() const; + bool hasPendingRequests() const; + void clearPendingRequests(); + + State state() const; + + Error error() const; + QString errorString() const; +%End + +public slots: +%If (Qt_3_1_0 -) + void abort(); +%End + +signals: +%If (Qt_3_1_0 -) + void stateChanged(int); + void responseHeaderReceived(const QHttpResponseHeader &); + void readyRead(const QHttpResponseHeader &); + void dataSendProgress(int,int); + void dataReadProgress(int,int); + + void requestStarted(int); + void requestFinished(int,bool); + void done(bool); +%End + +protected: + void operationGet(QNetworkOperation *); + void operationPut(QNetworkOperation *); + +%If (Qt_3_1_0 -) + void timerEvent(QTimerEvent *); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qtnetwork/qlocalfs.sip b/python/pyqt/sip/qtnetwork/qlocalfs.sip new file mode 100644 index 00000000..a8b816f1 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qlocalfs.sip @@ -0,0 +1,56 @@ +// This is the SIP interface definition for QLocalFs. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QLocalFs (Qt v2.1+)</Title> +<Para> +<Literal>QLocalFs</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_1_0 -) + +class QLocalFs : QNetworkProtocol +{ +%TypeHeaderCode +#include <qlocalfs.h> +%End + +public: + QLocalFs(); + + virtual int supportedOperations() const; + +protected: + virtual void operationListChildren(QNetworkOperation *); + virtual void operationMkDir(QNetworkOperation *); + virtual void operationRemove(QNetworkOperation *); + virtual void operationRename(QNetworkOperation *); + virtual void operationGet(QNetworkOperation *); + virtual void operationPut(QNetworkOperation *); +}; + +%End +%End diff --git a/python/pyqt/sip/qtnetwork/qnetwork.sip b/python/pyqt/sip/qtnetwork/qnetwork.sip new file mode 100644 index 00000000..6b87d4e4 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qnetwork.sip @@ -0,0 +1,34 @@ +// This is the SIP interface definition for qInitNetworkProtocols. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%If (Qt_NETWORKPROTOCOL) +%If (Qt_2_2_0 -) + +%ModuleHeaderCode +#include <qglobal.h> +#include <qnetwork.h> +%End + +void qInitNetworkProtocols(); + +%End +%End diff --git a/python/pyqt/sip/qtnetwork/qserversocket.sip b/python/pyqt/sip/qtnetwork/qserversocket.sip new file mode 100644 index 00000000..c130969e --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qserversocket.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for QServerSocket. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QServerSocket (Qt v2.2+)</Title> +<Para> +<Literal>QServerSocket</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +class QServerSocket : QObject +{ +%TypeHeaderCode +#include <qserversocket.h> +%End + +public: +%If (- Qt_3_0_0) + QServerSocket(Q_UINT16,int = 0,QObject * /TransferThis/ = 0, + const char * = 0); + QServerSocket(const QHostAddress &,Q_UINT16,int = 0, + QObject * /TransferThis/ = 0,const char * = 0); +%End +%If (Qt_3_0_0 -) + QServerSocket(Q_UINT16,int = 1,QObject * /TransferThis/ = 0, + const char * = 0); + QServerSocket(const QHostAddress &,Q_UINT16,int = 1, + QObject * /TransferThis/ = 0,const char * = 0); +%End + QServerSocket(QObject * /TransferThis/ = 0,const char * = 0); + + bool ok() const; + + Q_UINT16 port() const; + + int socket() const; + virtual void setSocket(int); + + QHostAddress address() const ; + + virtual void newConnection(int) = 0; + +protected: + QSocketDevice *socketDevice(); +}; + +%End diff --git a/python/pyqt/sip/qtnetwork/qsocket.sip b/python/pyqt/sip/qtnetwork/qsocket.sip new file mode 100644 index 00000000..1ce9165a --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qsocket.sip @@ -0,0 +1,348 @@ +// This is the SIP interface definition for QSocket. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSocket (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>Py_None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readLine</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>maxlen</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>maxlen</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>Py_None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +class QSocket : QObject, QIODevice +{ +%TypeHeaderCode +#include <qsocket.h> +%End + +public: + enum Error { + ErrConnectionRefused, + ErrHostNotFound, + ErrSocketRead + }; + + QSocket(QObject * /TransferThis/ = 0,const char * = 0); + + enum State { + Idle, + HostLookup, + Connecting, +%If (Qt_3_0_0 -) + Connected, +%End +%If (- Qt_3_0_0) + Listening, +%End + Closing, + Connection + }; + +%ConvertToSubClassCode + static struct class_graph { + char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QServerSocket, &sipClass_QServerSocket, -1, 1}, + {sipName_QSocket, &sipClass_QSocket, -1, 2}, + {sipName_QFtp, &sipClass_QFtp, -1, 3}, + {sipName_QLocalFs, &sipClass_QLocalFs, -1, 4}, +#if QT_VERSION >= 0x030000 + {sipName_QHttp, &sipClass_QHttp, -1, 5}, +#else + {NULL, NULL, -1, 5}, +#endif + {sipName_QDns, &sipClass_QDns, -1, -1}, + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + State state() const; + + int socket() const; + virtual void setSocket(int); + +%If (Qt_3_0_0 -) + QSocketDevice *socketDevice(); + virtual void setSocketDevice(QSocketDevice *); +%End + +%If (Qt_DNS) + virtual void connectToHost(const QString &,Q_UINT16) /ReleaseGIL/; +%End + QString peerName() const; + + bool open(int) /ReleaseGIL/; + void close() /ReleaseGIL/; + void flush() /ReleaseGIL/; +%If (Qt_3_0_0 -) + Offset size() const; + Offset at() const; + bool at(Offset); +%End +%If (- Qt_3_0_0) + uint size() const; + int at() const; + bool at(int); +%End + bool atEnd() const; + +%If (Qt_3_0_0 -) + Q_ULONG bytesAvailable() const; + Q_ULONG waitForMore(int) const /ReleaseGIL/; + //Q_ULONG waitForMore(int,bool *) const /ReleaseGIL/; + Q_ULONG bytesToWrite() const; +%End +%If (- Qt_3_0_0) + int bytesAvailable() const; + int waitForMore(int) const /ReleaseGIL/; + int bytesToWrite() const; +%End +%If (Qt_3_1_0 -) + void clearPendingData(); +%End + +%If (- Qt_3_0_0) + SIP_PYOBJECT readBlock(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QSocket::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End + + int writeBlock(const char * /Array/,uint /ArraySize/) /ReleaseGIL/; + + SIP_PYOBJECT readLine(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> readLine(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%End +%If (Qt_3_0_0 -) + SIP_PYOBJECT readBlock(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QSocket::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End + + Q_LONG writeBlock(const char * /Array/, + Q_ULONG /ArraySize/) /ReleaseGIL/; + + SIP_PYOBJECT readLine(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipCpp -> readLine(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + sipFree((ANY *)buf); + + Py_INCREF(Py_None); + sipRes = Py_None; + } + else + { + sipRes = PyString_FromStringAndSize(buf,actlen); + + sipFree((ANY *)buf); + + if (sipRes == NULL) + sipIsErr = 1; + } + } +%End +%End + + int getch() /ReleaseGIL/; + int putch(int) /ReleaseGIL/; + int ungetch(int); + + bool canReadLine() const; + virtual QString readLine() /ReleaseGIL/; + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + QHostAddress address() const; + QHostAddress peerAddress() const; + +%If (Qt_3_2_0 -) + void setReadBufferSize(Q_ULONG); + Q_ULONG readBufferSize() const; +%End + +signals: + void hostFound(); + void connected(); + void connectionClosed(); + void delayedCloseFinished(); + void readyRead(); + void bytesWritten(int); + void error(int); + +protected: +%If (- Qt_3_0_0) + QSocketDevice *socketDevice(); +%End + +private: + QSocket(const QSocket &); +}; + +%End diff --git a/python/pyqt/sip/qtnetwork/qsocketdevice.sip b/python/pyqt/sip/qtnetwork/qsocketdevice.sip new file mode 100644 index 00000000..181f6fc4 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qsocketdevice.sip @@ -0,0 +1,224 @@ +// This is the SIP interface definition for QSocketDevice. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSocketDevice (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>Q_LONG <Function>readBlock</Function></FuncDef> + <ParamDef>char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This takes a single <Literal>len</Literal> parameter. The +<Literal>data</Literal> is returned if there was no error, otherwise +<Literal>None</Literal> is returned. +</Para> + +<FuncSynopsis> + <FuncDef>Q_LONG <Function>writeBlock</Function></FuncDef> + <ParamDef>const char *<Parameter>data</Parameter></ParamDef> + <ParamDef>Q_ULONG <Parameter>len</Parameter></ParamDef> +</FuncSynopsis> +<Para> +<Literal>len</Literal> is derived from <Literal>data</Literal> and not passed +as a parameter. +</Para> +</Sect2> +%End + + +%If (Qt_2_2_0 -) + +class QSocketDevice : QIODevice +{ +%TypeHeaderCode +#include <qsocketdevice.h> +%End + +public: + enum Type { + Stream, + Datagram + }; + +%If (Qt_3_3_0 -) + enum Protocol { + IPv4, + IPv6, + Unknown + }; +%End + + QSocketDevice(Type = Stream); +%If (Qt_3_3_0 -) + QSocketDevice(Type,Protocol,int); +%End + QSocketDevice(int,Type); + + bool isValid() const; + Type type() const; +%If (Qt_3_3_0 -) + Protocol protocol() const; +%End + + int socket() const; + virtual void setSocket(int,Type); + + bool open(int) /ReleaseGIL/; + void close(); + void flush() /ReleaseGIL/; + +%If (- Qt_3_0_0) + uint size() const; + int at() const; + bool at(int); +%End +%If (Qt_3_0_0 -) + Offset size() const; + Offset at() const; + bool at(Offset); +%End + bool atEnd() const; + + bool blocking() const; + virtual void setBlocking(bool); + + bool addressReusable() const; + virtual void setAddressReusable(bool); + + int receiveBufferSize() const; + virtual void setReceiveBufferSize(uint); + int sendBufferSize() const; + virtual void setSendBufferSize(uint); + + virtual bool connect(const QHostAddress &,Q_UINT16); + + virtual bool bind(const QHostAddress &,Q_UINT16); + virtual bool listen(int); + virtual int accept(); + +%If (- Qt_3_0_0) + int bytesAvailable() const; + int waitForMore(int) const /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + Q_LONG bytesAvailable() const; + Q_LONG waitForMore(int) const /ReleaseGIL/; +%End + +%If (- Qt_3_0_0) + SIP_PYOBJECT readBlock(uint) /ReleaseGIL/ [int (char *,uint)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + int actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QSocketDevice::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + int writeBlock(const char * /Array/,uint /ArraySize/) /ReleaseGIL/; + virtual int writeBlock(const char * /Array/,uint /ArraySize/, + const QHostAddress &,Q_UINT16) /ReleaseGIL/; +%End +%If (Qt_3_0_0 -) + SIP_PYOBJECT readBlock(Q_ULONG) /ReleaseGIL/ [Q_LONG (char *,Q_ULONG)]; +%MethodCode + char *buf; + + if ((buf = (char *)sipMalloc(a0)) == NULL) + sipIsErr = 1; + else + { + Q_LONG actlen; + + Py_BEGIN_ALLOW_THREADS + actlen = sipSelfWasArg ? sipCpp -> QSocketDevice::readBlock(buf,a0) : sipCpp -> readBlock(buf,a0); + Py_END_ALLOW_THREADS + + if (actlen < 0) + { + Py_INCREF(Py_None); + sipRes = Py_None; + } + else if ((sipRes = PyString_FromStringAndSize(buf,actlen)) == NULL) + sipIsErr = 1; + + sipFree((ANY *)buf); + } +%End + + + Q_LONG writeBlock(const char * /Array/, + Q_ULONG /ArraySize/) /ReleaseGIL/; + virtual Q_LONG writeBlock(const char * /Array/,Q_ULONG /ArraySize/, + const QHostAddress &,Q_UINT16) /ReleaseGIL/; +%End + + int getch(); + int putch(int); + int ungetch(int); + + Q_UINT16 port() const; + Q_UINT16 peerPort() const; + QHostAddress address() const; + QHostAddress peerAddress() const; + + enum Error { + NoError, + AlreadyBound, + Inaccessible, + NoResources, + Bug, + Impossible, + NoFiles, + ConnectionRefused, + NetworkFailure, + UnknownError + }; + + Error error() const; + +protected: + void setError(Error); + +private: + QSocketDevice(const QSocketDevice &); +}; + +%End diff --git a/python/pyqt/sip/qtnetwork/qtnetworkmod.sip b/python/pyqt/sip/qtnetwork/qtnetworkmod.sip new file mode 100644 index 00000000..ca580d73 --- /dev/null +++ b/python/pyqt/sip/qtnetwork/qtnetworkmod.sip @@ -0,0 +1,78 @@ +// This is the SIP interface definition for the qtnetwork module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtnetwork 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qdns.sip +%Include qhostaddress.sip +%Include qftp.sip +%Include qhttp.sip +%Include qlocalfs.sip +%Include qnetwork.sip +%Include qserversocket.sip +%Include qsocket.sip +%Include qsocketdevice.sip + + +// The build file template. + +%Makefile qtnetwork.pro.in +# The project file for the qtnetwork module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtpe/copying.sip b/python/pyqt/sip/qtpe/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtpe/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtpe/qpeapplication.sip b/python/pyqt/sip/qtpe/qpeapplication.sip new file mode 100644 index 00000000..f71240e8 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeapplication.sip @@ -0,0 +1,223 @@ +// This is the SIP interface definition for QPEApplication. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class QPEApplication : QApplication +{ +%TypeHeaderCode +#include <qpe/qpeapplication.h> +#include <qwidgetlist.h> +%End + +public: + QPEApplication(SIP_PYLIST,Type=GuiClient) [(int &,char **,Type=GuiClient)]; +%MethodCode + // The Python interface is a list of argument strings that is + // modified. + + int argc; + char **argv; + + // Convert the list. + if ((argv = pyArgvToC(a0,&argc)) == NULL) + sipIsErr = 1; + else + { + // Create it now the arguments are right. + int nargc = argc; + + Py_BEGIN_ALLOW_THREADS + sipCpp = new sipQPEApplication(nargc,argv,(QApplication::Type)a1); + Py_END_ALLOW_THREADS + + // Now modify the original list. + updatePyArgv(a0,argc,argv); + } +%End + + ~QPEApplication(); +%MethodCode + // See the comments in ~QApplication() to understand what's + // being done here. + + QWidgetList *tlw = QApplication::topLevelWidgets(); + QWidgetListIt it(*tlw); + QWidget *w; + + while ((w = it.current()) != 0) + { + PyObject *sw; + + if ((sw = sipGetWrapper(w,sipClass_QWidget)) != NULL) + sipTransferTo(sw,NULL); + + ++it; + } + + delete tlw; +%End + +%ConvertToSubClassCode + // The table of Python class objects indexed by their names. The table + // must be sorted by name. + + static sipStringTypeClassMap map[] = { + {sipName_FileSelector, &sipClass_FileSelector}, + {sipName_MenuButton, &sipClass_MenuButton}, + {sipName_QPEApplication, &sipClass_QPEApplication}, + {sipName_QPEMenuBar, &sipClass_QPEMenuBar}, + {sipName_QPEToolBar, &sipClass_QPEToolBar}, + }; + + sipClass = sipMapStringToClass(sipCpp -> className(),map, + sizeof (map)/sizeof (map[0])); +%End + + static QString qpeDir(); + static QString documentDir(); + void applyStyle(); + static int defaultRotation(); + static void setDefaultRotation(int); + static void grabKeyboard(); + static void ungrabKeyboard(); + + enum StylusMode { + LeftOnly, + RightOnHold + }; + + static void setStylusOperation(QWidget *,StylusMode); + static StylusMode stylusOperation(QWidget *); + + enum InputMethodHint { + Normal, + AlwaysOff, + AlwaysOn + }; + + enum screenSaverHint { + Disable, + DisableLightOff, + DisableSuspend, + Enable + }; + + static void setInputMethodHint(QWidget *,InputMethodHint); + static InputMethodHint inputMethodHint(QWidget *); + + void showMainWidget(QWidget *,bool = 0); + void showMainDocumentWidget(QWidget *,bool = 0); + + static void setKeepRunning(); + bool keepRunning() const; + + int exec() /PyName=exec_loop, ReleaseGIL, + PreHook=__pyQtPreEventLoopHook__, + PostHook=__pyQtPostEventLoopHook__/; + +signals: + void clientMoused(); + void timeChanged(); + void clockChanged(bool); + void volumeChanged(bool); + void appMessage(const QCString &,const QByteArray &); + void weekChanged(bool); + void dateFormatChanged(DateFormat); + void flush(); + void reload(); + +protected: +// bool qwsEventFilter(QWSEvent *); +// void internalSetStyle(const QString &); + void prepareForTermination(bool); + virtual void restart(); + virtual void shutdown(); + bool eventFilter(QObject *,QEvent *); + void timerEvent(QTimerEvent *); + bool keyboardGrabbed() const; + bool raiseAppropriateWindow(); + virtual void tryQuit(); + + +%TypeCode +#include <string.h> + + +// Convert a Python argv list to a conventional C argc count and argv array. +static char **pyArgvToC(PyObject *argvlist,int *argcp) +{ + int argc; + char **argv; + + argc = PyList_Size(argvlist); + + // Allocate space for two copies of the argument pointers, plus the + // terminating NULL. + if ((argv = (char **)sipMalloc(2 * (argc + 1) * sizeof (char *))) == NULL) + return NULL; + + // Convert the list. + for (int a = 0; a < argc; ++a) + { + char *arg; + + // Get the argument and allocate memory for it. + if ((arg = PyString_AsString(PyList_GetItem(argvlist,a))) == NULL || + (argv[a] = (char *)sipMalloc(strlen(arg) + 1)) == NULL) + return NULL; + + // Copy the argument and save a pointer to it. + strcpy(argv[a],arg); + argv[a + argc + 1] = argv[a]; + } + + argv[argc + argc + 1] = argv[argc] = NULL; + + *argcp = argc; + + return argv; +} + + +// Remove arguments from the Python argv list that have been removed from the +// C argv array. +static void updatePyArgv(PyObject *argvlist,int argc,char **argv) +{ + for (int a = 0, na = 0; a < argc; ++a) + { + // See if it was removed. + if (argv[na] == argv[a + argc + 1]) + ++na; + else + PyList_SetSlice(argvlist,na,na + 1,NULL); + } +} +%End + +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpeapplnk.sip b/python/pyqt/sip/qtpe/qpeapplnk.sip new file mode 100644 index 00000000..f817ae50 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeapplnk.sip @@ -0,0 +1,157 @@ +// This is the SIP interface definition for AppLnk, AppLnkSet, DocLnk and +// DocLnkSet. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class AppLnk +{ +%TypeHeaderCode +#include <qpe/applnk.h> +%End + +public: + AppLnk(); + AppLnk(const QString &); + AppLnk(const AppLnk &); + + bool isValid() const; + + static void setSmallIconSize(int); + static void setBigIconSize(int); + static int smallIconSize(); + static int bigIconSize(); + + QString name() const; + const QPixmap& pixmap() const; + const QPixmap& bigPixmap() const; + virtual QString exec() const /PyName=exec_property/; + QString type() const; + QString rotation() const; + QString comment() const; + QString file() const; + QString linkFile() const; + QStringList mimeTypes() const; + QStringList mimeTypeIcons() const; + const QArray<int> &categories() const; + int id() const; + + bool fileKnown() const; + bool linkFileKnown() const; + + void execute() const /ReleaseGIL/; + void execute(const QStringList &) const /ReleaseGIL/; + void removeFiles(); + void removeLinkFile(); + + void setName(const QString &); + void setExec(const QString &); + void setFile(const QString &); + void setLinkFile(const QString &); + void setComment(const QString &); + void setType(const QString &); + void setIcon(const QString &); + void setCategories(const QArray<int> &); + bool writeLink() const; + + void setProperty(const QString &,const QString &); + QString property(const QString &) const; + +protected: + virtual void invoke(const QStringList &) const; + bool ensureLinkExists() const; +// Undocumented and missing on the Zaurus. +// void storeLink() const; +}; + + +class DocLnk : AppLnk +{ +%TypeHeaderCode +#include <qpe/applnk.h> +%End + +public: + DocLnk(); + DocLnk(const DocLnk &); + DocLnk(const QString &); + DocLnk(const QString &,bool); + + QString exec() const /PyName=exec_property/; + +protected: + void invoke(const QStringList &) const; +}; + + +class AppLnkSet +{ +%TypeHeaderCode +#include <qpe/applnk.h> +%End + +public: + AppLnkSet(); + AppLnkSet(const QString &); + + const AppLnk *find(int) const; + const AppLnk *findExec(const QString &) const; + + QStringList types() const; + QString typeName(const QString &) const; + QPixmap typePixmap(const QString &) const; + QPixmap typeBigPixmap(const QString &) const; + + void add(AppLnk *); + bool remove(AppLnk *); + + const QList<AppLnk> &children() const; + void detachChildren(); + +private: + AppLnkSet(const AppLnkSet &); +}; + + +class DocLnkSet : AppLnkSet +{ +%TypeHeaderCode +#include <qpe/applnk.h> +%End + +public: + DocLnkSet(); + DocLnkSet(const QString &,const QString & = QString::null); + + const QList<DocLnk> &children() const; + + void appendFrom(DocLnkSet &); + +private: + DocLnkSet(const DocLnkSet &); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpeconfig.sip b/python/pyqt/sip/qtpe/qpeconfig.sip new file mode 100644 index 00000000..a8f78d77 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeconfig.sip @@ -0,0 +1,78 @@ +// This is the SIP interface definition for Config. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Config +{ +%TypeHeaderCode +#include <qpe/config.h> +%End + +public: + typedef QMap<QString,QString> ConfigGroup; + + enum Domain { + File, + User + }; + + Config(const QString &,Domain = User); + + bool isValid() const; + bool hasKey(const QString &) const; + + void setGroup(const QString &); +// void writeEntry(const QString &,const char *); + void writeEntry(const QString &,const QString &); + void writeEntryCrypt(const QString &,const QString &); + void writeEntry(const QString &,int); +// void writeEntry(const QString &,bool); + void writeEntry(const QString &,const QStringList &,const QChar &); + void removeEntry(const QString &); + + QString readEntry(const QString &, + const QString & = QString::null) const; + QString readEntryCrypt(const QString &, + const QString & = QString::null) const; + QString readEntryDirect(const QString &, + const QString & = QString::null) const; + int readNumEntry(const QString &,int = -1) const; + bool readBoolEntry(const QString &,bool = 0) const; + QStringList readListEntry(const QString &,const QChar &) const; + + void clearGroup(); + + void write(const QString & = QString::null); + +protected: +// void read(); +// bool parse(const QString &); + +// static QString configFilename(const QString &,Domain); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpefilemanager.sip b/python/pyqt/sip/qtpe/qpefilemanager.sip new file mode 100644 index 00000000..d917980f --- /dev/null +++ b/python/pyqt/sip/qtpe/qpefilemanager.sip @@ -0,0 +1,53 @@ +// This is the SIP interface definition for FileManager. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class FileManager +{ +%TypeHeaderCode +#include <qpe/filemanager.h> +%End + +public: + FileManager(); + + bool saveFile(const DocLnk &,const QByteArray &); + bool saveFile(const DocLnk &,const QString &); + bool loadFile(const DocLnk &,QByteArray &); + bool loadFile(const DocLnk &,QString &); + bool copyFile(const AppLnk &,const AppLnk &); + + QIODevice *openFile(const DocLnk &) /ReleaseGIL/; + QIODevice *saveFile(const DocLnk &) /ReleaseGIL/; + + bool exists(const DocLnk &); + +protected: + bool ensurePathExists(const QString &); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpefileselector.sip b/python/pyqt/sip/qtpe/qpefileselector.sip new file mode 100644 index 00000000..cfea0630 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpefileselector.sip @@ -0,0 +1,69 @@ +// This is the SIP interface definition for FileSelector and FileSelectorItem. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class FileSelectorItem : QListViewItem +{ +%TypeHeaderCode +#include <qpe/fileselector.h> +%End + +public: + FileSelectorItem(QListView * /TransferThis/,const DocLnk &); + + DocLnk file() const; +}; + + +class FileSelector : QVBox +{ +%TypeHeaderCode +#include <qpe/fileselector.h> +%End + +public: + FileSelector(const QString &,QWidget * /TransferThis/,const char *, + bool = 1,bool = 1); + + void setNewVisible(bool); + void setCloseVisible(bool); + void reread(); + int fileCount(); +%If (- QtPE_1_6_0) + const DocLnk *selected(); +%End +%If (QtPE_1_6_0 -) + DocLnk selectedDocument(); +%End + +signals: + void fileSelected(const DocLnk &); + void newSelected(const DocLnk &); + void closeMe(); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpefontdatabase.sip b/python/pyqt/sip/qtpe/qpefontdatabase.sip new file mode 100644 index 00000000..2276b5b2 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpefontdatabase.sip @@ -0,0 +1,67 @@ +// This is the SIP interface definition for FontDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +%If (Qt_FONTDATABASE) + +class FontDatabase : QFontDatabase +{ +%TypeHeaderCode +#include <qpe/fontdatabase.h> +%End + +public: + FontDatabase(); + + QStringList families() const; + + static void loadRenderers(); +}; + +%End + + +%If (!Qt_FONTDATABASE) + +class FontDatabase +{ +%TypeHeaderCode +#include <qpe/fontdatabase.h> +%End + +public: + FontDatabase(); + + QStringList families() const; + static QValueList<int> standardSizes(); + + static void loadRenderers(); +}; + +%End + +%End diff --git a/python/pyqt/sip/qtpe/qpeglobal.sip b/python/pyqt/sip/qtpe/qpeglobal.sip new file mode 100644 index 00000000..f5b44828 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeglobal.sip @@ -0,0 +1,83 @@ +// This is the SIP interface definition for Global. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Global +{ +%TypeHeaderCode +#include <qpe/global.h> +%End + +public: + Global(); + + static const QDawg &fixedDawg(); + static const QDawg &addedDawg(); + static const QDawg &dawg(const QString &); + + static void addWords(const QStringList &); + static void addWords(const QString &,const QStringList &); + + static void createDocDir(); + + static void findDocuments(DocLnkSet *,const QString & = QString::null); + + static QString applicationFileName(const QString &,const QString &); + +// struct Command { +// const char *file; +// QWidget *(*func)(bool); +// bool maximized; +// bool documentary; +// }; + +// static void setBuiltinCommands(Command *); + +%If (- QtPE_1_6_0) + static void invoke(const QString &); +%End + static void execute(const QString &,const QString & = QString::null) /ReleaseGIL/; + static void setDocument(QWidget *,const QString &); + static bool terminateBuiltin(const QString &); + static void terminate(const AppLnk *); + + static bool isBuiltinCommand(const QString &); + + static void applyStyle(); + static void statusMessage(const QString &); + static QWidget *shutdown(bool = 0); + static QWidget *restart(bool = 0); + static void hideInputMethod(); + static void showInputMethod(); + + static void writeHWClock(); + + static QString shellQuote(const QString &); + static QString stringQuote(const QString &); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpemenubar.sip b/python/pyqt/sip/qtpe/qpemenubar.sip new file mode 100644 index 00000000..41648435 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpemenubar.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for QPEMenuBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class QPEMenuBar : QMenuBar +{ +%TypeHeaderCode +#include <qpe/qpemenubar.h> +%End + +public: + QPEMenuBar(QWidget * /TransferThis/ = 0,const char * = 0); + +protected: + virtual void keyPressEvent(QKeyEvent *); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpemenubutton.sip b/python/pyqt/sip/qtpe/qpemenubutton.sip new file mode 100644 index 00000000..ff3a729f --- /dev/null +++ b/python/pyqt/sip/qtpe/qpemenubutton.sip @@ -0,0 +1,61 @@ +// This is the SIP interface definition for MenuButton. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class MenuButton : QPushButton +{ +%TypeHeaderCode +#include <qpe/menubutton.h> +%End + +public: + MenuButton(QWidget * /TransferThis/,const char * = 0); + MenuButton(const QStringList &,QWidget * /TransferThis/, + const char * = 0); + + void clear(); + + int currentItem() const; + QString currentText() const; + + void insertItems(const QStringList &); + void insertItem(const QIconSet &,const QString & = QString::null); + void insertItem(const QString &); + void insertSeparator(); + + void setLabel(const QString &); + +signals: + void selected(int); + void selected(const QString &); + +public slots: + void select(int); + void select(const QString &); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpeqcopenvelope.sip b/python/pyqt/sip/qtpe/qpeqcopenvelope.sip new file mode 100644 index 00000000..9bbff30f --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeqcopenvelope.sip @@ -0,0 +1,39 @@ +// This is the SIP interface definition for QCopEnvelope. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class QCopEnvelope : QDataStream +{ +%TypeHeaderCode +#include <qpe/qcopenvelope_qws.h> +%End + +public: + QCopEnvelope(const QCString &,const QCString &); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpeqdawg.sip b/python/pyqt/sip/qtpe/qpeqdawg.sip new file mode 100644 index 00000000..f04d6425 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpeqdawg.sip @@ -0,0 +1,65 @@ +// This is the SIP interface definition for QDawg. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class QDawg +{ +%TypeHeaderCode +#include <qpe/qdawg.h> +%End + +public: + QDawg(); + + bool readFile(const QString &) /ReleaseGIL/; + bool read(QIODevice *) /ReleaseGIL/; + bool write(QIODevice *) const /ReleaseGIL/; + bool createFromWords(QIODevice *); + void createFromWords(const QStringList &); + QStringList allWords() const; + + bool contains(const QString &) const; + int countWords() const; + + class Node { + public: + QChar letter() const; + bool isWord() const; + bool isLast() const; + const QDawg::Node *next() const; + const QDawg::Node *jump() const; + + private: + Node(); + }; + + const QDawg::Node *root() const; + + void dump() const; +}; + +%End diff --git a/python/pyqt/sip/qtpe/qperesource.sip b/python/pyqt/sip/qtpe/qperesource.sip new file mode 100644 index 00000000..de094b0f --- /dev/null +++ b/python/pyqt/sip/qtpe/qperesource.sip @@ -0,0 +1,50 @@ +// This is the SIP interface definition for Resource. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class Resource +{ +%TypeHeaderCode +#include <qpe/resource.h> +%End + +public: + Resource(); + + static QImage loadImage(const QString &); + + static QPixmap loadPixmap(const QString &); + static QBitmap loadBitmap(const QString &); + static QString findPixmap(const QString &); + + static QIconSet loadIconSet(const QString &); + + static QString findSound(const QString &); + static QStringList allSounds(); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpetimestring.sip b/python/pyqt/sip/qtpe/qpetimestring.sip new file mode 100644 index 00000000..4df6a4f7 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpetimestring.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for DateFormat. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class DateFormat +{ +%TypeHeaderCode +#include <qpe/timestring.h> +%End + +public: + enum Order { + DayMonthYear, + MonthDayYear, + YearMonthDay + }; + + DateFormat(QChar = '/',Order = MonthDayYear); + DateFormat(QChar,Order,Order); + DateFormat(const DateFormat &); + + enum Verbosity { + shortNumber, + longNumber, + padNumber, + shortWord, + longWord, + showWeekDay + }; + + QString toNumberString() const; + QString toWordString() const; + + QString numberDate(const QDate &,int = 0) const; + QString wordDate(const QDate &,int = 0) const; + +%If (Qt_DATASTREAM) + void load(QDataStream &); + void save(QDataStream &) const; +%End + + QChar separator() const; + Order shortOrder() const; + Order longOrder() const; +}; + +%End diff --git a/python/pyqt/sip/qtpe/qpetoolbar.sip b/python/pyqt/sip/qtpe/qpetoolbar.sip new file mode 100644 index 00000000..1d503ea9 --- /dev/null +++ b/python/pyqt/sip/qtpe/qpetoolbar.sip @@ -0,0 +1,42 @@ +// This is the SIP interface definition for QPEToolBar. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +// The documentation is in the main documentation file because SIP isn't clever +// enough to handle the resulting %Timeline complexity. + + +%If (WS_QWS) + +class QPEToolBar : QToolBar +{ +%TypeHeaderCode +#include <qpe/qpetoolbar.h> +%End + +public: + QPEToolBar(QMainWindow * /TransferThis/ = 0,const char * = 0); + +protected: + virtual void childEvent(QChildEvent *); +}; + +%End diff --git a/python/pyqt/sip/qtpe/qtpemod.sip b/python/pyqt/sip/qtpe/qtpemod.sip new file mode 100644 index 00000000..3194a03d --- /dev/null +++ b/python/pyqt/sip/qtpe/qtpemod.sip @@ -0,0 +1,94 @@ +// This is the SIP interface definition for the qtpe module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtpe 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +// QPE has it's own version numbering. +%Timeline {QtPE_1_5_0 QtPE_1_6_0} + + +%ModuleHeaderCode +#include <qpe/version.h> +%End + +const char *QPE_VERSION; + + +%Include qpeapplication.sip +%Include qpeapplnk.sip +%Include qpeconfig.sip +%Include qpefilemanager.sip +%Include qpefileselector.sip +%Include qpefontdatabase.sip +%Include qpeglobal.sip +%Include qpemenubar.sip +%Include qpemenubutton.sip +%Include qpeqcopenvelope.sip +%Include qpeqdawg.sip +%Include qperesource.sip +%Include qpetimestring.sip +%Include qpetoolbar.sip + + +// The build file template. + +%Makefile qtpe.pro.in +# The project file for the qtpe module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ -lqpe +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtsql/copying.sip b/python/pyqt/sip/qtsql/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtsql/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtsql/qdatabrowser.sip b/python/pyqt/sip/qtsql/qdatabrowser.sip new file mode 100644 index 00000000..ff2e4d83 --- /dev/null +++ b/python/pyqt/sip/qtsql/qdatabrowser.sip @@ -0,0 +1,150 @@ +// This is the SIP interface definition for QDataBrowser. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDataBrowser (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual void <Function>del</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delOnCursor</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataBrowser : QWidget +{ +%TypeHeaderCode +#include <qdatabrowser.h> +%End + +public: + QDataBrowser(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + enum Boundary { + Unknown, + None, + BeforeBeginning, + Beginning, + End, + AfterEnd + }; + + Boundary boundary(); + void setBoundaryChecking(bool); + bool boundaryChecking() const; + + void setSort(const QSqlIndex &); + void setSort(const QStringList &); + QStringList sort() const; + void setFilter(const QString &); + QString filter() const; + + virtual void setSqlCursor(QSqlCursor * /GetWrapper/,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QDataBrowser::setSqlCursor(a0, a1) : sipCpp->setSqlCursor(a0, a1); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a1) + sipTransferTo(a0Wrapper,sipSelf); +%End + + QSqlCursor* sqlCursor() const; + virtual void setForm(QSqlForm *); + QSqlForm* form(); + + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + + virtual void setReadOnly(bool); + bool isReadOnly() const; + virtual void setAutoEdit(bool); + bool autoEdit() const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + +signals: + void firstRecordAvailable(bool); + void lastRecordAvailable(bool); + void nextRecordAvailable(bool); + void prevRecordAvailable(bool); + + void currentChanged(const QSqlRecord *); + void primeInsert(QSqlRecord *); + void primeUpdate(QSqlRecord *); + void primeDelete(QSqlRecord *); + void beforeInsert(QSqlRecord *); + void beforeUpdate(QSqlRecord *); + void beforeDelete(QSqlRecord *); + void cursorChanged(QSqlCursor::Mode); + +public slots: + virtual void refresh(); + + virtual void insert() /ReleaseGIL/; + virtual void update() /ReleaseGIL/; + virtual void del() /PyName=delOnCursor, ReleaseGIL/; + + virtual void first() /ReleaseGIL/; + virtual void last() /ReleaseGIL/; + virtual void next() /ReleaseGIL/; + virtual void prev() /ReleaseGIL/; + + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + + void updateBoundary(); + +protected: + virtual bool insertCurrent() /ReleaseGIL/; + virtual bool updateCurrent() /ReleaseGIL/; + virtual bool deleteCurrent() /ReleaseGIL/; + virtual bool currentEdited(); + + virtual QSql::Confirm confirmEdit(QSql::Op) /ReleaseGIL/; + virtual QSql::Confirm confirmCancel(QSql::Op) /ReleaseGIL/; + + virtual void handleError(const QSqlError &) /ReleaseGIL/; + +private: +%If (Qt_3_1_0 -) + QDataBrowser(const QDataBrowser &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qdatatable.sip b/python/pyqt/sip/qtsql/qdatatable.sip new file mode 100644 index 00000000..bcb02908 --- /dev/null +++ b/python/pyqt/sip/qtsql/qdatatable.sip @@ -0,0 +1,201 @@ +// This is the SIP interface definition for QDataTable. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDataTable (Qt v3+)</Title> +<Para> +<Literal>QDataTable</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataTable : QTable +{ +%TypeHeaderCode +#include <qdatatable.h> +%End + +public: + QDataTable(QWidget* /TransferThis/ = 0,const char * = 0); + QDataTable(QSqlCursor *,bool = 0,QWidget * /TransferThis/ = 0, + const char * = 0); + + virtual void addColumn(const QString &,const QString & = QString::null, + int = -1,const QIconSet & = QIconSet()); + virtual void removeColumn(uint); + virtual void setColumn(uint,const QString &, + const QString & = QString::null,int = -1, + const QIconSet & = QIconSet()); + + QString nullText() const; + QString trueText() const; + QString falseText() const; + DateFormat dateFormat() const; + bool confirmEdits() const; + bool confirmInsert() const; + bool confirmUpdate() const; + bool confirmDelete() const; + bool confirmCancels() const; + bool autoDelete() const; + bool autoEdit() const; + QString filter() const; + QStringList sort() const; + + virtual void setSqlCursor(QSqlCursor * /GetWrapper/ = 0,bool = 0,bool = 0); +%MethodCode + Py_BEGIN_ALLOW_THREADS + sipSelfWasArg ? sipCpp->QDataTable::setSqlCursor(a0, a1, a2) : sipCpp->setSqlCursor(a0, a1, a2); + Py_END_ALLOW_THREADS + + // Transfer ownership of the cursor if the autoDelete flag is + // set. + if (a0 && a2) + sipTransferTo(a0Wrapper,sipSelf); +%End + + QSqlCursor *sqlCursor() const; + + virtual void setNullText(const QString &); + virtual void setTrueText(const QString &); + virtual void setFalseText(const QString &); + virtual void setDateFormat(const DateFormat); + virtual void setConfirmEdits(bool); + virtual void setConfirmInsert(bool); + virtual void setConfirmUpdate(bool); + virtual void setConfirmDelete(bool); + virtual void setConfirmCancels(bool); + virtual void setAutoDelete(bool); + virtual void setAutoEdit(bool); + virtual void setFilter(const QString &); + virtual void setSort(const QStringList &); + virtual void setSort(const QSqlIndex &); + + enum Refresh { + RefreshData, + RefreshColumns, + RefreshAll + }; + + void refresh(Refresh); + void sortColumn(int,bool = 1,bool = 0); + QString text(int,int) const; + QVariant value(int,int) const; + QSqlRecord *currentRecord() const; + + void installEditorFactory(QSqlEditorFactory * /Transfer/); + void installPropertyMap(QSqlPropertyMap * /Transfer/); + + int numCols() const; + int numRows() const; + void setNumCols(int); + void setNumRows(int); + bool findBuffer(const QSqlIndex &,int = 0); + +%If (Qt_3_2_0 -) + void hideColumn(int); + void showColumn(int); +%End + +signals: + void currentChanged(QSqlRecord *); + void primeInsert(QSqlRecord *); + void primeUpdate(QSqlRecord *); + void primeDelete(QSqlRecord *); + void beforeInsert(QSqlRecord *); + void beforeUpdate(QSqlRecord *); + void beforeDelete(QSqlRecord *); + void cursorChanged(QSql::Op); + +public slots: + virtual void find(const QString &,bool,bool); + virtual void sortAscending(int); + virtual void sortDescending(int); + virtual void refresh(); + void setColumnWidth(int,int); +%If (Qt_3_0_5 -) + void adjustColumn(int); + void setColumnStretchable(int,bool); +%End +%If (Qt_3_1_0 -) + void swapColumns(int,int,bool = 0); +%End + +protected: + virtual bool insertCurrent(); + virtual bool updateCurrent(); + virtual bool deleteCurrent(); + + virtual QSql::Confirm confirmEdit(QSql::Op); + virtual QSql::Confirm confirmCancel(QSql::Op); + + virtual void handleError(const QSqlError &); + + virtual bool beginInsert(); + virtual QWidget *beginUpdate(int,int,bool); + + bool eventFilter(QObject *,QEvent *); +%If (Qt_3_2_0 -) + void keyPressEvent(QKeyEvent *); +%End + void resizeEvent(QResizeEvent *); + void contentsMousePressEvent(QMouseEvent *); + void contentsContextMenuEvent(QContextMenuEvent *); + void endEdit(int,int,bool,bool); + + // We don't specify /Factory/ for this because the returned QWidget + // will always have a parent which will own it. + QWidget *createEditor(int,int,bool) const; + + void activateNextCell(); + int indexOf(uint) const; + void reset(); + void setSize(QSqlCursor *); + void repaintCell(int,int); + void paintCell(QPainter *,int,int,const QRect &,bool, + const QColorGroup &); + virtual void paintField(QPainter *,const QSqlField *,const QRect &, + bool); +%If (Qt_3_1_0 -) + void drawContents(QPainter *,int,int,int,int); +%End + virtual int fieldAlignment(const QSqlField *); + void columnClicked(int); + void resizeData(int); + + QTableItem *item(int,int) const; + void setItem(int,int,QTableItem *); + void clearCell(int,int); + void setPixmap(int,int,const QPixmap &); + void takeItem(QTableItem *); + +private: + QWidget *beginEdit(int,int,bool); + +%If (Qt_3_1_0 -) + QDataTable(const QDataTable &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qdataview.sip b/python/pyqt/sip/qtsql/qdataview.sip new file mode 100644 index 00000000..e6bb36eb --- /dev/null +++ b/python/pyqt/sip/qtsql/qdataview.sip @@ -0,0 +1,60 @@ +// This is the SIP interface definition for QDataView. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDataView (Qt v3+)</Title> +<Para> +<Literal>QDataView</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QDataView : QWidget +{ +%TypeHeaderCode +#include <qdataview.h> +%End + +public: + QDataView(QWidget * /TransferThis/ = 0,const char * = 0,WFlags = 0); + + virtual void setForm(QSqlForm *); + QSqlForm *form(); + virtual void setRecord(QSqlRecord *); + QSqlRecord *record(); + +public slots: + virtual void refresh(QSqlRecord *); + virtual void readFields(); + virtual void writeFields(); + virtual void clearValues(); + +private: +%If (Qt_3_1_0 -) + QDataView(const QDataView &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qeditorfactory.sip b/python/pyqt/sip/qtsql/qeditorfactory.sip new file mode 100644 index 00000000..49f932b8 --- /dev/null +++ b/python/pyqt/sip/qtsql/qeditorfactory.sip @@ -0,0 +1,55 @@ +// This is the SIP interface definition for QEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QEditorFactory : QObject +{ +%TypeHeaderCode +#include <qeditorfactory.h> +%End + +public: + QEditorFactory(QObject * /TransferThis/ = 0,const char * = 0); + + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QVariant &) /Factory/; + + static QEditorFactory *defaultFactory(); + static void installDefaultFactory(QEditorFactory * /Transfer/); + +private: +%If (Qt_3_1_0 -) + QEditorFactory(const QEditorFactory &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsql.sip b/python/pyqt/sip/qtsql/qsql.sip new file mode 100644 index 00000000..f2df0753 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsql.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for QSql. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSql (Qt v3+)</Title> +<Para> +<Literal>QSql</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSql +{ +%TypeHeaderCode +#include <qsql.h> +%End + +public: + QSql(); + + enum Op { + None, + Insert, + Update, + Delete + }; + + enum Location { + BeforeFirst, + AfterLast + }; + + enum Confirm { + Cancel, + No, + Yes + }; + +%If (Qt_3_2_0 -) + enum ParameterType { + In, + Out, + InOut + }; + + enum TableType { + Tables, + SystemTables, + Views, + AllTables + }; +%End + +private: + QSql(const QSql &); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlcursor.sip b/python/pyqt/sip/qtsql/qsqlcursor.sip new file mode 100644 index 00000000..2e11c1bb --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlcursor.sip @@ -0,0 +1,148 @@ +// This is the SIP interface definition for QSqlCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlCursor (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>virtual int <Function>del</Function></FuncDef> + <ParamDef>const QString &<Parameter>filter</Parameter></ParamDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlCursor : QSqlRecord, QSqlQuery +{ +%TypeHeaderCode +#include <qsqlcursor.h> +%End + +public: + QSqlCursor(const QString & = QString::null,bool = 1,QSqlDatabase * = 0); + QSqlCursor(const QSqlCursor &); + + enum Mode { + ReadOnly, + Insert, + Update, + Delete, + Writable + }; + + QVariant value(int) const; + QVariant value(const QString &) const; +%If (Qt_3_1_0 -) + void setValue(int,const QVariant &); + void setValue(const QString &,const QVariant &); +%End + virtual QSqlIndex primaryIndex(bool = 1) const; + virtual QSqlIndex index(const QStringList &) const; + QSqlIndex index(const QString &) const; +// QSqlIndex index(const char *) const; + virtual void setPrimaryIndex(const QSqlIndex &); + + virtual void append(const QSqlFieldInfo &); + virtual void insert(int,const QSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const QString &,bool); + void setGenerated(int,bool); + + virtual QSqlRecord *editBuffer(bool = 0); + virtual QSqlRecord *primeInsert(); + virtual QSqlRecord *primeUpdate(); + virtual QSqlRecord *primeDelete(); + virtual int insert(bool = 1) /ReleaseGIL/; + virtual int update(bool = 1) /ReleaseGIL/; + virtual int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual void setMode(int); + int mode() const; + virtual void setCalculated(const QString &,bool); + bool isCalculated(const QString &) const; + virtual void setTrimmed(const QString &,bool); + bool isTrimmed(const QString &) const; + + bool isReadOnly() const; + bool canInsert() const; + bool canUpdate() const; + bool canDelete() const; + + bool select() /ReleaseGIL/; + bool select(const QSqlIndex &) /ReleaseGIL/; + bool select(const QSqlIndex &,const QSqlIndex &) /ReleaseGIL/; + virtual bool select(const QString &,const QSqlIndex & = QSqlIndex()) /ReleaseGIL/; + + virtual void setSort(const QSqlIndex &); + QSqlIndex sort() const; + virtual void setFilter(const QString &); + QString filter() const; + virtual void setName(const QString &,bool = 1); + QString name() const; + QString toString(const QString & = QString::null, + const QString & = ",") const; + +%If (Qt_3_1_0 -) + bool isNull(int) const; + bool isNull(const QString &) const; +%End + +protected: + void afterSeek(); + bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + + virtual QVariant calculateField(const QString &); + virtual int update(const QString &,bool = 1); + virtual int del(const QString &,bool = 1) /PyName=delRecords, ReleaseGIL/; + + virtual QString toString(const QString &,QSqlField *, + const QString &) const; + virtual QString toString(QSqlRecord *,const QString &,const QString &, + const QString &) const; + virtual QString toString(const QSqlIndex &,QSqlRecord *, + const QString &,const QString &, + const QString &) const; +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqldatabase.sip b/python/pyqt/sip/qtsql/qsqldatabase.sip new file mode 100644 index 00000000..2a6c516f --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqldatabase.sip @@ -0,0 +1,154 @@ +// This is the SIP interface definition for QSqlDatabase. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlDatabase (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QSqlQuery <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter> = QString::null</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execStatement</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlDatabase : QObject +{ +%TypeHeaderCode +#include <qsqldatabase.h> +%End + +public: +%ConvertToSubClassCode + static struct class_graph { + char *name; + sipWrapperType **type; + int yes, no; + } graph[] = { + {sipName_QSqlDriver, &sipClass_QSqlDriver, -1, 1}, + {sipName_QEditorFactory, &sipClass_QEditorFactory, 7, 2}, + {sipName_QSqlDatabase, &sipClass_QSqlDatabase, -1, 3}, + {sipName_QSqlForm, &sipClass_QSqlForm, -1, 4}, + {sipName_QDataView, &sipClass_QDataView, -1, 5}, + {sipName_QDataTable, &sipClass_QDataTable, -1, 6}, + {sipName_QDataBrowser, &sipClass_QDataBrowser, -1, -1}, + {sipName_QSqlEditorFactory, &sipClass_QSqlEditorFactory, -1, -1}, + }; + + int i = 0; + + sipClass = NULL; + + do + { + struct class_graph *cg = &graph[i]; + + if (cg->name != NULL && sipCpp->inherits(cg->name)) + { + sipClass = *cg->type; + i = cg->yes; + } + else + i = cg->no; + } + while (i >= 0); +%End + + bool open() /ReleaseGIL/; + bool open(const QString &,const QString &) /ReleaseGIL/; + void close(); + bool isOpen() const; + bool isOpenError() const; + QStringList tables() const; +%If (Qt_3_2_0 -) + QStringList tables(QSql::TableType) const; +%End + QSqlIndex primaryIndex(const QString &) const; + QSqlRecord record(const QString &) const; + QSqlRecord record(const QSqlQuery &) const; + QSqlRecordInfo recordInfo(const QString &) const; + QSqlRecordInfo recordInfo(const QSqlQuery &) const; + QSqlQuery exec(const QString & = QString::null) const /PyName=execStatement, ReleaseGIL/; + QSqlError lastError() const; + + bool transaction(); + bool commit(); + bool rollback(); + + virtual void setDatabaseName(const QString &); + virtual void setUserName(const QString &); + virtual void setPassword(const QString &); + virtual void setHostName(const QString &); + virtual void setPort(int); +%If (Qt_3_2_0 -) + void setConnectOptions(const QString & = QString::null); +%End + QString databaseName() const; + QString userName() const; + QString password() const; + QString hostName() const; + QString driverName() const; + int port() const; +%If (Qt_3_2_0 -) + QString connectOptions() const; +%End + + QSqlDriver *driver() const; + + static QSqlDatabase *addDatabase(const QString &, + const QString & = QString(QSqlDatabase::defaultConnection)); +%If (Qt_3_2_0 -) + static QSqlDatabase *addDatabase(QSqlDriver *, + const QString & = QString(QSqlDatabase::defaultConnection)); +%End + static QSqlDatabase *database(const QString & = QString(QSqlDatabase::defaultConnection),bool = 1); + static void removeDatabase(const QString &); +%If (Qt_3_2_0 -) + static void removeDatabase(QSqlDatabase *); +%End + static bool contains(const QString & = QString(QSqlDatabase::defaultConnection)); + static QStringList drivers(); +// static void registerSqlDriver(const QString &, +// const QSqlDriverCreatorBase *); +%If (Qt_3_2_0 -) + static bool isDriverAvailable(const QString &); +%End + +protected: + QSqlDatabase(const QString &,const QString &, + QObject * /TransferThis/ = 0,const char * = 0); +%If (Qt_3_2_0 -) + QSqlDatabase(QSqlDriver *,QObject * /TransferThis/ = 0, + const char * = 0); +%End + +private: +%If (Qt_3_1_0 -) + QSqlDatabase(const QSqlDatabase &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqldriver.sip b/python/pyqt/sip/qtsql/qsqldriver.sip new file mode 100644 index 00000000..3ebdaa94 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqldriver.sip @@ -0,0 +1,93 @@ +// This is the SIP interface definition for QSqlDriver. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlDriver (Qt v3+)</Title> +<Para> +<Literal>QSqlDriver</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlDriver : QObject +{ +%TypeHeaderCode +#include <qsqldriver.h> +%End + +public: + enum DriverFeature { + Transactions, + QuerySize, + BLOB, +%If (Qt_3_1_0 -) + Unicode, + PreparedQueries, + NamedPlaceholders, + PositionalPlaceholders +%End + }; + + QSqlDriver(QObject * /TransferThis/ = 0,const char * = 0); + + bool isOpen() const; + bool isOpenError() const; + + virtual bool beginTransaction(); + virtual bool commitTransaction(); + virtual bool rollbackTransaction(); + virtual QStringList tables(const QString &) const; + virtual QSqlIndex primaryIndex(const QString &) const; + virtual QSqlRecord record(const QString &) const; + virtual QSqlRecord record(const QSqlQuery &) const; + virtual QSqlRecordInfo recordInfo(const QString &) const; + virtual QSqlRecordInfo recordInfo(const QSqlQuery &) const; + virtual QString nullText() const; + virtual QString formatValue(const QSqlField *,bool = 0) const; + QSqlError lastError() const; + + virtual bool hasFeature(DriverFeature) const = 0; + virtual bool open(const QString &,const QString & = QString::null, + const QString & = QString::null, + const QString & = QString::null, + int = -1) = 0 /ReleaseGIL/; + virtual void close() = 0; + virtual QSqlQuery createQuery() const = 0; + +%If (Qt_3_2_0 -) + bool open(const QString &,const QString &,const QString &, + const QString &,int,const QString &) /ReleaseGIL/; +%End + +protected: + virtual void setOpen(bool); + virtual void setOpenError(bool); + virtual void setLastError(const QSqlError &); + +private: + QSqlDriver(const QSqlDriver &); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqleditorfactory.sip b/python/pyqt/sip/qtsql/qsqleditorfactory.sip new file mode 100644 index 00000000..af93bd44 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqleditorfactory.sip @@ -0,0 +1,57 @@ +// This is the SIP interface definition for QSqlEditorFactory. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlEditorFactory (Qt v3+)</Title> +<Para> +<Literal>QSqlEditorFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlEditorFactory : QEditorFactory +{ +%TypeHeaderCode +#include <qsqleditorfactory.h> +%End + +public: + QSqlEditorFactory(QObject * /TransferThis/ = 0,const char * = 0); + + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QVariant &) /Factory/; + virtual QWidget *createEditor(QWidget * /TransferThis/, + const QSqlField *) /Factory/; + + static QSqlEditorFactory *defaultFactory(); + static void installDefaultFactory(QSqlEditorFactory * /Transfer/); + +private: +%If (Qt_3_1_0 -) + QSqlEditorFactory(const QSqlEditorFactory &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlerror.sip b/python/pyqt/sip/qtsql/qsqlerror.sip new file mode 100644 index 00000000..17f95049 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlerror.sip @@ -0,0 +1,68 @@ +// This is the SIP interface definition for QSqlError. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlError (Qt v3+)</Title> +<Para> +<Literal>QSqlError</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlError +{ +%TypeHeaderCode +#include <qsqlerror.h> +%End + +public: + enum Type { + None, + Connection, + Statement, + Transaction, + Unknown + }; + + QSqlError(const QString & = QString::null, + const QString & = QString::null,int = QSqlError::None, + int = -1); + QSqlError(const QSqlError &); + + QString driverText() const; + virtual void setDriverText(const QString &); + QString databaseText() const; + virtual void setDatabaseText(const QString &); + int type() const; + virtual void setType(int); + int number() const; + virtual void setNumber(int); +%If (Qt_3_2_0 -) + QString text() const; + void showMessage(const QString & = QString::null) const; +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlfield.sip b/python/pyqt/sip/qtsql/qsqlfield.sip new file mode 100644 index 00000000..39dc0461 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlfield.sip @@ -0,0 +1,95 @@ +// This is the SIP interface definition for QSqlField and QSqlFieldInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlField (Qt v3+)</Title> +<Para> +<Literal>QSqlField</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlFieldInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlFieldInfo</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlField +{ +%TypeHeaderCode +#include <qsqlfield.h> +%End + +public: + QSqlField(const QString & = QString::null, + QVariant::Type = QVariant::Invalid ); + QSqlField(const QSqlField &); + + virtual void setValue(const QVariant &); + virtual QVariant value() const; + virtual void setName(const QString &); + QString name() const; + virtual void setNull(); + bool isNull() const; + virtual void setReadOnly(bool); + bool isReadOnly() const; + void clear(bool = 1); + QVariant::Type type() const; +}; + + +class QSqlFieldInfo +{ +%TypeHeaderCode +#include <qsqlfield.h> +%End + +public: + QSqlFieldInfo(const QString & = QString::null, + QVariant::Type = QVariant::Invalid,int = -1,int = -1, + int = -1,const QVariant & = QVariant(),int = 0,bool = 1, + bool = 0,bool = 0); + QSqlFieldInfo(const QSqlFieldInfo &); + QSqlFieldInfo(const QSqlField &,bool = 1); + + QSqlField toField() const; + int isRequired() const; + QVariant::Type type() const; + int length() const; + int precision() const; + QVariant defaultValue() const; + QString name() const; + int typeID() const; + bool isGenerated() const; + bool isTrim() const; + bool isCalculated() const; + + virtual void setTrim(bool); + virtual void setGenerated(bool); + virtual void setCalculated(bool); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlform.sip b/python/pyqt/sip/qtsql/qsqlform.sip new file mode 100644 index 00000000..84e05b79 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlform.sip @@ -0,0 +1,74 @@ +// This is the SIP interface definition for QSqlForm. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlForm (Qt v3+)</Title> +<Para> +<Literal>QSqlForm</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlForm : QObject +{ +%TypeHeaderCode +#include <qsqlform.h> +%End + +public: + QSqlForm(QObject * /TransferThis/ = 0,const char * = 0); + + virtual void insert(QWidget *,const QString &); + virtual void remove(const QString &); + uint count() const; + + QWidget *widget(uint) const; + QSqlField *widgetToField(QWidget *) const; + QWidget *fieldToWidget(QSqlField *) const; + + void installPropertyMap(QSqlPropertyMap * /Transfer/); + + virtual void setRecord(QSqlRecord *); + +public slots: + virtual void readField(QWidget *); + virtual void writeField(QWidget *); + virtual void readFields(); + virtual void writeFields(); + + virtual void clear(); + virtual void clearValues(bool = 0); + +protected: + virtual void insert(QWidget *,QSqlField *); + virtual void remove(QWidget *); + +private: +%If (Qt_3_1_0 -) + QSqlForm(const QSqlForm &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlindex.sip b/python/pyqt/sip/qtsql/qsqlindex.sip new file mode 100644 index 00000000..af88129e --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlindex.sip @@ -0,0 +1,64 @@ +// This is the SIP interface definition for QSqlIndex. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlIndex (Qt v3+)</Title> +<Para> +<Literal>QSqlIndex</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlIndex : QSqlRecord +{ +%TypeHeaderCode +#include <qsqlindex.h> +%End + +public: + QSqlIndex(const QString & = QString::null, + const QString & = QString::null); + QSqlIndex(const QSqlIndex &); + + virtual void setCursorName(const QString &); + QString cursorName() const; + virtual void setName(const QString &); + QString name() const; + + void append(const QSqlField &); + virtual void append(const QSqlField &,bool); + + bool isDescending(int) const; + virtual void setDescending(int,bool); + + QString toString(const QString & = QString::null,const QString & = ",", + bool = 1) const; + QStringList toStringList(const QString & = QString::null, + bool = 1) const; + + static QSqlIndex fromStringList(const QStringList &,const QSqlCursor *); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlpropertymap.sip b/python/pyqt/sip/qtsql/qsqlpropertymap.sip new file mode 100644 index 00000000..c2f8ae8b --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlpropertymap.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QSqlPropertyMap. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlPropertyMap (Qt v3+)</Title> +<Para> +<Literal>QSqlPropertyMap</Literal> is fully implemented. However, because PyQt +does not allow new properties to be defined, it is not possible to implement +custom editor widgets in Python and add them to a property map. These will +simply be ignored. +</Para> + +<Para> +This problem may be addressed in a future release of PyQt. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlPropertyMap +{ +%TypeHeaderCode +#include <qsqlpropertymap.h> +%End + +public: + QSqlPropertyMap(); + + QVariant property(QWidget *); + virtual void setProperty(QWidget *,const QVariant &); + + void insert(const QString &,const QString &); + void remove(const QString &); + + static QSqlPropertyMap *defaultMap(); + static void installDefaultMap(QSqlPropertyMap * /Transfer/); + +private: + QSqlPropertyMap(const QSqlPropertyMap &); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlquery.sip b/python/pyqt/sip/qtsql/qsqlquery.sip new file mode 100644 index 00000000..a7284f1b --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlquery.sip @@ -0,0 +1,115 @@ +// This is the SIP interface definition for QSqlQuery. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlQuery (Qt v3+)</Title> +<FuncSynopsis> + <FuncDef>QMap<QString,QVariant> <Function>boundValues</Function> const</FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3.2.0+) +</Para> + +<FuncSynopsis> + <FuncDef>virtual bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. (Qt v3.1+) +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlQuery +{ +%TypeHeaderCode +#include <qsqlquery.h> +%End + +public: + QSqlQuery(QSqlResult *); + QSqlQuery(const QString & = QString::null,QSqlDatabase * = 0); +%If (Qt_3_2_0 -) + QSqlQuery(QSqlDatabase *); +%End + QSqlQuery(const QSqlQuery &); + + bool isValid() const; + bool isActive() const; + bool isNull(int) const; + int at() const; + QString lastQuery() const; + int numRowsAffected() const; + QSqlError lastError() const; + bool isSelect() const; + int size() const; + const QSqlDriver *driver() const; + const QSqlResult *result() const; +%If (Qt_3_1_0 -) + bool isForwardOnly() const; + void setForwardOnly(bool); +%End + + virtual bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + virtual QVariant value(int) const; + + virtual bool seek(int,bool = 0) /ReleaseGIL/; + virtual bool next() /ReleaseGIL/; + virtual bool prev() /ReleaseGIL/; + virtual bool first() /ReleaseGIL/; + virtual bool last() /ReleaseGIL/; + +%If (Qt_3_1_0 -) + bool exec() /PyName=execQuery, ReleaseGIL/; + bool prepare(const QString &); + void bindValue(const QString &,const QVariant &); + void bindValue(int,const QVariant &); + void addBindValue(const QVariant &); +%End +%If (Qt_3_2_0 -) + void bindValue(const QString &,const QVariant &,QSql::ParameterType); + void bindValue(int,const QVariant &,QSql::ParameterType); + void addBindValue(const QVariant &,QSql::ParameterType); + QVariant boundValue(const QString &) const; + QVariant boundValue(int) const; +// QMap<QString,QVariant> boundValues() const; + QString executedQuery() const; +%End + +protected: + virtual void beforeSeek(); + virtual void afterSeek(); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlrecord.sip b/python/pyqt/sip/qtsql/qsqlrecord.sip new file mode 100644 index 00000000..cf1ec0e0 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlrecord.sip @@ -0,0 +1,178 @@ +// This is the SIP interface definition for QSqlRecord and QSqlRecordInfo. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlRecord (Qt v3+)</Title> +<Para> +<Literal>QSqlRecord</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QSqlRecordInfo (Qt v3+)</Title> +<Para> +<Literal>QSqlRecordInfo</Literal> is implemented as a Python list of +<Literal>QSqlFieldInfo</Literal> instances. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlRecord +{ +%TypeHeaderCode +#include <qsqlrecord.h> +%End + +public: + QSqlRecord(); + QSqlRecord(const QSqlRecord &); + + virtual QVariant value(int) const; + virtual QVariant value(const QString &) const; + virtual void setValue(int,const QVariant &); + virtual void setValue(const QString &,const QVariant &); + bool isGenerated(int) const; + bool isGenerated(const QString &) const; + virtual void setGenerated(const QString &,bool); + virtual void setGenerated(int,bool); + virtual void setNull(int); + virtual void setNull(const QString &); + bool isNull(int); + bool isNull(const QString &); +%If (Qt_3_1_0 -) +// bool isNull(int) const; +// bool isNull(const QString &) const; +%End + + int position(const QString &) const; + QString fieldName(int) const; + QSqlField *field(int); + QSqlField *field(const QString &); +// const QSqlField *field(int) const; +// const QSqlField *field(const QString &) const; + + virtual void append(const QSqlField &); + virtual void insert(int,const QSqlField &); + virtual void remove(int); + + bool isEmpty() const; + bool contains(const QString &) const; + virtual void clear(); + virtual void clearValues(bool = 0); + uint count() const; + virtual QString toString(const QString & = QString::null, + const QString & = ",") const; + virtual QStringList toStringList(const QString & = QString::null) const; +}; + + +%MappedType QSqlRecordInfo +{ +%TypeHeaderCode +#include <qsqlrecord.h> +#include "sipqtsqlQSqlFieldInfo.h" +%End + +%ConvertFromTypeCode + // Convert to a Python list of QSqlFieldInfo instances. + + int i; + PyObject *l; + + // Create the list. + + if ((l = PyList_New(sipCpp -> count())) == NULL) + return NULL; + + // Get it. + + i = 0; + QValueListConstIterator<QSqlFieldInfo> it; + + for (it = sipCpp -> begin(); it != sipCpp -> end(); ++it) + { + PyObject *tmobj; + + if ((tmobj = sipConvertFromNewInstance(new QSqlFieldInfo(*it),sipClass_QSqlFieldInfo,sipTransferObj)) == NULL || PyList_SetItem(l,i,tmobj) < 0) + { + Py_XDECREF(tmobj); + Py_DECREF(l); + + return NULL; + } + + ++i; + } + + return l; +%End + + +%ConvertToTypeCode + // Convert a Python list of QSqlFieldInfo instances to a QSqlRecordInfo + // on the heap. + + if (sipIsErr == NULL) + { + if (!PyList_Check(sipPy)) + return 0; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QSqlFieldInfo,SIP_NOT_NONE)) + return 0; + + return 1; + } + + QSqlRecordInfo *qri = new QSqlRecordInfo; + + for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) + { + int iserr = 0, state; + + // We apply the transfer to the list itself, not the elements. + QSqlFieldInfo *itm = reinterpret_cast<QSqlFieldInfo *>(sipConvertToInstance(PyList_GET_ITEM(sipPy,i),sipClass_QSqlFieldInfo,0,SIP_NOT_NONE,&state,&iserr)); + + if (iserr) + { + sipReleaseInstance(itm,sipClass_QSqlFieldInfo,state); + + *sipIsErr = 1; + delete qri; + + return 0; + } + + qri -> append(*itm); + + sipReleaseInstance(itm,sipClass_QSqlFieldInfo,state); + } + + *sipCppPtr = qri; + + return sipGetState(sipTransferObj); +%End +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlresult.sip b/python/pyqt/sip/qtsql/qsqlresult.sip new file mode 100644 index 00000000..f4fc7f6e --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlresult.sip @@ -0,0 +1,73 @@ +// This is the SIP interface definition for QSqlResult. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlResult (Qt v3+)</Title> +<Para> +<Literal>QSqlResult</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QSqlResult +{ +%TypeHeaderCode +#include <qsqlresult.h> +%End + +protected: + QSqlResult(const QSqlDriver *); + + int at() const; + QString lastQuery() const; + QSqlError lastError() const; + bool isValid() const; + bool isActive() const; + bool isSelect() const; + bool isForwardOnly() const; + const QSqlDriver *driver() const; + virtual void setAt(int); + virtual void setActive(bool); + virtual void setLastError(const QSqlError &); + virtual void setQuery(const QString &); + virtual void setSelect(bool); + virtual void setForwardOnly(bool); + + virtual QVariant data(int) = 0; + virtual bool isNull(int) = 0; + virtual bool reset(const QString &) = 0; + virtual bool fetch(int) = 0; + virtual bool fetchNext(); + virtual bool fetchPrev(); + virtual bool fetchFirst() = 0; + virtual bool fetchLast() = 0; + virtual int size() = 0; + virtual int numRowsAffected() = 0; + +private: + QSqlResult(const QSqlResult &); +}; + +%End diff --git a/python/pyqt/sip/qtsql/qsqlselectcursor.sip b/python/pyqt/sip/qtsql/qsqlselectcursor.sip new file mode 100644 index 00000000..289cc420 --- /dev/null +++ b/python/pyqt/sip/qtsql/qsqlselectcursor.sip @@ -0,0 +1,92 @@ +// This is the SIP interface definition for QSqlSelectCursor. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QSqlSelectCursor (Qt v3.2.0+)</Title> +<FuncSynopsis> + <FuncDef>int <Function>del</Function></FuncDef> + <ParamDef>bool <Parameter>invalidate</Parameter> = TRUE</ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>delRecords</Literal> in Python. +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>exec</Function></FuncDef> + <ParamDef>const QString &<Parameter>query</Parameter></ParamDef> +</FuncSynopsis> +<Para> +This has been renamed <Literal>execQuery</Literal> in Python. +</Para> +</Sect2> +%End + + +%If (Qt_3_2_0 -) + +class QSqlSelectCursor : QSqlCursor +{ +%TypeHeaderCode +#include <qsqlselectcursor.h> +%End + +public: + QSqlSelectCursor(const QString & = QString::null,QSqlDatabase * = 0); + QSqlSelectCursor(const QSqlSelectCursor &); + ~QSqlSelectCursor(); + + bool exec(const QString &) /PyName=execQuery, ReleaseGIL/; + bool select() /ReleaseGIL/; + +protected: + QSqlIndex primaryIndex(bool = 1) const; + QSqlIndex index(const QStringList &) const; + QSqlIndex index(const QString &) const; +// QSqlIndex index(const char *) const; + void setPrimaryIndex(const QSqlIndex &); + void append(const QSqlFieldInfo &); + void insert(int,const QSqlFieldInfo &); + void remove(int); + void clear(); + void setGenerated(const QString &,bool); + void setGenerated(int,bool); + QSqlRecord *editBuffer(bool = 0); + QSqlRecord *primeInsert(); + QSqlRecord *primeUpdate(); + QSqlRecord *primeDelete(); + int insert(bool = 1) /ReleaseGIL/; + int update(bool = 1) /ReleaseGIL/; + int del(bool = 1) /PyName=delRecords, ReleaseGIL/; + void setMode(int); + + void setSort(const QSqlIndex &); + QSqlIndex sort() const; + void setFilter(const QString &); + QString filter() const; + void setName(const QString &,bool = 1); + QString name() const; + QString toString(const QString & = QString::null, + const QString & = ",") const; + bool select(const QString &,const QSqlIndex & = QSqlIndex()) /ReleaseGIL/; +}; + +%End diff --git a/python/pyqt/sip/qtsql/qtsqlmod.sip b/python/pyqt/sip/qtsql/qtsqlmod.sip new file mode 100644 index 00000000..f780a9a3 --- /dev/null +++ b/python/pyqt/sip/qtsql/qtsqlmod.sip @@ -0,0 +1,88 @@ +// This is the SIP interface definition for the qtsql module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtsql 1 + +%Import qt/qtmod.sip +%Import qttable/qttablemod.sip + +%Include copying.sip + + +%Include qdatabrowser.sip +%Include qdatatable.sip +%Include qdataview.sip +%Include qeditorfactory.sip +%Include qsql.sip +%Include qsqlcursor.sip +%Include qsqldatabase.sip +%Include qsqldriver.sip +%Include qsqleditorfactory.sip +%Include qsqlerror.sip +%Include qsqlfield.sip +%Include qsqlform.sip +%Include qsqlindex.sip +%Include qsqlpropertymap.sip +%Include qsqlquery.sip +%Include qsqlrecord.sip +%Include qsqlresult.sip +%Include qsqlselectcursor.sip + + +// The build file template. + +%Makefile qtsql.pro.in +# The project file for the qtsql module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QTTABLE_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qttable/copying.sip b/python/pyqt/sip/qttable/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qttable/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qttable/qtable.sip b/python/pyqt/sip/qttable/qtable.sip new file mode 100644 index 00000000..87a0be39 --- /dev/null +++ b/python/pyqt/sip/qttable/qtable.sip @@ -0,0 +1,532 @@ +// This is the SIP interface definition for QTable, QTableItem, +// QCheckTableItem, QComboTableItem and QTableSelection. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QTable (Qt v2.2+)</Title> +<Para> +<Literal>QTable</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTableItem (Qt v2.2+)</Title> +<Para> +<Literal>QTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QCheckTableItem (Qt v3+)</Title> +<Para> +<Literal>QCheckTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QComboTableItem (Qt v3+)</Title> +<Para> +<Literal>QComboTableItem</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QTableSelection (Qt v2.2+)</Title> +<Para> +<Literal>QTableSelection</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_TABLE) +%If (Qt_2_2_0 -) + +class QTableSelection +{ +%TypeHeaderCode +#include <qtable.h> +%End + +public: + QTableSelection(); +%If (Qt_3_1_0 -) + QTableSelection(int,int,int,int); +%End + + void init(int,int); + void expandTo(int,int); + + int topRow() const; + int bottomRow() const; + int leftCol() const; + int rightCol() const; + int anchorRow() const; + int anchorCol() const; +%If (Qt_3_2_0 -) + int numRows() const; + int numCols() const; +%End + + bool isActive() const; +%If (Qt_3_2_0 -) + bool isEmpty() const; +%End +}; + + +class QTableItem : Qt +{ +%TypeHeaderCode +#include <qtable.h> +%End + +public: + enum EditType { + Never, + OnTyping, + WhenCurrent, + Always + }; + + // Note that the Qt documentation is wrong. Ownership is only taken by + // QTable::setItem(). +%If (Qt_3_2_0 -) + QTableItem(QTable *,EditType); +%End + QTableItem(QTable *,EditType,const QString &); + QTableItem(QTable *,EditType,const QString &,const QPixmap &); + +%ConvertToSubClassCode + Py_BEGIN_ALLOW_THREADS + +#if QT_VERSION >= 0x030000 + int rtti = sipCpp -> rtti(); + + if (rtti == QCheckTableItem::RTTI) + sipClass = sipClass_QCheckTableItem; + else if (rtti == QComboTableItem::RTTI) + sipClass = sipClass_QComboTableItem; + else + sipClass = 0; +#else + sipClass = 0; +#endif + + Py_END_ALLOW_THREADS +%End + + virtual QPixmap pixmap() const; + virtual QString text() const; + virtual void setPixmap(const QPixmap &); + virtual void setText(const QString &); + QTable *table() const; + + virtual int alignment() const; + virtual void setWordWrap(bool); + bool wordWrap() const; + + EditType editType() const; + virtual QWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(QWidget *); + virtual void setReplaceable(bool); + bool isReplaceable() const; + + virtual QString key() const; + virtual QSize sizeHint() const; + + virtual void setSpan(int,int); + int rowSpan() const; + int colSpan() const; + + virtual void setRow(int); + virtual void setCol(int); + int row() const; + int col() const; + + virtual void paint(QPainter *,const QColorGroup &,const QRect &,bool); + + void updateEditor(int,int); + +%If (Qt_3_0_0 -) + virtual void setEnabled(bool); + bool isEnabled() const; + + virtual int rtti() const; +%End + +protected: +%If (Qt_3_2_0 - Qt_3_3_0) + QString content() const; +%End +}; + + +%If (Qt_3_0_0 -) + +class QComboTableItem : QTableItem +{ +%TypeHeaderCode +#include <qtable.h> +%End + +public: + // Note that the Qt documentation is wrong. Ownership is only taken by + // QTable::setItem(). + QComboTableItem(QTable *,const QStringList &,bool = 0); + + virtual QWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(QWidget *); + virtual void paint(QPainter *,const QColorGroup &,const QRect &,bool); + virtual void setCurrentItem(int); + virtual void setCurrentItem(const QString &); + int currentItem() const; + QString currentText() const; + int count() const; + QString text(int) const; + virtual void setEditable(bool); + bool isEditable() const; + virtual void setStringList(const QStringList &); + + int rtti() const; + +%If (Qt_3_0_6 -) + QSize sizeHint() const; +%End +}; + +%End + + +%If (Qt_3_0_0 -) + +class QCheckTableItem : QTableItem +{ +%TypeHeaderCode +#include <qtable.h> +%End + +public: + // Note that the Qt documentation is wrong. Ownership is only taken by + // QTable::setItem(). + QCheckTableItem(QTable *,const QString &); + +%If (Qt_3_2_0 -) + void setText(const QString &); +%End + virtual QWidget *createEditor() const /Factory/; + virtual void setContentFromEditor(QWidget *); + virtual void paint(QPainter *,const QColorGroup &,const QRect &,bool); + virtual void setChecked(bool); + bool isChecked() const; + + int rtti() const; + +%If (Qt_3_0_6 -) + QSize sizeHint() const; +%End +}; + +%End + + +class QTable : QScrollView +{ +%TypeHeaderCode +#include <qtable.h> +%End + +public: + QTable(QWidget * /TransferThis/ = 0,const char * = 0); + QTable(int,int,QWidget * /TransferThis/ = 0,const char * = 0); + +%ConvertToSubClassCode + sipClass = (sipCpp->inherits(sipName_QTable) ? sipClass_QTable : NULL); +%End + + QHeader *horizontalHeader() const; + QHeader *verticalHeader() const; + +%If (- Qt_3_0_0) + enum SelectionMode { + Single, + Multi, + NoSelection + }; +%End +%If (Qt_3_0_0 -) + enum SelectionMode { + Single, + Multi, + SingleRow, + MultiRow, + NoSelection + }; +%End + + virtual void setSelectionMode(SelectionMode); + SelectionMode selectionMode() const; + + virtual void setItem(int,int,QTableItem * /Transfer/); + virtual void setText(int,int,const QString &); + virtual void setPixmap(int,int,const QPixmap &); + virtual QTableItem *item(int,int) const; + virtual QString text(int,int) const; + virtual QPixmap pixmap(int,int) const; + virtual void clearCell(int,int); + + virtual QRect cellGeometry(int,int) const; + virtual int columnWidth(int) const; + virtual int rowHeight(int) const; + virtual int columnPos(int) const; + virtual int rowPos(int) const; + virtual int columnAt(int) const; + virtual int rowAt(int) const; + +%If (- Qt_3_0_0) + int numRows() const; + int numCols() const; +%End +%If (Qt_3_0_0 -) + virtual int numRows() const; + virtual int numCols() const; +%End + + void updateCell(int,int); + + bool eventFilter(QObject *,QEvent *); + + int currentRow() const; + int currentColumn() const; + void ensureCellVisible(int,int); + + bool isSelected(int,int) const; + bool isRowSelected(int,bool = 0) const; + bool isColumnSelected(int,bool = 0) const; + int numSelections() const; + QTableSelection selection(int) const; + virtual int addSelection(const QTableSelection &); + virtual void removeSelection(const QTableSelection &); + virtual void removeSelection(int); + virtual int currentSelection() const; + +%If (Qt_3_1_0 -) + void selectCells(int,int,int,int); + void selectRow(int); + void selectColumn(int); +%End + + bool showGrid() const; + + bool columnMovingEnabled() const; + bool rowMovingEnabled() const; + + virtual void sortColumn(int,bool = 1,bool = 0); + + bool sorting() const; + + virtual void takeItem(QTableItem * /TransferBack/); + + virtual void setCellWidget(int,int,QWidget * /Transfer/); + virtual QWidget *cellWidget(int,int) const; + virtual void clearCellWidget(int,int); + +%If (Qt_3_0_0 -) + virtual QRect cellRect(int,int) const; +%End + + virtual void paintCell(QPainter *,int,int,const QRect &,bool); +%If (Qt_3_0_0 -) + virtual void paintCell(QPainter *,int,int,const QRect &,bool, + const QColorGroup &); +%End + virtual void paintFocus(QPainter *,const QRect &); + QSize sizeHint() const; + +%If (Qt_3_0_0 -) + bool isReadOnly() const; + bool isRowReadOnly(int) const; + bool isColumnReadOnly(int) const; + + void setEnabled(bool); + + void repaintSelections(); + + enum FocusStyle { + FollowStyle, + SpreadSheet + }; + + virtual void setFocusStyle(FocusStyle); + FocusStyle focusStyle() const; +%End + +%If (Qt_3_1_0 -) + void updateHeaderStates(); +%End + +public slots: + virtual void setNumRows(int); + virtual void setNumCols(int); + virtual void setShowGrid(bool); + virtual void hideRow(int); + virtual void hideColumn(int); + virtual void showRow(int); + virtual void showColumn(int); +%If (Qt_3_3_0 -) + bool isRowHidden(int) const; + bool isColumnHidden(int) const; +%End + + virtual void setColumnWidth(int,int); + virtual void setRowHeight(int,int); + + virtual void adjustColumn(int); + virtual void adjustRow(int); + + virtual void setColumnStretchable(int,bool); + virtual void setRowStretchable(int,bool); + bool isColumnStretchable(int) const; + bool isRowStretchable(int) const; + virtual void setSorting(bool); +%If (- Qt_3_0_0) + virtual void swapRows(int,int); + virtual void swapColumns(int,int); +%End +%If (Qt_3_0_0 -) + virtual void swapRows(int,int,bool = 0); + virtual void swapColumns(int,int,bool = 0); +%End + virtual void swapCells(int,int,int,int); + + virtual void setLeftMargin(int); + virtual void setTopMargin(int); + virtual void setCurrentCell(int,int); + void clearSelection(bool = 1); + virtual void setColumnMovingEnabled(bool); + virtual void setRowMovingEnabled(bool); + +%If (Qt_3_0_0 -) + virtual void setReadOnly(bool); + virtual void setRowReadOnly(int,bool); + virtual void setColumnReadOnly(int,bool); + + virtual void setDragEnabled(bool); + bool dragEnabled() const; + + virtual void insertRows(int,int = 1); + virtual void insertColumns(int,int = 1); + virtual void removeRow(int); + virtual void removeRows(const QMemArray<int> &); + virtual void removeColumn(int); + virtual void removeColumns(const QMemArray<int> &); + + virtual void editCell(int,int,bool = 0); +%End + +%If (Qt_3_1_0 -) + void setRowLabels(const QStringList &); + void setColumnLabels(const QStringList &); +%End + +protected: +%If (Qt_3_0_0 -) + enum EditMode { + NotEditing, + Editing, + Replacing + }; +%End + + void drawContents(QPainter *,int,int,int,int); + void contentsMousePressEvent(QMouseEvent *); + void contentsMouseMoveEvent(QMouseEvent *); + void contentsMouseDoubleClickEvent(QMouseEvent *); + void contentsMouseReleaseEvent(QMouseEvent *); +%If (Qt_3_0_0 -) + void contentsContextMenuEvent(QContextMenuEvent *); +%End + void keyPressEvent(QKeyEvent *); + void focusInEvent(QFocusEvent *); + void focusOutEvent(QFocusEvent *); +%If (- Qt_3_0_0) + void resizeEvent(QResizeEvent *); +%End +%If (Qt_3_0_0 -) + void viewportResizeEvent(QResizeEvent *); +%End + void showEvent(QShowEvent *); +%If (Qt_3_1_0 -) + void paintEvent(QPaintEvent *); +%End +%If (Qt_3_0_0 -) + void setEditMode(EditMode,int,int); + virtual void contentsDragEnterEvent(QDragEnterEvent *); + virtual void contentsDragMoveEvent(QDragMoveEvent *); + virtual void contentsDragLeaveEvent(QDragLeaveEvent *); + virtual void contentsDropEvent(QDropEvent *); + virtual QDragObject *dragObject(); + virtual void startDrag(); +%End + + virtual void paintEmptyArea(QPainter *,int,int,int,int); + virtual void activateNextCell(); + virtual QWidget *createEditor(int,int,bool) const /Factory/; + virtual void setCellContentFromEditor(int,int); + virtual QWidget *beginEdit(int,int,bool); + virtual void endEdit(int,int,bool,bool); + + virtual void resizeData(int); + virtual void insertWidget(int,int,QWidget *); + int indexOf(int,int) const; + +%If (Qt_3_0_0 -) + void windowActivationChange(bool); + bool isEditing() const; + EditMode editMode() const; + int currEditRow() const; + int currEditCol() const; +%End + +protected slots: + virtual void columnWidthChanged(int); + virtual void rowHeightChanged(int); + virtual void columnIndexChanged(int,int,int); + virtual void rowIndexChanged(int,int,int); + virtual void columnClicked(int); + +signals: + void currentChanged(int,int); + void clicked(int,int,int,const QPoint &); + void doubleClicked(int,int,int,const QPoint &); + void pressed(int,int,int,const QPoint &); + void selectionChanged(); + void valueChanged(int,int); +%If (Qt_3_0_0 -) + void contextMenuRequested(int,int,const QPoint &); + void dropped(QDropEvent *); +%End + +private: +%If (Qt_3_1_0 -) + QTable(const QTable &); +%End +}; + +%End +%End diff --git a/python/pyqt/sip/qttable/qttablemod.sip b/python/pyqt/sip/qttable/qttablemod.sip new file mode 100644 index 00000000..d470d223 --- /dev/null +++ b/python/pyqt/sip/qttable/qttablemod.sip @@ -0,0 +1,70 @@ +// This is the SIP interface definition for the qttable module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qttable 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qtable.sip + + +// The build file template. + +%Makefile qttable.pro.in +# The project file for the qttable module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtui/copying.sip b/python/pyqt/sip/qtui/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtui/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtui/qtuimod.sip b/python/pyqt/sip/qtui/qtuimod.sip new file mode 100644 index 00000000..f6616b0e --- /dev/null +++ b/python/pyqt/sip/qtui/qtuimod.sip @@ -0,0 +1,71 @@ +// This is the SIP interface definition for the qtui module of PyQt. Thanks to +// Hans-Peter Jansen for the original work. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtui 1 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qwidgetfactory.sip + + +// The build file template. + +%Makefile qtui.pro.in +# The project file for the qtui module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @PYQT_QUI_LIB@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End diff --git a/python/pyqt/sip/qtui/qwidgetfactory.sip b/python/pyqt/sip/qtui/qwidgetfactory.sip new file mode 100644 index 00000000..b011658e --- /dev/null +++ b/python/pyqt/sip/qtui/qwidgetfactory.sip @@ -0,0 +1,63 @@ +// This is the SIP interface definition for QWidgetFactory. Thanks to +// Hans-Peter Jansen for the original work. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QWidgetFactory (Qt v3+)</Title> +<Para> +<Literal>QWidgetFactory</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_3_0_0 -) + +class QWidgetFactory +{ +%TypeHeaderCode +#include <qwidgetfactory.h> +%End + +public: + QWidgetFactory(); + virtual ~QWidgetFactory(); + + static QWidget *create(const QString &,QObject * = 0, + QWidget * /TransferThis/ = 0, + const char * = 0) /Factory/; + static QWidget *create(QIODevice *,QObject * = 0, + QWidget * /TransferThis/ = 0, + const char * = 0) /Factory/; + static void addWidgetFactory(QWidgetFactory * /Transfer/); + static void loadImages(const QString &); + + virtual QWidget *createWidget(const QString &,QWidget * /TransferThis/, + const char *) const /Factory/; + +%If (Qt_3_1_0 -) + static QStringList widgets(); + static bool supportsWidget(const QString &); +%End +}; + +%End diff --git a/python/pyqt/sip/qtxml/copying.sip b/python/pyqt/sip/qtxml/copying.sip new file mode 100644 index 00000000..463904b2 --- /dev/null +++ b/python/pyqt/sip/qtxml/copying.sip @@ -0,0 +1,51 @@ +// This is the SIP file defining the PyQt license. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Copying +Copyright (c) 2007 + Riverbank Computing Limited <info@riverbankcomputing.co.uk> + +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. +%End + + +%OptionalInclude pyqt-internal.sip +%OptionalInclude pyqt-gpl.sip +%OptionalInclude pyqt-commercial.sip +%OptionalInclude pyqt-edu.sip +%OptionalInclude pyqt-eval.sip +%OptionalInclude pyqt-nc.sip +%OptionalInclude pyqt-tkc.sip diff --git a/python/pyqt/sip/qtxml/qdom.sip b/python/pyqt/sip/qtxml/qdom.sip new file mode 100644 index 00000000..ed87b0ae --- /dev/null +++ b/python/pyqt/sip/qtxml/qdom.sip @@ -0,0 +1,866 @@ +// This is the SIP interface definition for the QDom classes. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%ExportedDoc +<Sect2><Title>QDomImplementation (Qt v2.2+)</Title> +<Para> +<Literal>QDomImplementation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNode (Qt v2.2+)</Title> +<Para> +<Literal>QDomNode</Literal> is fully implemented, including the Python +<Literal>==</Literal> and <Literal>!=</Literal> operators. +</Para> +</Sect2> + +<Sect2><Title>QDomNodeList (Qt v2.2+)</Title> +<Para> +<Literal>QDomNodeList</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomDocument (Qt v2.2+)</Title> +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QCString &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QByteArray &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QString &<Parameter>text</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>text</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QIODevice *<Parameter>dev</Parameter></ParamDef> + <ParamDef>bool <Parameter>namespaceProcessing</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>dev</Literal> and +<Literal>namespaceProcessing</Literal> parameters and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QCString &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QByteArray &<Parameter>buffer</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>buffer</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QString &<Parameter>text</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>text</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>const QIODevice *<Parameter>dev</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +This takes the <Literal>dev</Literal> parameter only and returns a tuple +containing the <Literal>bool</Literal> result and the +<Literal>errorMsg</Literal>, <Literal>errorLine</Literal> and +<Literal>errorColumn</Literal> values. (Qt v3+) +</Para> + +<FuncSynopsis> + <FuncDef>bool <Function>setContent</Function></FuncDef> + <ParamDef>QXmlInputSource *<Parameter>source</Parameter></ParamDef> + <ParamDef>QXmlReader *<Parameter>reader</Parameter></ParamDef> + <ParamDef>QString *<Parameter>errorMsg</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorLine</Parameter> = 0</ParamDef> + <ParamDef>int *<Parameter>errorColumn</Parameter> = 0</ParamDef> +</FuncSynopsis> +<Para> +Not yet implemented. (Qt v3.2.0+) +</Para> +</Sect2> + +<Sect2><Title>QDomDocumentFragment (Qt v2.2+)</Title> +<Para> +<Literal>QDomDocumentFragment</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomDocumentType (Qt v2.2+)</Title> +<Para> +<Literal>QDomDocumentType</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNamedNodeMap (Qt v2.2+)</Title> +<Para> +<Literal>QDomNamedNodeMap</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomCharacterData (Qt v2.2+)</Title> +<Para> +<Literal>QDomCharacterData</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomAttr (Qt v2.2+)</Title> +<Para> +<Literal>QDomAttr</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomElement (Qt v2.2+)</Title> +<Para> +<Literal>QDomElement</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomText (Qt v2.2+)</Title> +<Para> +<Literal>QDomText</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomComment (Qt v2.2+)</Title> +<Para> +<Literal>QDomComment</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomCDATASection (Qt v2.2+)</Title> +<Para> +<Literal>QDomCDATASection</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomNotation (Qt v2.2+)</Title> +<Para> +<Literal>QDomNotation</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomEntity (Qt v2.2+)</Title> +<Para> +<Literal>QDomEntity</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomEntityReference (Qt v2.2+)</Title> +<Para> +<Literal>QDomEntityReference</Literal> is fully implemented. +</Para> +</Sect2> + +<Sect2><Title>QDomProcessingInstruction (Qt v2.2+)</Title> +<Para> +<Literal>QDomProcessingInstruction</Literal> is fully implemented. +</Para> +</Sect2> +%End + + +%If (Qt_DOM) +%If (Qt_2_2_0 -) + +class QDomImplementation +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomImplementation(); + QDomImplementation(const QDomImplementation &); + + virtual bool hasFeature(const QString &,const QString &); +%If (Qt_3_0_0 -) + virtual QDomDocumentType createDocumentType(const QString &, + const QString &, + const QString &); + virtual QDomDocument createDocument(const QString &,const QString &, + const QDomDocumentType &); +%End + bool isNull(); +}; + + +class QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + enum NodeType { + ElementNode, + AttributeNode, + TextNode, + CDATASectionNode, + EntityReferenceNode, + EntityNode, + ProcessingInstructionNode, + CommentNode, + DocumentNode, + DocumentTypeNode, + DocumentFragmentNode, + NotationNode, + BaseNode, + CharacterDataNode + }; + + QDomNode(); + QDomNode(const QDomNode &); + + bool operator==(const QDomNode &) const; + bool operator!=(const QDomNode &) const; + + virtual QDomNode insertBefore(const QDomNode &,const QDomNode &); + virtual QDomNode insertAfter(const QDomNode &,const QDomNode &); + virtual QDomNode replaceChild(const QDomNode &,const QDomNode &); + virtual QDomNode removeChild(const QDomNode &); + virtual QDomNode appendChild(const QDomNode &); +%If (Qt_3_0_0 -) + virtual bool hasChildNodes() const; +%End + virtual QDomNode cloneNode(bool = 1) const; +%If (Qt_3_0_0 -) + virtual void normalize(); + virtual bool isSupported(const QString &,const QString &) const; +%End + + virtual QString nodeName() const; + virtual NodeType nodeType() const; + virtual QDomNode parentNode() const; + virtual QDomNodeList childNodes() const; + virtual QDomNode firstChild() const; + virtual QDomNode lastChild() const; + virtual QDomNode previousSibling() const; + virtual QDomNode nextSibling() const; + virtual QDomNamedNodeMap attributes() const; + virtual QDomDocument ownerDocument() const; +%If (Qt_3_0_0 -) + virtual QString namespaceURI() const; + virtual QString localName() const; + virtual bool hasAttributes() const; +%End + + virtual QString nodeValue() const; + virtual void setNodeValue(const QString &); +%If (Qt_3_0_0 -) + virtual QString prefix() const; + virtual void setPrefix(const QString &); +%End + + virtual bool isAttr() const; + virtual bool isCDATASection() const; + virtual bool isDocumentFragment() const; + virtual bool isDocument() const; + virtual bool isDocumentType() const; + virtual bool isElement() const; + virtual bool isEntityReference() const; + virtual bool isText() const; + virtual bool isEntity() const; + virtual bool isNotation() const; + virtual bool isProcessingInstruction() const; + virtual bool isCharacterData() const; + virtual bool isComment() const; + + QDomNode namedItem(const QString &) const; + + bool isNull() const; + void clear(); + + QDomAttr toAttr(); + QDomCDATASection toCDATASection(); + QDomDocumentFragment toDocumentFragment(); + QDomDocument toDocument(); + QDomDocumentType toDocumentType(); + QDomElement toElement(); + QDomEntityReference toEntityReference(); + QDomText toText(); + QDomEntity toEntity(); + QDomNotation toNotation(); + QDomProcessingInstruction toProcessingInstruction(); + QDomCharacterData toCharacterData(); + QDomComment toComment(); + + void save(QTextStream &,int) const; +}; + + +class QDomNodeList +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomNodeList(); + QDomNodeList(const QDomNodeList &); + + virtual QDomNode item(int) const; + + virtual uint length() const; + uint count() const; +}; + + +class QDomDocumentType : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomDocumentType(); + QDomDocumentType(const QDomDocumentType &); + + virtual QString name() const; + virtual QDomNamedNodeMap entities() const; + virtual QDomNamedNodeMap notations() const; +%If (Qt_3_0_0 -) + virtual QString publicId() const; + virtual QString systemId() const; + virtual QString internalSubset() const; +%End + + QDomNode::NodeType nodeType() const; + bool isDocumentType() const; +}; + + +class QDomDocument : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomDocument(); + QDomDocument(const QString &); +%If (Qt_3_0_0 -) + QDomDocument(const QDomDocumentType &); +%End + QDomDocument(const QDomDocument &); + + QDomElement createElement(const QString &); + QDomDocumentFragment createDocumentFragment(); + QDomText createTextNode(const QString &); + QDomComment createComment(const QString &); + QDomCDATASection createCDATASection(const QString &); + QDomProcessingInstruction createProcessingInstruction(const QString &, + const QString &); + QDomAttr createAttribute(const QString &); + QDomEntityReference createEntityReference(const QString &); + QDomNodeList elementsByTagName(const QString &) const; +%If (Qt_3_0_0 -) + QDomElement elementById(const QString &); +%End + + QDomDocumentType doctype() const; + QDomImplementation implementation() const; + QDomElement documentElement() const; + +%If (- Qt_3_0_0) + bool setContent(const QCString &); + bool setContent(const QByteArray &); + bool setContent(const QString &); + bool setContent(QIODevice *); +%End +%If (Qt_3_0_0 -) + // Note that we need handwritten code for these because of the need to + // allocate storage for the error string. + SIP_PYTUPLE setContent(const QCString &,bool); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(const QByteArray &,bool); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(const QString &,bool); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(QIODevice *,bool); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(a0,a1,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(const QCString &); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(const QByteArray &); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(const QString &); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(*a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + + SIP_PYTUPLE setContent(QIODevice *); +%MethodCode + bool res; + QString *emsg = new QString(); + int eline, ecol; + + Py_BEGIN_ALLOW_THREADS + res = sipCpp -> QDomDocument::setContent(a0,emsg,&eline,&ecol); + Py_END_ALLOW_THREADS + + sipRes = sipBuildResult(&sipIsErr,"(bNii)",res,emsg,sipClass_QString,eline,ecol); +%End + +%End + +%If (Qt_3_2_0 -) +// bool setContent(QXmlInputSource *,QXmlReader *,QString * = 0,int * = 0, +// int * = 0); +%End + + QDomNode::NodeType nodeType() const; + bool isDocument() const; + + QString toString() const; +%If (Qt_3_1_0 -) + QString toString(int) const; +%End + QCString toCString() const; +%If (Qt_3_1_0 -) + QCString toCString(int) const; +%End +}; + + +class QDomNamedNodeMap +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomNamedNodeMap(); + QDomNamedNodeMap(const QDomNamedNodeMap &); + + QDomNode namedItem(const QString &) const; + QDomNode setNamedItem(const QDomNode &); + QDomNode removeNamedItem(const QString &); + QDomNode item(int) const; +%If (Qt_3_0_0 -) + QDomNode namedItemNS(const QString &,const QString &) const; + QDomNode setNamedItemNS(const QDomNode &); + QDomNode removeNamedItemNS(const QString &,const QString &); +%End + + uint length() const; +%If (Qt_3_0_0 -) + uint count() const; +%End + + bool contains(const QString &) const; +}; + + +class QDomDocumentFragment : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomDocumentFragment(); + QDomDocumentFragment(const QDomDocumentFragment &); + + QDomNode::NodeType nodeType() const; + bool isDocumentFragment() const; +}; + + +class QDomCharacterData : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomCharacterData(); + QDomCharacterData(const QDomCharacterData &); + + virtual QString substringData(unsigned long,unsigned long); + virtual void appendData(const QString &); + virtual void insertData(unsigned long,const QString &); + virtual void deleteData(unsigned long,unsigned long); + virtual void replaceData(unsigned long,unsigned long,const QString &); + + virtual uint length() const; + + virtual QString data() const; + virtual void setData(const QString &); + + QDomNode::NodeType nodeType() const; + bool isCharacterData() const; +}; + + +class QDomAttr : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomAttr(); + QDomAttr(const QDomAttr&); + + virtual QString name() const; + virtual bool specified() const; +%If (Qt_3_0_0 -) + virtual QDomElement ownerElement() const; +%End + + virtual QString value() const; + virtual void setValue(const QString &); + + QDomNode::NodeType nodeType() const; + bool isAttr() const; +}; + + +class QDomElement : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomElement(); + QDomElement(const QDomElement &); + + QString attribute(const QString &, + const QString & = QString::null) const; + void setAttribute(const QString &,const QString &); + void setAttribute(const QString &,int /Constrained/); +// void setAttribute(const QString &,uint); +%If (Qt_3_2_0 -) +// void setAttribute(const QString &,long); +// void setAttribute(const QString &,ulong); +%End + void setAttribute(const QString &,double); + void removeAttribute(const QString &); + QDomAttr attributeNode(const QString &); + QDomAttr setAttributeNode(const QDomAttr &); + QDomAttr removeAttributeNode(const QDomAttr &); + virtual QDomNodeList elementsByTagName(const QString &) const; + bool hasAttribute(const QString &) const; +%If (- Qt_3_0_0) + void normalize(); +%End + +%If (Qt_3_0_0 -) + QString attributeNS(const QString,const QString &, + const QString &) const; + void setAttributeNS(const QString,const QString &,const QString &); + void setAttributeNS(const QString,const QString &,int /Constrained/); +// void setAttributeNS(const QString,const QString &,uint); +%If (Qt_3_2_0 -) +// void setAttributeNS(const QString &,const QString &,long); +// void setAttributeNS(const QString &,const QString &,ulong); +%End + void setAttributeNS(const QString,const QString &,double); + void removeAttributeNS(const QString &,const QString &); + QDomAttr attributeNodeNS(const QString &,const QString &); + QDomAttr setAttributeNodeNS(const QDomAttr &); + virtual QDomNodeList elementsByTagNameNS(const QString &, + const QString &) const; + bool hasAttributeNS(const QString &,const QString &) const; +%End + + QString tagName() const; + void setTagName(const QString &); + + QDomNamedNodeMap attributes() const; + QDomNode::NodeType nodeType() const; + bool isElement() const; + + QString text() const; +}; + + +class QDomText : QDomCharacterData +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomText(); + QDomText(const QDomText &); + + QDomText splitText(int); + + QDomNode::NodeType nodeType() const; + bool isText() const; +}; + + +class QDomComment : QDomCharacterData +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomComment(); + QDomComment(const QDomComment &); + + QDomNode::NodeType nodeType() const; + bool isComment() const; +}; + + +class QDomCDATASection : QDomText +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomCDATASection(); + QDomCDATASection(const QDomCDATASection&); + + QDomNode::NodeType nodeType() const; + bool isCDATASection() const; +}; + + +class QDomNotation : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomNotation(); + QDomNotation(const QDomNotation &); + + QString publicId() const; + QString systemId() const; + + QDomNode::NodeType nodeType() const; + bool isNotation() const; +}; + + +class QDomEntity : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomEntity(); + QDomEntity(const QDomEntity &); + + virtual QString publicId() const; + virtual QString systemId() const; + virtual QString notationName() const; + + QDomNode::NodeType nodeType() const; + bool isEntity() const; +}; + + +class QDomEntityReference : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomEntityReference(); + QDomEntityReference(const QDomEntityReference &); + + QDomNode::NodeType nodeType() const; + bool isEntityReference() const; +}; + + +class QDomProcessingInstruction : QDomNode +{ +%TypeHeaderCode +#include <qdom.h> +%End + +public: + QDomProcessingInstruction(); + QDomProcessingInstruction(const QDomProcessingInstruction &); + + virtual QString target() const; + + virtual QString data() const; + virtual void setData(const QString &); + + QDomNode::NodeType nodeType() const; + bool isProcessingInstruction() const; +}; + +%End +%End diff --git a/python/pyqt/sip/qtxml/qtxmlmod.sip b/python/pyqt/sip/qtxml/qtxmlmod.sip new file mode 100644 index 00000000..58eebf44 --- /dev/null +++ b/python/pyqt/sip/qtxml/qtxmlmod.sip @@ -0,0 +1,80 @@ +// This is the SIP interface definition for the qtxml module of PyQt. +// +// Copyright (c) 2007 +// Riverbank Computing Limited <info@riverbankcomputing.co.uk> +// +// 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. + + +%Module qtxml 0 + +%Import qt/qtmod.sip + +%Include copying.sip + + +%Include qdom.sip + + +// This is only needed on Windows to make sure that the DLL containing the C++ +// code of the main qt module is loaded before we import our own C++ code which +// has been linked against it. All other modules inherit from a class in the +// qt module which sorts it out, but this module doesn't so we add a dummy. It +// is ignored by SIP v4.x and later. +%PrePythonCode +from qt import QObject +%End + + +// The build file template. + +%Makefile qtxml.pro.in +# The project file for the qtxml module. +# +# Copyright (c) 2007 +# Riverbank Computing Limited <info@riverbankcomputing.co.uk> +# +# 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. + + +TEMPLATE = lib +TARGET = @BLX_TARGET_LIB@ +DESTDIR = @PYQT_MODDIR@ +CONFIG += @BLX_CONFIG_LIB@ @PYQT_WARN@ +INCLUDEPATH = @BLX_INCLUDEPATH@ +DEFINES = @BLX_DEFINES@ +LIBS += @PYQT_QT_MODULE@ @BLX_LIBS@ +macx:QMAKE_LFLAGS += -framework Python + +SOURCES = $B + +HEADERS = $H +%End |
