Merge pull request #133 from hssm/browser-recenter
Fix automatic horizontal scrolling in browser
This commit is contained in:
commit
d824f178cc
@ -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 |
|
||||
|
Loading…
Reference in New Issue
Block a user