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

Expose QML singletons to Java

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Quick: Other

    Description

      Why?

      Cause

      • Java/Kotlin Android developers (users of QtQuickView) cannot interact with QML singletons (objects defined with pragma Singleton in QML) through the Java/Kotlin interface.
      • Singletons are critical for managing global states or utilities in QML applications, and the lack of direct support limits their usability in hybrid Android apps.

      Customer

      • ?
      • Technically less important than multi-args and easier to work around

      Cruft

      •  

      What?

      Definition

      • This ticket proposes adding API methods to QtQuickView and maybe QtQuickViewContent to:
      • Access and modify properties of QML singletons.
      • Connect to signals emitted by QML singletons.
      • Possibly invoke functions of the singleton (if we generally add the support for non-singletons)
      • This functionality would mirror existing capabilities for regular QML components (e.g., QtQuickViewContent interactions) and provide an easy way to integrate singleton-based logic into Android workflows.

      Demarcation

      Dependencies

      • FF (end of May 2025) dependent 6.10 for the new API
      •  

       

      Attachments

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

        Activity

          People

            qtandroidteam Qt Android Team
            soarmin Soheil Armin
            Bruno Vunderl Bruno Vunderl
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews