Browse Source

- Fix search item download when a column was sorted

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
e9c12cbf78
  1. 4
      src/SearchTab.cpp

4
src/SearchTab.cpp

@ -146,7 +146,7 @@ void SearchTab::sortSearchListInt(int index, Qt::SortOrder sortOrder){
for(int row=0; row<lines.size(); ++row){ for(int row=0; row<lines.size(); ++row){
SearchListModel->insertRow(SearchListModel->rowCount()); SearchListModel->insertRow(SearchListModel->rowCount());
int sourceRow = lines[row].first; int sourceRow = lines[row].first;
for(int col=0; col<5; ++col){ for(int col=0; col<6; ++col){
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col))); SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole); SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
} }
@ -166,7 +166,7 @@ void SearchTab::sortSearchListString(int index, Qt::SortOrder sortOrder){
for(int row=0; row<nbRows_old; ++row){ for(int row=0; row<nbRows_old; ++row){
SearchListModel->insertRow(SearchListModel->rowCount()); SearchListModel->insertRow(SearchListModel->rowCount());
int sourceRow = lines[row].first; int sourceRow = lines[row].first;
for(int col=0; col<5; ++col){ for(int col=0; col<6; ++col){
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col))); SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col)));
SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole); SearchListModel->setData(SearchListModel->index(nbRows_old+row, col), SearchListModel->data(SearchListModel->index(sourceRow, col), Qt::ForegroundRole), Qt::ForegroundRole);
} }

Loading…
Cancel
Save