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/pykde/doc/signal.html | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'python/pykde/doc/signal.html') diff --git a/python/pykde/doc/signal.html b/python/pykde/doc/signal.html index ab5b3f9d..b95ed7f6 100644 --- a/python/pykde/doc/signal.html +++ b/python/pykde/doc/signal.html @@ -79,25 +79,25 @@ NAME="AEN83" >A signal may be either a Qt signal (specified using SIGNAL()TQT_SIGNAL()) or a Python signal (specified using PYSIGNAL()PYQT_SIGNAL()).

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: