Results 1 to 4 of 4

Thread: TAB order on form

  1. #1
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default TAB order on form

    Hi there!
    Tell me please , is there any way to change all events connected with TAB key to another key - for example ENTER or some other? - i would like change widget focus using ENTER key.

    Tanks
    --
    Igor

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: TAB order on form

    Reimplement the widgets event() method, catch all Enter (or Return) key presses and fake a tab press (or call appropriate methods related to focus yourself) and if a tab/backtab occurs, ignore the event (if you want to disable focus change on tab key press).

  3. The following user says thank you to wysota for this useful post:

    igor_x (8th November 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: TAB order on form

    Better would be to have a
    1. QObject sublcass and
    2. Reimplement the eventFilter() and call focusNextChild() (really don't remeber the function call ) or as he said Use QApplication::sendEvent to push a KeyEvent to the queue

    And then installEventFilter for all the widget that will use this feature
    We can't solve problems by using the same kind of thinking we used when we created them

  5. #4
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: TAB order on form

    can u give me some example strings of code please ?

Similar Threads

  1. [Qt4.1] How to insert an image inside a Form?
    By Gonzalez in forum Qt Tools
    Replies: 5
    Last Post: 23rd September 2008, 11:20
  2. Tab Order Settings in a QDialog widgets
    By vinnu in forum Qt Programming
    Replies: 10
    Last Post: 21st September 2006, 16:25
  3. .h file for each form in QT 3.3.5 project??
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2006, 11:59
  4. Connecting slots/signals in subclassed form
    By qball2k5 in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2006, 16:01
  5. Replies: 1
    Last Post: 26th February 2006, 05:52

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
  •  
Qt is a trademark of The Qt Company.