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. [Solved] Confused about how to start a modeless dialog
Forum Updated to NodeBB v4.3 + New Features

[Solved] Confused about how to start a modeless dialog

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.2k 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.
  • D Offline
    D Offline
    dcortesi
    wrote on last edited by
    #1

    Hello. I have a working Qt app (PyQt4, Qt 4.8.5) that creates a main window with various things in it. Now I would like to add a feature as a modeless dialog: a separate independent window, and the user can interact with either it or with the main window.

    I understand the dialog would be based on a QWidget with parent=0, so an independent window. And within the code of that widget, it can terminate by calling self.close(). What I do not see is how to launch it so that the main window does not wait for it. If the main window code calls the dialog object's exec() method, does the main window not hang until the dialog ends?

    There is probably a simple answer but I have not found it in the docs.

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

      Hi,

      The dialog should be based on QDialog not QWidget. Call the open() method and you should be good.

      Hope it helps

      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
      • D Offline
        D Offline
        dcortesi
        wrote on last edited by
        #3

        Thank you. From the QDialog page, "Modeless dialogs are displayed using show(), which returns control to the caller immediately."

        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