Skip to content

Commit

Permalink
syncscroll: Fix TypeError with Qt WebKit and Python 3.10
Browse files Browse the repository at this point in the history
This fix is not needed in master branch because we do not support
Qt WebKit anymore.

Fixes #573.
  • Loading branch information
mitya57 committed Jan 23, 2022
1 parent 6d58206 commit 5cedbb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ReText/syncscroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def _updatePreviewScrollPosition(self):
preview_scroll_offset = preview_pixel_to_scroll_to - distance_to_top_of_viewport

pos = self.frame.scrollPosition()
# scrollPosition() returns QPoint for WebKit and QPointF for WebEngine
if isinstance(pos, QPoint):
preview_scroll_offset = int(preview_scroll_offset)
pos.setY(preview_scroll_offset)
self.frame.setScrollPosition(pos)

Expand Down

0 comments on commit 5cedbb0

Please sign in to comment.