
Originally Posted by
jano_alex_es
yep, thanks, but I'm looking for something not inside the Qpressevent. I'd like to know it at any time, not just when a key is pressed.
how about my event filter code ..
{
if(e
->type
() == QEvent::KeyPress){ printf("is it coming inside event..\n");
const QKeyEvent *ke
= static_cast<QKeyEvent
*>
(e
);
if(ke->key()==Qt::Key_F1){
qApp->quit();
printf("Logout buttin clicked..\n");
}
return true;
}
return QWidget::eventFilter(ob, e
);
}
bool RecRepView:: eventFilter(QObject *ob, QEvent *e)
{
if(e->type() == QEvent::KeyPress){
printf("is it coming inside event..\n");
const QKeyEvent *ke = static_cast<QKeyEvent *>(e);
if(ke->key()==Qt::Key_F1){
qApp->quit();
printf("Logout buttin clicked..\n");
}
return true;
}
return QWidget::eventFilter(ob, e);
}
To copy to clipboard, switch view to plain text mode
Bookmarks