##// END OF EJS Templates
Now Works with Python 2 & 3, Qt 4 & 5....
Now Works with Python 2 & 3, Qt 4 & 5. CMake now generates different librariy files depending on the linked Qt/Python versions: PythonQt - Qt 4.x + Python 2.x PythonQt_3 - Qt 4.x + Python 3.x PythonQt5 - Qt 5.x + Python 2.x PythonQt5_3 - Qt 5.x + Python 3.x Fix Qt 4 build.

File last commit:

r152:d0d61419dda4
r208:1476f2d2cf46
Show More
example.py
38 lines | 779 B | text/x-python | PythonLexer
from PythonQt.example import *
print "alternative 1 : CustomObject wrapped by decorators"
# create a new object
custom = CustomObject("John","Doe")
# print the object (to see how it is wrapped)
print custom
# print the methods available
print dir(custom)
# set a name
custom.setFirstName("Mike")
custom.setLastName("Michels")
# get the name
print custom.firstName() + " " + custom.lastName();
print
print "alternative 2 : CustomObject2 wrapped by factory"
# create a new object
custom2 = CustomObject2("John","Doe")
# print the object (to see how it is wrapped)
print custom2
# print the methods available
print dir(custom2)
# set a name
custom2.setFirstName("Mike")
custom2.setLastName("Michels")
# get the name
print custom2.firstName() + " " + custom2.lastName();