MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / eventFilter

Method eventFilter

src/gui/ClientEqOutputFader.cpp:124–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124bool ClientEqOutputFader::eventFilter(QObject* obj, QEvent* ev)
125{
126 if (obj == m_valueEdit) {
127 if (ev->type() == QEvent::Wheel) {
128 wheelEvent(static_cast<QWheelEvent*>(ev));
129 return true;
130 }
131 if (ev->type() == QEvent::KeyPress) {
132 auto* ke = static_cast<QKeyEvent*>(ev);
133 if (ke->key() == Qt::Key_Escape) {
134 QSignalBlocker b(m_valueEdit);
135 refreshValueLabel();
136 m_valueEdit->clearFocus();
137 return true;
138 }
139 }
140 if (ev->type() == QEvent::FocusIn) {
141 // Show bare number on focus so the user types just digits.
142 QSignalBlocker b(m_valueEdit);
143 const float db = linearToDb(m_gain);
144 m_valueEdit->setText(QString::number(db, 'f', 1));
145 m_valueEdit->selectAll();
146 } else if (ev->type() == QEvent::FocusOut) {
147 refreshValueLabel();
148 }
149 }
150 return QWidget::eventFilter(obj, ev);
151}
152
153void ClientEqOutputFader::setGainLinear(float linear)
154{

Callers

nothing calls this directly

Calls 3

wheelEventFunction · 0.85
keyMethod · 0.80
linearToDbFunction · 0.70

Tested by

no test coverage detected