From 4c7979877a2808a98cc60e234b8f2a0dc51acd4b Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Fri, 20 Aug 2010 12:42:25 +0300 Subject: fixed the newsigslot documentation to use API 2 --- doc/newsigslot.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'doc') diff --git a/doc/newsigslot.rst b/doc/newsigslot.rst index 15e9fca1c..99db7e0d6 100644 --- a/doc/newsigslot.rst +++ b/doc/newsigslot.rst @@ -91,15 +91,15 @@ Nothing better than examples to show how to use the new-style. Here you can find import sys from PySide import QtCore - # define a new slot that receives a QString and has + # define a new slot that receives a string and has # 'saySomeWords' as its name - @QtCore.Slot(QtCore.QString) + @QtCore.Slot(str) def saySomeWords(words): print words class Communicate(QtCore.QObject): # create a new signal on the fly and name it 'speak' - speak = QtCore.Signal(QtCore.QString) + speak = QtCore.Signal(str) someone = Communicate() # connect signal and slot @@ -114,18 +114,18 @@ Nothing better than examples to show how to use the new-style. Here you can find import sys from PySide import QtCore - # define a new slot that receives a C 'int' or a 'QString' + # define a new slot that receives a C 'int' or a 'str' # and has 'saySomething' as its name @QtCore.Slot(int) - @QtCore.Slot(QtCore.QString) + @QtCore.Slot(str) def saySomething(stuff): print stuff class Communicate(QtCore.QObject): # create two new signals on the fly: one will handle - # int type, the other will handle QStrings + # int type, the other will handle strings speakNumber = QtCore.Signal(int) - speakWord = QtCore.Signal(QtCore.QString) + speakWord = QtCore.Signal(str) someone = Communicate() # connect signal and slot properly @@ -143,29 +143,29 @@ Nothing better than examples to show how to use the new-style. Here you can find import sys from PySide import QtCore - # define a new slot that receives an C 'int' or a 'QString' + # define a new slot that receives an C 'int' or a 'str' # and has 'saySomething' as its name @QtCore.Slot(int) - @QtCore.Slot(QtCore.QString) + @QtCore.Slot(str) def saySomething(stuff): print stuff class Communicate(QtCore.QObject): # create two new signals on the fly: one will handle - # int type, the other will handle QStrings - speak = QtCore.Signal((int,), (QtCore.QString,)) + # int type, the other will handle strings + speak = QtCore.Signal((int,), (str,)) someone = Communicate() # connect signal and slot. As 'int' is the default - # we have to inform the QString when connecting the + # we have to specify the str when connecting the # second signal someone.speak.connect(saySomething) - someone.speak[QtCore.QString].connect(saySomething) + someone.speak[str].connect(saySomething) # emit 'speak' signal with different arguments. - # we have to inform the QString as int is the default + # we have to specify the str as int is the default someone.speak.emit(10) - someone.speak[QtCore.QString].emit("Hello everybody!") + someone.speak[str].emit("Hello everybody!") PyQt compatibility -- cgit v1.2.3