From 16a99bf5a61556063bb27a1421a499357c506be8 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 26 Aug 2023 03:44:38 +0100 Subject: [PATCH] Account for scrollbar margins in ListScene --- .../InsightWindow/Widgets/ListView/ListScene.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp index 40fbfdc3..28740191 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ListView/ListScene.cpp @@ -44,7 +44,13 @@ namespace Widgets startYPosition += listItem->size.height(); } - this->setSceneRect(0, 0, viewportWidth, std::max(viewportHeight, startYPosition)); + /* + * Due to a bug in Qt, we must subtract 2 from the scene rect width, to account for margins on the vertical + * scrollbar. + * + * See https://bugreports.qt.io/browse/QTBUG-99189 for more on this. + */ + this->setSceneRect(0, 0, viewportWidth - 2, std::max(viewportHeight, startYPosition)); this->update(); }