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

Early QML signals can be missed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.10
    • QPA: Android
    • Android

    Description

      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.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-137025
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change