@@ -143,8 +143,9 | |||||
143 | - PythonQt is not as Pythonic as PyQt in many details (e.g. operator mapping, pickling, translation support, ...) and it is maily thought for embedding and intercommunication between Qt/Cpp and Python |
|
143 | - PythonQt is not as Pythonic as PyQt in many details (e.g. operator mapping, pickling, translation support, ...) and it is maily thought for embedding and intercommunication between Qt/Cpp and Python | |
144 | - PythonQt allows to communicate in both directions, e.g. calling a Python object from C++ AND calling a C++ method from Python, while PyQt only handles the Python->C++ direction |
|
144 | - PythonQt allows to communicate in both directions, e.g. calling a Python object from C++ AND calling a C++ method from Python, while PyQt only handles the Python->C++ direction | |
145 | - PythonQt offers properties as Python attributes, while PyQt offers them as setter/getter methods (e.g. QWidget.width is a property in PythonQt and a method in PyQt) |
|
145 | - PythonQt offers properties as Python attributes, while PyQt offers them as setter/getter methods (e.g. QWidget.width is a property in PythonQt and a method in PyQt) | |
146 | - PythonQt does not auto-convert objects, e.g. when a QPainter expects a QBrush and you pass a QColor, it is rejected, you will need to write QBrush(QColor(1,2,3)) instead |
|
146 | - PythonQt does not (yet?) offer QtCore.SIGNAL() and QtCore.SLOT() methods, connect and disconnect just take strings for signals and slots | |
147 | - PythonQt returns/handles enums/flags as integers, which can cause problems on overloads that take ints and enums, a future version might use an own enum type (like PyQt does) |
|
147 | - QObject.emit to emit Qt signals from Python is not yet possible | |
|
148 | - Ownership of objects is a bit different in PythonQt, currently Python classes derived from a C++ class need to be manually references in PythonQt to not get deleted too early (this will be fixed) | |||
148 | - Probably there are lots of details that differ, I do not know PyQt that well to list them all. |
|
149 | - Probably there are lots of details that differ, I do not know PyQt that well to list them all. | |
149 |
|
150 | |||
150 |
|
151 |
@@ -62,13 +62,16 public slots: | |||||
62 | bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable); |
|
62 | bool disconnect(QObject* sender, const QByteArray& signal, PyObject* callable); | |
63 | bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); |
|
63 | bool disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot); | |
64 |
|
64 | |||
|
65 | bool static_QObject_connect(QObject* sender, const QByteArray& signal, PyObject* callable) { return connect(sender, signal, callable); } | |||
|
66 | bool static_QObject_connect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot) { return connect(sender, signal, receiver, slot); } | |||
|
67 | bool static_QObject_disconnect(QObject* sender, const QByteArray& signal, PyObject* callable) { return disconnect(sender, signal, callable); } | |||
|
68 | bool static_QObject_disconnect(QObject* sender, const QByteArray& signal, QObject* receiver, const QByteArray& slot) { return disconnect(sender, signal, receiver, slot); }; | |||
|
69 | ||||
65 |
|
|
70 | QObject* parent(QObject* o); | |
66 | void setParent(QObject* o, QObject* parent); |
|
71 | void setParent(QObject* o, QObject* parent); | |
67 |
|
72 | |||
68 | QVariantList children(QObject* o); |
|
73 | QVariantList children(QObject* o); | |
69 |
|
74 | |||
70 | QString static_Qt_escape(const QString& s) { return Qt::escape(s); } |
|
|||
71 |
|
||||
72 | //TODO: add findChild/findChildren/children/... |
|
75 | //TODO: add findChild/findChildren/children/... | |
73 | }; |
|
76 | }; | |
74 |
|
77 |
General Comments 0
You need to be logged in to leave comments.
Login now