Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127777

doc deprecates both ways to open a modal dialog

XMLWordPrintable

    • 40f7454c9 (dev), 423659af1 (6.9), ad98ad04b (6.8)
    • framework-content 1, framework-content 2, framework-content 3, framework-content 4

      https://doc.qt.io/qt-6/qdialog.html#modal-dialogs says: "The most common way to display a modal dialog is to call its exec() function." However, https://doc.qt.io/qt-6/qdialog.html#exec has a note that says "Avoid using this function; instead, use open()."

      https://doc.qt.io/qt-6/qdialog.html#open refers back to https://doc.qt.io/qt-6/qdialog.html#modal-dialogs. Which does not mention `open()`, but `show()`, and goes on to say: "If you use show() and setModal(true) together to perform a long operation, you must call QCoreApplication::processEvents()". However, the documentation of the latter says: "Use of this function is discouraged."

      So there seems to be no way to open a modal dialog for a long operation that is not deprecated.

       

       

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            javyas Jaishree Vyas
            jwu Joachim Wuttke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes