From 099e5dddf2b098af47da32ce36917e87096db5e0 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 19 Dec 2018 10:24:49 -0800 Subject: [PATCH] Qt: Switch module preferences to new-style signals and slots. Switch ModulePreferencesScrollArea to compile time signals and slots. Change-Id: Ic984c4a0b4538925f97e648695f4dcdc2699675c Reviewed-on: https://code.wireshark.org/review/31127 Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs --- ui/qt/module_preferences_scroll_area.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/ui/qt/module_preferences_scroll_area.cpp b/ui/qt/module_preferences_scroll_area.cpp index 6b3bf25106..9b4b544a78 100644 --- a/ui/qt/module_preferences_scroll_area.cpp +++ b/ui/qt/module_preferences_scroll_area.cpp @@ -246,20 +246,20 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg switch (prefs_get_type(pref)) { case PREF_DECODE_AS_UINT: - connect(le, SIGNAL(textEdited(QString)), this, SLOT(uintLineEditTextEdited(QString))); + connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::uintLineEditTextEdited); break; case PREF_UINT: - connect(le, SIGNAL(textEdited(QString)), this, SLOT(uintLineEditTextEdited(QString))); + connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::uintLineEditTextEdited); break; case PREF_STRING: case PREF_SAVE_FILENAME: case PREF_OPEN_FILENAME: case PREF_DIRNAME: - connect(le, SIGNAL(textEdited(QString)), this, SLOT(stringLineEditTextEdited(QString))); + connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::stringLineEditTextEdited); break; case PREF_RANGE: case PREF_DECODE_AS_RANGE: - connect(le, SIGNAL(textEdited(QString)), this, SLOT(rangeSyntaxLineEditTextEdited(QString))); + connect(le, &QLineEdit::textEdited, this, &ModulePreferencesScrollArea::rangeSyntaxLineEditTextEdited); break; default: break; @@ -271,7 +271,7 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg if (!pref) continue; if (prefs_get_type(pref) == PREF_BOOL) { - connect(cb, SIGNAL(toggled(bool)), this, SLOT(boolCheckBoxToggled(bool))); + connect(cb, &QCheckBox::toggled, this, &ModulePreferencesScrollArea::boolCheckBoxToggled); } } @@ -280,7 +280,7 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg if (!pref) continue; if (prefs_get_type(pref) == PREF_ENUM && prefs_get_enum_radiobuttons(pref)) { - connect(rb, SIGNAL(toggled(bool)), this, SLOT(enumRadioButtonToggled(bool))); + connect(rb, &QRadioButton::toggled, this, &ModulePreferencesScrollArea::enumRadioButtonToggled); } } @@ -289,7 +289,8 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg if (!pref) continue; if (prefs_get_type(pref) == PREF_ENUM && !prefs_get_enum_radiobuttons(pref)) { - connect(combo, SIGNAL(currentIndexChanged(int)), this, SLOT(enumComboBoxCurrentIndexChanged(int))); + connect(combo, static_cast(&QComboBox::currentIndexChanged), + this, &ModulePreferencesScrollArea::enumComboBoxCurrentIndexChanged); } } @@ -299,16 +300,16 @@ ModulePreferencesScrollArea::ModulePreferencesScrollArea(module_t *module, QWidg switch (prefs_get_type(pref)) { case PREF_UAT: - connect(pb, SIGNAL(clicked()), this, SLOT(uatPushButtonClicked())); + connect(pb, &QPushButton::clicked, this, &ModulePreferencesScrollArea::uatPushButtonClicked); break; case PREF_SAVE_FILENAME: - connect(pb, SIGNAL(clicked()), this, SLOT(saveFilenamePushButtonClicked())); + connect(pb, &QPushButton::clicked, this, &ModulePreferencesScrollArea::saveFilenamePushButtonClicked); break; case PREF_OPEN_FILENAME: - connect(pb, SIGNAL(clicked()), this, SLOT(openFilenamePushButtonClicked())); + connect(pb, &QPushButton::clicked, this, &ModulePreferencesScrollArea::openFilenamePushButtonClicked); break; case PREF_DIRNAME: - connect(pb, SIGNAL(clicked()), this, SLOT(dirnamePushButtonClicked())); + connect(pb, &QPushButton::clicked, this, &ModulePreferencesScrollArea::dirnamePushButtonClicked); break; } }