aboutsummaryrefslogtreecommitdiff
path: root/aolineedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'aolineedit.cpp')
-rw-r--r--aolineedit.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/aolineedit.cpp b/aolineedit.cpp
new file mode 100644
index 0000000..f6026e1
--- /dev/null
+++ b/aolineedit.cpp
@@ -0,0 +1,21 @@
+#include "aolineedit.h"
+
+AOLineEdit::AOLineEdit(QWidget *parent) : QLineEdit(parent)
+{
+ this->setReadOnly(true);
+ this->setFrame(false);
+
+ connect(this, SIGNAL(returnPressed()), this, SLOT(on_enter_pressed()));
+}
+
+void AOLineEdit::mouseDoubleClickEvent(QMouseEvent *e)
+{
+ QLineEdit::mouseDoubleClickEvent(e);
+
+ this->setReadOnly(false);
+}
+
+void AOLineEdit::on_enter_pressed()
+{
+ this->setReadOnly(true);
+}