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. Force window widget in focus until event occurs
Forum Updated to NodeBB v4.3 + New Features

Force window widget in focus until event occurs

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

    I am unsure of what the correct term is, but I my goal is to make a widget to forever be in "focus" or always "active" until, say, a button is clicked.

    I currently have a custom widget where someone can add an Item to a database. I want this to be the only window the user can access until the Cancel or Add Item button is pressed. Then the widget window closes and the user can resume with tasks on the main window. However, when the widget window is open, clicking outside of the widget onto the main application causes the widget window flashes and in in Windows OS, make an annoying sound. I hope that makes sense.

    Is there an option to set this in Qt Designer, or do I need to implement it in code?

    I am using VS with the Qt extension btw.

    1 Reply Last reply
    0
    • johnratiusJ Offline
      johnratiusJ Offline
      johnratius
      wrote on last edited by johnratius
      #3

      @SGaist ah ok. Can I modify my current widget to turn that into a modal dialog, or do i have to re-create my widget to a modal dialog?

      Edit: Set it up as a QDialog and then after making sure Qt Designer recognized the widget as a QDialog, I checked "modal" in the QDialog settings in Qt Designer and it works great.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        From the looks of it, you want a window modal dialog.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • johnratiusJ Offline
          johnratiusJ Offline
          johnratius
          wrote on last edited by johnratius
          #3

          @SGaist ah ok. Can I modify my current widget to turn that into a modal dialog, or do i have to re-create my widget to a modal dialog?

          Edit: Set it up as a QDialog and then after making sure Qt Designer recognized the widget as a QDialog, I checked "modal" in the QDialog settings in Qt Designer and it works great.

          1 Reply Last reply
          0

          • Login

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