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

Infinity not usable in QML

    XMLWordPrintable

Details

    • 4c716dd19c (qt/qtdeclarative/dev) 4c716dd19c (qt/tqtc-qtdeclarative/dev) 9b890ab5d0 (qt/qtdeclarative/6.3) e1615344e4 (qt/tqtc-qmlcompilerplus/6.2)

    Description

      Using constructs like

          QtObject {
              id: test
              property int x: Infinity
          }
      

      render into

      /home/cajus/tmp/build-infinity-Desktop_Qt_6_3_0_GCC_64bit-Debug/.rcc/qmlcache/appinfinity_main_qml.cpp: In lambda function:
      /home/cajus/tmp/build-infinity-Desktop_Qt_6_3_0_GCC_64bit-Debug/.rcc/qmlcache/appinfinity_main_qml.cpp:180:6: error: ‘inf’ was not declared in this scope; did you mean ‘ynf’?
        180 | r2 = inf;
            |      ^~~
            |      ynf

      .

       

      Trying

          QtObject {
              id: test
              property int x: Number.POSITIVE_INFINITY
          }
      

      runs into

      Warning: main.qml:11:32: Could not compile binding for x: Cannot generate efficient code for lookup in QJSValue
              property int x: Number.POSITIVE_INFINITY
                                     ^^^^^^^^^^^^^^^^^

      , but seems to work.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes