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

AndroidView with QML content gets replaced by non-existing window upon recompose

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.1
    • QPA: Android
    • Android Studio x86_64 Emulator (API 35),
      Windows 11 23H2,

      CMake = 3.30.5,
      Gradle = 8.14,
      Qt Tools for Android Studio = 4.1,
      QtGP = 1.3,
      Kotlin = 2.0.21,
      Java = jdk-17,
      NDK = 27.2.12479018
    • Android

      What:

      When moving from an Activity with a qtQuickView in it to another Activity or a second screen in a navGraph without interacting with said View and then returning, the qtQuickView is then frozen and unable to be interacted with. Logcat gives a warning from “qt.qpa.input.methods”:

      Touch event for non-existing window X

      where X is the window id/index.

       

      When moving into the second activity or the second navGraph route, this is printed in the log.

      Full runtime log with the same route as described below:
      nonExistingWindowRuntimeLog.txt

      The example highlights two different behaviours:

      • The first QtQuickView is initialized inside onCreate, and when returning to the screen for the second time (recompose), the View is gone and interacting with it's would-be position writes the non-existing window warning to log
      • The second QtQuickView is initialized in the Composable function where it's AndroidView is also located. In this implementation however, the non-existing window warning does not get logged when interacting with it the same way as the first one

      Steps to reproduce:

      1. Open app
      2. Click "Disappearing Views"
      3. Do not interact with either of the visible QtQuickViews
      4. Click "Second Screen"
      5. Click "Return"
      6. EXPECTED = Both QtQuickViews are visible as before
      7. ACTUAL = Both QtQuickViews are gone, top one citing non-existing window warning in log and the bottom one not

       

      Example video:

      nonexistent-window-video.mkv

      Example project:
      QTBUG-139098.7z
      (Note: replace QtBuild file directories in build.gradle with your local installations)

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

            qtandroidteam Qt Android Team
            tinomarttila Tino Marttila
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes