Skip to content

Commit

Permalink
Merge pull request #11034 from daschuer/effect-parameter-change-label
Browse files Browse the repository at this point in the history
Move connection to setEffectParameterSlot() to avoid double connection
  • Loading branch information
ronso0 authored Nov 3, 2022
2 parents 1211fed + 6e889b3 commit e9ecc28
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/widget/weffectparameternamebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ void WEffectParameterNameBase::setEffectParameterSlot(
&EffectParameterSlotBase::updated,
this,
&WEffectParameterNameBase::parameterUpdated);
if (qobject_cast<EffectKnobParameterSlot*>(m_pParameterSlot.data())) {
// Make connection to show parameter value instead of name briefly
// after value has changed.
connect(m_pParameterSlot.data(),
&EffectParameterSlotBase::valueChanged,
this,
&WEffectParameterNameBase::showNewValue);
}
}
parameterUpdated();
}
Expand All @@ -49,14 +57,6 @@ void WEffectParameterNameBase::parameterUpdated() {
setBaseTooltip(QString("%1\n%2").arg(
m_pParameterSlot->name(),
m_pParameterSlot->description()));
// Make connection to show parameter value instead of name briefly
// after value has changed.
if (m_pParameterSlot->parameterType() == EffectParameterType::Knob) {
connect(m_pParameterSlot.data(),
&EffectParameterSlotBase::valueChanged,
this,
&WEffectParameterNameBase::showNewValue);
}
} else {
m_text = kNoEffectString;
setBaseTooltip(tr("No effect loaded."));
Expand Down

0 comments on commit e9ecc28

Please sign in to comment.