[PyKDE] Aligning Text in a Table

Simon Edwards simon at simonzone.com
Fri Jun 27 17:21:00 BST 2003


Hi,

On Friday 27 June 2003 16:49, Bob Parnes wrote:
> Sorry for posing trivial questions, but I do not understand how to use
> paintCell. Attached is a demo to right-align text in a table cell.
> There is no error message, but the code is ignored. So I assume that I
> misinterpreted the documentation.

You've got yourself fairly mixed up. The idea is that you subclass QTable 
(i.e. FooTable), and reimplement the paintCell() method. When Qt wants your 
FooTable to paint a cell it will call your paintCell() method and pass in a 
QPainter object. In paintCell() you then draw the cell contents on the 
QPainter object that you received.

cheers,

-- 
Simon Edwards             | Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."




More information about the PyQt mailing list