[PyQt] openRPT and pyQT

Matt Newell newellm at blur.com
Fri Apr 23 00:42:18 BST 2010

> Thanks for the response.  I guess I'm surprized that others don't know
> about openRPT.  I wonder what everyone is using for a report writer?  I'm
> using pyQT to write a CRUD app.  And I need a report writer.  I looked at
> reportlab but soon discovered openRPT.  The xTuple folks use it (both
> xTuple and openRPT writer were written in QT).
> So I guess the question is what is required to interface pyQT to other QT
> programs written in C++.  I realize that the question is very general.  But
> I hope others will provide at least a starting point for me.
I think it really depends on what you want to accomplish using python/pyqt.  
At the very least you'll have to write .sip bindings for whatever classes you 
want to use from python.  From there you'll need to make the app into a 
library so it's functionality can be used from a python script, and/or embed 
python into the program itself and add hooks in appropriate places.

For example if your goal is to use a template already created through the gui, 
and have a script load that template and generate reports automatically with 
different data sets, then you might need a fairly small subset of the 
programs functionality exposed to python.

If on the other hand you want to be able to embed python fragments into the 
forms, in order to manipulate the data in some way, that may require 
significant modification to the program itself.

No matter what you will have to become familiar with sip, and if you go the 
embedding route you will also have to become familiar with some of python's 

> What is 
> implied also in my question is the assumation that because openRPT (and
> others) were written in QT that should be some sort of standard way to
> interface from pyQT.
Writing sip bindings for C++ classes that use Qt is fairly straightforward in 
most cases.  IMO it can be learned quite quickly by looking at the .sip files 
used by PyQt4 itself, and referring to the docs when you don't understand 
what is what.


More information about the PyQt mailing list