diff options
Diffstat (limited to 'muse2/awl')
-rw-r--r-- | muse2/awl/sigedit.cpp | 13 | ||||
-rw-r--r-- | muse2/awl/sigedit.h | 1 |
2 files changed, 13 insertions, 1 deletions
diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp index 826182ca..460aafe4 100644 --- a/muse2/awl/sigedit.cpp +++ b/muse2/awl/sigedit.cpp @@ -58,6 +58,16 @@ bool SigEdit::event(QEvent* event) if (event->type() == QEvent::KeyPress) { QKeyEvent* ke = static_cast<QKeyEvent*>(event); int segment = curSegment(); + if (ke->key() == Qt::Key_Return) + { + int z, n; + sscanf(lineEdit()->text().toLatin1().data(), "%d/%d", &z, &n); + AL::TimeSignature sig(z, n); + _sig = sig; + + emit returnPressed(); + return true; + } if (ke->key() == Qt::Key_Backtab) { if (segment == 2) { lineEdit()->setSelection(5, 2); @@ -117,6 +127,7 @@ void SigEdit::setValue(const QString& s) void SigEdit::updateValue() { + //printf("updateValue\n"); char buffer[64]; sprintf(buffer, "%d/%d", _sig.z, _sig.n); lineEdit()->setText(buffer); @@ -160,7 +171,7 @@ void SigEdit::fixup(QString& input) const QValidator::State SigEdit::validate(QString&,int&) const { // TODO - // printf("validate\n"); + //printf("validate\n"); return QValidator::Acceptable; } diff --git a/muse2/awl/sigedit.h b/muse2/awl/sigedit.h index dd059ea2..d2494798 100644 --- a/muse2/awl/sigedit.h +++ b/muse2/awl/sigedit.h @@ -54,6 +54,7 @@ class SigEdit : public QAbstractSpinBox signals: void valueChanged(const AL::TimeSignature&); + void returnPressed(); public slots: void setValue(const AL::TimeSignature&); |