PDA

View Full Version : Highlighting substring problem



chandan
18th April 2010, 16:56
Hello Everyone,
I am now in a middle of a project, where I am developing a use interface. I have a QAbstractListModel and I am adding that model into QTreeView. In my User Interface I have some filter buttons which will generally compress the list of items according to name of the user. I am using QSortFilterProxyModel and QRegExp for that. Everything is working fine but now I want to be more specific , like I want to highlight the substring that will be matched with the regular expression that is generated by pressing my filter window. I know where it is matching and I have the substring. So how can I achieve it? I want use different fornt and color mor matched portion and the portion that doesn't match with regular expression.

Thanks in advance.

chandan
18th April 2010, 17:01
I am sorry in my previous question there are some mistakes. I have corrected them in this.


Hello Everyone,
I am now in a middle of a project, where I am developing a user interface. I have a QAbstractListModel and I am adding that model into QTreeView. In my User Interface I have some filter buttons which will generally compress the list of items according to name of the patient from a list of patient. I am using QSortFilterProxyModel and QRegExp for that. Everything is working fine but now I want to be more specific , like I want to highlight the substring that will be matched with the regular expression that is generated by pressing my filter buttons. I know where it is matching and I have the substring. So how can I achieve it? I want to use different fornt and color for matched portion and the portion that doesn't match with regular expression.

Thanks in advance.