From fb7bfbf18d91d0bd0f1c88ee6043e3dfa7ae9b9e Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 20 Dec 2016 21:37:37 +0300 Subject: examples: Use QOverload to select overloaded signals and slots We can use QOverload since Qt 5.7 (it depends on Q_COMPILER_VARIADIC_TEMPLATES which is required since Qt 5.7). Use it in the examples to show the best practice. qOverload currently can't be used because it requires c++14. Change-Id: I94a3c0db9d551fe169fa3d19c07ec0b329d5946c Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart (Woboq GmbH) --- examples/widgets/tools/regularexpression/regularexpressiondialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/widgets/tools/regularexpression/regularexpressiondialog.cpp') diff --git a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp index f13240d06f..7a67c763d8 100644 --- a/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp +++ b/examples/widgets/tools/regularexpression/regularexpressiondialog.cpp @@ -94,10 +94,10 @@ RegularExpressionDialog::RegularExpressionDialog(QWidget *parent) connect(optimizeOnFirstUsageOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh); connect(dontAutomaticallyOptimizeOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh); - connect(offsetSpinBox, static_cast(&QSpinBox::valueChanged), + connect(offsetSpinBox, QOverload::of(&QSpinBox::valueChanged), this, &RegularExpressionDialog::refresh); - connect(matchTypeComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(matchTypeComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, &RegularExpressionDialog::refresh); connect(anchoredMatchOptionCheckBox, &QCheckBox::toggled, this, &RegularExpressionDialog::refresh); -- cgit v1.2.3