##// END OF EJS Templates
improved docs...
florianlink -
r143:7fb4ed4ea794
parent child
Show More
@@ -46,7 +46,7
46 \if USE_GLOBAL_DOXYGEN_DOC
46 \if USE_GLOBAL_DOXYGEN_DOC
47 \page PythonQtPage PythonQt Overview
47 \page PythonQtPage PythonQt Overview
48 \else
48 \else
49 \mainpage PythonQt Overview
49 \mainpage PythonQt
50 \endif
50 \endif
51
51
52 \section Introduction
52 \section Introduction
@@ -66,14 +66,9
66 Image Processing and Visualization platform MeVisLab (http://www.mevislab.de)
66 Image Processing and Visualization platform MeVisLab (http://www.mevislab.de)
67 scriptable from Python.
67 scriptable from Python.
68
68
69 \page Features Features
69
70
70 \section Download
71 \section Builtin Built-in Features
71
72 PythonQt is hosted on SourceForge at http://sourceforge.net/projects/pythonqt , you can access it via SVN
73 or download a tarball.
74
75
76 \section Features
77
72
78 The following are the built-in features of the PythonQt library:
73 The following are the built-in features of the PythonQt library:
79
74
@@ -96,7 +91,7
96 - Extensible handler for Python/C++ conversion of complex types, e.g. mapping of QVector<SomeObject> to/from a Python array
91 - Extensible handler for Python/C++ conversion of complex types, e.g. mapping of QVector<SomeObject> to/from a Python array
97 - 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)
92 - 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)
98
93
99 \section FeaturesQtAll Features (with PythonQt_QtAll linked in)
94 \section FeaturesQtAll Features with wrapper generator
100
95
101 Thanks to the new wrapper generator, PythonQt now offers the additional PythonQt_QtAll library which wraps the complete Qt API, including all C++ classes and all non-slots on QObject derived classes.
96 Thanks to the new wrapper generator, PythonQt now offers the additional PythonQt_QtAll library which wraps the complete Qt API, including all C++ classes and all non-slots on QObject derived classes.
102 This offers the following features:
97 This offers the following features:
@@ -118,9 +113,20
118 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
113 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
119 - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
114 - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
120
115
121
116 \page Download Download
122 \section Licensing
117
118 PythonQt is hosted on SourceForge at http://sourceforge.net/projects/pythonqt.
119
120 You can download the source code as a tarball at http://sourceforge.net/projects/pythonqt/files/.
121 Alternatively you can get the latest version from the svn repository.
122
123 You can also browse the source code online via ViewVC: http://pythonqt.svn.sourceforge.net/viewvc/pythonqt/trunk/
123
124
125 \note We do not offer prebuilt binaries, since there are so many possible combinations of
126 platforms (Windows/Linux/MacOs), architectures (32/64 bit) and Python versions.
127
128 \page License License
129
124 PythonQt is distributed under the LGPL license, so it pairs well with the LGPL of the Qt 4.5 release and allows
130 PythonQt is distributed under the LGPL license, so it pairs well with the LGPL of the Qt 4.5 release and allows
125 to be used in commercial applications when following the LGPL 2.1 obligations.
131 to be used in commercial applications when following the LGPL 2.1 obligations.
126
132
@@ -138,7 +144,6
138 You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
144 You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
139 but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
145 but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
140
146
141
142 \section Comparison Comparison with PyQt/PySide
147 \section Comparison Comparison with PyQt/PySide
143
148
144 - 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
149 - 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
@@ -154,7 +159,9
154 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
159 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
155 - 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).
160 - 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).
156
161
157 \section Interface
162 \page Developer Developer
163
164 \section Interface Interface
158
165
159 The main interface to PythonQt is the PythonQt singleton.
166 The main interface to PythonQt is the PythonQt singleton.
160 PythonQt needs to be initialized via PythonQt::init() once.
167 PythonQt needs to be initialized via PythonQt::init() once.
@@ -393,7 +400,7 yourCpp = None
393
400
394 \endcode
401 \endcode
395
402
396 \section Building
403 \page Building Building
397
404
398 PythonQt requires at least Qt 4.6.1 (for earlier Qt versions, you will need to run the pythonqt_gerenator, Qt 4.3 is the absolute minimum) and Python 2.5.x or 2.6.x on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes.
405 PythonQt requires at least Qt 4.6.1 (for earlier Qt versions, you will need to run the pythonqt_gerenator, Qt 4.3 is the absolute minimum) and Python 2.5.x or 2.6.x on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes.
399 To compile PythonQt, you will need a python developer installation which includes Python's header files and
406 To compile PythonQt, you will need a python developer installation which includes Python's header files and
@@ -473,12 +480,12 the python2x.[lib | dll | so | dynlib].
473
480
474 There is a unit test that tests most features of PythonQt, see the \b tests subdirectory for details.
481 There is a unit test that tests most features of PythonQt, see the \b tests subdirectory for details.
475
482
476 \section Examples
483 \page Examples Examples
477
484
478 Examples are available in the \b examples directory. The PyScriptingConsole implements a simple
485 Examples are available in the \b examples directory. The PyScriptingConsole implements a simple
479 interactive scripting console that shows how to script a simple application.
486 interactive scripting console that shows how to script a simple application. The PyLauncher application can be used to run arbitrary PythonQt scripts given on the commandline.
480
487
481 The following shows how to integrate PythonQt into you Qt application:
488 The following shows a simple example on how to integrate PythonQt into your Qt application:
482
489
483 \code
490 \code
484 #include "PythonQt.h"
491 #include "PythonQt.h"
@@ -491,22 +498,21 the python2x.[lib | dll | so | dynlib].
491 QApplication qapp(argc, argv);
498 QApplication qapp(argc, argv);
492
499
493 // init PythonQt and Python itself
500 // init PythonQt and Python itself
494 PythonQt::init(PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut);
501 PythonQt::init();
495
496
502
497 // get a smart pointer to the __main__ module of the Python interpreter
503 // get a smart pointer to the __main__ module of the Python interpreter
498 PythonQtObjectPtr mainContext = PythonQt::self()->getMainModule();
504 PythonQtObjectPtr context = PythonQt::self()->getMainModule();
499
505
500 // add a QObject as variable of name "example" to the namespace of the __main__ module
506 // add a QObject as variable of name "example" to the namespace of the __main__ module
501 PyExampleObject example;
507 PyExampleObject example;
502 PythonQt::self()->addObject(mainContext, "example", &example);
508 context.addObject("example", &example);
503
509
504 // do something
510 // do something
505 PythonQt::self()->runScript(mainContext, "print example\n");
511 context.evalScript("print example");
506 PythonQt::self()->runScript(mainContext, "def multiply(a,b):\n return a*b;\n");
512 context.evalScript("def multiply(a,b):\n return a*b;\n");
507 QVariantList args;
513 QVariantList args;
508 args << 42 << 47;
514 args << 42 << 47;
509 QVariant result = PythonQt::self()->call(mainContext,"multiply", args);
515 QVariant result = context.call("multiply", args);
510 ...
516 ...
511 \endcode
517 \endcode
512
518
General Comments 0
You need to be logged in to leave comments. Login now