Skip to content

Commit 90f8cc0

Browse files
committed
updated docs and exported class info
1 parent eb1b715 commit 90f8cc0

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/PythonQtClassInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct PythonQtMemberInfo {
8282
//! a class that stores all required information about a Qt object (and an optional associated C++ class name)
8383
/*! for fast lookup of slots when calling the object from Python
8484
*/
85-
class PythonQtClassInfo {
85+
class PYTHONQT_EXPORT PythonQtClassInfo {
8686

8787
public:
8888
PythonQtClassInfo();

src/PythonQtDoc.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
- Polymorphic downcasting (if e.g. PythonQt sees a QEvent, it can downcast it depending on the type(), so the Python e.g. sees a QPaintEvent instead of a plain QEvent)
114114
- Deriving C++ objects from Python and overwriting virtual method with a Python implementation (requires usage of wrapper generator or manual work!)
115115
- Extensible handler for Python/C++ conversion of complex types, e.g. mapping of QVector<SomeObject> to/from a Python array
116+
- Setting of dynamic QObject properties via setProperty(), dynamic properties can be accessed for reading and writing like normal Python attributes (but creating a new property needs to be done with setProperty(), to distinguish from normal Python attributes)
116117
117118
\section FeaturesQtAll Features (with PythonQt_QtAll linked in)
118119
@@ -130,24 +131,26 @@
130131
- QtUiTools
131132
- QtWebKit
132133
- QtXml
133-
- QtXmlPatterns
134-
- (phonon, QtHelp, assistant, designer are currently not supported, this would require some additional effort on the code generator)
134+
- (QtXmlPatterns, QtScript, QtHelp, phonon, assistant, designer are currently not supported, this would require some additional effort on the code generator)
135135
- For convenience, all classes are also available in the PythonQt.Qt module, for people who do not care in which module a class is located
136-
- Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python
136+
- Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python (this feature is considered experimental!)
137137
- Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
138138
- Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
139139
140140
\section Comparision Comparision with PyQt/PySide
141141
142-
- PythonQt is not as Pythonic as PyQt in many details (e.g. buffer protocol, pickling, translation support, ...) and it is mainly thought for embedding and intercommunication between Qt/Cpp and Python
142+
- PythonQt is not as pythonic as PyQt in many details (e.g. buffer protocol, pickling, translation support, ...) and it is mainly thought for embedding and intercommunication between Qt/Cpp and Python
143143
- 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
144144
- 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 does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
146-
- QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it
147-
- PythonQt does not (yet) offer to add new signals to Python/C++ objects
148-
- Ownership of objects is a bit different in PythonQt, currently Python classes derived from a C++ class need to be manually referenced in Python to not get deleted too early (this will be fixed)
149-
- QStrings are always converted to unicode Python objects (PyQt returns QString instead), we prefered to return Python strings.
145+
- PythonQt currently does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
146+
- QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it like a normal slot
147+
- PythonQt does not (yet) offer to add new signals to Python/C++ objects and it does not yet support the newstyle PyQt signals (so you need to connect via C++ string signatures)
148+
- Ownership of objects is a bit different in PythonQt, currently Python classes derived from a C++ class need to be manually referenced in Python to not get deleted too early (this will be fixed in a future version)
149+
- QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using str()
150+
- There are many details in the generated wrappers that could need some polishing, e.g., methods that use pointer arguments for additional return values could return a results tuple.
151+
- Not all types of QList/QVector/QHash templates are supported, some Qt methods use those as arguments/return values (but you can add your own handlers to handle them if you need them).
150152
- Probably there are lots of details that differ, I do not know PyQt that well to list them all.
153+
- In the long run, PythonQt will consider using/extending PySide with the features of PythonQt to get rid of its own generator and typesystem files, alternatively the KDE Smoke generator might be used in the future (this has not yet been decided, the current PythonQt generator works well and there is no hurry to switch).
151154
152155
\section Interface
153156

0 commit comments

Comments
 (0)