From 87a7260bb03d781ff1393cbd75e61954bdaf6c84 Mon Sep 17 00:00:00 2001 From: Chuck Craft Date: Mon, 12 Sep 2022 11:14:38 -0500 Subject: [PATCH] Qt6: migrate obsolete currentIndexChanged(QString) Similar to work done in !8070 and !8072 to move off a function that was deprecated in Qt5 and obsoleted in Qt6. Also migrate to syntax laid out in !4560 and !4565. --- ui/qt/capture_options_dialog.cpp | 4 ++-- ui/qt/capture_options_dialog.h | 2 +- ui/qt/remote_capture_dialog.cpp | 4 ++-- ui/qt/remote_capture_dialog.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/qt/capture_options_dialog.cpp b/ui/qt/capture_options_dialog.cpp index 2f317b7c32..8f31eff7ae 100644 --- a/ui/qt/capture_options_dialog.cpp +++ b/ui/qt/capture_options_dialog.cpp @@ -1390,7 +1390,7 @@ QWidget* InterfaceTreeDelegate::createEditor(QWidget *parent, const QStyleOption QComboBox *cb = new QComboBox(parent); cb->addItems(valid_link_types); - connect(cb, SIGNAL(currentIndexChanged(QString)), this, SLOT(linkTypeChanged(QString))); + connect(cb, &QComboBox::currentTextChanged, this, &InterfaceTreeDelegate::linkTypeChanged); w = (QWidget*) cb; break; } @@ -1445,7 +1445,7 @@ bool InterfaceTreeDelegate::eventFilter(QObject *object, QEvent *event) return false; } -void InterfaceTreeDelegate::linkTypeChanged(QString selected_link_type) +void InterfaceTreeDelegate::linkTypeChanged(const QString selected_link_type) { GList *list; link_row *temp; diff --git a/ui/qt/capture_options_dialog.h b/ui/qt/capture_options_dialog.h index 0816d2f904..1e1a176051 100644 --- a/ui/qt/capture_options_dialog.h +++ b/ui/qt/capture_options_dialog.h @@ -47,7 +47,7 @@ signals: void filterChanged(const QString filter); private slots: - void linkTypeChanged(QString selected_link_type); + void linkTypeChanged(const QString selected_link_type); void snapshotLengthChanged(int value); void bufferSizeChanged(int value); }; diff --git a/ui/qt/remote_capture_dialog.cpp b/ui/qt/remote_capture_dialog.cpp index 59043b075c..dff165275e 100644 --- a/ui/qt/remote_capture_dialog.cpp +++ b/ui/qt/remote_capture_dialog.cpp @@ -35,7 +35,7 @@ RemoteCaptureDialog::RemoteCaptureDialog(QWidget *parent) : fillComboBox(); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(apply_remote())); connect(this, SIGNAL(remoteAdded(GList *, remote_options*)), parent, SIGNAL(remoteAdded(GList *, remote_options*))); - connect(ui->hostCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(hostChanged(QString))); + connect(ui->hostCombo, &QComboBox::currentTextChanged, this, &RemoteCaptureDialog::hostChanged); } RemoteCaptureDialog::~RemoteCaptureDialog() @@ -43,7 +43,7 @@ RemoteCaptureDialog::~RemoteCaptureDialog() delete ui; } -void RemoteCaptureDialog::hostChanged(QString host) +void RemoteCaptureDialog::hostChanged(const QString host) { if (!host.compare(tr("Clear list"))) { recent_free_remote_host_list(); diff --git a/ui/qt/remote_capture_dialog.h b/ui/qt/remote_capture_dialog.h index 2ed592479b..86ef074024 100644 --- a/ui/qt/remote_capture_dialog.h +++ b/ui/qt/remote_capture_dialog.h @@ -37,7 +37,7 @@ private slots: void on_pwAuth_toggled(bool checked); void on_nullAuth_toggled(bool checked); void apply_remote(); - void hostChanged(QString host); + void hostChanged(const QString host); private: Ui::RemoteCaptureDialog *ui;