[Qt-interest] Tree Item High Lighter

william.crocker at analog.com william.crocker at analog.com
Mon Dec 27 16:42:16 CET 2010



Scott Aron Bloom wrote:
> 
> -----Original Message-----
> From: qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com
> [mailto:qt-interest-bounces+scott.bloom=onshorecs.com at qt.nokia.com] On
> Behalf Of Eckhard Jokisch
> Sent: Sunday, December 26, 2010 7:53 PM
> To: qt-interest at qt.nokia.com
> Subject: Re: [Qt-interest] Tree Item High Lighter
> 
> Am 27.12.2010 00:54, schrieb Sajjad:
>> Hello forum,
>>
>> I have subclassed the QAbstractItemModel to generate a customized tree
> model
>> and since the tree model represent a large database, it is hard for
> the user
>> to browse down all  the items in the  tree and find a  particular
> item. For
>> a better usability, i would like to have a textfield where the user
> type a
>> item name and the item with the name matched will be highlighted in
> the
>> tree.
>>
>> Any hint on implementing this feature. I think i need to work with
> regular
>> expression here and i am not sure how to search down the tree and
> highlight
>> it.
> What about this:
> while setting up the model data also fill a QHash<QString,QModelIndex>.
> Like this you can simply search for the string in the QHash and get the
> associated modelindex.
> 

I thought long term storage of QModelIndex items was not recommended.

Bill



More information about the Qt-interest-old mailing list