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

Early QML signals can be missed

XMLWordPrintable

    • Android
    • f00372269 (dev)

      When the QQuickView status changes, that status change is propagated through JNI, to our assigned QtQmlStatusChangeListener interface. However, the call to that interface is then posted onto the Android thread, and the JNI call returns.

      This leads to a timing issue where, if the Android UI thread is conveniently busy, the Qt event loop thread processes emitted QML signals before the user can register a listener for them.

      Steps:

      1. Pull the tests from QTBUG-130768, but add the following code at the beginning of TestActivity::onStatusChanged, to simulate a busy Android UI thread causing a delayed call:
        • try {
              Thread.sleep(2500);
          } catch(Exception e) {
              e.printStackTrace();
          } 
      1. Run tests

      Expected:

      Tests pass

      Result:

      The first N tests will fail due to their signal listeners not being registered on the Java side yet, thus Java not receiving those signals.

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

            pevirkku Petri Virkkunen
            pevirkku Petri Virkkunen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes