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

QWebSocket slot is reentered if modal QDialog is created from slot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.6.1
    • None
    • in c++, w/ visual studio 2012
      windows 7 64 bit
      win64 vc11 qt

      1. Create a QWebSocket
      2. Connect a slot to the `textMessageReceived(const QString &)` signal
      3. In the slot function, create a `QDialog` and call `exec()`
      4. Instrument some connection and sending of a text message to the web socket.
      5. Run the program

      I saw the slot function reentered two additional times when run from c++, causing a total of 3 QDialogs to appear. The callstack shows Qt's `sendPostedEvents` being called from the QDialog's event loop which seems to be retriggering the socket signal events.

      Changing the `textMessageReceived` slot connection to a `Qt::QueuedConnection` circumvents the bug.

      In an extended version of this bug reproduction, instead of creating the `QDialog` in c++, we called a Python function to create the `QDialog` via PySide2. In this case many more windows were created until the program ran into some memory related crash.

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

            kurt.pattyn Kurt Pattyn
            edwardl Edward
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes