Skip to content

Commit

Permalink
Merge pull request #456 from ghutchis/fix-header-crash
Browse files Browse the repository at this point in the history
Check scene plugin header before adjusting column sizes
  • Loading branch information
ghutchis authored Jan 9, 2024
2 parents a7d4136 + 8ededde commit c5ab6af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion avogadro/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,8 @@ void MainWindow::setupInterface()
m_sceneTreeView->setAlternatingRowColors(true);
m_sceneTreeView->header()->setStretchLastSection(false);
m_sceneTreeView->header()->setVisible(false);
m_sceneTreeView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
if (m_sceneTreeView->header()->count() > 0)
m_sceneTreeView->header()->setSectionResizeMode(0, QHeaderView::Stretch);
connect(m_sceneTreeView, &QAbstractItemView::activated, this,
&MainWindow::sceneItemActivated);
connect(m_sceneTreeView, &QAbstractItemView::clicked, this,
Expand Down

0 comments on commit c5ab6af

Please sign in to comment.