kaszewczyk
2nd November 2009, 15:17
Hello,
i have problem with handling keyboard event, the problem is related to QTextEdit Widget the point is:
i have QTextEdit object for example called writeTextEdit and i installed on it event filter
this->writeTextEdit->installEventFilter(this);
next i implement eventFilter method
bool FooClass::eventFilter(QObject* _o, QEvent* _e){
if(_e->type() == QEvent::KeyPress){
QKeyEvent* eventKey = static_cast<QKeyEvent*>(_e);
if(eventKey->key() == Qt::Key_Return){
//do something
}
return true;
}else{
return QObject::eventFilter(_o, _e);
}
}
and when i run my app and want to write something in QTextEdit no letters are show inside, what is the problem?
Best Regards
kaszewczyk
i have problem with handling keyboard event, the problem is related to QTextEdit Widget the point is:
i have QTextEdit object for example called writeTextEdit and i installed on it event filter
this->writeTextEdit->installEventFilter(this);
next i implement eventFilter method
bool FooClass::eventFilter(QObject* _o, QEvent* _e){
if(_e->type() == QEvent::KeyPress){
QKeyEvent* eventKey = static_cast<QKeyEvent*>(_e);
if(eventKey->key() == Qt::Key_Return){
//do something
}
return true;
}else{
return QObject::eventFilter(_o, _e);
}
}
and when i run my app and want to write something in QTextEdit no letters are show inside, what is the problem?
Best Regards
kaszewczyk