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. Get focus on current widget with Qt buttons
Qt 6.11 is out! See what's new in the release blog

Get focus on current widget with Qt buttons

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 704 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.
  • Q Offline
    Q Offline
    QtVik
    wrote on last edited by
    #1

    I have two dock widgets say A and B.

    widget A is a QGLWidget and widget B is QWidget.

    I have few buttons in widget B.

    When I click on buttons from widget B the focus is still on widget A or Widget A is active.

    How to get the focus on widget B when the button is clicked ?

    Q 1 Reply Last reply
    0
    • Q QtVik

      I have two dock widgets say A and B.

      widget A is a QGLWidget and widget B is QWidget.

      I have few buttons in widget B.

      When I click on buttons from widget B the focus is still on widget A or Widget A is active.

      How to get the focus on widget B when the button is clicked ?

      Q Offline
      Q Offline
      QtVik
      wrote on last edited by
      #2

      @QtVik this->setFocus() worked.

      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