mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user