From: Soeren Apel Date: Sat, 3 Jun 2017 20:44:28 +0000 (+0200) Subject: Don't use Q_EMIT, it's not needed anymore X-Git-Tag: pulseview-0.4.0~45 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=25e734c848a23fc526d5b410235e8e7e9fb5edde;p=pulseview.git Don't use Q_EMIT, it's not needed anymore The Q_EMIT macro (just like the regular Qt emit) is syntactic sugar to let people who read the code know that a method call placed somewhere is actually a signal. We don't use Q_EMIT consistently throughout PV and I don't think it's really needed anyway, so this patch removes the few remaining instances. --- diff --git a/pv/view/view.cpp b/pv/view/view.cpp index 17b9c153..4ac98114 100644 --- a/pv/view/view.cpp +++ b/pv/view/view.cpp @@ -376,7 +376,7 @@ void View::set_scale(double scale) { if (scale_ != scale) { scale_ = scale; - Q_EMIT scale_changed(); + scale_changed(); } } @@ -389,7 +389,7 @@ void View::set_offset(const pv::util::Timestamp& offset) { if (offset_ != offset) { offset_ = offset; - Q_EMIT offset_changed(); + offset_changed(); } } @@ -419,7 +419,7 @@ void View::set_tick_prefix(pv::util::SIPrefix tick_prefix) { if (tick_prefix_ != tick_prefix) { tick_prefix_ = tick_prefix; - Q_EMIT tick_prefix_changed(); + tick_prefix_changed(); } } @@ -432,7 +432,7 @@ void View::set_tick_precision(unsigned tick_precision) { if (tick_precision_ != tick_precision) { tick_precision_ = tick_precision; - Q_EMIT tick_precision_changed(); + tick_precision_changed(); } } @@ -445,7 +445,7 @@ void View::set_tick_period(const pv::util::Timestamp& tick_period) { if (tick_period_ != tick_period) { tick_period_ = tick_period; - Q_EMIT tick_period_changed(); + tick_period_changed(); } } @@ -458,7 +458,7 @@ void View::set_time_unit(pv::util::TimeUnit time_unit) { if (time_unit_ != time_unit) { time_unit_ = time_unit; - Q_EMIT time_unit_changed(); + time_unit_changed(); } } diff --git a/pv/widgets/timestampspinbox.cpp b/pv/widgets/timestampspinbox.cpp index fd52c504..21b3d0d7 100644 --- a/pv/widgets/timestampspinbox.cpp +++ b/pv/widgets/timestampspinbox.cpp @@ -87,7 +87,7 @@ void TimestampSpinBox::setValue(const pv::util::Timestamp& val) value_ = val; updateEdit(); - Q_EMIT valueChanged(value_); + valueChanged(value_); } void TimestampSpinBox::on_editingFinished() diff --git a/pv/widgets/wellarray.cpp b/pv/widgets/wellarray.cpp index 433a7f5e..04a7ccec 100644 --- a/pv/widgets/wellarray.cpp +++ b/pv/widgets/wellarray.cpp @@ -220,7 +220,7 @@ void WellArray::setSelected(int row, int col) updateCell(oldRow, oldCol); updateCell(selRow, selCol); if (row >= 0) - Q_EMIT selected(row, col); + selected(row, col); } void WellArray::focusInEvent(QFocusEvent*)