From 479f5f799523bffbcc83dff581a2299c047c6fff Mon Sep 17 00:00:00 2001
From: tpearson
A slot can be either a Python callable object, a Qt signal (specified using SIGNAL()TQT_SIGNAL()), a Python signal (specified using PYSIGNAL()PYQT_SIGNAL()), or a Qt slot (specified using SLOT()TQT_SLOT()).
You connect signals to slots (and other signals) as you would from C++. For @@ -110,14 +110,14 @@ WIDTH="100%" >
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,TQT_SIGNAL("QtSig()"),pyFunction)
+TQObject.connect(a,TQT_SIGNAL("QtSig()"),pyClass.pyMethod)
+TQObject.connect(a,TQT_SIGNAL("QtSig()"),PYQT_SIGNAL("PySig"))
+TQObject.connect(a,TQT_SIGNAL("QtSig()"),TQT_SLOT("QtSlot()"))
+TQObject.connect(a,PYQT_SIGNAL("PySig"),pyFunction)
+TQObject.connect(a,PYQT_SIGNAL("PySig"),pyClass.pyMethod)
+TQObject.connect(a,PYQT_SIGNAL("PySig"),TQT_SIGNAL("QtSig()"))
+TQObject.connect(a,PYQT_SIGNAL("PySig"),TQT_SLOT("QtSlot()"))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 a.emit(SIGNAL("clicked()"),())
-a.emit(PYSIGNAL("pySig"),("Hello","World"))a.emit(TQT_SIGNAL("clicked()"),())
+a.emit(PYQT_SIGNAL("pySig"),("Hello","World"))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: