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. How to raise a non-modal window over a QDialog?

How to raise a non-modal window over a QDialog?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.4k 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.
  • R Offline
    R Offline
    Robert Hairgrove
    wrote on last edited by
    #1

    I have a QMainWindow which is the main application window, and would like to show another QMainWindow, which is a help browser, when the user presses the F1 key. It is created with the application window as its parent object. This works nicely, and it is shown on top of the stack if only the main window or another QWidget-type window was open.

    But if I have opened a QDialog from the main window (using the exec() function) and then press F1, the help window opens, but it is hidden by the QDialog. Calling raise() on the help window has no effect; and if I try to use anything but the exec() function to open the dialog (i.e. open() or show()), the dialog is not shown at all.

    How can I raise the help browser above the dialogs in my application, keeping it non-modal so that the user can switch between viewing the dialog and the help topics? I am using Linux Ubuntu with the default GNOME window manager, but this should eventually run on Windows as well. Thanks!

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Robert Hairgrove
      wrote on last edited by
      #2

      Solved ... the reason I didn't see anything when calling the dialog's open() or show() functions was because I was creating it as a normal variable on the stack instead of with new. Now everything seems to work.

      1 Reply Last reply
      2
      • R Offline
        R Offline
        Robert Hairgrove
        wrote on last edited by
        #3

        BTW, I marked this as SOLVED, got the SUCCESS notification from the web page, but the status hasn't changed yet AFAICT.

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

          Hi,

          Still the caching issue, it's marked properly. I see it as such.

          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

          • Login

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