Browse Source

Initial TQt conversion

pull/1/head
Timothy Pearson 11 years ago
parent
commit
7d27356baf
  1. 4
      custom/custom.c
  2. 4
      custom/customw.c
  3. 2
      doc/html/_sources/annotations.txt
  4. 30
      doc/html/_sources/c_api.txt
  5. 2
      doc/html/_sources/directives.txt
  6. 4
      doc/html/_sources/introduction.txt
  7. 8
      doc/html/_sources/specification_files.txt
  8. 6
      doc/html/_sources/using.txt
  9. 2
      doc/html/_static/basic.css
  10. 2
      doc/html/_static/default.css
  11. 8
      doc/html/_static/jquery.js
  12. 12
      doc/html/annotations.html
  13. 14
      doc/html/build_system.html
  14. 30
      doc/html/c_api.html
  15. 4
      doc/html/command_line.html
  16. 90
      doc/html/directives.html
  17. 4
      doc/html/genindex.html
  18. 6
      doc/html/incompatibilities.html
  19. 2
      doc/html/index.html
  20. 14
      doc/html/introduction.html
  21. 2
      doc/html/searchindex.js
  22. 38
      doc/html/specification_files.html
  23. 81
      doc/html/using.html
  24. 12
      sipgen/export.c
  25. 394
      sipgen/gencode.c
  26. 4
      sipgen/lexer.c
  27. 4
      sipgen/lexer.l
  28. 2
      sipgen/main.c
  29. 62
      sipgen/parser.c
  30. 20
      sipgen/parser.h
  31. 34
      sipgen/parser.y
  32. 24
      sipgen/sip.h
  33. 56
      sipgen/transform.c
  34. 100
      siplib/qtlib.c
  35. 76
      siplib/sip.h
  36. 4
      siplib/sipint.h
  37. 118
      siplib/siplib.c
  38. 28
      siputils.py
  39. 28
      siputils.py.orig
  40. 2
      specs/aix-g++
  41. 2
      specs/aix-g++-64
  42. 4
      specs/aix-xlc
  43. 4
      specs/aix-xlc-64
  44. 2
      specs/bsdi-g++
  45. 2
      specs/cygwin-g++
  46. 2
      specs/darwin-g++
  47. 2
      specs/dgux-g++
  48. 2
      specs/freebsd-g++
  49. 2
      specs/freebsd-g++34
  50. 2
      specs/freebsd-g++40
  51. 2
      specs/freebsd-icc
  52. 2
      specs/hpux-acc
  53. 2
      specs/hpux-acc-64
  54. 2
      specs/hpux-acc-o64
  55. 2
      specs/hpux-cc
  56. 2
      specs/hpux-g++
  57. 2
      specs/hpux-g++-64
  58. 2
      specs/hpuxi-acc
  59. 2
      specs/hpuxi-acc-64
  60. 2
      specs/hurd-g++
  61. 2
      specs/irix-cc
  62. 2
      specs/irix-cc-64
  63. 2
      specs/irix-cc-o32
  64. 2
      specs/irix-g++
  65. 2
      specs/irix-g++-64
  66. 2
      specs/linux-arm-g++
  67. 2
      specs/linux-arm-thumb-g++
  68. 2
      specs/linux-armv6-g++
  69. 2
      specs/linux-cxx
  70. 2
      specs/linux-ecc-64
  71. 2
      specs/linux-g++
  72. 2
      specs/linux-g++-32
  73. 2
      specs/linux-g++-64
  74. 2
      specs/linux-icc
  75. 2
      specs/linux-kcc
  76. 2
      specs/linux-kylix
  77. 2
      specs/linux-lsb
  78. 2
      specs/linux-pgcc
  79. 2
      specs/lynxos-g++
  80. 2
      specs/macx-g++
  81. 2
      specs/macx-pbuilder
  82. 2
      specs/macx-xcode
  83. 4
      specs/macx-xlc
  84. 4
      specs/netbsd-g++
  85. 4
      specs/openbsd-g++
  86. 2
      specs/qnx-g++
  87. 2
      specs/reliant-cds
  88. 2
      specs/reliant-cds-64
  89. 2
      specs/sco-cc
  90. 2
      specs/sco-g++
  91. 2
      specs/solaris-cc
  92. 2
      specs/solaris-cc-64
  93. 2
      specs/solaris-g++
  94. 2
      specs/solaris-g++-64
  95. 2
      specs/tru64-cxx
  96. 2
      specs/tru64-g++
  97. 2
      specs/unixware-cc
  98. 2
      specs/unixware-g++
  99. 2
      specs/win32-borland
  100. 2
      specs/win32-g++
  101. 2
      specs/win32-icc
  102. 2
      specs/win32-msvc
  103. 2
      specs/win32-msvc.net
  104. 2
      specs/win32-msvc2005
  105. 2
      specs/win32-msvc2008
  106. 2
      specs/win32-watcom
  107. 2
      sphinx/annotations.rst
  108. 30
      sphinx/c_api.rst
  109. 2
      sphinx/directives.rst
  110. 4
      sphinx/introduction.rst
  111. 8
      sphinx/specification_files.rst
  112. 6
      sphinx/using.rst

4
custom/custom.c

@ -14,14 +14,14 @@ int main(int argc, char **argv)
* to be a builtin in the custom interpreter. The name of the function
* will be the name of the module with "init" prepended. The modules
* must be built as static libraries (using the -k flag to configure.py
* for SIP and PyQt).
* for SIP and PyTQt).
*/
/* The sip module will be builtin. */
extern void initsip(void);
/*
* Uncomment these (and in the structure below) to include the PyQt
* Uncomment these (and in the structure below) to include the PyTQt
* modules as builtins.
*/
/* extern void initqt(void);*/

4
custom/customw.c

@ -18,14 +18,14 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
* to be a builtin in the custom interpreter. The name of the function
* will be the name of the module with "init" prepended. The modules
* must be built as static libraries (using the -k flag to configure.py
* for SIP and PyQt).
* for SIP and PyTQt).
*/
/* The sip module will be builtin. */
extern void initsip(void);
/*
* Uncomment these (and in the structure below) to include the PyQt
* Uncomment these (and in the structure below) to include the PyTQt
* modules as builtins.
*/
/* extern void initqt(void);*/

2
doc/html/_sources/annotations.txt

@ -162,7 +162,7 @@ Argument Annotations
encoding is ``"None"`` and the ``str`` type otherwise.
Python v2 will use the ``str`` type to represent the argument if the
encoding is ``"None"`` and the ``unicode`` type otherwise.
encoding is ``"None"`` and the ``tqunicode`` type otherwise.
.. argument-annotation:: GetWrapper

30
doc/html/_sources/c_api.txt

@ -202,13 +202,13 @@ specification files.
``u`` (long) [unsigned int]
Convert a C/C++ ``unsigned int`` to a Python long.
``w`` (unicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 unicode object or a
``w`` (tqunicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 tqunicode object or a
Python v3 string object.
``x`` (unicode/string) [wchar_t \*]
``x`` (tqunicode/string) [wchar_t \*]
Convert a C/C++ ``L'\0'`` terminated wide character string to a Python
v2 unicode object or a Python v3 string object. If the string pointer
v2 tqunicode object or a Python v3 string object. If the string pointer
is ``NULL`` then the result is ``Py_None``.
``A`` (string) [char \*]
@ -272,8 +272,8 @@ specification files.
Convert a named C/C++ ``enum`` to an instance of the corresponding
Python named enum type.
``G`` (unicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python unicode
``G`` (tqunicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python tqunicode
object. If the array is ``NULL`` then the length is ignored and the
result is ``Py_None``.
@ -1124,7 +1124,7 @@ specification files.
Convert a Python string-like object of length 1 to a C/C++ ``char``
according to the encoding ``e``. ``e`` can either be ``A`` for ASCII,
``L`` for Latin-1, or ``8`` for UTF-8. For Python v2 the object may be
either a string or a unicode object that can be encoded. For Python v3
either a string or a tqunicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1182,12 +1182,12 @@ specification files.
``u`` (long) [unsigned int \*]
Convert a Python long to a C/C++ ``unsigned int``.
``w`` (unicode/string) [wchar_t \*]
Convert a Python v2 string or unicode object or a Python v3 string
``w`` (tqunicode/string) [wchar_t \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
object of length 1 to a C/C++ wide character.
``x`` (unicode/string) [wchar_t \*\*]
Convert a Python v2 string or unicode object or a Python v3 string
``x`` (tqunicode/string) [wchar_t \*\*]
Convert a Python v2 string or tqunicode object or a Python v3 string
object to a C/C++ ``L'\0'`` terminated wide character string. If the
Python object is ``Py_None`` then the string is ``NULL``.
@ -1199,7 +1199,7 @@ specification files.
identifies the object in the context defined by the ``S`` format
character and allows an extra reference to the object to be kept to
ensure that the string remains valid. For Python v2 the object may be
either a string or a unicode object that can be encoded. For Python v3
either a string or a tqunicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1258,8 +1258,8 @@ specification files.
``F`` (wrapped enum) [:ctype:`sipTypeDef` \*, enum \*]
Convert a Python named enum type to the corresponding C/C++ ``enum``.
``G`` (unicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or unicode object or a Python v3 string
``G`` (tqunicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
object to a C/C++ wide character array and its length. If the Python
object is ``Py_None`` then the array and length are ``NULL`` and zero
respectively.
@ -1696,7 +1696,7 @@ name prefixed by ``sip``. For example, the derived class for class ``Klass``
is ``sipKlass``.
If a C++ class doesn't have any virtual or protected methods in it or any of
it's super-class hierarchy, or does not emit any Qt signals, then a derived
it's super-class hierarchy, or does not emit any Qt Q_SIGNALS, then a derived
class is not generated.
Most of the time handwritten code should ignore the derived classes. The only

2
doc/html/_sources/directives.txt

@ -515,7 +515,7 @@ the correct type prior to conversion.
When used as part of a class specification it can automatically convert
additional types of Python object. For example, PyQt uses it in the
specification of the ``QString`` class to allow Python string objects and
unicode objects to be used wherever ``QString`` instances are expected.
tqunicode objects to be used wherever ``QString`` instances are expected.
The following variables are made available to the handwritten code:

4
doc/html/_sources/introduction.txt

@ -74,7 +74,7 @@ SIP, and the bindings it produces, have the following features:
- support for C++ exceptions and wrapping them as Python exceptions
- the automatic generation of complementary rich comparison slots
- the automatic generation of complementary rich comparison Q_SLOTS
- support for deprecation warnings
@ -164,6 +164,6 @@ toolkit.
The SIP code generator understands the signal/slot type safe callback mechanism
that Qt uses to connect objects together. This allows applications to define
new Python signals, and allows any Python callable object to be used as a slot.
new Python Q_SIGNALS, and allows any Python callable object to be used as a slot.
SIP itself does not require Qt to be installed.

8
doc/html/_sources/specification_files.txt

@ -130,15 +130,15 @@ file.
*class-variable* |
**public:** |
**public Q_SLOTS:** |
**public slots:** |
**public Q_SLOTS:** |
**protected:** |
**protected Q_SLOTS:** |
**protected slots:** |
**protected Q_SLOTS:** |
**private:** |
**private Q_SLOTS:** |
**private slots:** |
**private Q_SLOTS:** |
**Q_SIGNALS:** |
**signals:**]
**Q_SIGNALS:**]
*constructor* ::= [**explicit**] *name* **(** [*argument-list*] **)**
[*exceptions*] [*function-annotations*]

6
doc/html/_sources/using.txt

@ -284,7 +284,7 @@ previous examples.
instance being constructed has a parent) then ownership of the instance
is transferred from Python to C++. It is needed because Qt maintains
objects (i.e. instances derived from the ``QObject`` class) in a
hierachy. When an object is destroyed all of its children are also
hierachy. When an object is destroyed all of its tqchildren are also
automatically destroyed. It is important, therefore, that the Python
garbage collector doesn't also try and destroy them. This is covered in
more detail in :ref:`ref-object-ownership`. SIP provides many other
@ -552,8 +552,8 @@ Support for Wide Characters
---------------------------
SIP v4.6 introduced support for wide characters (i.e. the ``wchar_t`` type).
Python's C API includes support for converting between unicode objects and wide
character strings and arrays. When converting from a unicode object to wide
Python's C API includes support for converting between tqunicode objects and wide
character strings and arrays. When converting from a tqunicode object to wide
characters SIP creates the string or array on the heap (using memory allocated
using :cfunc:`sipMalloc()`). This then raises the problem of how this memory
is subsequently freed.

2
doc/html/_static/basic.css

@ -3,7 +3,7 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* -- main layout ----------------------------------------------------------- */
/* -- main tqlayout ----------------------------------------------------------- */
div.clearer {
clear: both;

2
doc/html/_static/default.css

@ -5,7 +5,7 @@
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
/* -- page tqlayout ----------------------------------------------------------- */
body {
font-family: sans-serif;

8
doc/html/_static/jquery.js vendored

@ -1039,7 +1039,7 @@ jQuery.extend({
// IE uses filters for opacity
if ( !jQuery.support.opacity && name == "opacity" ) {
if ( set ) {
// IE has trouble with opacity if it does not have layout
// IE has trouble with opacity if it does not have tqlayout
// Force it by setting the zoom level
elem.zoom = 1;
@ -1182,7 +1182,7 @@ jQuery.each({
nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
children: function(elem){return jQuery.sibling(elem.firstChild);},
tqchildren: function(elem){return jQuery.sibling(elem.firstChild);},
contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
}, function(name, fn){
jQuery.fn[ name ] = function( selector ) {
@ -1250,7 +1250,7 @@ jQuery.each({
empty: function() {
// Remove element nodes and prevent memory leaks
jQuery(this).children().remove();
jQuery(this).tqchildren().remove();
// Remove any remaining nodes
while ( this.firstChild )
@ -2202,7 +2202,7 @@ if ( document.querySelectorAll ) (function(){
var oldSizzle = Sizzle, div = document.createElement("div");
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or unicode characters when
// Safari can't handle uppercase or tqunicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;

12
doc/html/annotations.html

@ -82,16 +82,16 @@ within the range if it is greater or equal to the lower bound and less
than the upper bound. Each bound can be omitted meaning that the range is
unbounded in that direction.</p>
<p>For example:</p>
<div class="last highlight-python"><pre># This is part of the PyQt4 API up to but excluding v2.
void hex() /API=PyQt4:-2/
<div class="last highlight-python"><pre># This is part of the PyTQt4 API up to but excluding v2.
void hex() /API=PyTQt4:-2/
# This is part of the PyQt4 API starting from v2.
void hex() /PyName=hex_, API=PyQt4:2-/</pre>
# This is part of the PyTQt4 API starting from v2.
void hex() /PyName=hex_, API=PyTQt4:2-/</pre>
</div>
</dd>
</dl>
<p>The following example shows argument and function annotations:</p>
<div class="highlight-python"><pre>void exec(QWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/;</pre>
<div class="highlight-python"><pre>void exec(TQWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/;</pre>
</div>
<p>Note that the current version of SIP does not complain about unknown
annotations, or annotations used out of their correct context.</p>
@ -191,7 +191,7 @@ directive. If the directive is not specified then <tt class="xref docutils lite
<p>Python v3 will use the <tt class="docutils literal"><span class="pre">bytes</span></tt> type to represent the argument if the
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">str</span></tt> type otherwise.</p>
<p>Python v2 will use the <tt class="docutils literal"><span class="pre">str</span></tt> type to represent the argument if the
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">unicode</span></tt> type otherwise.</p>
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">tqunicode</span></tt> type otherwise.</p>
</dd></dl>
<dl class="argument-annotation">

14
doc/html/build_system.html

@ -56,18 +56,18 @@ care of the details of particular combinations of platform and compiler. It
supports over 50 different platform/compiler combinations.</p>
<p>The build system is implemented as a pure Python module called <tt class="xref docutils literal"><span class="pre">sipconfig</span></tt>
that contains a number of classes and functions. Using this module you can
write bespoke configuration scripts (e.g. PyQt&#8217;s <tt class="docutils literal"><span class="pre">configure.py</span></tt>) or use it
write bespoke configuration scripts (e.g. PyTQt&#8217;s <tt class="docutils literal"><span class="pre">configure.py</span></tt>) or use it
with other Python based build systems (e.g.
<a class="reference external" href="http://www.python.org/sigs/distutils-sig/distutils.html">Distutils</a> and
<a class="reference external" href="http://www.scons.org">SCons</a>).</p>
<p>An important feature of SIP is the ability to generate bindings that are built
on top of existing bindings. For example, both
<a class="reference external" href="http://www.riverbankcomputing.com/software/pykde/">PyKDE</a> and
<a class="reference external" href="http://pyqwt.sourceforge.net/">PyQwt</a> are built on top of PyQt but all three
packages are maintained by different developers. To make this easier PyQt
<a class="reference external" href="http://pyqwt.sourceforge.net/">PyQwt</a> are built on top of PyTQt but all three
packages are maintained by different developers. To make this easier PyTQt
includes its own configuration module, <tt class="docutils literal"><span class="pre">pyqtconfig</span></tt>, that contains additional
classes intended to be used by the configuration scripts of bindings built on
top of PyQt. The SIP build system includes facilities that do a lot of the
top of PyTQt. The SIP build system includes facilities that do a lot of the
work of creating these additional configuration modules.</p>
<dl class="function">
<dt id="sipconfig.create_config_module">
@ -551,12 +551,12 @@ and <tt class="docutils literal"><span class="pre">BMAKE</span></tt>.</dd></dl>
<a title="sipconfig.Configuration" class="reference internal" href="#sipconfig.Configuration"><tt class="xref docutils literal"><span class="pre">Configuration</span></tt></a> class or a sub-class.</li>
<li><em>console</em> &#8211; is set if the target is a console (rather than GUI) target. This
only affects Windows and is ignored on other platforms.</li>
<li><em>qt</em> &#8211; is set if the target uses Qt. For Qt v4 a list of Qt libraries may
be specified and a simple non-zero value implies QtCore and QtGui.</li>
<li><em>qt</em> &#8211; is set if the target uses TQt. For TQt v4 a list of TQt libraries may
be specified and a simple non-zero value implies TQtCore and TQtGui.</li>
<li><em>opengl</em> &#8211; is set if the target uses OpenGL.</li>
<li><em>python</em> &#8211; is set if the target uses Python.h.</li>
<li><em>threaded</em> &#8211; is set if the target requires thread support. It is set
automatically if the target uses Qt and Qt has thread support
automatically if the target uses TQt and TQt has thread support
enabled.</li>
<li><em>warnings</em> &#8211; is set if compiler warning messages should be enabled. The default
of <tt class="xref docutils literal"><span class="pre">None</span></tt> means that warnings are enabled for SIP v4.x and

30
doc/html/c_api.html

@ -261,12 +261,12 @@ the result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt> to a Python long.</dd>
<dt><tt class="docutils literal"><span class="pre">u</span></tt> (long) [unsigned int]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt> to a Python long.</dd>
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (unicode/string) [wchar_t]</dt>
<dd>Convert a C/C++ wide character to a Python v2 unicode object or a
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (tqunicode/string) [wchar_t]</dt>
<dd>Convert a C/C++ wide character to a Python v2 tqunicode object or a
Python v3 string object.</dd>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (unicode/string) [wchar_t *]</dt>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (tqunicode/string) [wchar_t *]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">L'\0'</span></tt> terminated wide character string to a Python
v2 unicode object or a Python v3 string object. If the string pointer
v2 tqunicode object or a Python v3 string object. If the string pointer
is <tt class="docutils literal"><span class="pre">NULL</span></tt> then the result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">A</span></tt> (string) [char *]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">'\0'</span></tt> terminated string to a Python v2 or v3 string
@ -329,8 +329,8 @@ Python named enum type.</p>
<dt><tt class="docutils literal"><span class="pre">F</span></tt> (wrapped enum) [enum, <tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *]</dt>
<dd>Convert a named C/C++ <tt class="docutils literal"><span class="pre">enum</span></tt> to an instance of the corresponding
Python named enum type.</dd>
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (unicode) [wchar_t *, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a>]</dt>
<dd>Convert a C/C++ wide character array and its length to a Python unicode
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (tqunicode) [wchar_t *, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a>]</dt>
<dd>Convert a C/C++ wide character array and its length to a Python tqunicode
object. If the array is <tt class="docutils literal"><span class="pre">NULL</span></tt> then the length is ignored and the
result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">N</span></tt> (wrapped instance) [<em>type</em> *, <tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *, PyObject *]</dt>
@ -1428,7 +1428,7 @@ to be passed.</p>
<dd>Convert a Python string-like object of length 1 to a C/C++ <tt class="docutils literal"><span class="pre">char</span></tt>
according to the encoding <tt class="docutils literal"><span class="pre">e</span></tt>. <tt class="docutils literal"><span class="pre">e</span></tt> can either be <tt class="docutils literal"><span class="pre">A</span></tt> for ASCII,
<tt class="docutils literal"><span class="pre">L</span></tt> for Latin-1, or <tt class="docutils literal"><span class="pre">8</span></tt> for UTF-8. For Python v2 the object may be
either a string or a unicode object that can be encoded. For Python v3
either a string or a tqunicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.</dd>
<dt><tt class="docutils literal"><span class="pre">b</span></tt> (integer) [bool *]</dt>
@ -1472,11 +1472,11 @@ then the string is <tt class="docutils literal"><span class="pre">NULL</span></t
<dd>Convert a Python long to a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">u</span></tt> (long) [unsigned int *]</dt>
<dd>Convert a Python long to a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (unicode/string) [wchar_t *]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (tqunicode/string) [wchar_t *]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
object of length 1 to a C/C++ wide character.</dd>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (unicode/string) [wchar_t **]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (tqunicode/string) [wchar_t **]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
object to a C/C++ <tt class="docutils literal"><span class="pre">L'\0'</span></tt> terminated wide character string. If the
Python object is <tt class="docutils literal"><span class="pre">Py_None</span></tt> then the string is <tt class="docutils literal"><span class="pre">NULL</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">Ae</span></tt> (object) [int, const char **]</dt>
@ -1487,7 +1487,7 @@ ASCII, <tt class="docutils literal"><span class="pre">L</span></tt> for Latin-1,
identifies the object in the context defined by the <tt class="docutils literal"><span class="pre">S</span></tt> format
character and allows an extra reference to the object to be kept to
ensure that the string remains valid. For Python v2 the object may be
either a string or a unicode object that can be encoded. For Python v3
either a string or a tqunicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.</dd>
<dt><tt class="docutils literal"><span class="pre">B</span></tt> (string/bytes) [int, const char **]</dt>
@ -1548,8 +1548,8 @@ not passed if this flag is specified.</dd>
</dd>
<dt><tt class="docutils literal"><span class="pre">F</span></tt> (wrapped enum) [<tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *, enum *]</dt>
<dd>Convert a Python named enum type to the corresponding C/C++ <tt class="docutils literal"><span class="pre">enum</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (unicode/string) [wchar_t **, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a> *]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (tqunicode/string) [wchar_t **, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a> *]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
object to a C/C++ wide character array and its length. If the Python
object is <tt class="docutils literal"><span class="pre">Py_None</span></tt> then the array and length are <tt class="docutils literal"><span class="pre">NULL</span></tt> and zero
respectively.</dd>
@ -2080,7 +2080,7 @@ corresponding generated type structure (see <a class="reference internal" href="
name prefixed by <tt class="docutils literal"><span class="pre">sip</span></tt>. For example, the derived class for class <tt class="docutils literal"><span class="pre">Klass</span></tt>
is <tt class="docutils literal"><span class="pre">sipKlass</span></tt>.</p>
<p>If a C++ class doesn&#8217;t have any virtual or protected methods in it or any of
it&#8217;s super-class hierarchy, or does not emit any Qt signals, then a derived
it&#8217;s super-class hierarchy, or does not emit any TQt signals, then a derived
class is not generated.</p>
<p>Most of the time handwritten code should ignore the derived classes. The only
exception is that handwritten constructor code specified using the

4
doc/html/command_line.html

@ -70,8 +70,8 @@ is omitted then <tt class="docutils literal"><span class="pre">stdin</span></tt>
<dl class="cmdoption">
<dt id="cmdoption-sip-a">
<tt class="descname">-a</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-sip-a" title="Permalink to this definition"></a></dt>
<dd>The name of the QScintilla API file to generate. This file contains a
description of the module API in a form that the QScintilla editor
<dd>The name of the TQScintilla API file to generate. This file contains a
description of the module API in a form that the TQScintilla editor
component can use for auto-completion and call tips. (The file may also be
used by the SciTE editor but must be sorted first.) By default the file is
not generated.</dd></dl>

90
doc/html/directives.html

@ -100,7 +100,7 @@ Klass *klassInstance;
version number must be greater than or equal to 1.</p>
<p>See <a class="reference external" href="using.html#ref-incompat-apis"><em>Managing Incompatible APIs</em></a> for more detail.</p>
<p>For example:</p>
<div class="highlight-python"><pre>%API PyQt4 1</pre>
<div class="highlight-python"><pre>%API PyTQt4 1</pre>
</div>
<dl class="directive">
<dt id="directive-%BIGetBufferCode">
@ -313,9 +313,9 @@ same name.</p>
subsequent <a class="reference internal" href="#directive-%CModule"><tt class="xref docutils literal"><span class="pre">%CModule</span></tt></a> or <a class="reference internal" href="#directive-%Module"><tt class="xref docutils literal"><span class="pre">%Module</span></tt></a> directive is
interpreted as defining a component module.</p>
<p>For example:</p>
<div class="highlight-python"><pre>%CompositeModule PyQt4.Qt
%Include QtCore/QtCoremod.sip
%Include QtGui/QtGuimod.sip</pre>
<div class="highlight-python"><pre>%CompositeModule PyTQt4.TQt
%Include TQtCore/TQtCoremod.sip
%Include TQtGui/TQtGuimod.sip</pre>
</div>
<p>The main purpose of a composite module is as a programmer convenience as they
don&#8217;t have to remember which which individual module an object is defined in.</p>
@ -333,9 +333,9 @@ SIP generated modules (refered to as component modules in this context).</p>
subsequent <a class="reference internal" href="#directive-%CModule"><tt class="xref docutils literal"><span class="pre">%CModule</span></tt></a> or <a class="reference internal" href="#directive-%Module"><tt class="xref docutils literal"><span class="pre">%Module</span></tt></a> directive is
interpreted as defining a component module.</p>
<p>For example:</p>
<div class="highlight-python"><pre>%ConsolidatedModule PyQt4._qt
%Include QtCore/QtCoremod.sip
%Include QtGui/QtGuimod.sip</pre>
<div class="highlight-python"><pre>%ConsolidatedModule PyTQt4._qt
%Include TQtCore/TQtCoremod.sip
%Include TQtGui/TQtGuimod.sip</pre>
</div>
<p>A consolidated module is not intended to be explicitly imported by an
application. Instead it is imported by its component modules when they
@ -380,8 +380,8 @@ made to each element of the list.</dd>
</dl>
<p>The handwritten code must explicitly return a <tt class="docutils literal"><span class="pre">PyObject</span> <span class="pre">*</span></tt>. If there was an
error then a Python exception must be raised and <tt class="docutils literal"><span class="pre">NULL</span></tt> returned.</p>
<p>The following example converts a <tt class="docutils literal"><span class="pre">QList&lt;QWidget</span> <span class="pre">*&gt;</span></tt> instance to a Python
list of <tt class="docutils literal"><span class="pre">QWidget</span></tt> instances:</p>
<p>The following example converts a <tt class="docutils literal"><span class="pre">TQList&lt;TQWidget</span> <span class="pre">*&gt;</span></tt> instance to a Python
list of <tt class="docutils literal"><span class="pre">TQWidget</span></tt> instances:</p>
<div class="highlight-python"><pre>%ConvertFromTypeCode
PyObject *l;
@ -390,15 +390,15 @@ list of <tt class="docutils literal"><span class="pre">QWidget</span></tt> insta
return NULL;
// Go through each element in the C++ instance and convert it to a
// wrapped QWidget.
// wrapped TQWidget.
for (int i = 0; i &lt; sipCpp-&gt;size(); ++i)
{
QWidget *w = sipCpp-&gt;at(i);
TQWidget *w = sipCpp-&gt;at(i);
PyObject *wobj;
// Get the Python wrapper for the QWidget instance, creating a new
// Get the Python wrapper for the TQWidget instance, creating a new
// one if necessary, and handle any ownership transfer.
if ((wobj = sipConvertFromType(w, sipType_QWidget, sipTransferObj)) == NULL)
if ((wobj = sipConvertFromType(w, sipType_TQWidget, sipTransferObj)) == NULL)
{
// There was an error so garbage collect the Python list.
Py_DECREF(l);
@ -469,21 +469,21 @@ it can.</p>
</dd>
</dl>
<p>The handwritten code must not explicitly return.</p>
<p>The following example shows the sub-class conversion code for <tt class="docutils literal"><span class="pre">QEvent</span></tt> based
class hierarchy in PyQt:</p>
<div class="highlight-python"><pre>class QEvent
<p>The following example shows the sub-class conversion code for <tt class="docutils literal"><span class="pre">TQEvent</span></tt> based
class hierarchy in PyTQt:</p>
<div class="highlight-python"><pre>class TQEvent
{
%ConvertToSubClassCode
// QEvent sub-classes provide a unique type ID.
// TQEvent sub-classes provide a unique type ID.
switch (sipCpp-&gt;type())
{
case QEvent::Timer:
sipType = sipType_QTimerEvent;
case TQEvent::Timer:
sipType = sipType_TQTimerEvent;
break;
case QEvent::KeyPress:
case QEvent::KeyRelease:
sipType = sipType_QKeyEvent;
case TQEvent::KeyPress:
case TQEvent::KeyRelease:
sipType = sipType_TQKeyEvent;
break;
// Skip the remaining event types to keep the example short.
@ -514,9 +514,9 @@ used as part of the <a class="reference internal" href="#directive-%MappedType">
specification. The code is also called to determine if the Python object is of
the correct type prior to conversion.</p>
<p>When used as part of a class specification it can automatically convert
additional types of Python object. For example, PyQt uses it in the
specification of the <tt class="docutils literal"><span class="pre">QString</span></tt> class to allow Python string objects and
unicode objects to be used wherever <tt class="docutils literal"><span class="pre">QString</span></tt> instances are expected.</p>
additional types of Python object. For example, PyTQt uses it in the
specification of the <tt class="docutils literal"><span class="pre">TQString</span></tt> class to allow Python string objects and
tqunicode objects to be used wherever <tt class="docutils literal"><span class="pre">TQString</span></tt> instances are expected.</p>
<p>The following variables are made available to the handwritten code:</p>
<dl class="docutils">
<dt>int *sipIsErr</dt>
@ -554,8 +554,8 @@ returned instance is a derived class. See
<a class="reference external" href="c_api.html#ref-derived-classes"><em>Generated Derived Classes</em></a>.</li>
</ul>
</blockquote>
<p>The following example converts a Python list of <tt class="docutils literal"><span class="pre">QPoint</span></tt> instances to a
<tt class="docutils literal"><span class="pre">QList&lt;QPoint&gt;</span></tt> instance:</p>
<p>The following example converts a Python list of <tt class="docutils literal"><span class="pre">TQPoint</span></tt> instances to a
<tt class="docutils literal"><span class="pre">TQList&lt;TQPoint&gt;</span></tt> instance:</p>
<div class="highlight-python"><pre>%ConvertToTypeCode
// See if we are just being asked to check the type of the Python
// object.
@ -567,11 +567,11 @@ returned instance is a derived class. See
return 0;
// Check the type of each element. We specify SIP_NOT_NONE to
// disallow None because it is a list of QPoint, not of a pointer
// to a QPoint, so None isn't appropriate.
// disallow None because it is a list of TQPoint, not of a pointer
// to a TQPoint, so None isn't appropriate.
for (int i = 0; i &lt; PyList_GET_SIZE(sipPy); ++i)
if (!sipCanConvertToType(PyList_GET_ITEM(sipPy, i),
sipType_QPoint, SIP_NOT_NONE))
sipType_TQPoint, SIP_NOT_NONE))
return 0;
// The type is valid.
@ -579,26 +579,26 @@ returned instance is a derived class. See
}
// Create the instance on the heap.
QList&lt;QPoint&gt; *ql = new QList&lt;QPoint&gt;;
TQList&lt;TQPoint&gt; *ql = new TQList&lt;TQPoint&gt;;
for (int i = 0; i &lt; PyList_GET_SIZE(sipPy); ++i)
{
QPoint *qp;
TQPoint *qp;
int state;
// Get the address of the element's C++ instance. Note that, in
// this case, we don't apply any ownership changes to the list
// elements, only to the list itself.
qp = reinterpret_cast&lt;QPoint *&gt;(sipConvertToType(
qp = reinterpret_cast&lt;TQPoint *&gt;(sipConvertToType(
PyList_GET_ITEM(sipPy, i),
sipType_QPoint, 0,
sipType_TQPoint, 0,
SIP_NOT_NONE,
&amp;state, sipIsErr));
// Deal with any errors.
if (*sipIsErr)
{
sipReleaseType(qp, sipType_QPoint, state);
sipReleaseType(qp, sipType_TQPoint, state);
// Tidy up.
delete ql;
@ -609,11 +609,11 @@ returned instance is a derived class. See
ql-&gt;append(*qp);
// A copy of the QPoint was appended to the list so we no longer
// A copy of the TQPoint was appended to the list so we no longer
// need it. It may be a temporary instance that should be
// destroyed, or a wrapped instance that should not be destroyed.
// sipReleaseType() will do the right thing.
sipReleaseType(qp, sipType_QPoint, state);
sipReleaseType(qp, sipType_TQPoint, state);
}
// Return the instance.
@ -685,7 +685,7 @@ modules, that doesn&#8217;t have an explicit meta-type.</p>
meta-type used by a particular C/C++ type.</p>
<p>See the section <a class="reference external" href="using.html#ref-types-metatypes"><em>Types and Meta-types</em></a> for more details.</p>
<p>For example:</p>
<div class="highlight-python"><pre>%DefaultMetatype PyQt4.QtCore.pyqtWrapperType</pre>
<div class="highlight-python"><pre>%DefaultMetatype PyTQt4.TQtCore.pyqtWrapperType</pre>
</div>
<dl class="directive">
<dt id="directive-%DefaultSupertype">
@ -916,8 +916,8 @@ pointer to the structure or class.</dd>
<dt>int sipRes</dt>
<dd>The handwritten code should set this to the result to be returned.</dd>
</dl>
<p>The following simplified example is taken from PyQt. The <tt class="docutils literal"><span class="pre">QCustomEvent</span></tt>
class allows arbitary data to be attached to the event. In PyQt this data is
<p>The following simplified example is taken from PyTQt. The <tt class="docutils literal"><span class="pre">TQCustomEvent</span></tt>
class allows arbitary data to be attached to the event. In PyTQt this data is
always a Python object and so should be handled by the garbage collector:</p>
<div class="highlight-python"><pre>%GCClearCode
PyObject *obj;
@ -961,7 +961,7 @@ collector.</dd>
<dt>int sipRes</dt>
<dd>The handwritten code should set this to the result to be returned.</dd>
</dl>
<p>The following simplified example is taken from PyQt&#8217;s <tt class="docutils literal"><span class="pre">QCustomEvent</span></tt> class:</p>
<p>The following simplified example is taken from PyTQt&#8217;s <tt class="docutils literal"><span class="pre">TQCustomEvent</span></tt> class:</p>
<div class="highlight-python"><pre>%GCTraverseCode
PyObject *obj;
@ -1245,7 +1245,7 @@ the handwritten code that converts an instance of the mapped type to a Python
object.</p>
<p>For example:</p>
<div class="highlight-python"><pre>template&lt;Type *&gt;
%MappedType QList
%MappedType TQList
{
%TypeHeaderCode
// Include the library interface to the type being mapped.
@ -1272,7 +1272,7 @@ object.</p>
}
// Create the instance on the heap.
QList&lt;Type *&gt; *ql = new QList&lt;Type *&gt;;
TQList&lt;Type *&gt; *ql = new TQList&lt;Type *&gt;;
for (int i = 0; i &lt; PyList_GET_SIZE(sipPy); ++i)
{
@ -1333,9 +1333,9 @@ object.</p>
%End
}</pre>
</div>
<p>Using this we can use, for example, <tt class="docutils literal"><span class="pre">QList&lt;QObject</span> <span class="pre">*&gt;</span></tt> throughout the
<p>Using this we can use, for example, <tt class="docutils literal"><span class="pre">TQList&lt;TQObject</span> <span class="pre">*&gt;</span></tt> throughout the
module&#8217;s specification files (and in any module that imports this one). The
generated code will automatically map this to and from a Python list of QObject
generated code will automatically map this to and from a Python list of TQObject
instances when appropriate.</p>
<dl class="directive">
<dt id="directive-%MethodCode">

4
doc/html/genindex.html

@ -569,7 +569,7 @@
<dt><a href="command_line.html#cmdoption-sip-x">-x &lt;FEATURE&gt;</a></dt>
<dt><a href="command_line.html#cmdoption-sip-z">-z &lt;FILE&gt;</a></dt>
</dl></dd>
<dt><a href="specification_files.html#stype-SIP_ANYSLOT">SIP_ANYSLOT (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_ANYSLOT">SIP_ANYTQT_SLOT (SIP type)</a></dt>
<dt><a href="c_api.html#SIP_API_MAJOR_NR">SIP_API_MAJOR_NR (C macro)</a></dt>
<dt><a href="c_api.html#SIP_API_MINOR_NR">SIP_API_MINOR_NR (C macro)</a></dt>
<dt><a href="build_system.html#sipconfig.Configuration.sip_bin">sip_bin (sipconfig.Configuration attribute)</a></dt>
@ -587,7 +587,7 @@
<dt><a href="specification_files.html#stype-SIP_PYSLICE">SIP_PYSLICE (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_PYTUPLE">SIP_PYTUPLE (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_PYTYPE">SIP_PYTYPE (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_QOBJECT">SIP_QOBJECT (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_TQOBJECT">SIP_TQOBJECT (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_RXOBJ_CON">SIP_RXOBJ_CON (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_RXOBJ_DIS">SIP_RXOBJ_DIS (SIP type)</a></dt>
<dt><a href="specification_files.html#stype-SIP_SIGNAL">SIP_SIGNAL (SIP type)</a></dt>

6
doc/html/incompatibilities.html

@ -102,8 +102,8 @@ from <a title="sipBuildResult" class="reference external" href="c_api.html#sipBu
been removed.</p>
</div>
<div class="section" id="removal-of-pyqt-specific-features">
<h3>Removal of PyQt-specific Features<a class="headerlink" href="#removal-of-pyqt-specific-features" title="Permalink to this headline"></a></h3>
<p>The following PyQt-specific support functions have been removed.</p>
<h3>Removal of PyTQt-specific Features<a class="headerlink" href="#removal-of-pyqt-specific-features" title="Permalink to this headline"></a></h3>
<p>The following PyTQt-specific support functions have been removed.</p>
<ul class="simple">
<li><tt class="xref docutils literal"><span class="pre">sipConnectRx()</span></tt></li>
<li><tt class="xref docutils literal"><span class="pre">sipDisconnectRx()</span></tt></li>
@ -210,7 +210,7 @@ still supported).</p>
<li><a class="reference external" href="#truediv">__truediv__</a></li>
<li><a class="reference external" href="#sipwrapper-user-member">sipWrapper user Member</a></li>
<li><a class="reference external" href="#removal-of-previously-deprecated-features">Removal of Previously Deprecated Features</a></li>
<li><a class="reference external" href="#removal-of-pyqt-specific-features">Removal of PyQt-specific Features</a></li>
<li><a class="reference external" href="#removal-of-pyqt-specific-features">Removal of PyTQt-specific Features</a></li>
<li><a class="reference external" href="#id1">Newly Deprecated Features</a></li>
</ul>
</li>

2
doc/html/index.html

@ -51,7 +51,7 @@
<li class="toctree-l2"><a class="reference external" href="introduction.html#license">License</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#sip-components">SIP Components</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#qt-support">Qt Support</a></li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#qt-support">TQt Support</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="incompatibilities.html">Potential Incompatibilities with Earlier Versions</a><ul>

14
doc/html/introduction.html

@ -53,8 +53,8 @@
<p>This is the reference guide for SIP 4.10.5. SIP is a tool for
automatically generating <a class="reference external" href="http://www.python.org">Python</a> bindings for C and
C++ libraries. SIP was originally developed in 1998 for
<a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt">PyQt</a> - the Python
bindings for the Qt GUI toolkit - but is suitable for generating bindings for
<a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt">PyTQt</a> - the Python
bindings for the TQt GUI toolkit - but is suitable for generating bindings for
any C or C++ library.</p>
<p>This version of SIP generates bindings for Python v2.3 or later, including
Python v3.</p>
@ -163,13 +163,13 @@ needed to build the extension module. It is covered in detail in
</ul>
</div>
<div class="section" id="qt-support">
<h2>Qt Support<a class="headerlink" href="#qt-support" title="Permalink to this headline"></a></h2>
<p>SIP has specific support for the creation of bindings based on Nokia&#8217;s Qt
<h2>TQt Support<a class="headerlink" href="#qt-support" title="Permalink to this headline"></a></h2>
<p>SIP has specific support for the creation of bindings based on Nokia&#8217;s TQt
toolkit.</p>
<p>The SIP code generator understands the signal/slot type safe callback mechanism
that Qt uses to connect objects together. This allows applications to define
that TQt uses to connect objects together. This allows applications to define
new Python signals, and allows any Python callable object to be used as a slot.</p>
<p>SIP itself does not require Qt to be installed.</p>
<p>SIP itself does not require TQt to be installed.</p>
</div>
</div>
@ -185,7 +185,7 @@ new Python signals, and allows any Python callable object to be used as a slot.<
<li><a class="reference external" href="#license">License</a></li>
<li><a class="reference external" href="#features">Features</a></li>
<li><a class="reference external" href="#sip-components">SIP Components</a></li>
<li><a class="reference external" href="#qt-support">Qt Support</a></li>
<li><a class="reference external" href="#qt-support">TQt Support</a></li>
</ul>
</li>
</ul>

2
doc/html/searchindex.js

File diff suppressed because one or more lines are too long

38
doc/html/specification_files.html

@ -171,15 +171,15 @@ file.</p>
<em>virtual-operator</em> |
<em>class-variable</em> |
<strong>public:</strong> |
<strong>public Q_SLOTS:</strong> |
<strong>public slots:</strong> |
<strong>public slots:</strong> |
<strong>protected:</strong> |
<strong>protected Q_SLOTS:</strong> |
<strong>protected slots:</strong> |
<strong>protected slots:</strong> |
<strong>private:</strong> |
<strong>private Q_SLOTS:</strong> |
<strong>private slots:</strong> |
<strong>Q_SIGNALS:</strong> |
<strong>private slots:</strong> |
<strong>signals:</strong> |
<strong>signals:</strong>]
<em>constructor</em> ::= [<strong>explicit</strong>] <em>name</em> <strong>(</strong> [<em>argument-list</em>] <strong>)</strong>
@ -193,7 +193,7 @@ file.</p>
[<em>function-annotations</em>] <strong>;</strong> [<a class="reference external" href="directives.html#directive-%MethodCode"><tt class="xref docutils literal"><span class="pre">%MethodCode</span></tt></a>]
[<a class="reference external" href="directives.html#directive-%VirtualCatcherCode"><tt class="xref docutils literal"><span class="pre">%VirtualCatcherCode</span></tt></a>]
<em>method</em> ::= [<strong>Q_SIGNAL</strong>] [<strong>Q_SLOT</strong>] <em>type</em> <em>name</em> <strong>(</strong>
<em>method</em> ::= [<strong>TQ_SIGNAL</strong>] [<strong>TQ_SLOT</strong>] <em>type</em> <em>name</em> <strong>(</strong>
[<em>argument-list</em>] <strong>)</strong> [<strong>const</strong>] [<em>exceptions</em>] [<strong>= 0</strong>]
[<em>function-annotations</em>] [<em>c++-signature</em>] <strong>;</strong>
[<a class="reference external" href="directives.html#directive-%Docstring"><tt class="xref docutils literal"><span class="pre">%Docstring</span></tt></a>] [<a class="reference external" href="directives.html#directive-%MethodCode"><tt class="xref docutils literal"><span class="pre">%MethodCode</span></tt></a>]
@ -202,7 +202,7 @@ file.</p>
<em>static-method</em> ::= <strong>static</strong> <em>function</em>
<em>virtual-method</em> ::= [<strong>Q_SIGNAL</strong>] [<strong>Q_SLOT</strong>] <strong>virtual</strong> <em>type</em> <em>name</em>
<em>virtual-method</em> ::= [<strong>TQ_SIGNAL</strong>] [<strong>TQ_SLOT</strong>] <strong>virtual</strong> <em>type</em> <em>name</em>
<strong>(</strong> [<em>argument-list</em>] <strong>)</strong> [<strong>const</strong>] [<em>exceptions</em>] [<strong>= 0</strong>]
[<em>function-annotations</em>] [<em>c++-signature</em>] <strong>;</strong>
[<a class="reference external" href="directives.html#directive-%MethodCode"><tt class="xref docutils literal"><span class="pre">%MethodCode</span></tt></a>] [<a class="reference external" href="directives.html#directive-%VirtualCatcherCode"><tt class="xref docutils literal"><span class="pre">%VirtualCatcherCode</span></tt></a>]
@ -310,7 +310,7 @@ file.</p>
<em>argument</em> ::= [
<em>type</em> [<em>name</em>] [<em>argument-annotations</em>] [<em>default-value</em>] |
<a class="reference internal" href="#stype-SIP_ANYSLOT"><tt class="xref docutils literal"><span class="pre">SIP_ANYSLOT</span></tt></a> [<em>default-value</em>] |
<a class="reference internal" href="#stype-SIP_QOBJECT"><tt class="xref docutils literal"><span class="pre">SIP_QOBJECT</span></tt></a> |
<a class="reference internal" href="#stype-SIP_TQOBJECT"><tt class="xref docutils literal"><span class="pre">SIP_TQOBJECT</span></tt></a> |
<a class="reference internal" href="#stype-SIP_RXOBJ_CON"><tt class="xref docutils literal"><span class="pre">SIP_RXOBJ_CON</span></tt></a> |
<a class="reference internal" href="#stype-SIP_RXOBJ_DIS"><tt class="xref docutils literal"><span class="pre">SIP_RXOBJ_DIS</span></tt></a> |
<a class="reference internal" href="#stype-SIP_SIGNAL"><tt class="xref docutils literal"><span class="pre">SIP_SIGNAL</span></tt></a> [<em>default-value</em>] |
@ -467,28 +467,28 @@ Handwritten code must be provided to interpret the conversion correctly.</p>
<p>This is a <tt class="docutils literal"><span class="pre">PyObject</span> <span class="pre">*</span></tt> that is a Python type object.</p>
<dl class="sip-type">
<dt id="stype-SIP_QOBJECT">
<tt class="descname">SIP_QOBJECT</tt><a class="headerlink" href="#stype-SIP_QOBJECT" title="Permalink to this definition"></a></dt>
<dt id="stype-SIP_TQOBJECT">
<tt class="descname">SIP_TQOBJECT</tt><a class="headerlink" href="#stype-SIP_TQOBJECT" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>This is a <tt class="docutils literal"><span class="pre">QObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from Qt&#8217;s
<tt class="docutils literal"><span class="pre">QObject</span></tt> class.</p>
<p>This is a <tt class="docutils literal"><span class="pre">TQObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from TQt&#8217;s
<tt class="docutils literal"><span class="pre">TQObject</span></tt> class.</p>
<dl class="sip-type">
<dt id="stype-SIP_RXOBJ_CON">
<tt class="descname">SIP_RXOBJ_CON</tt><a class="headerlink" href="#stype-SIP_RXOBJ_CON" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>This is a <tt class="docutils literal"><span class="pre">QObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from Qt&#8217;s
<tt class="docutils literal"><span class="pre">QObject</span></tt> class. It is used as the type of the receiver instead of <tt class="docutils literal"><span class="pre">const</span>
<span class="pre">QObject</span> <span class="pre">*</span></tt> in functions that implement a connection to a slot.</p>
<p>This is a <tt class="docutils literal"><span class="pre">TQObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from TQt&#8217;s
<tt class="docutils literal"><span class="pre">TQObject</span></tt> class. It is used as the type of the receiver instead of <tt class="docutils literal"><span class="pre">const</span>
<span class="pre">TQObject</span> <span class="pre">*</span></tt> in functions that implement a connection to a slot.</p>
<dl class="sip-type">
<dt id="stype-SIP_RXOBJ_DIS">
<tt class="descname">SIP_RXOBJ_DIS</tt><a class="headerlink" href="#stype-SIP_RXOBJ_DIS" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<p>This is a <tt class="docutils literal"><span class="pre">QObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from Qt&#8217;s
<tt class="docutils literal"><span class="pre">QObject</span></tt> class. It is used as the type of the receiver instead of <tt class="docutils literal"><span class="pre">const</span>
<span class="pre">QObject</span> <span class="pre">*</span></tt> in functions that implement a disconnection from a slot.</p>
<p>This is a <tt class="docutils literal"><span class="pre">TQObject</span> <span class="pre">*</span></tt> that is a C++ instance of a class derived from TQt&#8217;s
<tt class="docutils literal"><span class="pre">TQObject</span></tt> class. It is used as the type of the receiver instead of <tt class="docutils literal"><span class="pre">const</span>
<span class="pre">TQObject</span> <span class="pre">*</span></tt> in functions that implement a disconnection from a slot.</p>
<dl class="sip-type">
<dt id="stype-SIP_SIGNAL">
<tt class="descname">SIP_SIGNAL</tt><a class="headerlink" href="#stype-SIP_SIGNAL" title="Permalink to this definition"></a></dt>
@ -514,11 +514,11 @@ of an explicitly generated signal to a slot.</p>
<tt class="docutils literal"><span class="pre">const</span> <span class="pre">char</span> <span class="pre">*</span></tt> in functions that implement the connection of an internally
generated signal to a slot. The type includes a comma separated list of types
that is the C++ signature of of the signal.</p>
<p>To take an example, <tt class="docutils literal"><span class="pre">QAccel::connectItem()</span></tt> connects an internally generated
<p>To take an example, <tt class="docutils literal"><span class="pre">TQAccel::connectItem()</span></tt> connects an internally generated
signal to a slot. The signal is emitted when the keyboard accelerator is
activated and it has a single integer argument that is the ID of the
accelerator. The C++ signature is:</p>
<div class="highlight-python"><pre>bool connectItem(int id, const QObject *receiver, const char *member);</pre>
<div class="highlight-python"><pre>bool connectItem(int id, const TQObject *receiver, const char *member);</pre>
</div>
<p>The corresponding SIP specification is:</p>
<div class="highlight-python"><pre>bool connectItem(int, SIP_RXOBJ_CON, SIP_SLOT_CON(int));</pre>

81
doc/html/using.html

@ -235,13 +235,13 @@ be used for this example without change.</p>
<div class="section" id="a-more-complex-c-example">
<h2>A More Complex C++ Example<a class="headerlink" href="#a-more-complex-c-example" title="Permalink to this headline"></a></h2>
<p>In this last example we will wrap a fictional C++ library that contains a class
that is derived from a Qt class. This will demonstrate how SIP allows a class
that is derived from a TQt class. This will demonstrate how SIP allows a class
hierarchy to be split across multiple Python extension modules, and will
introduce SIP&#8217;s versioning system.</p>
<p>The library contains a single C++ class called <tt class="docutils literal"><span class="pre">Hello</span></tt> which is derived from
Qt&#8217;s <tt class="docutils literal"><span class="pre">QLabel</span></tt> class. It behaves just like <tt class="docutils literal"><span class="pre">QLabel</span></tt> except that the text
TQt&#8217;s <tt class="docutils literal"><span class="pre">TQLabel</span></tt> class. It behaves just like <tt class="docutils literal"><span class="pre">TQLabel</span></tt> except that the text
in the label is hard coded to be <tt class="docutils literal"><span class="pre">Hello</span> <span class="pre">World</span></tt>. To make the example more
interesting we&#8217;ll also say that the library only supports Qt v4.2 and later,
interesting we&#8217;ll also say that the library only supports TQt v4.2 and later,
and also includes a function called <tt class="docutils literal"><span class="pre">setDefault()</span></tt> that is not implemented
in the Windows version of the library.</p>
<p>The <tt class="docutils literal"><span class="pre">hello.h</span></tt> header file looks something like this:</p>
@ -251,12 +251,13 @@ in the Windows version of the library.</p>
#include &lt;qwidget.h&gt;
#include &lt;qstring.h&gt;
class Hello : public QLabel {
// This is needed by the Qt Meta-Object Compiler.
class Hello : public TQLabel {
// This is needed by the TQt Meta-Object Compiler.
Q_OBJECT
TQ_OBJECT
public:
Hello(QWidget *parent = 0);
Hello(TQWidget *parent = 0);
private:
// Prevent instances from being copied.
@ -265,7 +266,7 @@ private:
};
#if !defined(Q_OS_WIN)
void setDefault(const QString &amp;def);
void setDefault(const TQString &amp;def);
#endif</pre>
</div>
<p>The corresponding SIP specification file would then look something like this:</p>
@ -273,25 +274,25 @@ void setDefault(const QString &amp;def);
%Module hello 0
%Import QtGui/QtGuimod.sip
%Import TQtGui/TQtGuimod.sip
%If (Qt_4_2_0 -)
%If (TQt_4_2_0 -)
class Hello : QLabel {
class Hello : TQLabel {
%TypeHeaderCode
#include &lt;hello.h&gt;
%End
public:
Hello(QWidget *parent /TransferThis/ = 0);
Hello(TQWidget *parent /TransferThis/ = 0);
private:
Hello(const Hello &amp;);
};
%If (!WS_WIN)
void setDefault(const QString &amp;def);
void setDefault(const TQString &amp;def);
%End
%End</pre>
@ -301,12 +302,12 @@ previous examples.</p>
<blockquote>
<ul class="simple">
<li>The <a class="reference external" href="directives.html#directive-%Import"><tt class="xref docutils literal"><span class="pre">%Import</span></tt></a> directive has been added to specify that we are
extending the class hierarchy defined in the file <tt class="docutils literal"><span class="pre">QtGui/QtGuimod.sip</span></tt>.
This file is part of PyQt. The build system will take care of finding
extending the class hierarchy defined in the file <tt class="docutils literal"><span class="pre">TQtGui/TQtGuimod.sip</span></tt>.
This file is part of PyTQt. The build system will take care of finding
the file&#8217;s exact location.</li>
<li>The <a class="reference external" href="directives.html#directive-%If"><tt class="xref docutils literal"><span class="pre">%If</span></tt></a> directive has been added to specify that everything
<a class="footnote-reference" href="#id11" id="id8">[4]</a> up to the matching <a class="reference external" href="directives.html#directive-%End"><tt class="xref docutils literal"><span class="pre">%End</span></tt></a> directive only applies to Qt
v4.2 and later. <tt class="docutils literal"><span class="pre">Qt_4_2_0</span></tt> is a <em>tag</em> defined in <tt class="docutils literal"><span class="pre">QtCoremod.sip</span></tt>
<a class="footnote-reference" href="#id11" id="id8">[4]</a> up to the matching <a class="reference external" href="directives.html#directive-%End"><tt class="xref docutils literal"><span class="pre">%End</span></tt></a> directive only applies to TQt
v4.2 and later. <tt class="docutils literal"><span class="pre">TQt_4_2_0</span></tt> is a <em>tag</em> defined in <tt class="docutils literal"><span class="pre">TQtCoremod.sip</span></tt>
<a class="footnote-reference" href="#id12" id="id9">[5]</a> using the <a class="reference external" href="directives.html#directive-%Timeline"><tt class="xref docutils literal"><span class="pre">%Timeline</span></tt></a> directive. <a class="reference external" href="directives.html#directive-%Timeline"><tt class="xref docutils literal"><span class="pre">%Timeline</span></tt></a>