summaryrefslogtreecommitdiffstats
path: root/siplib/qtlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'siplib/qtlib.c')
-rw-r--r--siplib/qtlib.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/siplib/qtlib.c b/siplib/qtlib.c
index ca0817a..88432b7 100644
--- a/siplib/qtlib.c
+++ b/siplib/qtlib.c
@@ -1,6 +1,6 @@
/*
* The SIP library code that implements the interface to the optional module
- * supplied Qt support.
+ * supplied TQt support.
*
* Copyright (c) 2010 Riverbank Computing Limited <info@riverbankcomputing.com>
*
@@ -26,9 +26,9 @@
#include "sipint.h"
-/* This is how Qt "types" signals and slots. */
-#define isQtSlot(s) (*(s) == '1')
-#define isQtSignal(s) (*(s) == '2')
+/* This is how TQt "types" signals and slots. */
+#define isTQtSlot(s) (*(s) == '1')
+#define isTQtSignal(s) (*(s) == '2')
static PyObject *getWeakRef(PyObject *obj);
@@ -44,8 +44,8 @@ static void *newSignal(void *txrx, const char **sig);
*/
static void *findSignal(void *txrx, const char **sig)
{
- if (sipQtSupport->qt_find_universal_signal != NULL)
- txrx = sipQtSupport->qt_find_universal_signal(txrx, sig);
+ if (sipTQtSupport->qt_find_universal_signal != NULL)
+ txrx = sipTQtSupport->qt_find_universal_signal(txrx, sig);
return txrx;
}
@@ -58,8 +58,8 @@ static void *newSignal(void *txrx, const char **sig)
{
void *new_txrx = findSignal(txrx, sig);
- if (new_txrx == NULL && sipQtSupport->qt_create_universal_signal != NULL)
- new_txrx = sipQtSupport->qt_create_universal_signal(txrx, sig);
+ if (new_txrx == NULL && sipTQtSupport->qt_create_universal_signal != NULL)
+ new_txrx = sipTQtSupport->qt_create_universal_signal(txrx, sig);
return new_txrx;
}
@@ -72,7 +72,7 @@ static void *newSignal(void *txrx, const char **sig)
static void *createUniversalSlot(sipWrapper *txSelf, const char *sig,
PyObject *rxObj, const char *slot, const char **member, int flags)
{
- void *us = sipQtSupport->qt_create_universal_slot(txSelf, sig, rxObj, slot,
+ void *us = sipTQtSupport->qt_create_universal_slot(txSelf, sig, rxObj, slot,
member, flags);
if (us && txSelf)
@@ -83,7 +83,7 @@ static void *createUniversalSlot(sipWrapper *txSelf, const char *sig,
/*
- * Invoke a single slot (Qt or Python) and return the result.
+ * Invoke a single slot (TQt or Python) and return the result.
*/
PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
{
@@ -92,12 +92,12 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
/* Keep some compilers quiet. */
oxtype = oxvalue = oxtb = NULL;
- /* Fan out Qt signals. (Only PyQt3 will do this.) */
+ /* Fan out TQt signals. (Only PyTQt3 will do this.) */
if (slot->name != NULL && slot->name[0] != '\0')
{
- assert(sipQtSupport->qt_emit_signal);
+ assert(sipTQtSupport->qt_emit_signal);
- if (sipQtSupport->qt_emit_signal(slot->pyobj, slot->name, sigargs) < 0)
+ if (sipTQtSupport->qt_emit_signal(slot->pyobj, slot->name, sigargs) < 0)
return NULL;
Py_INCREF(Py_None);
@@ -125,7 +125,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
{
/*
* If the real object has gone then we pretend everything is Ok. This
- * mimics the Qt behaviour of not caring if a receiving object has been
+ * mimics the TQt behaviour of not caring if a receiving object has been
* deleted.
*/
Py_DECREF(sref);
@@ -191,7 +191,7 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
* We make repeated attempts to call a slot. If we work out that it failed
* because of an immediate type error we try again with one less argument.
* We keep going until we run out of arguments to drop. This emulates the
- * Qt ability of the slot to accept fewer arguments than a signal provides.
+ * TQt ability of the slot to accept fewer arguments than a signal provides.
*/
sa = sigargs;
Py_INCREF(sa);
@@ -307,13 +307,13 @@ PyObject *sip_api_invoke_slot(const sipSlot *slot, PyObject *sigargs)
*/
int sip_api_same_slot(const sipSlot *sp, PyObject *rxObj, const char *slot)
{
- /* See if they are signals or Qt slots, ie. they have a name. */
+ /* See if they are signals or TQt slots, ie. they have a name. */
if (slot != NULL)
{
if (sp->name == NULL || sp->name[0] == '\0')
return 0;
- return (sipQtSupport->qt_same_name(sp->name, slot) && sp->pyobj == rxObj);
+ return (sipTQtSupport->qt_same_name(sp->name, slot) && sp->pyobj == rxObj);
}
/* See if they are pure Python methods. */
@@ -352,32 +352,32 @@ void *sipGetRx(sipSimpleWrapper *txSelf, const char *sigargs, PyObject *rxObj,
const char *slot, const char **memberp)
{
if (slot != NULL)
- if (isQtSlot(slot) || isQtSignal(slot))
+ if (isTQtSlot(slot) || isTQtSignal(slot))
{
void *rx;
*memberp = slot;
- if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipQObjectType)) == NULL)
+ if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipTQObjectType)) == NULL)
return NULL;
- if (isQtSignal(slot))
+ if (isTQtSignal(slot))
rx = findSignal(rx, memberp);
return rx;
}
/*
- * The slot was either a Python callable or PyQt3 Python signal so there
+ * The slot was either a Python callable or PyTQt3 Python signal so there
* should be a universal slot.
*/
- return sipQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp);
+ return sipTQtSupport->qt_find_slot(sipGetAddress(txSelf), sigargs, rxObj, slot, memberp);
}
/*
- * Convert a Python receiver (either a Python signal or slot or a Qt signal or
- * slot) to a Qt receiver. It is only ever called when the signal is a Qt
+ * Convert a Python receiver (either a Python signal or slot or a TQt signal or
+ * slot) to a TQt receiver. It is only ever called when the signal is a TQt
* signal. Return NULL is there was an error.
*/
void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs,
@@ -386,16 +386,16 @@ void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs,
if (slot == NULL)
return createUniversalSlot(txSelf, sigargs, rxObj, NULL, memberp, flags);
- if (isQtSlot(slot) || isQtSignal(slot))
+ if (isTQtSlot(slot) || isTQtSignal(slot))
{
void *rx;
*memberp = slot;
- if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipQObjectType)) == NULL)
+ if ((rx = sip_api_get_cpp_ptr((sipSimpleWrapper *)rxObj, sipTQObjectType)) == NULL)
return NULL;
- if (isQtSignal(slot))
+ if (isTQtSignal(slot))
rx = newSignal(rx, memberp);
return rx;
@@ -407,20 +407,20 @@ void *sip_api_convert_rx(sipWrapper *txSelf, const char *sigargs,
/*
- * Connect a Qt signal or a Python signal to a Qt slot, a Qt signal, a Python
+ * Connect a TQt signal or a Python signal to a TQt slot, a TQt signal, a Python
* slot or a Python signal. This is all possible combinations.
*/
PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj,
const char *slot, int type)
{
- /* Handle Qt signals. */
- if (isQtSignal(sig))
+ /* Handle TQt signals. */
+ if (isTQtSignal(sig))
{
void *tx, *rx;
const char *member, *real_sig;
int res;
- if ((tx = sip_api_get_cpp_ptr((sipSimpleWrapper *)txObj, sipQObjectType)) == NULL)
+ if ((tx = sip_api_get_cpp_ptr((sipSimpleWrapper *)txObj, sipTQObjectType)) == NULL)
return NULL;
real_sig = sig;
@@ -431,15 +431,15 @@ PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj,
if ((rx = sip_api_convert_rx((sipWrapper *)txObj, sig, rxObj, slot, &member, 0)) == NULL)
return NULL;
- res = sipQtSupport->qt_connect(tx, real_sig, rx, member, type);
+ res = sipTQtSupport->qt_connect(tx, real_sig, rx, member, type);
return PyBool_FromLong(res);
}
- /* Handle Python signals. Only PyQt3 will get this far. */
- assert(sipQtSupport->qt_connect_py_signal);
+ /* Handle Python signals. Only PyTQt3 will get this far. */
+ assert(sipTQtSupport->qt_connect_py_signal);
- if (sipQtSupport->qt_connect_py_signal(txObj, sig, rxObj, slot) < 0)
+ if (sipTQtSupport->qt_connect_py_signal(txObj, sig, rxObj, slot) < 0)
return NULL;
Py_INCREF(Py_True);
@@ -448,20 +448,20 @@ PyObject *sip_api_connect_rx(PyObject *txObj, const char *sig, PyObject *rxObj,
/*
- * Disconnect a signal to a signal or a Qt slot.
+ * Disconnect a signal to a signal or a TQt slot.
*/
PyObject *sip_api_disconnect_rx(PyObject *txObj,const char *sig,
PyObject *rxObj,const char *slot)
{
- /* Handle Qt signals. */
- if (isQtSignal(sig))
+ /* Handle TQt signals. */
+ if (isTQtSignal(sig))
{
sipSimpleWrapper *txSelf = (sipSimpleWrapper *)txObj;
void *tx, *rx;
const char *member;
int res;
- if ((tx = sip_api_get_cpp_ptr(txSelf, sipQObjectType)) == NULL)
+ if ((tx = sip_api_get_cpp_ptr(txSelf, sipTQObjectType)) == NULL)
return NULL;
if ((rx = sipGetRx(txSelf, sig, rxObj, slot, &member)) == NULL)
@@ -473,22 +473,22 @@ PyObject *sip_api_disconnect_rx(PyObject *txObj,const char *sig,
/* Handle Python signals. */
tx = findSignal(tx, &sig);
- res = sipQtSupport->qt_disconnect(tx, sig, rx, member);
+ res = sipTQtSupport->qt_disconnect(tx, sig, rx, member);
/*
* Delete it if it is a universal slot as this will be it's only
* connection. If the slot is actually a universal signal then it
* should leave it in place.
*/
- sipQtSupport->qt_destroy_universal_slot(rx);
+ sipTQtSupport->qt_destroy_universal_slot(rx);
return PyBool_FromLong(res);
}
- /* Handle Python signals. Only PyQt3 will get this far. */
- assert(sipQtSupport->qt_disconnect_py_signal);
+ /* Handle Python signals. Only PyTQt3 will get this far. */
+ assert(sipTQtSupport->qt_disconnect_py_signal);
- sipQtSupport->qt_disconnect_py_signal(txObj, sig, rxObj, slot);
+ sipTQtSupport->qt_disconnect_py_signal(txObj, sig, rxObj, slot);
Py_INCREF(Py_True);
return Py_True;
@@ -530,7 +530,7 @@ static char *sipStrdup(const char *s)
/*
* Initialise a slot, returning 0 if there was no error. If the signal was a
- * Qt signal, then the slot may be a Python signal or a Python slot. If the
+ * TQt signal, then the slot may be a Python signal or a Python slot. If the
* signal was a Python signal, then the slot may be anything.
*/
int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot)
@@ -576,7 +576,7 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot)
* because they are generated on the fly and we can't take a
* reference as that may keep the instance (ie. self) alive.
* We therefore treat it as if the user had specified the slot
- * at "obj, SLOT('meth()')" rather than "obj.meth" (see below).
+ * at "obj, TQT_SLOT('meth()')" rather than "obj.meth" (see below).
*/
const char *meth;
@@ -613,11 +613,11 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot)
}
else if ((sp -> name = sipStrdup(slot)) == NULL)
return -1;
- else if (isQtSlot(slot))
+ else if (isTQtSlot(slot))
{
/*
- * The user has decided to connect a Python signal to a Qt slot and
- * specified the slot as "obj, SLOT('meth()')" rather than "obj.meth".
+ * The user has decided to connect a Python signal to a TQt slot and
+ * specified the slot as "obj, TQT_SLOT('meth()')" rather than "obj.meth".
*/
char *tail;
@@ -638,7 +638,7 @@ int sip_api_save_slot(sipSlot *sp, PyObject *rxObj, const char *slot)
sp -> pyobj = rxObj;
}
else
- /* It's a Qt signal. */
+ /* It's a TQt signal. */
sp -> pyobj = rxObj;
return 0;