summaryrefslogtreecommitdiff
path: root/muse2/awl
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-10-15 21:23:20 +0000
committerFlorian Jung <flo@windfisch.org>2011-10-15 21:23:20 +0000
commite4124c33aca9180e545cca0b353308625fc0082a (patch)
treeb0967f926a0c7c4f4e6912411ac10b7e4c3aeab8 /muse2/awl
parent7249c6fb8513867e13dd6a69ebb51648e734204e (diff)
sigedit boxes now select their content when you click at them
Diffstat (limited to 'muse2/awl')
-rw-r--r--muse2/awl/sigspinbox.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/muse2/awl/sigspinbox.cpp b/muse2/awl/sigspinbox.cpp
index 6e38b164..a4e4b21f 100644
--- a/muse2/awl/sigspinbox.cpp
+++ b/muse2/awl/sigspinbox.cpp
@@ -1,14 +1,34 @@
#include "sigspinbox.h"
#include "al/sig.h"
#include <QKeyEvent>
+#include <QMouseEvent>
#include <stdio.h>
+#include <QLineEdit>
+
+class MyLineEdit : public QLineEdit
+{
+ public:
+ MyLineEdit() : QLineEdit() {};
+ MyLineEdit(QWidget* parent) : QLineEdit(parent) {};
+
+ protected:
+ virtual void mousePressEvent (QMouseEvent* e)
+ {
+ QLineEdit::mousePressEvent(e);
+ printf("!!!\n");
+ selectAll();
+ }
+};
+
SigSpinBox::SigSpinBox(QWidget *parent) :
QSpinBox(parent)
{
_denominator=false;
+ setLineEdit(new MyLineEdit(this));
}
-void SigSpinBox::keyPressEvent(QKeyEvent*ev)
+
+void SigSpinBox::keyPressEvent(QKeyEvent* ev)
{
switch (ev->key()) {
case Qt::Key_Return: