summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorMatti Airas <matti.p.airas@nokia.com>2010-08-20 12:42:25 +0300
committerMatti Airas <matti.p.airas@nokia.com>2010-08-20 12:42:25 +0300
commit4c7979877a2808a98cc60e234b8f2a0dc51acd4b (patch)
treedb84b03c3951ff9895bd1de5c32b5f996570bbcc /doc
parent18d65457dc735543cfcead4a4cac427138b522bb (diff)
downloadpyside-4c7979877a2808a98cc60e234b8f2a0dc51acd4b.tar.gz
pyside-4c7979877a2808a98cc60e234b8f2a0dc51acd4b.tar.xz
pyside-4c7979877a2808a98cc60e234b8f2a0dc51acd4b.zip
fixed the newsigslot documentation to use API 2
Diffstat (limited to 'doc')
-rw-r--r--doc/newsigslot.rst30
1 files changed, 15 insertions, 15 deletions
diff --git a/doc/newsigslot.rst b/doc/newsigslot.rst
index 15e9fca..99db7e0 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