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
+5 -1
View File
@@ -340,7 +340,11 @@ class BooksView(QTableView): # {{{
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 {{{