if anyone was interested...heres my code storing those data...yes it could be written better way...but it solves the problem ![Smile](images/smilies/smile.png)
for(int row=0; row<filterModel->rowCount();row++){
QModelIndex sourceIndex0
= filterModel
->mapToSource
(index0
);
out << sourceIndex0.data().toInt()<<"\t";
QModelIndex sourceIndex1
= filterModel
->mapToSource
(index1
);
out << sourceIndex1.data().toInt()<<"\t";
QModelIndex sourceIndex2
= filterModel
->mapToSource
(index2
);
out << sourceIndex2.data().toString()<<"\t"<<endl;
}
QTextStream out(&file);
for(int row=0; row<filterModel->rowCount();row++){
QModelIndex index0 = filterModel->index(row, 0);
QModelIndex sourceIndex0 = filterModel->mapToSource(index0);
out << sourceIndex0.data().toInt()<<"\t";
QModelIndex index1 = filterModel->index(row, 1);
QModelIndex sourceIndex1 = filterModel->mapToSource(index1);
out << sourceIndex1.data().toInt()<<"\t";
QModelIndex index2 = filterModel->index(row, 2);
QModelIndex sourceIndex2 = filterModel->mapToSource(index2);
out << sourceIndex2.data().toString()<<"\t"<<endl;
}
To copy to clipboard, switch view to plain text mode
although it assumes that model has 3 columns...
Bookmarks