调试初版

This commit is contained in:
xu
2026-10-14 18:22:41 +08:00
parent d3a355bd3f
commit e5efdea06e
26 changed files with 289 additions and 140 deletions
+8 -6
View File
@@ -1,5 +1,6 @@
#include "paramcontrol.h"
#include "numpaddialog.h"
#include "global.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
@@ -101,7 +102,7 @@ void ParamControl::adjustByKnob(int steps)
emit valueChanged(m_value);
}
// 点击数值框 / 回车 → 弹出数字键盘(面板靠左、不透明度 80%);↑/↓ → 每档加减一次
// 点击数值框 / 空格 → 弹出数字键盘(面板靠左、不透明度 80%);↑/↓ → 每档加减一次
bool ParamControl::eventFilter(QObject* obj, QEvent* ev)
{
if (obj == m_valueEdit) {
@@ -111,17 +112,18 @@ bool ParamControl::eventFilter(QObject* obj, QEvent* ev)
}
if (ev->type() == QEvent::KeyPress) {
QKeyEvent* ke = static_cast<QKeyEvent*>(ev);
if (ke->key() == Qt::Key_Return || ke->key() == Qt::Key_Enter) {
const int k = ke->key();
if (Keys::space(k)) {
openNumPad();
return true;
}
// 旋钮档:↑ 加一档、↓ 减一档(每档 = m_step)。Tab/Shift+Tab 走焦点链、
// 空格激活按钮,各不重叠;按住方向键由按键自动重复继续调
if (ke->key() == Qt::Key_Up) {
// 旋钮档:↑ 加一档、↓ 减一档(每档 = m_step)。Tab/Shift+Tab 走焦点链,
// 各不重叠;按住方向键由按键自动重复继续调
if (Keys::up(k)) {
adjustByKnob(1);
return true;
}
if (ke->key() == Qt::Key_Down) {
if (Keys::down(k)) {
adjustByKnob(-1);
return true;
}