PDA

View Full Version : QPushButton loses shortcut



Cruz
21st February 2009, 23:56
Hi!

Using Designer I defined shortcuts (G and Space) for two of the QPushButtons on my gui. At first, both of the shortcuts work and I can trigger the button by pressing the assigned key. Both of these buttons trigger some lengthy processes that can be aborted. So when the button is pressed either by the mouse or by the shortcut key I do this:



ui.playButton->setDown(true);
ui.playButton->setText("Stop");


to have the buttons give a visual feedback that they are active and that they will abort the process with the next click.

Now the interesting thing is that the button with the G shortcut assigned loses the shortcut after the first trigger and never gets it back. The mouse still works. The code for both buttons is identical. The G key is not used for anything else in the entire software. I have no clue how and why this happens or where to look for a mistake. Any ideas?

talk2amulya
22nd February 2009, 07:21
if the other one is not losing the shortcut, it means that there is a difference in the way the two button's properties have been set..have u checked?