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

qmlEngine and qmlContext always return null for a QML Module API class

    XMLWordPrintable

Details

    Description

      qmlEngine and qmlContext funcitons always return null for a QML Module API class.

      For a constructor null is probably ok, because the functions seem to work the same way for other ("ordinary") classes, too.

      SomeModuleApiClass::SomeModuleApiClass(QObject *parent) : QObject(parent)
      {
          qDebug() << qmlEngine(this); // null, ok?
          qDebug() << qmlContext(this);  // null, ok?
      }
      

      But for any other function qmlEngine and qmlContext should return valid pointers:

      SomeModuleApiClass::someFunction()
      {
          qDebug() << qmlEngine(this); // null, nok!
          qDebug() << qmlContext(this);  // null, nok!
      }
      

      Attachments

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

        Activity

          People

            mvogt Matthew Vogt (closed Nokia identity) (Inactive)
            skananoj Sami Kananoja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes