| 122 | } |
| 123 | |
| 124 | bool 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 | |
| 153 | void ClientEqOutputFader::setGainLinear(float linear) |
| 154 | { |
nothing calls this directly
no test coverage detected