From 27b7bf6815cda7abb67026c37b3e44daee1803cb Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Thu, 15 Mar 2012 18:21:23 +0000 Subject: merged with trunk --- muse2/awl/sigspinbox.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'muse2/awl/sigspinbox.cpp') diff --git a/muse2/awl/sigspinbox.cpp b/muse2/awl/sigspinbox.cpp index f1399538..f3cbe06d 100644 --- a/muse2/awl/sigspinbox.cpp +++ b/muse2/awl/sigspinbox.cpp @@ -8,8 +8,7 @@ class MyLineEdit : public QLineEdit { public: - MyLineEdit() : QLineEdit() {}; - MyLineEdit(QWidget* parent) : QLineEdit(parent) {}; + MyLineEdit(QWidget* parent = 0) : QLineEdit(parent) {}; protected: virtual void mousePressEvent (QMouseEvent* e) @@ -19,10 +18,10 @@ class MyLineEdit : public QLineEdit } }; - SigSpinBox::SigSpinBox(QWidget *parent) : QSpinBox(parent) { + setKeyboardTracking(false); _denominator=false; setLineEdit(new MyLineEdit(this)); } @@ -31,9 +30,14 @@ void SigSpinBox::keyPressEvent(QKeyEvent* ev) { switch (ev->key()) { case Qt::Key_Return: + QSpinBox::keyPressEvent(ev); emit returnPressed(); return; break; + case Qt::Key_Escape: + emit escapePressed(); + return; + break; case Qt::Key_Left: case Qt::Key_Right: case Qt::Key_Slash: -- cgit v1.2.3