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

Android: QQuickView doesnt render with Jetpack Compose navigation outside startDestination

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat 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 an app has QtQuickViews placed in Jetpack Composes navigation graphs non-start screens, the Views do not render. When checking the log, qtQuickView status also isn’t being set to READY as opposed to the startDestination screen where its status is. This leads to the Views not being rendered.

      This happens when:

      1. the Views are initialized in onCreate() and then applied at AndroidView() factory and,
      2. when they are initialized on a composable function (see picture) and then applied at AndroidView() factory.

       

      When qtQuickView from the code above is displayed in the startDestination, the qtQuickView gets displayed as expected. However, when this code is in a composable view that the navigation structure does not start from, the qtQuickView does not get displayed.

      If an XML layout is placed in the AndroidView() were a qtQuickView is failing to render, the XML layout renders without problems

      The example project and video showcase 3 instances to highlight problems and difference between expected and actual behaviour:

      1. onCreate initialization
      2. Compose function initialization
      3. Display XML frame

      Steps to reproduce:

      (Fully restart app every time you reach step 4 and want to choose other options)

      1. Open app
      2. Click "Navigation Problems"
      3. Do not interact with visible QtQuickView (QTBUG-138922)
      4. Choose from one of the following:
        1. Click "Remember initialization example"
        2. Click "onCreate initialization example"
        3. Click "XML layout example"
      5. Observe behaviour:
        1. EXPECTED / ACTUAL = Visible QtQuickView / No rendered QtQuickView
        2. EXPECTED / ACTUAL = Visible QtQuickView / No rendered QtQuickView
        3. EXPECTED / ACTUAL = Visible XML content / Visible XML content

       

      Example video:

      navigation-issue-video.mkv

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

        1. image-2025-08-11-16-04-55-963.png
          image-2025-08-11-16-04-55-963.png
          25 kB
        2. navigation-issue-video.mkv
          16.49 MB
        3. navigation-issue-video.mp4
          12.23 MB
        4. QTBUG-139081.7z
          91 kB
        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:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes