example.py
28 lines
| 631 B
| text/x-python
|
PythonLexer
florianlink
|
r153 | from PythonQt import QtCore, QtGui, example | ||
ezust
|
r0 | |||
# call our new constructor of QSize | ||||
florianlink
|
r153 | size = QtCore.QSize(QtCore.QPoint(1,2)); | ||
ezust
|
r0 | |||
# call our new QPushButton constructor | ||||
florianlink
|
r153 | button = QtGui.QPushButton("sometext"); | ||
ezust
|
r0 | |||
# call the move slot (overload1) | ||||
florianlink
|
r153 | button.move(QtCore.QPoint(0,0)) | ||
ezust
|
r0 | |||
# call the move slot (overload2) | ||||
button.move(0,0) | ||||
# call the static method | ||||
florianlink
|
r153 | print QtGui.QWidget.mouseGrabber(); | ||
ezust
|
r0 | |||
# create a CPP object via constructor | ||||
florianlink
|
r153 | yourCpp = example.YourCPPObject(2,11.5) | ||
ezust
|
r0 | |||
# call the wrapped method on CPP object | ||||
print yourCpp.doSomething(3); | ||||
# show slots available on yourCpp | ||||
print dir(yourCpp) | ||||
# destructor will be called: | ||||
yourCpp = None | ||||