[PyQt] Cannot figure out the canvas module in the PyQt4 package

David Boddie david at boddie.org.uk
Mon Aug 27 11:47:28 BST 2007


On Mon Aug 27 11:16:00 BST 2007, Shyamsundar, Purkayastha wrote:

> I was not aware of the QGraphics package of Qt. My notion was that all
> the earlier QCanvas classes have been renamed with Q3Canvas in Py4 and
> was searching for it PyQt4 modules.

PyQt4 doesn't include any of the Qt3Support classes. There is a third-party
project to produce bindings for some of these classes but I don't think it
includes any of the Q3Canvas classes.

> Going by the API docs I figured out that it has all the features
> provided by QCanvas
> 
> Is it more superior that the QCanvas ? 

Yes, probably in every respect that matters. Some details:

  http://doc.trolltech.com/4.3/graphicsview.html
  http://doc.trolltech.com/qq/qq19-graphicsview.html

If you have existing code that uses the QCanvas classes, you might appreciate
the porting information that's available for C++ programmers:

  http://doc.trolltech.com/4.3/graphicsview-porting.html
  http://doc.trolltech.com/qq/qq21-portingcanvas.html

A lot of the general advice given is also applicable to PyQt applications.

David


More information about the PyQt mailing list