Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Focus always on First Widget

Focus always on First Widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 544 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sebastian
    wrote on last edited by
    #1

    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

    jsulmJ 1 Reply Last reply
    0
    • S Sebastian

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved