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

QML compatibility is broken for Flickable

    XMLWordPrintable

Details

    • All
    • 33d85e20037e83d10b8ce66f8745f00d84baccd8 (qt/qtdeclarative/5.12)

    Description

      Patch https://codereview.qt-project.org/#/c/211785/ introduces fine-grained signals for some properties.

      Consider the follow code:

      import QtQuick 2.11
      
      Flickable {
          onAtXEndChanged: console.trace()
      }
      

      The notifier of atXEnd is changed from isAtBoundaryChanged() to atXEndChanged() and the latter signal is Q_REVISION(12), so on Qt-5.11 the code works fine and the property change handler connects to isAtBoundaryChanged.
      On the other side, the same code on 5.12 fails with error

      "Flickable.onAtYEndChanged" is not available in QtQuick 2.10.
      

      The engine can not connect to the new signal because of the old import statement and it has no idea that the property has had another notifier that it still can try connect to.

      As far as I can see, the proper solution would be to extend revisions support in Q_PROPERTY macro so it will be possible to write

      Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY isAtBoundaryChanged)
      Q_PROPERTY(bool atXEnd READ isAtXEnd NOTIFY atXEndChanged REVISION 12)
      

      and make the engine to use the older notifier on older import statement.

      However such change is a significant development and it is too late to include it into the upcoming release.

      We have to choose between two evils — break the (QML) source compatibility for all Flickable.

      {atXEnd,atXBeginning,atYEnd,atYBeginning}

      notifier users or break source compatibility for users who maybe added a conflict signals with same names (atXEndChanged and so on).

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kaffeine Alexandr Akulich
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes