Skip to content

Commit 08a6b85

Browse files
committed
improved docs
1 parent 3a1ea5f commit 08a6b85

File tree

1 file changed

+30
-24
lines changed

1 file changed

+30
-24
lines changed

src/PythonQtDoc.h

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
\if USE_GLOBAL_DOXYGEN_DOC
4747
\page PythonQtPage PythonQt Overview
4848
\else
49-
\mainpage PythonQt Overview
49+
\mainpage PythonQt
5050
\endif
5151
5252
\section Introduction
@@ -66,14 +66,9 @@
6666
Image Processing and Visualization platform MeVisLab (http://www.mevislab.de)
6767
scriptable from Python.
6868
69+
\page Features Features
6970
70-
\section Download
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
71+
\section Builtin Built-in Features
7772
7873
The following are the built-in features of the PythonQt library:
7974
@@ -96,7 +91,7 @@
9691
- Extensible handler for Python/C++ conversion of complex types, e.g. mapping of QVector<SomeObject> to/from a Python array
9792
- 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)
9893
99-
\section FeaturesQtAll Features (with PythonQt_QtAll linked in)
94+
\section FeaturesQtAll Features with wrapper generator
10095
10196
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.
10297
This offers the following features:
@@ -118,9 +113,20 @@
118113
- Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
119114
- Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
120115
121-
122-
\section Licensing
116+
\page Download Download
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/
123124
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+
124130
PythonQt is distributed under the LGPL license, so it pairs well with the LGPL of the Qt 4.5 release and allows
125131
to be used in commercial applications when following the LGPL 2.1 obligations.
126132
@@ -138,7 +144,6 @@
138144
You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
139145
but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
140146
141-
142147
\section Comparison Comparison with PyQt/PySide
143148
144149
- 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 @@
154159
- Probably there are lots of details that differ, I do not know PyQt that well to list them all.
155160
- 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).
156161
157-
\section Interface
162+
\page Developer Developer
163+
164+
\section Interface Interface
158165
159166
The main interface to PythonQt is the PythonQt singleton.
160167
PythonQt needs to be initialized via PythonQt::init() once.
@@ -393,7 +400,7 @@ yourCpp = None
393400
394401
\endcode
395402
396-
\section Building
403+
\page Building Building
397404
398405
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.
399406
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].
473480
474481
There is a unit test that tests most features of PythonQt, see the \b tests subdirectory for details.
475482
476-
\section Examples
483+
\page Examples Examples
477484
478485
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.
480487
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:
482489
483490
\code
484491
#include "PythonQt.h"
@@ -491,22 +498,21 @@ the python2x.[lib | dll | so | dynlib].
491498
QApplication qapp(argc, argv);
492499
493500
// init PythonQt and Python itself
494-
PythonQt::init(PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut);
495-
501+
PythonQt::init();
496502
497503
// get a smart pointer to the __main__ module of the Python interpreter
498-
PythonQtObjectPtr mainContext = PythonQt::self()->getMainModule();
504+
PythonQtObjectPtr context = PythonQt::self()->getMainModule();
499505
500506
// add a QObject as variable of name "example" to the namespace of the __main__ module
501507
PyExampleObject example;
502-
PythonQt::self()->addObject(mainContext, "example", &example);
508+
context.addObject("example", &example);
503509
504510
// do something
505-
PythonQt::self()->runScript(mainContext, "print example\n");
506-
PythonQt::self()->runScript(mainContext, "def multiply(a,b):\n return a*b;\n");
511+
context.evalScript("print example");
512+
context.evalScript("def multiply(a,b):\n return a*b;\n");
507513
QVariantList args;
508514
args << 42 << 47;
509-
QVariant result = PythonQt::self()->call(mainContext,"multiply", args);
515+
QVariant result = context.call("multiply", args);
510516
...
511517
\endcode
512518

0 commit comments

Comments
 (0)