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

Source incompatible change in Qt 5.14's QML Binding (required argument restoreMode)

    XMLWordPrintable

Details

    • All
    • 316a120f37982db9f3062ac1e094d92da4e356d7

    Description

      In Qt 5.14, the required parameter `restoreMode` was added to the `Binding` type. This makes all code that uses `Binding` print a warning. Warnings in our code causes exceptions to be thrown. Was this change an intentional source compatibility breakage?:

      file:///[...].qml:409:17: QML Binding: Not restoring previous value because restoreMode has not been set. 
      

      Here's how to reproduce (it seems like the normal way to use Binding):

      Rectangle { 
          id: rrr
          Binding { 
              target: rrr 
              property: "color" 
              value: "red" 
              when: foo
          } 
      } 
      

      As there is no preprocessor in QML, code that needs to work with both 5.13 and 5.14, (e.g., during porting,) needs to make a new type, (e.g., UnbrokenBinding,) and based on Qt versions, selectively register either of the two implementations.

      Attachments

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              andrhans Andreas Aardal Hanssen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: