Results 1 to 3 of 3

Thread: setTabOrder for button

  1. #1
    Join Date
    Mar 2013
    Posts
    34
    Thanks
    1

    Default setTabOrder for button

    I try to jump with tab key between a QLineEdit and QPushButton but when I hit the key, the edit stays focused. This is the relevant code:

    Qt Code:
    1. QWidget *widget = new QWidget(this);
    2. QVBoxLayout *vbox = new QVBoxLayout();
    3. widget->setLayout(vbox);
    4. QLineEdit *line = new QLineEdit();
    5. QPushButton *button = new QPushButton("click");
    6. vbox->addWidget(line);
    7. vbox->addWidget(button);
    8. setTabOrder(line, button);
    9. setTabOrder(button, line);
    10. setCentralWidget(widget);
    To copy to clipboard, switch view to plain text mode 

    Please, does anyone know what I'm doing wrong?

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setTabOrder for button

    Remove line no 9.

  3. #3
    Join Date
    Mar 2013
    Posts
    34
    Thanks
    1

    Default Re: setTabOrder for button

    Does not help..? I'm on MacOS, using Qt 5.0.1.

Similar Threads

  1. Replies: 2
    Last Post: 26th April 2011, 11:44
  2. Replies: 6
    Last Post: 21st August 2010, 21:09
  3. Replies: 1
    Last Post: 2nd August 2010, 05:40
  4. QWidget::setTabOrder question
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 14th January 2009, 22:46
  5. SetTaborder
    By sonuani in forum Newbie
    Replies: 5
    Last Post: 26th February 2008, 11:48

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.