When mirroring current index only mirror row, not column

This commit is contained in:
Kovid Goyal 2018-02-01 13:00:37 +05:30
parent d4d49fbe95
commit 4e5b306547
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -340,7 +340,11 @@ def mirror_selection_between_views(self, src):
dest = self.pin_view if src is self else self
self.allow_mirroring = False
dest.selectionModel().select(src.selectionModel().selection(), QItemSelectionModel.ClearAndSelect)
dest.selectionModel().setCurrentIndex(src.selectionModel().currentIndex(), QItemSelectionModel.NoUpdate)
ci = dest.currentIndex()
nci = src.selectionModel().currentIndex()
if ci.isValid():
nci = dest.model().index(nci.row(), ci.column())
dest.selectionModel().setCurrentIndex(nci, QItemSelectionModel.NoUpdate)
self.allow_mirroring = True
# Column Header Context Menu {{{