Askar
14th December 2009, 08:36
Dear Friends,
I need to filter Esc key in Dialogs, i had reimplemented keyPressEvent(QKeyEvent *) just below,
but its not working
void myCLass::keyPressEvent(QKeyEvent *e)
{
if(e->key()==Qt::Key_Escape)
{
e->ignore();
}
else
{
QDialog::keyPressEvent(e);
}
}
i have set Focus Policy in my dialog object
win = new QDialog(this);
win->setFocusPolicy(Qt::StrongFocus);
can any body help me t o fix this problem
I need to filter Esc key in Dialogs, i had reimplemented keyPressEvent(QKeyEvent *) just below,
but its not working
void myCLass::keyPressEvent(QKeyEvent *e)
{
if(e->key()==Qt::Key_Escape)
{
e->ignore();
}
else
{
QDialog::keyPressEvent(e);
}
}
i have set Focus Policy in my dialog object
win = new QDialog(this);
win->setFocusPolicy(Qt::StrongFocus);
can any body help me t o fix this problem