Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PyQt5 - How to focus a QDialog?

PyQt5 - How to focus a QDialog?

Scheduled Pinned Locked Moved Solved Qt for Python
2 Posts 1 Posters 407 Views 1 Watching
  • 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.
  • PatitotectiveP Offline
    PatitotectiveP Offline
    Patitotective
    wrote on last edited by Patitotective
    #1

    I want to focus a dialog (that was opened using dialog.open()).
    I tried with dialog.setFocus(Qt.FocusReason.MouseFocusReason) and app.setActiveWindow(dialog) but none of them worked.

    1 Reply Last reply
    0
    • PatitotectiveP Offline
      PatitotectiveP Offline
      Patitotective
      wrote on last edited by
      #2
      dialog.activateWindow()
      

      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