Results 1 to 8 of 8

Thread: about tab order

  1. #1
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    2

    Default about tab order

    hello , everyone.Can i use Qt::Key_Left , Qt::Key_Up , Qt::Key_Right and Qt::Key_Down to implement tab order function???

  2. #2
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: about tab order

    You have my permission

  3. #3
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    2

    Default Re: about tab order

    what???what??

  4. #4
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    2

    Default Re: about tab order

    I sorry about my english . I mean that I don't want to use tab key ,and use Key_Left , Key_Up, Key_Right,Key_Down to implement the same function as tab key . Can anyone tell me how to do that?

  5. #5
    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: about tab order

    The easiest way is to create QAccel and tie it to a custom slot and invoke QWidget::focusNextChild() or QWidget::focusPreviousChild() from it, but probably you want more.

    Other solution is to install an event filter using QObject::installEventFilter() and check if you caught the right QKeyEvent and invoke QWidget::setFocus().

  6. #6
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    2

    Default Re: about tab order

    Hello , jacek . Can you some examples about the above two solutions ?my e-mail is:
    hesummar@126.com .. Thank you

  7. #7
    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: about tab order

    You can find an example in QObject::installEventFilter() docs. All you have to do is to check what key was pressed and invoke setFocus().

    What exactly should happen if for example user presses Key_Up?

  8. #8
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    2

    Default Re: about tab order

    jacek,Thank you ,because my work is to develop a program for a machine , and the machine's keyboard doesn't have an key_tab key. but I found an example in <<c++ gui design with qt3>> .

Similar Threads

  1. Tab Order Settings in a QDialog widgets
    By vinnu in forum Qt Programming
    Replies: 10
    Last Post: 21st September 2006, 16:25
  2. about QHash elements order
    By bruce1007 in forum Qt Programming
    Replies: 2
    Last Post: 25th August 2006, 07:17
  3. window stacking order
    By nupul in forum Newbie
    Replies: 4
    Last Post: 10th April 2006, 10:16
  4. Replies: 1
    Last Post: 26th February 2006, 05:52
  5. Changing the order of columns in QTreeView
    By johnny_sparx in forum Qt Programming
    Replies: 1
    Last Post: 15th February 2006, 00:00

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.