summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
inline | side by side (from parent 1:
c031de4)
The timer is no longer needed as the introduction of
settings_restored_ allows us to determine whether we
should resize the trace label header to its proper
width when the show event is received.
This is because the show event is received only after
all widget resizing took place. This means that the
header pane sizes will be reliable at this point,
making this solution much cleaner than relying on
a timer repeatedly calling expand_header_to_fit().
for (int w : splitter_->sizes())
splitter_area_width += w;
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;
- }
-
// 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());
// 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());
// resized to their final sizes.
update_layout();
// resized to their final sizes.
update_layout();
+ if (!settings_restored_)
+ expand_header_to_fit();
+
if (scroll_needs_defaults_) {
set_scroll_default();
scroll_needs_defaults_ = false;
if (scroll_needs_defaults_) {
set_scroll_default();
scroll_needs_defaults_ = false;
expand_header_to_fit();
}
expand_header_to_fit();
}
-void View::on_repeat_splitter_expansion()
-{
- // Don't mess with the header if settings were restored in the meanwhile
- if (!settings_restored_)
- expand_header_to_fit();
-}
-
void View::h_scroll_value_changed(int value)
{
if (updating_scroll_)
void View::h_scroll_value_changed(int value)
{
if (updating_scroll_)
private Q_SLOTS:
void on_splitter_moved();
private Q_SLOTS:
void on_splitter_moved();
- void on_repeat_splitter_expansion();
void h_scroll_value_changed(int value);
void v_scroll_value_changed();
void h_scroll_value_changed(int value);
void v_scroll_value_changed();