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.
This commit is contained in:
Levi Jetzer
2026-08-06 10:40:03 +02:00
parent f95ff29c21
commit a911d72756
+1 -1
View File
@@ -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);