I could use match method of the model...but it is not the problem to get the indexes...the problem is TO SET SELECTED items on particular indexes....
when the data stored on those indexes match some/value criteria....
my code now looks this way:
if(model->rowCount()){
for(int row=0; row<model->rowCount();++row){
if((model->data(index0).toInt()==id) && (model->data(index1).toInt()==flags)){
msgLogView->selectRow(row);
}
}
}
if(model->rowCount()){
for(int row=0; row<model->rowCount();++row){
QModelIndex index0 = model->index(row, 0);
QModelIndex index1 = model->index(row, 1);
if((model->data(index0).toInt()==id) && (model->data(index1).toInt()==flags)){
msgLogView->selectRow(row);
}
}
}
To copy to clipboard, switch view to plain text mode
Im comparing values in column 0 and 1...they are Integers
Bookmarks