Focus always on First Widget



  • Dear All,
    I have a layout QHboxlayout in which i have 3 widgets added.My problem is when i start the application the focus is always on the first widget.I have no set any focus.Even If i am clicking on other widget the focus shift on first widget.I dont know from where the focus is coming.
    Do any one have idea how can i identify that from where the focus is setting on the first widget.Please let me know.

    TIA


  • Moderators

    @Sebastian Which widget should have the focus when starting?
    If you designed your UI with Designer you can edit the tab-order there. Else you can set focus after setupUi() call using http://doc.qt.io/qt-5/qwidget.html#setFocus-1
    "i am clicking on other widget the focus shift on first widget" - this sounds strange. Are you doing something with focus/events in your app?


Log in to reply
 

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