Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Tab order and focus on first



  • I have two windows, which I made in Qt Creator. This two ui files are similar. They has a few QLineEdit, QLabel and QDialogButtonBox. I made a tab order under designer and one window is fine - tab order is okey and after show first widget is focused. Second window is broken - I made a tab order under designer but after window is shown then focus is on QDialogButtonBox - I need click Tab to get first widget. Tabs are fine, but focus is broken. I don't add any code in cpp file, this windows are shown in the same way. How can I fix this? Now I add to second window:
    @
    ui->leFirst->setFocus();
    @
    but this is fix, not solution.


Log in to reply