Skip to content

Commit

Permalink
fix: crash of unfound size
Browse files Browse the repository at this point in the history
  • Loading branch information
hualet committed Aug 30, 2024
1 parent 886e4a0 commit 12de9a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/views/termwidgetpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,16 @@ void TermWidgetPage::split(Qt::Orientation orientation)
// if there's no splitter, or the orientation is not correct,
// create a new splitter, put the 2 terms into the splitter,
// and replace the old term with the splitter.
QSplitter *newSplitter = createSubSplit(term, orientation);

if (splitter) {
// see above splitter->insertWidget part to know why.
QList<int> sizes = splitter->sizes();
sizes.insert(index, sizes.at(index));
QSplitter *newSplitter = createSubSplit(term, orientation);
splitter->insertWidget(index, newSplitter);
splitter->setSizes(sizes);
setSplitStyle(splitter);
} else {
QSplitter *newSplitter = createSubSplit(term, orientation);
m_layout->insertWidget(index, newSplitter);
}
}
Expand Down

0 comments on commit 12de9a0

Please sign in to comment.