From 05ddca043a4d7f437f63571a1131dc2f4504f243 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 4 Nov 2023 16:48:22 +0100 Subject: [PATCH] Add comment to explain why autoscroll was added --- novelwriter/gui/projtree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/novelwriter/gui/projtree.py b/novelwriter/gui/projtree.py index e1fd6533..89cd4e72 100644 --- a/novelwriter/gui/projtree.py +++ b/novelwriter/gui/projtree.py @@ -508,11 +508,14 @@ class GuiProjectTree(QTreeWidget): self.setDragEnabled(True) self.setDragDropMode(QAbstractItemView.InternalMove) self.setDropIndicatorShown(True) + + # Disable built-in autoscroll as it isn't working in some Qt + # releases (see #1561) and instead use our own implementation self.setAutoScroll(False) # But don't allow drop on root level # Due to a bug, this stops working somewhere between Qt 5.15.3 - # and 5.15.8, so this is also blocked in dropEvent + # and 5.15.8, so this is also blocked in dropEvent (see #1569) trRoot = self.invisibleRootItem() trRoot.setFlags(trRoot.flags() ^ Qt.ItemIsDropEnabled)