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

QMessageBox logs warnings when reopening

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.11.3
    • None
    • Windows

    Description

      A rough action plan :
      1. create QMessageBox object;
      2. call QMessageBox::show();
      3. close dialog through click 'X' on window;
      4. re-show dialog through call QMessageBox::show().
      After these actions, an entry appears in debug output: "QWindowsNativeInterface::nativeResourceForWindow: 'handle' requested for null window or window without handle (qWarning).

      Minimal code example:

      int main(int argc, char *argv[])
      {
       QApplication a(argc, argv);
       QMessageBox msgBox;
       QObject::connect(&msgBox, &QMessageBox::finished, &msgBox, &QMessageBox::show, Qt::QueuedConnection);
       msgBox.show();
       return a.exec();
      }

      Qt::QueuedConnection is mandatory, direct call from signal handler does not produce this behavior. Similar behavior can be obtained by calling QMessageBox::show(), for example, from QPushButton::clicked or all other widget signal.

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            shmkv Ilya Shamukov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes