- // Only adjust pane sizes if the header hasn't been partially hidden by the user
- if (header_fully_visible()) {
- int splitter_area_width = 0;
- for (int w : splitter_->sizes())
- splitter_area_width += w;
-
- // Make sure the header has enough horizontal space to show all labels fully
- QList<int> pane_sizes;
- pane_sizes.push_back(header_->extended_size_hint().width());
- pane_sizes.push_back(splitter_area_width - header_->extended_size_hint().width());
- splitter_->setSizes(pane_sizes);
+ int splitter_area_width = 0;
+ for (int w : splitter_->sizes())
+ splitter_area_width += w;
+
+ // Workaround for when the header needs resizing but the view
+ // isn't visible yet and thus splitter_->sizes() returns (0, 0)
+ if (splitter_area_width == 0) {
+ QTimer::singleShot(50, this, SLOT(on_repeat_splitter_expansion()));
+ return;