Skip to content

Commit f873031

Browse files
author
florianlink
committed
ported to PY3K
git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@283 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent d91a993 commit f873031

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
from PythonQt.example import *
22

3-
print "CustomObject wrapped by decorators"
3+
print("CustomObject wrapped by decorators")
44

55
# create a new object
66
custom = CustomObject("John","Doe")
77

88
# print the object (to see how it is wrapped)
9-
print custom
9+
print (custom)
1010

1111
# print the methods available
12-
print dir(custom)
12+
print (dir(custom))
1313

1414
# set a name
1515
custom.setFirstName("Mike")
1616
custom.setLastName("Michels")
1717

1818
# get the name
19-
print custom.firstName() + " " + custom.lastName();
19+
print (custom.firstName() + " " + custom.lastName())

examples/PyCustomMetaTypeExample/example.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
custom = CustomObject("John","Doe")
55

66
# print the methods available
7-
print dir(custom)
7+
print (dir(custom))
88

99
# set a name
1010
custom.setFirstName("Mike")
1111
custom.setLastName("Michels")
1212

1313
# get the name
14-
print custom.firstName() + " " + custom.lastName();
14+
print (custom.firstName() + " " + custom.lastName())
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from PythonQt import QtCore, QtGui, example
22

33
# call our new constructor of QSize
4-
size = QtCore.QSize(QtCore.QPoint(1,2));
4+
size = QtCore.QSize(QtCore.QPoint(1,2))
55

66
# call our new QPushButton constructor
7-
button = QtGui.QPushButton("sometext");
7+
button = QtGui.QPushButton("sometext")
88

99
# call the move slot (overload1)
1010
button.move(QtCore.QPoint(0,0))
@@ -13,16 +13,16 @@
1313
button.move(0,0)
1414

1515
# call the static method
16-
print QtGui.QWidget.mouseGrabber();
16+
print (QtGui.QWidget.mouseGrabber())
1717

1818
# create a CPP object via constructor
1919
yourCpp = example.YourCPPObject(2,11.5)
2020

2121
# call the wrapped method on CPP object
22-
print yourCpp.doSomething(3);
22+
print (yourCpp.doSomething(3))
2323

24-
# show Q_SLOTS available on yourCpp
25-
print dir(yourCpp)
24+
# show slots available on yourCpp
25+
print (dir(yourCpp))
2626

2727
# destructor will be called:
2828
yourCpp = None

0 commit comments

Comments
 (0)