File tree 3 files changed +12
-12
lines changed
3 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
from PythonQt .example import *
2
2
3
- print "CustomObject wrapped by decorators"
3
+ print ( "CustomObject wrapped by decorators" )
4
4
5
5
# create a new object
6
6
custom = CustomObject ("John" ,"Doe" )
7
7
8
8
# print the object (to see how it is wrapped)
9
- print custom
9
+ print ( custom )
10
10
11
11
# print the methods available
12
- print dir (custom )
12
+ print ( dir (custom ) )
13
13
14
14
# set a name
15
15
custom .setFirstName ("Mike" )
16
16
custom .setLastName ("Michels" )
17
17
18
18
# get the name
19
- print custom .firstName () + " " + custom .lastName ();
19
+ print ( custom .firstName () + " " + custom .lastName ())
Original file line number Diff line number Diff line change 4
4
custom = CustomObject ("John" ,"Doe" )
5
5
6
6
# print the methods available
7
- print dir (custom )
7
+ print ( dir (custom ) )
8
8
9
9
# set a name
10
10
custom .setFirstName ("Mike" )
11
11
custom .setLastName ("Michels" )
12
12
13
13
# get the name
14
- print custom .firstName () + " " + custom .lastName ();
14
+ print ( custom .firstName () + " " + custom .lastName ())
Original file line number Diff line number Diff line change 1
1
from PythonQt import QtCore , QtGui , example
2
2
3
3
# call our new constructor of QSize
4
- size = QtCore .QSize (QtCore .QPoint (1 ,2 ));
4
+ size = QtCore .QSize (QtCore .QPoint (1 ,2 ))
5
5
6
6
# call our new QPushButton constructor
7
- button = QtGui .QPushButton ("sometext" );
7
+ button = QtGui .QPushButton ("sometext" )
8
8
9
9
# call the move slot (overload1)
10
10
button .move (QtCore .QPoint (0 ,0 ))
13
13
button .move (0 ,0 )
14
14
15
15
# call the static method
16
- print QtGui .QWidget .mouseGrabber ();
16
+ print ( QtGui .QWidget .mouseGrabber ())
17
17
18
18
# create a CPP object via constructor
19
19
yourCpp = example .YourCPPObject (2 ,11.5 )
20
20
21
21
# call the wrapped method on CPP object
22
- print yourCpp .doSomething (3 );
22
+ print ( yourCpp .doSomething (3 ))
23
23
24
- # show Q_SLOTS available on yourCpp
25
- print dir (yourCpp )
24
+ # show slots available on yourCpp
25
+ print ( dir (yourCpp ) )
26
26
27
27
# destructor will be called:
28
28
yourCpp = None
You can’t perform that action at this time.
0 commit comments