Qt: Another filter expression toolbar layout attempt.
authorGerald Combs <gerald@wireshark.org>
Sat, 17 Feb 2018 19:44:41 +0000 (11:44 -0800)
committerStig Bjørlykke <stig@bjorlykke.org>
Sat, 17 Feb 2018 21:00:06 +0000 (21:00 +0000)
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>
ui/qt/main_window_slots.cpp

index b78c1ddc0d6a63b8b10d08dda00d974c69d2215a..a41aa2dbded5fbc061b66335b6c4d50519cdf42f 100644 (file)
@@ -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);
 }
 
 //