Dear Friends,
I need to override the Esc key event so i tried to reimplement keyPressEvent() of QDialog. but it is not executed when i pressed any key. the code is given below.
{
if(e->key()==Qt::Key_Escape)
{
}
else
{
}
}
void Myclass::keyPressEvent(QKeyEvent *e)
{
if(e->key()==Qt::Key_Escape)
{
QMessageBox(0,"Error","Key press");
}
else
{
QDialog::keyPressEvent(e);
}
}
To copy to clipboard, switch view to plain text mode
while defining QDialog i gave setFocusPolicy(Qt::StrongFocus) as like below
QDialog::setFocusPolicy(Qt
::StrongFocus);
win = new QDialog(this);
QDialog::setFocusPolicy(Qt::StrongFocus);
To copy to clipboard, switch view to plain text mode
can any body help me where im getting wrong
Bookmarks