Fix automatic horizontal scrolling in browser

This commit is contained in:
Houssam Salem 2016-06-07 16:32:19 +10:00
parent 1b0750ba9b
commit 7a60482269

View file

@ -189,7 +189,11 @@ class DataModel(QAbstractTableModel):
tv = self.browser.form.tableView
if idx:
tv.selectRow(idx.row())
# we save and then restore the horizontal scroll position because
# scrollTo() also scrolls horizontally which is confusing
h = tv.horizontalScrollBar().value()
tv.scrollTo(idx, tv.PositionAtCenter)
tv.horizontalScrollBar().setValue(h)
if count < 500:
# discard large selections; they're too slow
sm.select(items, QItemSelectionModel.SelectCurrent |