On Fri, 5 Mar 2004 09:48:47 -0800 (PST), Peter Gordon <[EMAIL PROTECTED]> wrote:

Is it possible to add QPushButton (or QToolButton) to
QListView with QListViewItem or any other way? I want
to have one column with pusbutton.
Also how can you control the background/foreground
color of each row? I saw an article on Trolltech site
using C++ but I do not know how to traslate it to
Python.

To derive from the QListViewItem and overwrite the paintCell method. So you can control the colors.

    def paintCell(self, p, cg, column, width, align):
        _qg = QColorGroup(cg)
        _qg.setColor(QColorGroup.Text, a_text_color)
        _qg.setColor(QColorGroup.Background, a_background_color)
        QListViewItem.paintCell(self, p, _qg, column,width, align)

The step must well-advised. Every insert or sort of rows call this method.



Peter

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what youâre looking for faster
http://search.yahoo.com

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde



-- The box said "Requires WinXP, W2k, or better," and so I installed Linux.

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde

Reply via email to