From 2ba3167d104faba774fa19bbc40bc7acf940eb4a Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Wed, 15 Jan 2025 14:29:28 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20off-by-one=20error=20in=20TimelineView?= =?UTF-8?q?=E2=80=99s=20implicit=20width?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QDate("2025-01-01").daysTo(QDate("2025-01-01")) returns 1, but the width should be for two days, because the view shows the last day too. --- src/timelineview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timelineview.cpp b/src/timelineview.cpp index c1f27dd..d157ebf 100644 --- a/src/timelineview.cpp +++ b/src/timelineview.cpp @@ -288,7 +288,7 @@ void TimelineView::populate() void TimelineView::updateImplicitWidth() { - setImplicitWidth(m_dayWidth * m_fromDate.daysTo(m_toDate)); + setImplicitWidth(m_dayWidth * (m_fromDate.daysTo(m_toDate) + 1)); } #include "moc_timelineview.cpp"