PDA

View Full Version : Source Model Ad Proxy Model



sajis997
18th July 2011, 17:04
Hello forum,

I have subclassed the QAbstractItemModel to create a tree model and assigned it to the tree view to show the data in tree hierarchy. Now i want to highlight a tree item based on the input of the line edit.

Even if the child item is not expanded, it will be highlighted if the line edit expression is matched. I have the following questions.

1 I have instantiated the proxyModel and set to the source model.

2. The Tree view set the proxymodel instead the main model, Is that ok?


I do not want to alter any item in the tree view except the fact that the matched item will be highlighted. But i am having the item to be filtered as well(only the matched item is shown in the tree view and the rest are removed from the view), which i do not want. I want to highlight the matched item.


Looking forward to some hints on this issue

Thanks
Sajjad

Santosh Reddy
19th July 2011, 05:13
http://www.qtcentre.org/threads/42428-Highlight-Tree-Item-Viw?p=197462#poststop