How can i set QLineEdit as current widget?



  • Hello!
    I have some QLineEdit, how can i set it as current widget to user can input text immediately after this.
    I try it:
    @lineEdit->setFocus();
    lineEdit->setCursorPosition(0);@
    But it does not worke.



  • What "does not work" about it? You'll need to provide more information because line 1 is exactly what you should do.



  • May be you are setting some other values as well / changing focus. As per the above comment lineEdit->setFocus() does the work. You can create just a sample app and cross check.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.