More PyQt6 nonsense

This commit is contained in:
Kovid Goyal 2021-12-23 13:24:38 +05:30
parent 271f988b72
commit ca2003b405
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 0 deletions

View File

@ -1143,6 +1143,7 @@ class GridView(QListView):
pass pass
def moveCursor(self, action, modifiers): def moveCursor(self, action, modifiers):
action = QAbstractItemView.CursorAction(action)
index = QListView.moveCursor(self, action, modifiers) index = QListView.moveCursor(self, action, modifiers)
if action in (QAbstractItemView.CursorAction.MoveLeft, QAbstractItemView.CursorAction.MoveRight) and index.isValid(): if action in (QAbstractItemView.CursorAction.MoveLeft, QAbstractItemView.CursorAction.MoveRight) and index.isValid():
ci = self.currentIndex() ci = self.currentIndex()

View File

@ -1233,6 +1233,7 @@ class BooksView(QTableView): # {{{
def moveCursor(self, action, modifiers): def moveCursor(self, action, modifiers):
orig = self.currentIndex() orig = self.currentIndex()
action = QAbstractItemView.CursorAction(action)
index = QTableView.moveCursor(self, action, modifiers) index = QTableView.moveCursor(self, action, modifiers)
if action == QAbstractItemView.CursorAction.MovePageDown: if action == QAbstractItemView.CursorAction.MovePageDown:
moved = index.row() - orig.row() moved = index.row() - orig.row()