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

Fix QML compatibility for Text item

    XMLWordPrintable

Details

    • All
    • 7f6657337f3b0b43c089efd29c914d4af26395e2 (qt/qtdeclarative/5.12)

    Description

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

      Consider the follow code:

      import QtQuick 2.11
      
      Text {
          onContentWidthChanged: console.trace()
      }
      

      The notifier of contentWidth is changed from contentSizeChanged() to contentWidthChanged() and the latter signal is Q_REVISION(12), so on Qt-5.11 the code works fine and the property change handler connects to contentSizeChanged.
      On the other side, the same code on 5.12 fails, because the notifiers are not available in QtQuick 2.11 and earlier.

      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(qreal contentWidth READ contentWidth NOTIFY contentSizeChanged)
      Q_PROPERTY(qreal contentWidth READ contentWidth NOTIFY contentWidthChanged 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.

      See also: QTBUG-71243

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            kaffeine Alexandr Akulich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes