Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-76025 Specify the QML language and write a QML-to-C++ compiler
  3. QTBUG-113150

qmlsc: Support Math.PI and other static data properties

    XMLWordPrintable

Details

    Description

      More at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math#static_properties

       

      Code

      import QtQuick
      
      Window {
          width: 200 * Math.PI
          height: 200 * Math.SQRT2
          visible: true
      }
      
      

       

      Compiler output

      Warning: Main.qml: Object type Math is not derived from QObject or QQmlComponent. You may need to fully qualify all names in C++ so that moc can see them. You may also need to add qt_extract_metatypes(<target containing >). [compiler]
      Warning: Main.qml:4:20: Could not compile binding for width: Cannot generate efficient code for lookup in QJSValue [compiler]
          width: 200 * Math.PI
                            ^^
      Warning: Main.qml: Object type Math is not derived from QObject or QQmlComponent. You may need to fully qualify all names in C++ so that moc can see them. You may also need to add qt_extract_metatypes(<target containing >). [compiler]
      Warning: Main.qml:5:21: Could not compile binding for height: Cannot generate efficient code for lookup in QJSValue [compiler]
          height: 200 * Math.SQRT2
                             ^^^^^
      

      Attachments

        For Gerrit Dashboard: QTBUG-113150
        # Subject Branch Project Status CR V

        Activity

          People

            diseraluca Luca Di Sera
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change