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

Infinity - real vs int

    XMLWordPrintable

Details

    • d93f5eb55e (qt/tqtc-qmlcompilerplus/6.2) 0fbb39435e (qt/qtdeclarative/6.4) 0fbb39435e (qt/tqtc-qtdeclarative/6.4) d93f5eb55e (qt/tqtc-qmlcompilerplus/6.2.7), 35e2bb090 (dev)

    Description

      When using +/- Infinity with int properties like in

      property int x: Infinity
      

      this is converted to

      ..../Foo_qml.cpp:1100:45: warning: overflow in conversion from ‘double’ to ‘int’ changes value from ‘+Inf’ to ‘2147483647’ [-Woverflow]
       1100 | r2_1 = std::numeric_limits<double>::infinity();
            |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

      which may not be the desired thing.

      Due to the lack of real integer values in this place, it's better to use the desired values directly instead of Infinity anyway, but I thought it's worth an issue.

      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