[PySide] PySide C++ hybrid app

Florian Link florianlink at gmail.com
Fri Mar 21 15:14:51 CET 2014


For hybrid Qt C++/Python applications or embedding Python into an existing
Qt application, PythonQt might also be worth a look, also the wrappers are
not as complete as PySide's, it has a nice API for embedding and calling
Python from Qt.

http://pythonqt.sourceforge.net/

regards,
Florian



On Fri, Mar 21, 2014 at 12:00 PM, <pyside-request at qt-project.org> wrote:

> Send PySide mailing list submissions to
>         pyside at qt-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.qt-project.org/mailman/listinfo/pyside
> or, via email, send a message with subject or body 'help' to
>         pyside-request at qt-project.org
>
> You can reach the person managing the list at
>         pyside-owner at qt-project.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PySide digest..."
>
>
> Today's Topics:
>
>    1. Re: PySide C++ hybrid app. (peter_karasev at agilent.com)
>    2. PySide documentation on Qt Assistant (Jorge Araya Navarro)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 20 Mar 2014 15:13:27 +0000
> From: <peter_karasev at agilent.com>
> Subject: Re: [PySide] PySide C++ hybrid app.
> To: <ntod8729 at uni.sydney.edu.au>, <mpachock at gmail.com>,
>         <pyside at qt-project.org>
> Message-ID:
>         <D815FB9026482D448D198191DAACD66D202D4D67 at wcosexch01.agilent.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Michal,
>
>  What makes this somewhat difficult (for me anyway) is when you are trying
> to expose non-QT classes together with shiboken QT classes. Boost python
> makes executing python from c++ pretty easy; I use template functors like
> this one to to grab QT objects in c++:
>
>
> http://stackoverflow.com/questions/18542778/import-classes-from-pyside-inside-of-a-boost-python-module/20874038#20874038
>
> Once you register the converter with
> QtGui_from_python<QColor,SBK_QCOLOR_IDX>() , a boost::python wrapped class
> that returns QColor will end up returning a PySide.QtGui.QColor object on
> the python side.
>
> -pk
>
>
> ________________________________
> From: pyside-bounces+peter_karasev=agilent.com at qt-project.org[pyside-bounces+peter_karasev=
> agilent.com at qt-project.org] on behalf of ntod8729 at uni.sydney.edu.au [
> ntod8729 at uni.sydney.edu.au]
> Sent: Monday, March 17, 2014 10:42
> To: Micha? Pachocki; pyside at qt-project.org
> Subject: Re: [PySide] PySide C++ hybrid app.
>
>
> Hi Michal,
>
> You need to first embed the Python interpreter into your C++ application.
> You can find the relevant information on doing that here<
> http://docs.python.org/2/extending/embedding.html> . Section 5.3 shows
> you how you can call a Python function from C++. You then need to wrap your
> function arguments as PyObects using either the python C API (for types
> such as int, char * etc.) or shiboken (for Qt classes) in order to pass
> them to your Python function. You will also need to unwrap any return types
> to retrieve a pointer to use in C++. There is some code that demonstrates
> the wrapping/unwrapping here in some of the source from the CLAM project<
> http://clam-project.org/clam/trunk/ipyclam/>. Admittedly I haven't tried
> the shiboken code myself as I had already rolled my own before stumbling
> across this, but I based some code on their sipunwrap source for doing the
> same thing with PyQt without any problems.
>
> Hope this helps,
> Nick ?
>
>
> ________________________________
> From: pyside-bounces+ntod8729=uni.sydney.edu.au at qt-project.org<pyside-bounces+ntod8729=
> uni.sydney.edu.au at qt-project.org> on behalf of Micha? Pachocki <
> mpachock at gmail.com>
> Sent: Monday, 17 March 2014 3:39 PM
> To: pyside at qt-project.org
> Subject: [PySide] PySide C++ hybrid app.
>
> Hello,
>
> In tutorial "SuperHybrids part 2, now Qt + PySide [1]" there is a
> description how run python code from c++ lib, but the app is running from
> python. How to make calls to PySide from native C++ app, so C++ objects
> will be visible from Python and vice-versa?
>
> [1] http://lynxline.com/superhybrids-part-2-now-qt-pyside/
>
> regards,
> mp
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.qt-project.org/pipermail/pyside/attachments/20140320/861021fb/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Thu, 20 Mar 2014 11:05:05 -0600
> From: Jorge Araya Navarro <kartelo at gmx.com>
> Subject: [PySide] PySide documentation on Qt Assistant
> To: pyside at qt-project.org
> Message-ID: <1395335105.6334.3.camel at localhost.localdomain>
> Content-Type: text/plain; charset="utf-8"
>
> Hello!
>
> I'm in a journey of generating important python-related documentation of
> many important projects to view them on Qt Assistant. I'm struggling to
> understand how I can generate the PySide documentation, or how could I
> change the CMakeLists files to add the command `sphinx-build -b qthelp .
> build/qthelp` and then `qcollectiongenerator-qt4
> build/qthelp/PySide.qhcp` so the documentation for Qt Assistant can be
> generated.
>
> Any help will be very appreciated!
> --
> Pax et bonum.
> Jorge Araya Navarro.
> Dise?ador publicitario, programador Python/C++ y colaborador en Parabola
> GNU/Linux-libre.
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.qt-project.org/pipermail/pyside/attachments/20140320/c60ddb54/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside
>
>
> End of PySide Digest, Vol 26, Issue 15
> **************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20140321/4da9a1e8/attachment.html>


More information about the PySide mailing list