tags:

views:

607

answers:

3
+1  Q: 

PyQT and PyCairo

I know it's possible to place a PyCairo surface inside a Gtk Drawing Area. But I think Qt is a lot better to work with, so I've been wondering if there's anyway to place a PyCairo surface inside some Qt component?

+2  A: 

Qt's own OpenGL based surfaces (using QPainter) are known to be much faster than Cairo. Might you explain why you want specifically Cairo in Qt?

For the basics of using QPainter see this excerpt from the book "C++ GUI Programming with Qt4", and while it's C++ code, the PyQt implementation will be parallel.

As for joining Cairo with Qt... This article in ArsTechnica sheds some light - it seems nothing that could help you exists currently (iow., nobody tried such marriage).

zgoda
A: 

My need to use Cairo inside QT is that I've already developed a plotting API using PyCairo CairoPlot. This application should be a gui for the user to create and manipulate the graphics, making it easier to use

Rodrigo
A: 

For plotting with you should also consider matplotlib, which provides a higher level API and integrates well with PyQT.

Eli Bendersky