diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-10-10 16:05:57 -0700 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-10-11 17:03:21 +0000 |
commit | 11c58e78f74f22a3b485ca59ae8de837435faf5f (patch) | |
tree | be13b218345c00488d06d406f97fa23364b1b0b3 | |
parent | e5bcf6b40223c3cfd13438861d4fb88bbd4b5934 (diff) |
Qt: More new-style signals+slot conversions.
-rw-r--r-- | ui/qt/bluetooth_att_server_attributes_dialog.cpp | 8 | ||||
-rw-r--r-- | ui/qt/capture_file_dialog.cpp | 8 | ||||
-rw-r--r-- | ui/qt/display_filter_expression_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/export_object_dialog.cpp | 10 | ||||
-rw-r--r-- | ui/qt/extcap_argument_file.cpp | 4 | ||||
-rw-r--r-- | ui/qt/lbm_stream_dialog.cpp | 4 | ||||
-rw-r--r-- | ui/qt/lte_mac_statistics_dialog.cpp | 8 | ||||
-rw-r--r-- | ui/qt/multicast_statistics_dialog.cpp | 9 | ||||
-rw-r--r-- | ui/qt/preference_editor_frame.cpp | 12 | ||||
-rw-r--r-- | ui/qt/profile_dialog.cpp | 12 |
10 files changed, 40 insertions, 39 deletions
diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp index 6eece0ca11..16e8149eef 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp +++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp @@ -59,10 +59,10 @@ BluetoothAttServerAttributesDialog::BluetoothAttServerAttributesDialog(QWidget & ui->setupUi(this); loadGeometry(parent.width() * 4 / 5, parent.height() * 2 / 3); - connect(ui->tableTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(tableContextMenu(const QPoint &))); - connect(ui->interfaceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(interfaceCurrentIndexChanged(int))); - connect(ui->deviceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(deviceCurrentIndexChanged(int))); - connect(ui->removeDuplicatesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(removeDuplicatesStateChanged(int))); + connect(ui->tableTreeWidget, &QTreeWidget::customContextMenuRequested, this, &BluetoothAttServerAttributesDialog::tableContextMenu); + connect(ui->interfaceComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BluetoothAttServerAttributesDialog::interfaceCurrentIndexChanged); + connect(ui->deviceComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &BluetoothAttServerAttributesDialog::deviceCurrentIndexChanged); + connect(ui->removeDuplicatesCheckBox, &QCheckBox::stateChanged, this, &BluetoothAttServerAttributesDialog::removeDuplicatesStateChanged); ui->tableTreeWidget->sortByColumn(column_number_handle, Qt::AscendingOrder); diff --git a/ui/qt/capture_file_dialog.cpp b/ui/qt/capture_file_dialog.cpp index 8015a27716..bb56b7b2be 100644 --- a/ui/qt/capture_file_dialog.cpp +++ b/ui/qt/capture_file_dialog.cpp @@ -603,7 +603,7 @@ void CaptureFileDialog::addPreview(QVBoxLayout &v_box) { preview_grid->addWidget(&preview_first_elapsed_, 3, 1); preview_labels_ << lbl << &preview_first_elapsed_; - connect(this, SIGNAL(currentChanged(const QString &)), this, SLOT(preview(const QString &))); + connect(this, &CaptureFileDialog::currentChanged, this, &CaptureFileDialog::preview); preview(""); } @@ -692,7 +692,7 @@ QDialogButtonBox *CaptureFileDialog::addHelpButton(topic_action_e help_topic) if (button_box) { button_box->addButton(QDialogButtonBox::Help); - connect(button_box, SIGNAL(helpRequested()), this, SLOT(on_buttonBox_helpRequested())); + connect(button_box, &QDialogButtonBox::helpRequested, this, &CaptureFileDialog::on_buttonBox_helpRequested); } return button_box; } @@ -784,8 +784,8 @@ check_savability_t CaptureFileDialog::exportSelectedPackets(QString &file_name, if (button_box) { save_bt_ = button_box->button(QDialogButtonBox::Save); if (save_bt_) { - connect(&packet_range_group_box_, SIGNAL(validityChanged(bool)), - save_bt_, SLOT(setEnabled(bool))); + connect(&packet_range_group_box_, &PacketRangeGroupBox::validityChanged, + save_bt_, &QPushButton::setEnabled); } } diff --git a/ui/qt/display_filter_expression_dialog.cpp b/ui/qt/display_filter_expression_dialog.cpp index 6bb5fe186f..828a53a543 100644 --- a/ui/qt/display_filter_expression_dialog.cpp +++ b/ui/qt/display_filter_expression_dialog.cpp @@ -87,8 +87,8 @@ DisplayFilterExpressionDialog::DisplayFilterExpressionDialog(QWidget *parent) : value_label_pfx_ = ui->valueLabel->text(); - connect(ui->valueLineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateWidgets())); - connect(ui->rangeLineEdit, SIGNAL(textEdited(QString)), this, SLOT(updateWidgets())); + connect(ui->valueLineEdit, &QLineEdit::textEdited, this, &DisplayFilterExpressionDialog::updateWidgets); + connect(ui->rangeLineEdit, &QLineEdit::textEdited, this, &DisplayFilterExpressionDialog::updateWidgets); // Trigger updateWidgets ui->fieldTreeWidget->selectionModel()->clear(); diff --git a/ui/qt/export_object_dialog.cpp b/ui/qt/export_object_dialog.cpp index 931e7ee9a6..a7e484f1d1 100644 --- a/ui/qt/export_object_dialog.cpp +++ b/ui/qt/export_object_dialog.cpp @@ -54,9 +54,9 @@ ExportObjectDialog::ExportObjectDialog(QWidget &parent, CaptureFile &cf, registe eo_ui_->progressBar->setAttribute(Qt::WA_MacSmallSize, true); #endif - connect(&model_, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(modelDataChanged(QModelIndex, int, int))); - connect(&model_, SIGNAL(modelReset()), this, SLOT(modelRowsReset())); + connect(&model_, &ExportObjectModel::rowsInserted, + this, &ExportObjectDialog::modelDataChanged); + connect(&model_, &ExportObjectModel::modelReset, this, &ExportObjectDialog::modelRowsReset); connect(eo_ui_->filterLine, &QLineEdit::textChanged, &proxyModel_, &ExportObjectProxyModel::setTextFilterString); connect(eo_ui_->objectTree, &ExportObjectsTreeView::currentIndexChanged, this, &ExportObjectDialog::currentHasChanged); @@ -79,8 +79,8 @@ ExportObjectDialog::ExportObjectDialog(QWidget &parent, CaptureFile &cf, registe if (save_all_bt_) save_all_bt_->setEnabled(false); if (close_bt) close_bt->setDefault(true); - connect(&cap_file_, SIGNAL(captureEvent(CaptureEvent)), - this, SLOT(captureEvent(CaptureEvent))); + connect(&cap_file_, &CaptureFile::captureEvent, + this, &ExportObjectDialog::captureEvent); } ExportObjectDialog::~ExportObjectDialog() diff --git a/ui/qt/extcap_argument_file.cpp b/ui/qt/extcap_argument_file.cpp index 3bb9611615..89d52627fc 100644 --- a/ui/qt/extcap_argument_file.cpp +++ b/ui/qt/extcap_argument_file.cpp @@ -75,8 +75,8 @@ QWidget * ExtcapArgumentFileSelection::createEditor(QWidget * parent) buttonSelect->setToolTip(QString().fromUtf8(_argument->tooltip)); } - connect(buttonSelect, SIGNAL(clicked()), (QObject *)this, SLOT(openFileDialog())); - connect(buttonClear, SIGNAL(clicked()), (QObject *)this, SLOT(clearFilename())); + connect(buttonSelect, &QPushButton::clicked, this, &ExtcapArgumentFileSelection::openFileDialog); + connect(buttonClear, &QPushButton::clicked, this, &ExtcapArgumentFileSelection::clearFilename); editLayout->addWidget(textBox); editLayout->addWidget(buttonSelect); diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp index 7b141455f3..af9b2ab10f 100644 --- a/ui/qt/lbm_stream_dialog.cpp +++ b/ui/qt/lbm_stream_dialog.cpp @@ -332,8 +332,8 @@ LBMStreamDialog::LBMStreamDialog(QWidget * parent, capture_file * cfile) : { m_ui->setupUi(this); m_dialog_info = new LBMStreamDialogInfo(); - connect(this, SIGNAL(accepted()), this, SLOT(closeDialog())); - connect(this, SIGNAL(rejected()), this, SLOT(closeDialog())); + connect(this, &LBMStreamDialog::accepted, this, &LBMStreamDialog::closeDialog); + connect(this, &LBMStreamDialog::rejected, this, &LBMStreamDialog::closeDialog); fillTree(); } diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp index 50c1083352..14a2716ccd 100644 --- a/ui/qt/lte_mac_statistics_dialog.cpp +++ b/ui/qt/lte_mac_statistics_dialog.cpp @@ -601,12 +601,12 @@ LteMacStatisticsDialog::LteMacStatisticsDialog(QWidget &parent, CaptureFile &cf, } // Set handler for when the tree item changes to set the appropriate labels. - connect(statsTreeWidget(), SIGNAL(itemSelectionChanged()), - this, SLOT(updateHeaderLabels())); + connect(statsTreeWidget(), &QTreeWidget::itemSelectionChanged, + this, &LteMacStatisticsDialog::updateHeaderLabels); // Set handler for when display filter string is changed. - connect(this, SIGNAL(updateFilter(QString)), - this, SLOT(filterUpdated(QString))); + connect(this, &LteMacStatisticsDialog::updateFilter, + this, &LteMacStatisticsDialog::filterUpdated); } // Destructor. diff --git a/ui/qt/multicast_statistics_dialog.cpp b/ui/qt/multicast_statistics_dialog.cpp index a35d70c8aa..57c3499953 100644 --- a/ui/qt/multicast_statistics_dialog.cpp +++ b/ui/qt/multicast_statistics_dialog.cpp @@ -229,9 +229,10 @@ MulticastStatisticsDialog::MulticastStatisticsDialog(QWidget &parent, CaptureFil << buffer_alarm_threshold_le_ << stream_empty_speed_le_ << total_empty_speed_le_; - foreach (QWidget *line_edit, line_edits_) { + foreach (QWidget *w, line_edits_) { + QLineEdit *line_edit = qobject_cast<QLineEdit *>(w); line_edit->setMinimumWidth(one_em * 5); - connect(line_edit, SIGNAL(textEdited(QString)), this, SLOT(updateWidgets())); + connect(line_edit, &QLineEdit::textEdited, this, &MulticastStatisticsDialog::updateWidgets); } addFilterActions(); @@ -240,8 +241,8 @@ MulticastStatisticsDialog::MulticastStatisticsDialog(QWidget &parent, CaptureFil setDisplayFilter(filter); } - connect(this, SIGNAL(updateFilter(QString)), - this, SLOT(updateMulticastParameters())); + connect(this, &MulticastStatisticsDialog::updateFilter, + this, &MulticastStatisticsDialog::updateMulticastParameters); /* Register the tap listener */ register_tap_listener_mcast_stream(tapinfo_); diff --git a/ui/qt/preference_editor_frame.cpp b/ui/qt/preference_editor_frame.cpp index f7a374bfe9..9a7e067d50 100644 --- a/ui/qt/preference_editor_frame.cpp +++ b/ui/qt/preference_editor_frame.cpp @@ -87,8 +87,8 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module switch (prefs_get_type(pref_)) { case PREF_UINT: case PREF_DECODE_AS_UINT: - connect(ui->preferenceLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(uintLineEditTextEdited(QString))); + connect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged, + this, &PreferenceEditorFrame::uintLineEditTextEdited); show = true; break; case PREF_SAVE_FILENAME: @@ -97,14 +97,14 @@ void PreferenceEditorFrame::editPreference(preference *pref, pref_module *module browse_button = true; // Fallthrough case PREF_STRING: - connect(ui->preferenceLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(stringLineEditTextEdited(QString))); + connect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged, + this, &PreferenceEditorFrame::stringLineEditTextEdited); show = true; break; case PREF_RANGE: case PREF_DECODE_AS_RANGE: - connect(ui->preferenceLineEdit, SIGNAL(textChanged(QString)), - this, SLOT(rangeLineEditTextEdited(QString))); + connect(ui->preferenceLineEdit, &SyntaxLineEdit::textChanged, + this, &PreferenceEditorFrame::rangeLineEditTextEdited); show = true; break; default: diff --git a/ui/qt/profile_dialog.cpp b/ui/qt/profile_dialog.cpp index 7959bf83b0..7d4a60cd84 100644 --- a/ui/qt/profile_dialog.cpp +++ b/ui/qt/profile_dialog.cpp @@ -106,10 +106,10 @@ ProfileDialog::ProfileDialog(QWidget *parent) : pd_ui_->cmbProfileTypes->addItems(ProfileSortModel::filterTypes()); - connect (pd_ui_->cmbProfileTypes, SIGNAL(currentTextChanged(const QString &)), - this, SLOT(filterChanged(const QString &))); - connect (pd_ui_->lineProfileFilter, SIGNAL(textChanged(const QString &)), - this, SLOT(filterChanged(const QString &))); + connect (pd_ui_->cmbProfileTypes, &QComboBox::currentTextChanged, + this, &ProfileDialog::filterChanged); + connect (pd_ui_->lineProfileFilter, &QLineEdit::textChanged, + this, &ProfileDialog::filterChanged); currentItemChanged(); @@ -760,8 +760,8 @@ void ProfileDialog::resetTreeView() QItemSelectionModel *selModel = pd_ui_->profileTreeView->selectionModel(); connect(selModel, &QItemSelectionModel::currentChanged, this, &ProfileDialog::currentItemChanged, Qt::QueuedConnection); - connect(selModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), - this, SLOT(selectionChanged())); + connect(selModel, &QItemSelectionModel::selectionChanged, + this, &ProfileDialog::selectionChanged); selectionChanged(); |