Results 1 to 2 of 2

Thread: QPushButton loses shortcut

  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QPushButton loses shortcut

    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:

    Qt Code:
    1. ui.playButton->setDown(true);
    2. ui.playButton->setText("Stop");
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton loses shortcut

    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?

Similar Threads

  1. Qpushbutton
    By iamhere in forum Qt Programming
    Replies: 5
    Last Post: 15th October 2008, 04:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.