roshan_iiita 0 Light Poster

I am making a application for maping some keyboard shortcuts to some event. So, i need detecting the keyboard shortcuts pressed after clicking a button. For Example, i have a button having text on it "change". When i click on it text on it changes to "press keys" then i need the user to type the shortcut keys he want to map then the text of the button changes to the keys pressed.
While surfing the net, i was only able to find the function :

void MainWindow::keyPressEvent(QKeyEvent *event)
{
    ...
}

but it doesn't fulfill my purpose as i need calling this function from the slot function defined so that i can detect only when i need.
Anybody having any idea how this can be achieved ?