From e4124c33aca9180e545cca0b353308625fc0082a Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Sat, 15 Oct 2011 21:23:20 +0000 Subject: sigedit boxes now select their content when you click at them --- muse2/awl/sigspinbox.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'muse2/awl/sigspinbox.cpp') 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 +#include #include +#include + +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: -- cgit v1.2.3