Im performing search operation on a tablewidget.(using search key)
Highlighted found key in the table widget.
Now i want to update the table, which contains only those rows which has search key.
Now i already highlighted the found search key, but i'm unable to fetch whole row which contains the search key.
Please tell me how can i get that particular row, which contain that search key?
QString SearchKey
=ui
->lineEdit_key
->text
();
QList<QTableWidgetItem *> LTempTable =temp->findItems(SearchKey,Qt::MatchExactly);
cout<<"the matched count:"<<LTempTable.count()<<endl;
foreach(rowPtr,LTempTable)
{
rowPtr->setBackground(Qt::red);
int rowNo=temp->row(rowPtr);
cout<<"THE ROW NUMBER IS:"<<rowNo<<endl; <-----getting row number but how can i get complete row?
}
}
QString SearchKey=ui->lineEdit_key->text();
QList<QTableWidgetItem *> LTempTable =temp->findItems(SearchKey,Qt::MatchExactly);
cout<<"the matched count:"<<LTempTable.count()<<endl;
foreach(rowPtr,LTempTable)
{
rowPtr->setBackground(Qt::red);
int rowNo=temp->row(rowPtr);
cout<<"THE ROW NUMBER IS:"<<rowNo<<endl; <-----getting row number but how can i get complete row?
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks