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

Make QtQuickView APIs strongly typed

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P1: Critical
    • 6.8.0 FF
    • None
    • Quick: Other
    • None
    • Android
    • 2024wk18FOQtforAndroid, 2024wk20s2FOQtforAndroid, 2024wk22s2FOQtforAndroid, 2024wk24s2FOQtforAndroid
    • 4f4160fb6 (dev), 7282c54fe (dev), 876991d8b (dev), afd1bb021 (dev), 3cdf282d9 (dev), a8007cc3d (dev)

    Description

      Why?

      All current (6.7) QtQuickView communication APIs (set/get/connect) have String based parameters: property names and signal names.

      It is error prone and works against decoupling of QML project and Java project. Changes in QML project, can break the Java project without development time or compile time errors.  **  

      How?

      As the metatype information is available after building the QML project, one possible solution is to generate Java classes that carry required metatype info. The user will be able to pass those types as "properties" or "signals" instead of Strings.

      // Before
      qtQuickView.setProperty("rotation", 10.0);
      

      Becomes:

      // After
      qtQuickView.setProperty(AppModule.Properties.rotation, 10.0);
      

      where the AppModule.Properties is a java class, and rotation can be another class or even again a String field (if String, that keeps the method signature intact).

      Edit Note: T

       

      Attachments

        Issue Links

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

          Activity

            People

              soarmin Soheil Armin
              soarmin Soheil Armin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: