comparison widgets/ModelDataTableDialog.cpp @ 403:dc32f6e7839b

* minor enhancement to data edit make-current
author Chris Cannam
date Wed, 18 Jun 2008 14:34:13 +0000
parents 66e01a6c9554
children 4075bf03faef
comparison
equal deleted inserted replaced
402:66e01a6c9554 403:dc32f6e7839b
164 int topRow = row - rh/2; 164 int topRow = row - rh/2;
165 if (topRow < 0) topRow = 0; 165 if (topRow < 0) topRow = 0;
166 //!!! should not do any of this if an item in the given row is 166 //!!! should not do any of this if an item in the given row is
167 //already current; should not scroll if the current row is already 167 //already current; should not scroll if the current row is already
168 //visible 168 //visible
169 std::cerr << "rh = " << rh << ", row = " << row << ", scrolling to "
170 << topRow << std::endl;
169 m_tableView->scrollTo 171 m_tableView->scrollTo
170 (m_table->getModelIndexForRow(topRow)); 172 (m_table->getModelIndexForRow(topRow));
171 m_tableView->selectionModel()->setCurrentIndex 173 m_tableView->selectionModel()->setCurrentIndex
172 (m_table->getModelIndexForRow(row), QItemSelectionModel::Select); 174 (m_table->getModelIndexForRow(row),
175 QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
173 } 176 }
174 177
175 void 178 void
176 ModelDataTableDialog::viewClicked(const QModelIndex &index) 179 ModelDataTableDialog::viewClicked(const QModelIndex &index)
177 { 180 {