our old code will help u a lot
{
if(e
->type
() == QEvent::KeyPress){ printf("is it coming inside event..\n");
const QKeyEvent *ke
= static_cast<QKeyEvent
*>
(e
);
if(ke->key()== Qt::Key_A){ //check enum Qt::Key
//do your modifications here
printf("A button clicked..\n");
}
return true;
}
return QWidget::eventFilter(ob, e
);
}
bool GraphView:: 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_A){ //check enum Qt::Key
//do your modifications here
printf("A button clicked..\n");
}
return true;
}
return QWidget::eventFilter(ob, e);
}
To copy to clipboard, switch view to plain text mode
Bookmarks