How to merge KeyReleaseEvent
and QPushButton
using signal
.
I mean whenever user will press enter key button should call some function using SLOT. So what i have to use in the signal?
void mywindow::keyReleaseEvent(QKeyEvent *event)
{
switch(event->key())
{
case Qt::Key_Enter:
connect(button1, SIGNAL(clicked()), this, SLOT(fileNew()));
connect(button2, SIGNAL(clicked()), this, SLOT(file()));
break;
}
}