diff options
Diffstat (limited to 'python/sip/doc')
-rw-r--r-- | python/sip/doc/sipref.html | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/python/sip/doc/sipref.html b/python/sip/doc/sipref.html index 850fe61f..71fcbdb4 100644 --- a/python/sip/doc/sipref.html +++ b/python/sip/doc/sipref.html @@ -997,7 +997,7 @@ that is derived from a Qt class. This will demonstrate how SIP allows a class hierarchy to be split across multiple Python extension modules, and will introduce SIP'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'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 +Qt'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'll also say that the library only supports Qt v3.0 and later, and also includes a function called <tt class="docutils literal"><span class="pre">setDefault()</span></tt> that is not implemented @@ -1006,16 +1006,16 @@ in the Windows version of the library.</p> <pre class="literal-block"> // Define the interface to the hello library. -#include <qlabel.h> -#include <qwidget.h> -#include <qstring.h> +#include <tqlabel.h> +#include <tqwidget.h> +#include <tqstring.h> -class Hello : public QLabel { +class Hello : public TQLabel { // This is needed by the Qt Meta-Object Compiler. Q_OBJECT public: - Hello(QWidget *parent, const char *name = 0, WFlags f = 0); + Hello(TQWidget *parent, const char *name = 0, WFlags f = 0); private: // Prevent instances from being copied. @@ -1024,7 +1024,7 @@ private: }; #if !defined(Q_OS_WIN) -void setDefault(const QString &def); +void setDefault(const TQString &def); #endif </pre> <p>The corresponding SIP specification file would then look something like this:</p> @@ -1037,21 +1037,21 @@ void setDefault(const QString &def); %If (Qt_3_0_0 -) -class Hello : QLabel { +class Hello : TQLabel { %TypeHeaderCode #include <hello.h> %End public: - Hello(QWidget *parent /TransferThis/, const char *name = 0, WFlags f = 0); + Hello(TQWidget *parent /TransferThis/, const char *name = 0, WFlags f = 0); private: Hello(const Hello &); }; %If (!WS_WIN) -void setDefault(const QString &def); +void setDefault(const TQString &def); %End %End @@ -1079,7 +1079,7 @@ removed. This is not supported by SIP.</li> of the constructor. It specifies that if the argument is not 0 (i.e. the <tt class="docutils literal"><span class="pre">Hello</span></tt> 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 <tt class="docutils literal"><span class="pre">QObject</span></tt> class) in +maintains objects (i.e. instances derived from the <tt class="docutils literal"><span class="pre">TQObject</span></tt> class) in a hierachy. When an object is destroyed all of its children are also automatically destroyed. It is important, therefore, that the Python garbage collector doesn't also try and destroy them. This is covered in @@ -1722,20 +1722,20 @@ Handwritten code must be provided to interpret the conversion correctly.</p> </div> <div class="section"> <h3><a class="toc-backref" href="#id55" id="sip-qobject" name="sip-qobject">6.3.9 SIP_QOBJECT</a></h3> -<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'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 Qt's +<tt class="docutils literal"><span class="pre">TQObject</span></tt> class.</p> </div> <div class="section"> <h3><a class="toc-backref" href="#id56" id="sip-rxobj-con" name="sip-rxobj-con">6.3.10 SIP_RXOBJ_CON</a></h3> -<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'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 Qt'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> </div> <div class="section"> <h3><a class="toc-backref" href="#id57" id="sip-rxobj-dis" name="sip-rxobj-dis">6.3.11 SIP_RXOBJ_DIS</a></h3> -<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'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 Qt'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> </div> <div class="section"> <h3><a class="toc-backref" href="#id58" id="sip-signal" name="sip-signal">6.3.12 SIP_SIGNAL</a></h3> @@ -1755,12 +1755,12 @@ 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> <pre class="literal-block"> -bool connectItem(int id, const QObject *receiver, const char *member); +bool connectItem(int id, const TQObject *receiver, const char *member); </pre> <p>The corresponding SIP specification is:</p> <pre class="literal-block"> @@ -1962,8 +1962,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<QWidget</span> <span class="pre">*></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">QList<TQWidget</span> <span class="pre">*></span></tt> instance to a Python +list of <tt class="docutils literal"><span class="pre">TQWidget</span></tt> instances:</p> <pre class="literal-block"> %ConvertFromTypeCode PyObject *l; @@ -1973,13 +1973,13 @@ 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 < sipCpp -> size(); ++i) { - QWidget *w = sipCpp -> at(i); + TQWidget *w = sipCpp -> 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 = sipConvertFromInstance(w, sipClass_QWidget, sipTransferObj)) == NULL) { @@ -2041,21 +2041,21 @@ have to recognise the exact class, only the most specific sub-class that it can.</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 +<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 PyQt:</p> <pre class="literal-block"> class QEvent { %ConvertToSubClassCode - // QEvent sub-classes provide a unique type ID. + // TQEvent sub-classes provide a unique type ID. switch (sipCpp -> type()) { - case QEvent::Timer: + case TQEvent::Timer: sipClass = sipClass_QTimerEvent; break; - case QEvent::KeyPress: - case QEvent::KeyRelease: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: sipClass = sipClass_QKeyEvent; break; @@ -2089,8 +2089,8 @@ 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> +specification of the <tt class="docutils literal"><span class="pre">TQString</span></tt> class to allow Python string objects and +unicode 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> @@ -2128,8 +2128,8 @@ returned instance is a derived class. See <a class="reference" href="#generated Classes</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<QPoint></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">QList<TQPoint></span></tt> instance:</p> <pre class="literal-block"> %ConvertToTypeCode // See if we are just being asked to check the type of the Python @@ -2142,8 +2142,8 @@ Classes</a>.</li> 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 < PyList_GET_SIZE(sipPy); ++i) if (!sipCanConvertToInstance(PyList_GET_ITEM(sipPy, i), sipClass_QPoint, SIP_NOT_NONE)) @@ -2154,17 +2154,17 @@ Classes</a>.</li> } // Create the instance on the heap. - QList<QPoint> *ql = new QList<QPoint>; + QList<TQPoint> *ql = new QList<TQPoint>; for (int i = 0; i < 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<QPoint *>(sipConvertToInstance( + qp = reinterpret_cast<TQPoint *>(sipConvertToInstance( PyList_GET_ITEM(sipPy, i), sipClass_QPoint, 0, SIP_NOT_NONE, @@ -2184,7 +2184,7 @@ Classes</a>.</li> ql -> 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. // sipReleaseInstance() will do the right thing. @@ -2387,7 +2387,7 @@ 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> +<p>The following simplified example is taken from PyQt. The <tt class="docutils literal"><span class="pre">TQCustomEvent</span></tt> class allows arbitary data to be attached to the event. In PyQt this data is always a Python object and so should be handled by the garbage collector:</p> <pre class="literal-block"> @@ -2431,7 +2431,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's <tt class="docutils literal"><span class="pre">QCustomEvent</span></tt> class:</p> +<p>The following simplified example is taken from PyQt's <tt class="docutils literal"><span class="pre">TQCustomEvent</span></tt> class:</p> <pre class="literal-block"> %GCTraverseCode PyObject *obj; @@ -2681,7 +2681,7 @@ template<Type *> { %TypeHeaderCode // Include the library interface to the type being mapped. -#include <qlist.h> +#include <tqlist.h> %End %ConvertToTypeCode @@ -2765,7 +2765,7 @@ template<Type *> %End } </pre> -<p>Using this we can use, for example, <tt class="docutils literal"><span class="pre">QList<QObject</span> <span class="pre">*></span></tt> throughout the +<p>Using this we can use, for example, <tt class="docutils literal"><span class="pre">QList<TQObject</span> <span class="pre">*></span></tt> throughout the module'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 instances when appropriate.</p> @@ -3327,7 +3327,7 @@ cases the value is optional.</dd> </dl> <p>The following example shows argument and function annotations:</p> <pre class="literal-block"> -void exec(QWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/; +void exec(TQWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/; </pre> <p>Note that the current version of SIP does not complain about unknown annotations, or annotations used out of their correct context.</p> @@ -3948,13 +3948,13 @@ comes with a reference.</dd> <dd>This connects a signal to a signal or slot and returns <tt class="docutils literal"><span class="pre">Py_True</span></tt> if the signal was connected or <tt class="docutils literal"><span class="pre">Py_False</span></tt> if not. If there was some other error then a Python exception is raised and <tt class="docutils literal"><span class="pre">NULL</span></tt> is returned. <em>sender</em> -is the wrapped <tt class="docutils literal"><span class="pre">QObject</span></tt> derived instance that emits the signal. +is the wrapped <tt class="docutils literal"><span class="pre">TQObject</span></tt> derived instance that emits the signal. <em>signal</em> is the typed name of the signal. <em>receiver</em> is the wrapped -<tt class="docutils literal"><span class="pre">QObject</span></tt> derived instance or Python callable that the signal is +<tt class="docutils literal"><span class="pre">TQObject</span></tt> derived instance or Python callable that the signal is connected to. <em>slot</em> is the typed name of the slot, or <tt class="docutils literal"><span class="pre">NULL</span></tt> if <em>receiver</em> is a Python callable. <em>type</em> is the type of connection and is cast from Qt::ConnectionType. It is normally only used by PyQt to -implement <tt class="docutils literal"><span class="pre">QObject.connect()</span></tt>.</dd> +implement <tt class="docutils literal"><span class="pre">TQObject.connect()</span></tt>.</dd> </dl> </div> <div class="section"> @@ -4116,12 +4116,12 @@ needs to be tested once rather than after each call.)</p> <dd>This disconnects a signal from a signal or slot and returns <tt class="docutils literal"><span class="pre">Py_True</span></tt> if the signal was disconnected or <tt class="docutils literal"><span class="pre">Py_False</span></tt> if not. If there was some other error then a Python exception is raised and <tt class="docutils literal"><span class="pre">NULL</span></tt> is returned. -<em>sender</em> is the wrapped <tt class="docutils literal"><span class="pre">QObject</span></tt> derived instance that emits the signal. +<em>sender</em> is the wrapped <tt class="docutils literal"><span class="pre">TQObject</span></tt> derived instance that emits the signal. <em>signal</em> is the typed name of the signal. <em>receiver</em> is the wrapped -<tt class="docutils literal"><span class="pre">QObject</span></tt> derived instance or Python callable that the signal is +<tt class="docutils literal"><span class="pre">TQObject</span></tt> derived instance or Python callable that the signal is connected to. <em>slot</em> is the typed name of the slot, or <tt class="docutils literal"><span class="pre">NULL</span></tt> if <em>receiver</em> is a Python callable. It is normally only used by PyQt to -implement <tt class="docutils literal"><span class="pre">QObject.disconnect()</span></tt>.</dd> +implement <tt class="docutils literal"><span class="pre">TQObject.disconnect()</span></tt>.</dd> </dl> </div> <div class="section"> @@ -4130,10 +4130,10 @@ implement <tt class="docutils literal"><span class="pre">QObject.disconnect()</s <dt>int sipEmitSignal(PyObject *txobj, const char *signal, PyObject *args)</dt> <dd>This emits a signal and returns zero if there was no error. If there was an error then a Python exception is raised and a negative value is -returned. <em>txobj</em> is the wrapped <tt class="docutils literal"><span class="pre">QObject</span></tt> derived instance that emits +returned. <em>txobj</em> is the wrapped <tt class="docutils literal"><span class="pre">TQObject</span></tt> derived instance that emits the signal. <em>signal</em> is the typed name of the signal. <em>args</em> is a Python tuple of the signal arguments. It is normally only used by PyQt to -implement <tt class="docutils literal"><span class="pre">QObject.emit()</span></tt>.</dd> +implement <tt class="docutils literal"><span class="pre">TQObject.emit()</span></tt>.</dd> </dl> </div> <div class="section"> @@ -4211,9 +4211,9 @@ description of the arguments.</dd> <h2><a class="toc-backref" href="#id179" id="sipgetsender" name="sipgetsender">9.34 sipGetSender()</a></h2> <dl class="docutils"> <dt>const void *sipGetSender()</dt> -<dd>This returns a pointer to the last <tt class="docutils literal"><span class="pre">QObject</span></tt> instance that emitted a Qt +<dd>This returns a pointer to the last <tt class="docutils literal"><span class="pre">TQObject</span></tt> instance that emitted a Qt signal. It is normally only used by PyQt to implement -<tt class="docutils literal"><span class="pre">QObject.sender()</span></tt>.</dd> +<tt class="docutils literal"><span class="pre">TQObject.sender()</span></tt>.</dd> </dl> </div> <div class="section"> @@ -4686,7 +4686,7 @@ Python string.</dd> created is returned. If the instance has already been wrapped then a new reference to the existing object is returned. <em>addr</em> is the address of the instance represented as a number. <em>type</em> is the type of the object -(e.g. <tt class="docutils literal"><span class="pre">qt.QWidget</span></tt>).</dd> +(e.g. <tt class="docutils literal"><span class="pre">qt.TQWidget</span></tt>).</dd> <dt>wrapper</dt> <dd>This is the type object of the base type of all instances wrapped by SIP.</dd> <dt>wrappertype</dt> |