Results 1 to 3 of 3

Thread: How to avoid keyboard-button-toggling ?

  1. #1
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to avoid keyboard-button-toggling ?

    Hi,

    in my application, I use a couple of QPushButtons inside a QGroupBox. The auto-exclusive-mode is activated for all buttons.
    Unfortunately, you can toggle the buttons using the up-/down-/left-/right-keys.
    I would like to change this behavior, so that pressing these keys will only change the focus.
    In fact, I would like the auto-exclusive-buttons-group to behave like a group of "normal" buttons.
    Where do I have to start ? Where do these key-operations come from ? We are not talking about shortcuts, right ?

  2. #2
    Join Date
    Jan 2008
    Posts
    56
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to avoid keyboard-button-toggling ?

    Hi,

    have a look at http://doc.trolltech.com/4.4/qwidget.html#keyPressEvent
    reimplement it and prevent the keyboard actions you don't want.

    Regards,

    Rainer

  3. #3
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to avoid keyboard-button-toggling ?

    Hi,

    thanks for your answer. Implementing custom keyPressEvent()-functions would be the "hardcore"-solution...
    Aren't there any parameters or switches ? I've seen so many keyboard related functionalites (like Qt::focusPolicy), but I didn't find something like that for toggling !?

Similar Threads

  1. Replies: 4
    Last Post: 23rd November 2006, 05:24

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.