Press "Enter"
-
Hellow, i have some problem:
I have a code:
@ if (e->key()==Qt::Key_Enter)
{
qDebug() << "1";
emit makeIndent();
}@
It is doesnt work, but this code worke wright
@ if (e->key()==Qt::Key_E)
{
qDebug() << "1";
emit makeIndent();
}@
I need that signal will called when user press key "Enter" to move to the next line -
I guess the eventfilter for your widget or dialog intercepts the event to use it for something else. You should either make sure that you use a widget that will receive that event, or you should use an eventfilter yourself to get it before it is intercepted.
-
First, I think so too, but this code is first in the keyPressEvent:
@void qssTextEdit::keyPressEvent(QKeyEvent *e)
{
if (e->key()==Qt::Key_Enter)
{
qDebug() << "1";
emit makeIndent();
}
//Next code
@
And there are no any key filters in program. Code worke wright if instead "Enter" use Escape or Tab in example -
Do you want Key_Enter or Key_Return?
Key_Enter usually is the small enter key on the keypad.