Results 1 to 4 of 4

Thread: Getting the Tab Key to Advance Through Fields

  1. #1

    Default Getting the Tab Key to Advance Through Fields

    I wrote a program which, under certain conditions, pops up a QWidget form. The code starts out:

    void raiseForm()
    {
    // Main window
    createTicketWindow = new QWidget();
    createTicketWindow->setGeometry(600, 400,550,370);
    createTicketWindow->setMinimumSize( 550, 370);
    ...

    and then goes on to define QTextEdit boxes for the form.

    Unfortunately, the tab key simply inserts a tab. I want it to take the user from one QTextEdit to the next. How do I accomplish that within this function?

    Thanks.

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

    Default Re: Getting the Tab Key to Advance Through Fields

    Reimplement event() for the text edit, detect that you are handling a tab key press and call focusNextChild().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: Getting the Tab Key to Advance Through Fields

    I understand, but how? What class am I re-implementing it in, QWidget? My class? What does it look like?

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

    Default Re: Getting the Tab Key to Advance Through Fields

    I'm sorry, I will not code that for you. You have to do the research yourself. I have given you enough information for a good kick start. Start by looking up event() and focusNextChild().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. GUI parametres update in advance slot
    By galvanize in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2013, 07:40
  2. qwizard and fields
    By GrahamLabdon in forum Newbie
    Replies: 2
    Last Post: 11th May 2011, 07:58
  3. Replies: 3
    Last Post: 24th April 2011, 16:35
  4. Replies: 0
    Last Post: 16th April 2010, 23:21
  5. tr() and static fields
    By drkbkr in forum Qt Programming
    Replies: 6
    Last Post: 5th June 2007, 16:01

Tags for this Thread

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.