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

QML Singletons are not available inside QQmlExpressions

    XMLWordPrintable

Details

    Description

      class TestClass : public QObject
      {
        Q_OBJECT
        Q_PROPERTY(QJSValue func READ func WRITE setFunc);
        // ...
      };
      
      engine->rootContext()->setContextProperty("testClass", new TestClass);
      QQmlExpression expr(engine->rootContext(), 0,
                          "testClass.func = function () { Singleton.func(); });
      expr.evaluate();
      

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            aalpert Alan Alpert
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes