hi all,
I want to perform a search operation in a table widget and want to highlight the row which contains particular word(key used for searching).
Please somebody tell me is that possible?
Printable View
hi all,
I want to perform a search operation in a table widget and want to highlight the row which contains particular word(key used for searching).
Please somebody tell me is that possible?
Loop through the elements or see QSortFilterProxyModel.
Thank u....
I tried like this....
Code:
QList<QTableWidgetItem *> LTempTable =temp->findItems("001",Qt::MatchEndsWith); cout<<"the matched count:"<<LTempTable.count()<<endl; foreach(rowPtr,LTempTable) { rowPtr->setBackground(Qt::red); }
But it is highlighting only that particular item, i want to highlight that whole row...
How can i do that?
Put in a for loop and set the background on all items in the same row as the matched item.
Alternatively you could use the QTableWidget selection with selection mode QAbstractItemView::ExtendedSelection and selection behaviour QAbstractItemView::SelectRows.