aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-12-24 11:11:20 -0600
committerAnders Broman <a.broman58@gmail.com>2018-12-24 23:30:03 +0000
commitc899c002afc3c10e9cbe137677af3996340972af (patch)
tree899ad2cff53ec299de2a992b3a0a8e8a210d5a0f /ui
parent7facbfdaa525e2137ce193f6054c7fe6066b18c7 (diff)
Qt: Switch ui/qt/widgets/*.cpp to new-style signals and slots.
Switch our remaining home-grown widgets (which excludes QCustomPlot) to new-style signals and slots. Change-Id: Icbe2d25d4ddad11b66f4c1369fa0da89c213ba72 Reviewed-on: https://code.wireshark.org/review/31190 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/widgets/additional_toolbar.cpp13
-rw-r--r--ui/qt/widgets/apply_line_edit.cpp40
-rw-r--r--ui/qt/widgets/apply_line_edit.h2
-rw-r--r--ui/qt/widgets/byte_view_text.cpp4
-rw-r--r--ui/qt/widgets/capture_filter_combo.cpp23
-rw-r--r--ui/qt/widgets/display_filter_combo.cpp2
-rw-r--r--ui/qt/widgets/editor_color_dialog.cpp2
-rw-r--r--ui/qt/widgets/editor_file_dialog.cpp2
-rw-r--r--ui/qt/widgets/filter_expression_toolbar.cpp18
-rw-r--r--ui/qt/widgets/find_line_edit.cpp4
-rw-r--r--ui/qt/widgets/interface_toolbar_lineedit.cpp8
-rw-r--r--ui/qt/widgets/label_stack.cpp2
-rw-r--r--ui/qt/widgets/overlay_scroll_bar.cpp6
-rw-r--r--ui/qt/widgets/syntax_line_edit.cpp4
14 files changed, 66 insertions, 64 deletions
diff --git a/ui/qt/widgets/additional_toolbar.cpp b/ui/qt/widgets/additional_toolbar.cpp
index 72c2fee61f..447088c2d8 100644
--- a/ui/qt/widgets/additional_toolbar.cpp
+++ b/ui/qt/widgets/additional_toolbar.cpp
@@ -100,14 +100,14 @@ AdditionalToolbarWidgetAction::AdditionalToolbarWidgetAction(ext_toolbar_t * ite
: QWidgetAction(parent),
toolbar_item(item)
{
- connect(wsApp, SIGNAL(captureActive(int)), this, SLOT(captureActive(int)));
+ connect(wsApp, &WiresharkApplication::captureActive, this, &AdditionalToolbarWidgetAction::captureActive);
}
AdditionalToolbarWidgetAction::AdditionalToolbarWidgetAction(const AdditionalToolbarWidgetAction & copy_object)
: QWidgetAction(copy_object.parent()),
toolbar_item(copy_object.toolbar_item)
{
- connect(wsApp, SIGNAL(captureActive(int)), this, SLOT(captureActive(int)));
+ connect(wsApp, &WiresharkApplication::captureActive, this, &AdditionalToolbarWidgetAction::captureActive);
}
@@ -187,7 +187,7 @@ QWidget * AdditionalToolbarWidgetAction::createButton(ext_toolbar_t * item, QWid
QPushButton * button = new QPushButton(item->name, parent);
button->setText(item->name);
- connect(button, SIGNAL(clicked()), this, SLOT(onButtonClicked()));
+ connect(button, &QPushButton::clicked, this, &AdditionalToolbarWidgetAction::onButtonClicked);
ext_toolbar_register_update_cb(item, (ext_toolbar_action_cb)&toolbar_button_cb, (void *)button);
@@ -233,7 +233,7 @@ QWidget * AdditionalToolbarWidgetAction::createBoolean(ext_toolbar_t * item, QWi
checkbox->setText(item->name);
setCheckable(true);
checkbox->setCheckState(defValue.compare("true", Qt::CaseInsensitive) == 0 ? Qt::Checked : Qt::Unchecked);
- connect(checkbox, SIGNAL(stateChanged(int)), this, SLOT(onCheckBoxChecked(int)));
+ connect(checkbox, &QCheckBox::stateChanged, this, &AdditionalToolbarWidgetAction::onCheckBoxChecked);
ext_toolbar_register_update_cb(item, (ext_toolbar_action_cb)&toolbar_boolean_cb, (void *)checkbox);
@@ -313,7 +313,7 @@ QWidget * AdditionalToolbarWidgetAction::createTextEditor(ext_toolbar_t * item,
frame->layout()->addWidget(strEdit);
- connect(strEdit, SIGNAL(textApplied()), this, SLOT(sendTextToCallback()));
+ connect(strEdit, &ApplyLineEdit::textApplied, this, &AdditionalToolbarWidgetAction::sendTextToCallback);
ext_toolbar_register_update_cb(item, (ext_toolbar_action_cb)&toolbar_string_cb, (void *)strEdit);
@@ -475,7 +475,8 @@ QWidget * AdditionalToolbarWidgetAction::createSelector(ext_toolbar_t * item, QW
frame->layout()->addWidget(myBox);
- connect(myBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onSelectionInWidgetChanged(int)));
+ connect(myBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &AdditionalToolbarWidgetAction::onSelectionInWidgetChanged);
ext_toolbar_register_update_cb(item, (ext_toolbar_action_cb)&toolbar_selector_cb, (void *)myBox);
diff --git a/ui/qt/widgets/apply_line_edit.cpp b/ui/qt/widgets/apply_line_edit.cpp
index c86df8d246..83ed8d6b6a 100644
--- a/ui/qt/widgets/apply_line_edit.cpp
+++ b/ui/qt/widgets/apply_line_edit.cpp
@@ -19,18 +19,18 @@
ApplyLineEdit::ApplyLineEdit(QString linePlaceholderText, QWidget * parent)
: QLineEdit(parent),
- applyButton(0)
+ apply_button_(0)
{
emptyAllowed_ = false;
regex_ = QString();
- applyButton = new StockIconToolButton(parent, "x-filter-apply");
- applyButton->setCursor(Qt::ArrowCursor);
- applyButton->setEnabled(false);
- applyButton->setToolTip(tr("Apply changes"));
- applyButton->setIconSize(QSize(24, 14));
- applyButton->setMaximumWidth(30);
- applyButton->setStyleSheet(
+ apply_button_ = new StockIconToolButton(parent, "x-filter-apply");
+ apply_button_->setCursor(Qt::ArrowCursor);
+ apply_button_->setEnabled(false);
+ apply_button_->setToolTip(tr("Apply changes"));
+ apply_button_->setIconSize(QSize(24, 14));
+ apply_button_->setMaximumWidth(30);
+ apply_button_->setStyleSheet(
"QToolButton {"
" border: none;"
" background: transparent;" // Disables platform style on Windows.
@@ -40,16 +40,16 @@ ApplyLineEdit::ApplyLineEdit(QString linePlaceholderText, QWidget * parent)
#ifdef Q_OS_MAC
setAttribute(Qt::WA_MacSmallSize, true);
- applyButton->setAttribute(Qt::WA_MacSmallSize, true);
+ apply_button_->setAttribute(Qt::WA_MacSmallSize, true);
#endif
setPlaceholderText(linePlaceholderText);
- connect(this, SIGNAL(textEdited(const QString&)), this, SLOT(onTextEdited(const QString&)));
- connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged(const QString&)));
+ connect(this, &ApplyLineEdit::textEdited, this, &ApplyLineEdit::onTextEdited);
+ connect(this, &ApplyLineEdit::textChanged, this, &ApplyLineEdit::onTextChanged);
- connect(this, SIGNAL(returnPressed()), this, SLOT(onSubmitContent()));
- connect(applyButton, SIGNAL(clicked()), this, SLOT(onSubmitContent()));
+ connect(this, &ApplyLineEdit::returnPressed, this, &ApplyLineEdit::onSubmitContent);
+ connect(apply_button_, &StockIconToolButton::clicked, this, &ApplyLineEdit::onSubmitContent);
handleValidation(QString(linePlaceholderText));
@@ -104,7 +104,7 @@ bool ApplyLineEdit::isValidText(QString & text, bool ignoreEmptyCheck)
void ApplyLineEdit::onTextEdited(const QString & text)
{
QString newText = QString(text);
- applyButton->setEnabled(isValidText(newText));
+ apply_button_->setEnabled(isValidText(newText));
handleValidation(newText);
}
@@ -125,7 +125,7 @@ void ApplyLineEdit::handleValidation(QString newText)
"}"
)
.arg(frameWidth + 1)
- .arg(applyButton->sizeHint().width() + frameWidth)
+ .arg(apply_button_->sizeHint().width() + frameWidth)
.arg(isValidText(newText, true) ? QString("") : ColorUtils::fromColorT(prefs.gui_text_invalid).name());
setStyleSheet(style_sheet);
@@ -134,13 +134,13 @@ void ApplyLineEdit::handleValidation(QString newText)
void ApplyLineEdit::resizeEvent(QResizeEvent *)
{
int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- QSize apsz = applyButton->sizeHint();
+ QSize apsz = apply_button_->sizeHint();
- applyButton->move((contentsRect().right() + pos().x()) - ( frameWidth + apsz.width() ) - 2,
+ apply_button_->move((contentsRect().right() + pos().x()) - ( frameWidth + apsz.width() ) - 2,
contentsRect().top() + pos().y());
- applyButton->setMinimumHeight(height());
- applyButton->setMaximumHeight(height());
+ apply_button_->setMinimumHeight(height());
+ apply_button_->setMaximumHeight(height());
}
void ApplyLineEdit::onSubmitContent()
@@ -150,7 +150,7 @@ void ApplyLineEdit::onSubmitContent()
return;
/* Freeze apply button to signal the text has been sent. Will be unfreezed, if the text in the textbox changes again */
- applyButton->setEnabled(false);
+ apply_button_->setEnabled(false);
emit textApplied();
}
diff --git a/ui/qt/widgets/apply_line_edit.h b/ui/qt/widgets/apply_line_edit.h
index ec0ef2cabb..91e440c59a 100644
--- a/ui/qt/widgets/apply_line_edit.h
+++ b/ui/qt/widgets/apply_line_edit.h
@@ -43,7 +43,7 @@ private:
QString regex_;
bool emptyAllowed_;
- StockIconToolButton *applyButton;
+ StockIconToolButton *apply_button_;
bool isValidText(QString &, bool ignoreEmptyCheck = false);
void handleValidation(QString newText);
diff --git a/ui/qt/widgets/byte_view_text.cpp b/ui/qt/widgets/byte_view_text.cpp
index 636f2c1cd0..6e2c1dcd50 100644
--- a/ui/qt/widgets/byte_view_text.cpp
+++ b/ui/qt/widgets/byte_view_text.cpp
@@ -97,7 +97,7 @@ void ByteViewText::createContextMenu()
}
ctx_menu_.addActions(format_actions->actions());
- connect(format_actions, SIGNAL(triggered(QAction*)), this, SLOT(setHexDisplayFormat(QAction*)));
+ connect(format_actions, &QActionGroup::triggered, this, &ByteViewText::setHexDisplayFormat);
ctx_menu_.addSeparator();
@@ -122,7 +122,7 @@ void ByteViewText::createContextMenu()
}
ctx_menu_.addActions(encoding_actions->actions());
- connect(encoding_actions, SIGNAL(triggered(QAction*)), this, SLOT(setCharacterEncoding(QAction*)));
+ connect(encoding_actions, &QActionGroup::triggered, this, &ByteViewText::setCharacterEncoding);
}
bool ByteViewText::isEmpty() const
diff --git a/ui/qt/widgets/capture_filter_combo.cpp b/ui/qt/widgets/capture_filter_combo.cpp
index 5cd469f0a0..e869d6f924 100644
--- a/ui/qt/widgets/capture_filter_combo.cpp
+++ b/ui/qt/widgets/capture_filter_combo.cpp
@@ -64,17 +64,18 @@ CaptureFilterCombo::CaptureFilterCombo(QWidget *parent, bool plain) :
"}"
);
- connect(this, SIGNAL(interfacesChanged()), cf_edit_, SLOT(checkFilter()));
- connect(cf_edit_, SIGNAL(pushFilterSyntaxStatus(const QString&)),
- this, SIGNAL(pushFilterSyntaxStatus(const QString&)));
- connect(cf_edit_, SIGNAL(popFilterSyntaxStatus()),
- this, SIGNAL(popFilterSyntaxStatus()));
- connect(cf_edit_, SIGNAL(captureFilterSyntaxChanged(bool)),
- this, SIGNAL(captureFilterSyntaxChanged(bool)));
- connect(cf_edit_, SIGNAL(startCapture()), this, SIGNAL(startCapture()));
- connect(cf_edit_, SIGNAL(startCapture()), this, SLOT(saveAndRebuildFilterList()));
- connect(wsApp, SIGNAL(appInitialized()), this, SLOT(rebuildFilterList()));
- connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(rebuildFilterList()));
+ connect(this, &CaptureFilterCombo::interfacesChanged, cf_edit_,
+ static_cast<void (CaptureFilterEdit::*)()>(&CaptureFilterEdit::checkFilter));
+ connect(cf_edit_, &CaptureFilterEdit::pushFilterSyntaxStatus,
+ this, &CaptureFilterCombo::pushFilterSyntaxStatus);
+ connect(cf_edit_, &CaptureFilterEdit::popFilterSyntaxStatus,
+ this, &CaptureFilterCombo::popFilterSyntaxStatus);
+ connect(cf_edit_, &CaptureFilterEdit::captureFilterSyntaxChanged,
+ this, &CaptureFilterCombo::captureFilterSyntaxChanged);
+ connect(cf_edit_, &CaptureFilterEdit::startCapture, this, &CaptureFilterCombo::startCapture);
+ connect(cf_edit_, &CaptureFilterEdit::startCapture, this, &CaptureFilterCombo::saveAndRebuildFilterList);
+ connect(wsApp, &WiresharkApplication::appInitialized, this, &CaptureFilterCombo::rebuildFilterList);
+ connect(wsApp, &WiresharkApplication::preferencesChanged, this, &CaptureFilterCombo::rebuildFilterList);
rebuildFilterList();
clearEditText();
diff --git a/ui/qt/widgets/display_filter_combo.cpp b/ui/qt/widgets/display_filter_combo.cpp
index dca82bffc8..6f2cf71f20 100644
--- a/ui/qt/widgets/display_filter_combo.cpp
+++ b/ui/qt/widgets/display_filter_combo.cpp
@@ -69,7 +69,7 @@ DisplayFilterCombo::DisplayFilterCombo(QWidget *parent) :
);
setToolTip(tr("Select from previously used filters."));
- connect(wsApp, SIGNAL(preferencesChanged()), this, SLOT(updateMaxCount()));
+ connect(wsApp, &WiresharkApplication::preferencesChanged, this, &DisplayFilterCombo::updateMaxCount);
}
extern "C" void dfilter_recent_combo_write_all(FILE *rf) {
diff --git a/ui/qt/widgets/editor_color_dialog.cpp b/ui/qt/widgets/editor_color_dialog.cpp
index 76b79aefae..2749ad7dd8 100644
--- a/ui/qt/widgets/editor_color_dialog.cpp
+++ b/ui/qt/widgets/editor_color_dialog.cpp
@@ -21,7 +21,7 @@ EditorColorDialog::EditorColorDialog(const QModelIndex& index, const QColor& ini
, index_(index)
, current_(initial)
{
- connect(color_button_, SIGNAL(clicked()), this, SLOT(applyColor()));
+ connect(color_button_, &QPushButton::clicked, this, &EditorColorDialog::applyColor);
}
// QAbstractItemView installs QAbstractItemDelegate's event filter after
diff --git a/ui/qt/widgets/editor_file_dialog.cpp b/ui/qt/widgets/editor_file_dialog.cpp
index 73802a2c6c..397d091dc3 100644
--- a/ui/qt/widgets/editor_file_dialog.cpp
+++ b/ui/qt/widgets/editor_file_dialog.cpp
@@ -34,7 +34,7 @@ EditorFileDialog::EditorFileDialog(const QModelIndex& index, enum FileMode mode,
setText(directory);
file_dialog_button_->setText(UTF8_HORIZONTAL_ELLIPSIS);
- connect(file_dialog_button_, SIGNAL(clicked()), this, SLOT(applyFilename()));
+ connect(file_dialog_button_, &QPushButton::clicked, this, &EditorFileDialog::applyFilename);
}
void EditorFileDialog::setOption(QFileDialog::Option option, bool on)
diff --git a/ui/qt/widgets/filter_expression_toolbar.cpp b/ui/qt/widgets/filter_expression_toolbar.cpp
index 92c8934280..42036f23c6 100644
--- a/ui/qt/widgets/filter_expression_toolbar.cpp
+++ b/ui/qt/widgets/filter_expression_toolbar.cpp
@@ -53,10 +53,10 @@ FilterExpressionToolBar::FilterExpressionToolBar(QWidget * parent) :
connect(this, &DragDropToolBar::actionMoved, this, &FilterExpressionToolBar::onActionMoved);
connect(this, &DragDropToolBar::newFilterDropped, this, &FilterExpressionToolBar::onFilterDropped);
- connect(wsApp, SIGNAL(appInitialized()),
- this, SLOT(filterExpressionsChanged()));
- connect(wsApp, SIGNAL(filterExpressionsChanged()),
- this, SLOT(filterExpressionsChanged()));
+ connect(wsApp, &WiresharkApplication::appInitialized,
+ this, &FilterExpressionToolBar::filterExpressionsChanged);
+ connect(wsApp, &WiresharkApplication::filterExpressionsChanged,
+ this, &FilterExpressionToolBar::filterExpressionsChanged);
}
@@ -69,23 +69,23 @@ void FilterExpressionToolBar::onCustomMenuHandler(const QPoint& pos)
QMenu * filterMenu = new QMenu(this);
QAction *actFilter = filterMenu->addAction(tr("Filter Button Preferences..."));
- connect(actFilter, SIGNAL(triggered()), this, SLOT(toolBarShowPreferences()));
+ connect(actFilter, &QAction::triggered, this, &FilterExpressionToolBar::toolBarShowPreferences);
actFilter->setProperty(dfe_property_label_, filterAction->property(dfe_property_label_));
actFilter->setProperty(dfe_property_expression_, filterAction->property(dfe_property_expression_));
actFilter->setData(filterAction->data());
filterMenu->addSeparator();
QAction * actEdit = filterMenu->addAction(tr("Edit"));
- connect(actEdit, SIGNAL(triggered()), this, SLOT(editFilter()));
+ connect(actEdit, &QAction::triggered, this, &FilterExpressionToolBar::editFilter);
actEdit->setProperty(dfe_property_label_, filterAction->property(dfe_property_label_));
actEdit->setProperty(dfe_property_expression_, filterAction->property(dfe_property_expression_));
actEdit->setData(filterAction->data());
QAction * actDisable = filterMenu->addAction(tr("Disable"));
- connect(actDisable, SIGNAL(triggered()), this, SLOT(disableFilter()));
+ connect(actDisable, &QAction::triggered, this, &FilterExpressionToolBar::disableFilter);
actDisable->setProperty(dfe_property_label_, filterAction->property(dfe_property_label_));
actDisable->setProperty(dfe_property_expression_, filterAction->property(dfe_property_expression_));
actDisable->setData(filterAction->data());
QAction * actRemove = filterMenu->addAction(tr("Remove"));
- connect(actRemove, SIGNAL(triggered()), this, SLOT(removeFilter()));
+ connect(actRemove, &QAction::triggered, this, &FilterExpressionToolBar::removeFilter);
actRemove->setProperty(dfe_property_label_, filterAction->property(dfe_property_label_));
actRemove->setProperty(dfe_property_expression_, filterAction->property(dfe_property_expression_));
actRemove->setData(filterAction->data());
@@ -264,7 +264,7 @@ gboolean FilterExpressionToolBar::filter_expression_add_action(const void *key _
data->toolbar->addWidget(sep);
}
data->toolbar->addAction(dfb_action);
- connect(dfb_action, SIGNAL(triggered()), data->toolbar, SLOT(filterClicked()));
+ connect(dfb_action, &QAction::triggered, data->toolbar, &FilterExpressionToolBar::filterClicked);
data->actions_added = true;
return FALSE;
}
diff --git a/ui/qt/widgets/find_line_edit.cpp b/ui/qt/widgets/find_line_edit.cpp
index a374af2683..7dfa7a0898 100644
--- a/ui/qt/widgets/find_line_edit.cpp
+++ b/ui/qt/widgets/find_line_edit.cpp
@@ -30,12 +30,12 @@ void FindLineEdit::contextMenuEvent(QContextMenuEvent *event)
action = menu->addAction(tr("Textual Find"));
action->setCheckable(true);
action->setChecked(!use_regex_);
- connect(action, SIGNAL(triggered()), this, SLOT(setUseTextual()));
+ connect(action, &QAction::triggered, this, &FindLineEdit::setUseTextual);
action = menu->addAction(tr("Regular Expression Find"));
action->setCheckable(true);
action->setChecked(use_regex_);
- connect(action, SIGNAL(triggered()), this, SLOT(setUseRegex()));
+ connect(action, &QAction::triggered, this, &FindLineEdit::setUseRegex);
#endif
menu->exec(event->globalPos());
diff --git a/ui/qt/widgets/interface_toolbar_lineedit.cpp b/ui/qt/widgets/interface_toolbar_lineedit.cpp
index cf0eb6b4b4..0b2a4600c9 100644
--- a/ui/qt/widgets/interface_toolbar_lineedit.cpp
+++ b/ui/qt/widgets/interface_toolbar_lineedit.cpp
@@ -40,10 +40,10 @@ InterfaceToolbarLineEdit::InterfaceToolbarLineEdit(QWidget *parent, QString vali
updateStyleSheet(isValid());
- connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(validateText()));
- connect(this, SIGNAL(textEdited(const QString &)), this, SLOT(validateEditedText()));
- connect(this, SIGNAL(returnPressed()), this, SLOT(applyEditedText()));
- connect(apply_button_, SIGNAL(clicked()), this, SLOT(applyEditedText()));
+ connect(this, &InterfaceToolbarLineEdit::textChanged, this, &InterfaceToolbarLineEdit::validateText);
+ connect(this, &InterfaceToolbarLineEdit::textEdited, this, &InterfaceToolbarLineEdit::validateEditedText);
+ connect(this, &InterfaceToolbarLineEdit::returnPressed, this, &InterfaceToolbarLineEdit::applyEditedText);
+ connect(apply_button_, &StockIconToolButton::clicked, this, &InterfaceToolbarLineEdit::applyEditedText);
}
void InterfaceToolbarLineEdit::validateText()
diff --git a/ui/qt/widgets/label_stack.cpp b/ui/qt/widgets/label_stack.cpp
index 0e0465e49a..65d281f5f8 100644
--- a/ui/qt/widgets/label_stack.cpp
+++ b/ui/qt/widgets/label_stack.cpp
@@ -32,7 +32,7 @@ LabelStack::LabelStack(QWidget *parent) :
#endif
fillLabel();
- connect(&temporary_timer_, SIGNAL(timeout()), this, SLOT(updateTemporaryStatus()));
+ connect(&temporary_timer_, &QTimer::timeout, this, &LabelStack::updateTemporaryStatus);
}
void LabelStack::setTemporaryContext(const int ctx) {
diff --git a/ui/qt/widgets/overlay_scroll_bar.cpp b/ui/qt/widgets/overlay_scroll_bar.cpp
index e6ff1b8b1d..ff9f26748b 100644
--- a/ui/qt/widgets/overlay_scroll_bar.cpp
+++ b/ui/qt/widgets/overlay_scroll_bar.cpp
@@ -77,10 +77,10 @@ OverlayScrollBar::OverlayScrollBar(Qt::Orientation orientation, QWidget *parent)
child_sb_.setStyle(child_style_);
// XXX Do we need to connect anything else?
- connect(this, SIGNAL(rangeChanged(int,int)), this, SLOT(setChildRange(int,int)));
- connect(this, SIGNAL(valueChanged(int)), &child_sb_, SLOT(setValue(int)));
+ connect(this, &OverlayScrollBar::rangeChanged, this, &OverlayScrollBar::setChildRange);
+ connect(this, &OverlayScrollBar::valueChanged, &child_sb_, &QScrollBar::setValue);
- connect(&child_sb_, SIGNAL(valueChanged(int)), this, SLOT(setValue(int)));
+ connect(&child_sb_, &QScrollBar::valueChanged, this, &OverlayScrollBar::setValue);
}
OverlayScrollBar::~OverlayScrollBar()
diff --git a/ui/qt/widgets/syntax_line_edit.cpp b/ui/qt/widgets/syntax_line_edit.cpp
index e241c86b7b..ae4e082548 100644
--- a/ui/qt/widgets/syntax_line_edit.cpp
+++ b/ui/qt/widgets/syntax_line_edit.cpp
@@ -66,8 +66,8 @@ void SyntaxLineEdit::setCompleter(QCompleter *c)
// Completion items are not guaranteed to be sorted (recent filters +
// fields), so no setModelSorting.
completer_->setMaxVisibleItems(max_completion_items_);
- QObject::connect(completer_, SIGNAL(activated(QString)),
- this, SLOT(insertFieldCompletion(QString)));
+ QObject::connect(completer_, static_cast<void (QCompleter::*)(const QString &)>(&QCompleter::activated),
+ this, &SyntaxLineEdit::insertFieldCompletion);
}
void SyntaxLineEdit::setSyntaxState(SyntaxState state) {