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

qmlRegisterSingletonType (QJSValue) only works for Objects

    XMLWordPrintable

Details

    • All
    • 64102ae231317eb6f637304918e55153dadef72d (qt/qtdeclarative/dev) 0c029b420ea9b7631cf87d427c0821320064c01b (qt/qtdeclarative/6.1)

    Description

      When registering singletons using QJSValue (https://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType) only QJSValues based on objects work properly, all others become undefined.

      Doesn't work:

      • 5
      • "fooBar"
        Works:
      • new Number(5) / new Object(5)
      • new String("fooBar") / new Object("fooBar")

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            max.goldstein Maximilian Goldstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes