[PyQt] QItemDelegate
Andreas Pakulat
apaku at gmx.de
Wed Nov 21 16:06:45 GMT 2007
On 21.11.07 16:02:31, Alexandre Badez wrote:
> 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.
You can't, unless you copy the code, translate it to python and put it
into your own delegate. Only whats documented in the API docs can be
used without copying it, everything else in Qt's code is private.
Andreas
--
Your mode of life will be changed for the better because of new developments.
More information about the PyQt
mailing list