From 8ededde19a670492ae5af2fe6e4b927a57165207 Mon Sep 17 00:00:00 2001 From: Geoff Hutchison Date: Mon, 8 Jan 2024 20:07:52 -0500 Subject: [PATCH] Check scene plugin header before adjusting column sizes Signed-off-by: Geoff Hutchison --- avogadro/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/avogadro/mainwindow.cpp b/avogadro/mainwindow.cpp index c5ec4462..8b27a45b 100644 --- a/avogadro/mainwindow.cpp +++ b/avogadro/mainwindow.cpp @@ -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,