diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-02-17 11:44:41 -0800 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2018-02-17 21:00:06 +0000 |
commit | 1c5d6881de42d9093933718e7bec6211222fb7d6 (patch) | |
tree | dc25e07d075acab1da1f4f8cee5415f81e14ad96 | |
parent | 9826cde91d56be3cbbaf7609a29e2bbb3478835c (diff) |
Qt: Another filter expression toolbar layout attempt.
Try hiding and showing the filter expression toolbar in order to update
its layout. This is a bit ham-fisted but seems to be the only way to get
it to work properly after clearing and inserting buttons.
Bug: 14121
Change-Id: Iea851c029c1586abfdb01c639914f6fe97ea29b3
Reviewed-on: https://code.wireshark.org/review/25840
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r-- | ui/qt/main_window_slots.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/qt/main_window_slots.cpp b/ui/qt/main_window_slots.cpp index b78c1ddc0d..a41aa2dbde 100644 --- a/ui/qt/main_window_slots.cpp +++ b/ui/qt/main_window_slots.cpp @@ -1025,16 +1025,17 @@ void MainWindow::filterExpressionsChanged() data.window = this; data.actions_added = false; + // Hiding and showing seems to be the only way to get the layout to + // work correctly in some cases. See bug 14121 for details. + setUpdatesEnabled(false); + filter_expression_toolbar_->hide(); filter_expression_toolbar_->clear(); // XXX Add a context menu for removing and changing buttons. filter_expression_iterate_expressions(filter_expression_add_action, &data); - if (data.actions_added) { - // QToolButton calls updateGeometry+update all over the place. - // updateGeometry should be sufficient here. - main_ui_->displayFilterToolBar->updateGeometry(); - } + filter_expression_toolbar_->show(); + setUpdatesEnabled(true); } // |