--- mainwindow.cpp ----
this->drive_ = new Drive(driveName, this);
this->ui->tableView->setModel(this->drive_);
this->ui->treeView->setModel(this->drive_->tagTree_);
QObject::connect(this
->ui
->treeView,
SIGNAL(clicked
(const QModelIndex
&)),
this,SLOT(recalculate()));
QObject::connect(this
->ui
->treeView,
SIGNAL(viewReleased
()),
this->ui->tableView,SLOT(reset()));
QObject::connect(this
->ui
->treeView,
SIGNAL(viewReleased
()),
this->ui->tableView,SLOT(scrollToTop()));
... unrelated code ...
void MainWindow::recalculate() {
QModelIndexList selection = this->ui->treeView->selectionModel()->selectedIndexes();
this->drive_->recalculate(selection);
}
--- drive.cpp ----
return results_.size();
}
--- mainwindow.cpp ----
this->drive_ = new Drive(driveName, this);
this->ui->tableView->setModel(this->drive_);
this->ui->treeView->setModel(this->drive_->tagTree_);
QObject::connect(this->ui->treeView,SIGNAL(clicked(const QModelIndex&)),
this,SLOT(recalculate()));
QObject::connect(this->ui->treeView,SIGNAL(viewReleased()),
this->ui->tableView,SLOT(reset()));
QObject::connect(this->ui->treeView,SIGNAL(viewReleased()),
this->ui->tableView,SLOT(scrollToTop()));
... unrelated code ...
void MainWindow::recalculate() {
QModelIndexList selection = this->ui->treeView->selectionModel()->selectedIndexes();
this->drive_->recalculate(selection);
}
--- drive.cpp ----
int Drive::rowCount(const QModelIndex &parent) const {
return results_.size();
}
To copy to clipboard, switch view to plain text mode
Bookmarks