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

Cannot use variableAxes due to wrong component versioning

    XMLWordPrintable

Details

    • d5742fa29 (dev), 0fe0d41b4 (6.7)

    Description

      When trying to access the new font.variableAxes member, the following error occurs:

      ".variableAxes" is not available due to component versioning. 

      Attached (in variablefont.qml) is a minimal example to reproduce it.

      The regression was introduced in the following change: https://codereview.qt-project.org/c/qt/qtdeclarative/+/544161

      Apparently, the REVISION usage does not work inside Q_GADGET?

      I am not sure if this is the idiomatic way to fix it (otherwise I would just open a Gerrit patch), but the following patch fixes the issue:

       

      diff --git a/src/quick/util/qquickvaluetypes_p.h b/src/quick/util/qquickvaluetypes_p.h
      index 842ef387d8..3ccf3219da 100644
      --- a/src/quick/util/qquickvaluetypes_p.h
      +++ b/src/quick/util/qquickvaluetypes_p.h
      @@ -408,7 +408,7 @@ class Q_QUICK_EXPORT QQuickFontValueType
           Q_PROPERTY(bool kerning READ kerning WRITE setKerning FINAL)
           Q_PROPERTY(bool preferShaping READ preferShaping WRITE setPreferShaping FINAL)
           Q_PROPERTY(QVariantMap features READ features WRITE setFeatures FINAL)
      -    Q_PROPERTY(QVariantMap variableAxes READ variableAxes WRITE setVariableAxes FINAL REVISION(6, 7))
      +    Q_PROPERTY(QVariantMap variableAxes READ variableAxes WRITE setVariableAxes FINAL)
       
           QML_VALUE_TYPE(font)
           QML_FOREIGN(QFont)
      @@ -472,8 +472,8 @@ public:
           QVariantMap features() const;
           void setFeatures(const QVariantMap &features);
       
      -    QVariantMap variableAxes() const;
      -    void setVariableAxes(const QVariantMap &variableAxes);
      +    Q_REVISION(6, 7) QVariantMap variableAxes() const;
      +    Q_REVISION(6, 7) void setVariableAxes(const QVariantMap &variableAxes);
       
           operator QFont() const { return v; }
       };
      

       

      CC vhilshei esabraha 

      Attachments

        1. Icon.qml
          0.4 kB
        2. variablefont.qml
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            vimpostor Magnus Groß
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes