Jaya Meghani wrote:
Hi,

If I add more columns in Tree Widget of Contact List then on clicking - 
background is applied to only one column.
Is this because in paint function of QtContact::paint() the option.rect gives 
the rect for a particular trewidgetitem on which its clicked.
For example if I click on row=0 and col=1, I get only that cell highlighted. 
Whereas I want whole row (row=1) to be selected. How can I achive this?

In Qt 4.2, the QTreeView supports a new property: allColumnsShowFocus[1], which probably do what you want. Unfortunately it is not present in Qt 4.1. You will have to resort to either:

- Repaint all columns in QtContact::paint(), ignoring index.row(). Easy, but not sure it will work.

- Inherit from QTreeWidget to force a repaint of the full row when selection changes, using QTreeView::setDirtyRegion(QRegion). You need to inherit from QTreeWidget because setDirtyRegion is protected.

[1]: http://doc.trolltech.com/4.2/qtreeview.html#allColumnsShowFocus-prop

Aurélien

_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to