From 203ba231d0276943aae36111f9ec1e949f3c6a4c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 3 Dec 2011 22:23:44 -0600 Subject: Initial TQt conversion --- doc/signal.html | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'doc/signal.html') diff --git a/doc/signal.html b/doc/signal.html index ab5b3f9..76599e6 100644 --- a/doc/signal.html +++ b/doc/signal.html @@ -76,7 +76,7 @@ NAME="AEN83" >General Signals and Slots

A signal may be either a Qt signal (specified using +>A signal may be either a TQt signal (specified using SIGNAL()PYSIGNAL()).

A slot can be either a Python callable object, a Qt signal (specified using +>A slot can be either a Python callable object, a TQt signal (specified using SIGNAL()PYSIGNAL()), or a Qt slot (specified using +>), or a TQt slot (specified using SLOT()

QObject.connect(a,SIGNAL("QtSig()"),pyFunction)
-QObject.connect(a,SIGNAL("QtSig()"),pyClass.pyMethod)
-QObject.connect(a,SIGNAL("QtSig()"),PYSIGNAL("PySig"))
-QObject.connect(a,SIGNAL("QtSig()"),SLOT("QtSlot()"))
-QObject.connect(a,PYSIGNAL("PySig"),pyFunction)
-QObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod)
-QObject.connect(a,PYSIGNAL("PySig"),SIGNAL("QtSig()"))
-QObject.connect(a,PYSIGNAL("PySig"),SLOT("QtSlot()"))
TQObject.connect(a,SIGNAL("TQtSig()"),pyFunction) +TQObject.connect(a,SIGNAL("TQtSig()"),pyClass.pyMethod) +TQObject.connect(a,SIGNAL("TQtSig()"),PYSIGNAL("PySig")) +TQObject.connect(a,SIGNAL("TQtSig()"),SLOT("TQtSlot()")) +TQObject.connect(a,PYSIGNAL("PySig"),pyFunction) +TQObject.connect(a,PYSIGNAL("PySig"),pyClass.pyMethod) +TQObject.connect(a,PYSIGNAL("PySig"),SIGNAL("TQtSig()")) +TQObject.connect(a,PYSIGNAL("PySig"),SLOT("TQtSlot()"))

When a slot is a Python method that corresponds to a Qt slot then a signal can -be connected to either the Python method or the Qt slot. The following +>When a slot is a Python method that corresponds to a TQt slot then a signal can +be connected to either the Python method or the TQt slot. The following connections achieve the same effect.

sbar = QScrollBar()
-lcd = QLCDNumber()
+>sbar = TQScrollBar()
+lcd = TQLCDNumber()
 
-QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd.display)
-QObject.connect(sbar,SIGNAL("valueChanged(int)"),lcd,SLOT("display(int)"))

Any instance of a class that is derived from the QObjectTQObject class can emit a signal using the emit method. This takes -two arguments. The first is the Python or Qt signal, the second is a Python +two arguments. The first is the Python or TQt signal, the second is a Python tuple which are the arguments to the signal. For example:

Qt allows a signal to be connected to a slot that requires fewer arguments than -the signal passes. The extra arguments are quietly discarded. Python slots +>TQt allows a signal to be connected to a slot that retquires fewer arguments than +the signal passes. The extra arguments are tquietly discarded. Python slots can be used in the same way.

int QMenuData::insertItem (const QString & text,
-     const QObject * receiver, const char * member,
+>int TQMenuData::insertItem (const TQString & text,
+     const TQObject * receiver, const char * member,
      int accel = 0, int id = -1, int index = -1 )
 
-KAction ( const QString& text, int accel,
-     const QObject* receiver, const char* slot,
-     QObject* parent, const char* name = 0 )

Notice the "const QObject* receiver, const char* slot" parameters for each declaration.

Notice the "const TQObject* receiver, const char* slot" parameters for each declaration.

In PyKDE, these two parameters are replaced with a SINGLE parameter that specifies the slot to be connected to the menu item, toolbar button or KAction: