diff --git a/qrenderdoc/Widgets/Extended/RDHeaderView.cpp b/qrenderdoc/Widgets/Extended/RDHeaderView.cpp index 77913591d..13a109cae 100644 --- a/qrenderdoc/Widgets/Extended/RDHeaderView.cpp +++ b/qrenderdoc/Widgets/Extended/RDHeaderView.cpp @@ -467,6 +467,21 @@ void RDHeaderView::setColumnStretchHints(const QList &hints) resizeSectionsWithHints(); } +void RDHeaderView::setRootIndex(const QModelIndex &index) +{ + QHeaderView::setRootIndex(index); + + // need to enqueue this after the root index is actually processed (this function is called + // *before* the root index changes). + if(!m_sectionStretchHints.isEmpty()) + { + GUIInvoke::defer([this]() { + cacheSectionMinSizes(); + resizeSectionsWithHints(); + }); + } +} + void RDHeaderView::headerDataChanged(Qt::Orientation orientation, int logicalFirst, int logicalLast) { if(m_customSizing) diff --git a/qrenderdoc/Widgets/Extended/RDHeaderView.h b/qrenderdoc/Widgets/Extended/RDHeaderView.h index a4b272bae..e8902addd 100644 --- a/qrenderdoc/Widgets/Extended/RDHeaderView.h +++ b/qrenderdoc/Widgets/Extended/RDHeaderView.h @@ -67,6 +67,7 @@ public: void setCustomSizing(bool sizing) { m_customSizing = sizing; } int pinnedWidth() { return m_pinnedWidth; } public slots: + void setRootIndex(const QModelIndex &index) override; void headerDataChanged(Qt::Orientation orientation, int logicalFirst, int logicalLast); void columnsInserted(const QModelIndex &parent, int first, int last); void rowsChanged(const QModelIndex &parent, int first, int last);