From 7d27356bafd5670adcc8753ab5437b3bf8ffa4be Mon Sep 17 00:00:00 2001
From: Timothy Pearson
See Managing Incompatible APIs for more detail.
For example:
-%API PyQt4 1
+%API PyTQt4 1
For example:
-%CompositeModule PyQt4.Qt
-%Include QtCore/QtCoremod.sip
-%Include QtGui/QtGuimod.sip
+%CompositeModule PyTQt4.TQt
+%Include TQtCore/TQtCoremod.sip
+%Include TQtGui/TQtGuimod.sip
The main purpose of a composite module is as a programmer convenience as they don’t have to remember which which individual module an object is defined in.
@@ -333,9 +333,9 @@ SIP generated modules (refered to as component modules in this context). subsequent %CModule or %Module directive is interpreted as defining a component module.For example:
-%ConsolidatedModule PyQt4._qt
-%Include QtCore/QtCoremod.sip
-%Include QtGui/QtGuimod.sip
+%ConsolidatedModule PyTQt4._qt
+%Include TQtCore/TQtCoremod.sip
+%Include TQtGui/TQtGuimod.sip
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.
The handwritten code must explicitly return a PyObject *. If there was an error then a Python exception must be raised and NULL returned.
-The following example converts a QList<QWidget *> instance to a Python -list of QWidget instances:
+The following example converts a TQList<TQWidget *> instance to a Python +list of TQWidget instances:
%ConvertFromTypeCode
PyObject *l;
@@ -390,15 +390,15 @@ list of QWidget 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 = 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.
The handwritten code must not explicitly return.
-The following example shows the sub-class conversion code for QEvent based
-class hierarchy in PyQt:
-class QEvent
+The following example shows the sub-class conversion code for TQEvent based
+class hierarchy in PyTQt:
+class TQEvent
{
%ConvertToSubClassCode
- // QEvent sub-classes provide a unique type ID.
+ // TQEvent sub-classes provide a unique type ID.
switch (sipCpp->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
specification. The code is also called to determine if the Python object is of
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.
+additional types of Python object. For example, PyTQt uses it in the
+specification of the TQString class to allow Python string objects and
+tqunicode objects to be used wherever TQString instances are expected.
The following variables are made available to the handwritten code:
- int *sipIsErr
@@ -554,8 +554,8 @@ returned instance is a derived class. See
Generated Derived Classes.
-The following example converts a Python list of QPoint instances to a
-QList<QPoint> instance:
+The following example converts a Python list of TQPoint instances to a
+TQList<TQPoint> instance:
%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 < 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<QPoint> *ql = new QList<QPoint>;
+ TQList<TQPoint> *ql = new TQList<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 *>(sipConvertToType(
+ qp = reinterpret_cast<TQPoint *>(sipConvertToType(
PyList_GET_ITEM(sipPy, i),
- sipType_QPoint, 0,
+ sipType_TQPoint, 0,
SIP_NOT_NONE,
&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->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’t have an explicit meta-type.
meta-type used by a particular C/C++ type.
See the section Types and Meta-types for more details.
For example:
-%DefaultMetatype PyQt4.QtCore.pyqtWrapperType
+%DefaultMetatype PyTQt4.TQtCore.pyqtWrapperType
-
@@ -916,8 +916,8 @@ pointer to the structure or class.
- int sipRes
- The handwritten code should set this to the result to be returned.
-The following simplified example is taken from PyQt. The QCustomEvent
-class allows arbitary data to be attached to the event. In PyQt this data is
+
The following simplified example is taken from PyTQt. The TQCustomEvent
+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:
%GCClearCode
PyObject *obj;
@@ -961,7 +961,7 @@ collector.
- int sipRes
- The handwritten code should set this to the result to be returned.
-The following simplified example is taken from PyQt’s QCustomEvent class:
+The following simplified example is taken from PyTQt’s TQCustomEvent class:
%GCTraverseCode
PyObject *obj;
@@ -1245,7 +1245,7 @@ the handwritten code that converts an instance of the mapped type to a Python
object.
For example:
template<Type *>
-%MappedType QList
+%MappedType TQList
{
%TypeHeaderCode
// Include the library interface to the type being mapped.
@@ -1272,7 +1272,7 @@ object.
}
// Create the instance on the heap.
- QList<Type *> *ql = new QList<Type *>;
+ TQList<Type *> *ql = new TQList<Type *>;
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
{
@@ -1333,9 +1333,9 @@ object.
%End
}
-Using this we can use, for example, QList<QObject *> throughout the
+
Using this we can use, for example, TQList<TQObject *> 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
+generated code will automatically map this to and from a Python list of TQObject
instances when appropriate.
-
--
cgit v1.2.1