Qt4-preview-feedback Archive, April 2007
Problem with search within tree- and probably other views
Message 1 in thread
Hi all,
I am trying to implement a search within a QTreeView of QStandardItems. Therefore I search a string in all columns with
QList<QStandardItem*> m_Search;
m_Search.clear();
for(int i=0; i<header()->count() /*columnCount()*/; i++)
m_Search += static_cast<QStandardItemModel*>(model())->findItems(what, (Qt::MatchFlags)flags, i);
m_SearchIt = m_Search.begin();
scrollTo((*m_SearchIt)->index());
The problem is that when the given text occurs in the 4th line on the 2nd column, but in the 2nd line in the 4th column,
then the 4th line will be selected first, and pressing F3 for finding the next occurance will jump back to the 2nd line. Is there
a workaround or will this be changed in the future? Maybe implementing -1 for searching in all columns?
To unsubscribe - send "unsubscribe" in the subject to qt4-preview-feedback-request@xxxxxxxxxxxxx