Results 1 to 3 of 3

Thread: How can I associate arrow keys?

  1. #1
    Join Date
    Jan 2006
    Posts
    46
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default How can I associate arrow keys?

    I can associate buttons to keyboard letters (&<Letter>), but I would like to
    associate arrows instead. How can I do this?

    Also, is there a way to stop the buttons flickering when the key is kept
    pressed?

    Also, is there a way to associate a keyboard key without having to hold
    down "Alt" (or "Control") at the same time?

    Thank you

    Mariane

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I associate arrow keys?

    You might try something like:
    Qt Code:
    1. _button->setAccel( Qt::Key_Right );
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Posts
    46
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How can I associate arrow keys?

    I tried:

    QPushButton *forwards = new QPushButton( "&I_Forwards", this, "forwards" );
    (...)
    forwards->setAccel( Qt::Key_Right );

    It compiled and worked fine (as soon as I stopped trying to make it go forwards
    with the forwards key )

    Thank you.

    Mariane

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.