From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:44:01 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebindings@1157645 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- python/sip/doc/sipref.html | 114 ++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 57 deletions(-) (limited to 'python/sip/doc/sipref.html') 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.

The library contains a single C++ class called Hello which is derived from -Qt's QLabel class. It behaves just like QLabel except that the text +Qt's TQLabel class. It behaves just like TQLabel except that the text in the label is hard coded to be Hello World. 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 setDefault() that is not implemented @@ -1006,16 +1006,16 @@ in the Windows version of the library.

 // 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
 

The corresponding SIP specification file would then look something like this:

@@ -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. of the constructor. It specifies that if the argument is not 0 (i.e. the Hello 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 +maintains objects (i.e. instances derived from the TQObject 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.

6.3.9   SIP_QOBJECT

-

This is a QObject * that is a C++ instance of a class derived from Qt's -QObject class.

+

This is a TQObject * that is a C++ instance of a class derived from Qt's +TQObject class.

6.3.10   SIP_RXOBJ_CON

-

This is a QObject * that is a C++ instance of a class derived from Qt's -QObject class. It is used as the type of the receiver instead of const -QObject * in functions that implement a connection to a slot.

+

This is a TQObject * that is a C++ instance of a class derived from Qt's +TQObject class. It is used as the type of the receiver instead of const +TQObject * in functions that implement a connection to a slot.

6.3.11   SIP_RXOBJ_DIS

-

This is a QObject * that is a C++ instance of a class derived from Qt's -QObject class. It is used as the type of the receiver instead of const -QObject * in functions that implement a disconnection from a slot.

+

This is a TQObject * that is a C++ instance of a class derived from Qt's +TQObject class. It is used as the type of the receiver instead of const +TQObject * in functions that implement a disconnection from a slot.

6.3.12   SIP_SIGNAL

@@ -1755,12 +1755,12 @@ of an explicitly generated signal to a slot.

const char * 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.

-

To take an example, QAccel::connectItem() connects an internally generated +

To take an example, TQAccel::connectItem() 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:

-bool connectItem(int id, const QObject *receiver, const char *member);
+bool connectItem(int id, const TQObject *receiver, const char *member);
 

The corresponding SIP specification is:

@@ -1962,8 +1962,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 QList<TQWidget *> instance to a Python +list of TQWidget instances:

 %ConvertFromTypeCode
     PyObject *l;
@@ -1973,13 +1973,13 @@ 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 = 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.
 
 

The handwritten code must not explicitly return.

-

The following example shows the sub-class conversion code for QEvent based +

The following example shows the sub-class conversion code for TQEvent based class hierarchy in PyQt:

 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.

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.

+specification of the TQString class to allow Python string objects and +unicode objects to be used wherever TQString instances are expected.

The following variables are made available to the handwritten code:

int *sipIsErr
@@ -2128,8 +2128,8 @@ returned instance is a derived class. See QPoint instances to a -QList<QPoint> instance:

+

The following example converts a Python list of TQPoint instances to a +QList<TQPoint> instance:

 %ConvertToTypeCode
     // See if we are just being asked to check the type of the Python
@@ -2142,8 +2142,8 @@ Classes.
             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.
     }
 
     // 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.
 
         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.
 
int sipRes
The handwritten code should set this to the result to be returned.
-

The following simplified example is taken from PyQt. The QCustomEvent +

The following simplified example is taken from PyQt. The TQCustomEvent 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:

@@ -2431,7 +2431,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 PyQt's TQCustomEvent class:

 %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
 }
 
-

Using this we can use, for example, QList<QObject *> throughout the +

Using this we can use, for example, QList<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 instances when appropriate.

@@ -3327,7 +3327,7 @@ cases the value is optional.

The following example shows argument and function annotations:

-void exec(QWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/;
+void exec(TQWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/;
 

Note that the current version of SIP does not complain about unknown annotations, or annotations used out of their correct context.

@@ -3948,13 +3948,13 @@ comes with a reference.
This connects a signal to a signal or slot and returns Py_True if the signal was connected or Py_False if not. If there was some other error then a Python exception is raised and NULL is returned. sender -is the wrapped QObject derived instance that emits the signal. +is the wrapped TQObject derived instance that emits the signal. signal is the typed name of the signal. receiver is the wrapped -QObject derived instance or Python callable that the signal is +TQObject derived instance or Python callable that the signal is connected to. slot is the typed name of the slot, or NULL if receiver is a Python callable. type is the type of connection and is cast from Qt::ConnectionType. It is normally only used by PyQt to -implement QObject.connect().
+implement TQObject.connect().
@@ -4116,12 +4116,12 @@ needs to be tested once rather than after each call.)

This disconnects a signal from a signal or slot and returns Py_True if the signal was disconnected or Py_False if not. If there was some other error then a Python exception is raised and NULL is returned. -sender is the wrapped QObject derived instance that emits the signal. +sender is the wrapped TQObject derived instance that emits the signal. signal is the typed name of the signal. receiver is the wrapped -QObject derived instance or Python callable that the signal is +TQObject derived instance or Python callable that the signal is connected to. slot is the typed name of the slot, or NULL if receiver is a Python callable. It is normally only used by PyQt to -implement QObject.disconnect().
+implement TQObject.disconnect().
@@ -4130,10 +4130,10 @@ implement QObject.disconnect()int sipEmitSignal(PyObject *txobj, const char *signal, PyObject *args)
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. txobj is the wrapped QObject derived instance that emits +returned. txobj is the wrapped TQObject derived instance that emits the signal. signal is the typed name of the signal. args is a Python tuple of the signal arguments. It is normally only used by PyQt to -implement QObject.emit().
+implement TQObject.emit().
@@ -4211,9 +4211,9 @@ description of the arguments.

9.34   sipGetSender()

const void *sipGetSender()
-
This returns a pointer to the last QObject instance that emitted a Qt +
This returns a pointer to the last TQObject instance that emitted a Qt signal. It is normally only used by PyQt to implement -QObject.sender().
+TQObject.sender().
@@ -4686,7 +4686,7 @@ Python string. created is returned. If the instance has already been wrapped then a new reference to the existing object is returned. addr is the address of the instance represented as a number. type is the type of the object -(e.g. qt.QWidget). +(e.g. qt.TQWidget).
wrapper
This is the type object of the base type of all instances wrapped by SIP.
wrappertype
-- cgit v1.2.3