From a911d72756bad5d3942ec41722fa9e8c0b562329 Mon Sep 17 00:00:00 2001 From: Levi Jetzer Date: Thu, 6 Aug 2026 10:40:03 +0200 Subject: [PATCH] Fix crash when opening a project: invalid index in corner layout ProjectView::initWidgets() called insertSpacing(1, 10) on a QHBoxLayout that was still empty, inserting past the end of the item list. The corrupted layout crashed later in QWidget::setLayout() via QLayoutPrivate::reparentChildWidgets() and QBoxLayout::itemAt(). Use addSpacing(10) instead, which is equivalent for an empty layout. --- sources/projectview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/projectview.cpp b/sources/projectview.cpp index 2978d9745..a8292bba7 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -842,7 +842,7 @@ void ProjectView::initWidgets() QHBoxLayout *TopRightCorner_Layout = new QHBoxLayout(); TopRightCorner_Layout->setContentsMargins(0,0,0,0); // some place left to the 'next_right_view_button' button - TopRightCorner_Layout->insertSpacing(1,10); + TopRightCorner_Layout->addSpacing(10); QHBoxLayout *TopLeftCorner_Layout = new QHBoxLayout(); TopLeftCorner_Layout->setContentsMargins(0,0,0,0);