i would like to ask few question about filtering via QSortFilterProxyModel:
in regard to the example from http://doc.qt.nokia.com/latest/itemv...ltermodel.html
1. is it possible to be notified when the proxyfilter has finished filtering ? i would like the user to be informed that its working in the background and need to know when it has finished.
2. after having finished i would like the user to be able to click on the view that contains the filter results and have the source-view containing the model-data to jump to the row the user has selected. how do i do that!?
thnx alot.
Added after 39 minutes:
ok, i figured out how to do point 2:
// //////////////////////////////////
void MainWindow
::on_tableView_2_pressed(QModelIndex index
) // //////////////////////////////////
{
ui->tableView->setCurrentIndex( proxyModel->mapToSource(index) );
}
// //////////////////////////////////
void MainWindow::on_tableView_2_pressed(QModelIndex index)
// //////////////////////////////////
{
ui->tableView->setCurrentIndex( proxyModel->mapToSource(index) );
}
To copy to clipboard, switch view to plain text mode
but the currentIndex is not alway the topmost index within my source-view,
means the relevant row within my source-view is not always the topmost row within the scroll-area.
how do i achive that ??
it would be nice if someone has an idea how to achive point 1 
Added after 8 minutes:
ok, again for those interested:
// //////////////////////////////////
void MainWindow
::on_tableView_2_pressed(QModelIndex index
) // //////////////////////////////////
{
ui->tableView->setCurrentIndex( proxyModel->mapToSource(index) );
ui
->tableView
->scrollTo
(proxyModel
->mapToSource
(index
),
QAbstractItemView::PositionAtTop);
}
// //////////////////////////////////
void MainWindow::on_tableView_2_pressed(QModelIndex index)
// //////////////////////////////////
{
ui->tableView->setCurrentIndex( proxyModel->mapToSource(index) );
ui->tableView->scrollTo(proxyModel->mapToSource(index), QAbstractItemView::PositionAtTop);
}
To copy to clipboard, switch view to plain text mode
does the magic.
but still dont know how to achive point 1, help is appreciated.
Bookmarks