[PyQt] QItemDelegate

Alexandre Badez alexandre.badez at gmail.com
Wed Nov 21 15:02:31 GMT 2007


Good afternoon everyone,

I'm developing a "little" application for my own purpose, using Qt model
view.

I've develop my own model, for my own data, witch is quiet like a tree (to
make it simple).

I've got many tree view connected to my single model and that works great.

For one of those view, I would like to change a bit how it should be
represented (make some color on some specific line, and put some data of a
sub node in a line of an upper node).

So, I create a new delegate (witch inherit from QItemDelegate) and redefined
the 'paint' method for my own purpose.
I take a look about the trolltech method of qitemdelegate.cpp, and they use
the function qt_format_text function to make it properly.
This function his defined in qpainter.cpp (but it's not a method, it's a
function).

I would like to use it too in my own delegate.
How could I do that ? I've not found any clue of this function in the pyQt
documentation.

Should I do it an other way ?

Thanks for you time, and sorry for my english, it's not my mother tong.

-- 
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071121/b96b4389/attachment.html


More information about the PyQt mailing list