update dict
[QFreeRecite.git] / src / gui / LineEdit.cpp
blob2edff150bc2b97dd73320e4a90bc8f13a0632696
1 #include <QKeyEvent>
2 #include "LineEdit.h"
3 #include "Speaker.h"
5 LineEdit::LineEdit(QWidget *parent)
6 : QLineEdit(parent)
8 //Do Nothing;
11 void LineEdit::keyPressEvent(QKeyEvent *event) {
12 if(freeze == false) {
13 if( (event->key() >= Qt::Key_A && event->key() <= Qt::Key_Z) ||
14 event->key() == Qt::Key_Space )
15 Speaker::play("type");
16 else if(event->key() == Qt::Key_Backspace)
17 Speaker::play("remove");
19 QLineEdit::keyPressEvent(event);
22 bool LineEdit::isFreeze() const {
23 return freeze;
26 void LineEdit::setFreeze(bool flag) {
27 freeze = flag;
28 setReadOnly(freeze);
29 if(!freeze)
30 clear();