diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-07-16 09:06:39 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-07-16 23:25:38 +0000 |
commit | 2cfa3013bc2890dd1ea8468366344c3d3878f3a0 (patch) | |
tree | 14cafaa7809c37e7b9908a601d56001bc1a04fc6 | |
parent | 40d180ec6d3b1154bc314d14eac90822feed7e33 (diff) |
Qt: Create the main display filter combo sooner.
Construct MainWindow::df_combo_box_ in our initializer list, otherwise
anything that triggers a resizeEvent early on might result in an NPE.
Wait until everything is in place before calling setMinimumWidth.
Bug: 14979
Change-Id: I78b349f9c3ea53d8b1399a77169bbbd0a4a69191
Reviewed-on: https://code.wireshark.org/review/28728
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r-- | ui/qt/main_window.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index a8d98568f3..cd4064fdb0 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -270,7 +270,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), main_ui_(new Ui::MainWindow), cur_layout_(QVector<unsigned>()), - df_combo_box_(NULL), + df_combo_box_(new DisplayFilterCombo), packet_list_(NULL), proto_tree_(NULL), previous_focus_(NULL), @@ -364,12 +364,6 @@ MainWindow::MainWindow(QWidget *parent) : Qt::BlockingQueuedConnection); #endif - // We set the minimum width of df_combo_box_ in resizeEvent so that it won't shrink - // down too much if we have a lot of filter buttons. Unfortunately that can break - // Aero snapping if our window is large or maximized. Set a minimum width here in - // order to counteract that. - setMinimumWidth(350); // Arbitrary - df_combo_box_ = new DisplayFilterCombo(); const DisplayFilterEdit *df_edit = qobject_cast<DisplayFilterEdit *>(df_combo_box_->lineEdit()); connect(df_edit, SIGNAL(pushFilterSyntaxStatus(const QString&)), main_ui_->statusBar, SLOT(pushFilterStatus(const QString&))); @@ -688,6 +682,12 @@ MainWindow::MainWindow(QWidget *parent) : /* Register Interface Toolbar callbacks */ iface_toolbar_register_cb(mainwindow_add_toolbar, mainwindow_remove_toolbar); + // We set the minimum width of df_combo_box_ in resizeEvent so that it won't shrink + // down too much if we have a lot of filter buttons. Unfortunately that can break + // Aero snapping if our window is large or maximized. Set a minimum width here in + // order to counteract that. + setMinimumWidth(350); // Arbitrary + showWelcome(); } |