Results 1 to 3 of 3

Thread: Checkbox Setfocus

  1. #1
    Join Date
    Aug 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Checkbox Setfocus

    I need an example, as moves to a qlineedit after i presses a checkbox:
    something like that

    Qt Code:
    1. ui->txtGarg - QLineEdit
    2.  
    3. void protocolonutri::on_cboOthersGarg_toggled(bool checked)
    4. {
    5. ui->txtGarg->setEnabled(checked);
    6. if (!checked)
    7. ui->txtGarg->setText("");
    8.  
    9. else
    10. ui->txtGarg->setFocus();
    11. }
    To copy to clipboard, switch view to plain text mode 

    SetFocus Doesnt Work Well, how i can do?
    Sorry for my english
    Last edited by high_flyer; 22nd August 2011 at 10:26. Reason: code tags

  2. #2
    Join Date
    Mar 2010
    Location
    Heredia, Costa Rica
    Posts
    257
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    24
    Thanked 17 Times in 14 Posts

    Default Re: Checkbox Setfocus

    Try setFocus(Qt::OtherFocusReason)

  3. #3
    Join Date
    Aug 2011
    Posts
    24
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Checkbox Setfocus

    i try but dont work

Similar Threads

  1. Replies: 4
    Last Post: 1st June 2011, 15:54
  2. setFocus() on Lineedit
    By qtuser20 in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2010, 19:54
  3. setFocus problem
    By roxton in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2009, 06:41
  4. QLineEdit setFocus
    By bunjee in forum Qt Programming
    Replies: 4
    Last Post: 24th April 2008, 17:22
  5. setfocus working?
    By mahe2310 in forum Qt Programming
    Replies: 8
    Last Post: 10th March 2006, 03:45

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.