git-svn-id: svn://db.shs.com.ru/libs@27 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-06-22 11:43:23 +00:00
parent bd18963bf1
commit d092e32714
3 changed files with 10 additions and 5 deletions

View File

@@ -581,8 +581,9 @@ QPair<QString, QString> SQLTableWidget::trColumn(const QString & n) {
void SQLTableWidget::updateTable(bool save_selection) {
if ((!filters_active || !table_opened)) return;
int sp = ui->view->verticalScrollBar()->value();
if (!filters_active || !table_opened) return;
int vp = ui->view->verticalScrollBar()->value();
int hp = ui->view->horizontalScrollBar()->value();
//bool focus = view->hasFocus();
QModelIndex csi;
QModelIndexList sl;
@@ -613,7 +614,6 @@ void SQLTableWidget::updateTable(bool save_selection) {
ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
ui->layoutNew->invalidate();
ui->view->verticalScrollBar()->setValue(sp);
if (save_selection) {
QItemSelectionModel * sm = ui->view->selectionModel();
foreach (const QModelIndex & i, sl)
@@ -644,6 +644,8 @@ void SQLTableWidget::updateTable(bool save_selection) {
}
}
}
ui->view->verticalScrollBar()->setValue(vp);
ui->view->horizontalScrollBar()->setValue(hp);
//if (focus) view->setFocus();
}