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

[Reg 6.4 -> 6.5] qmlRegisterSingletonInstance does not work with importPath over http

    XMLWordPrintable

Details

    • Android, Linux/X11
    • 7d405c4e3 (dev), c78c563fa (6.9), 1e669127d (tqtc/lts-6.8), 7e3621536 (tqtc/lts-6.5)

    Description

      Using qmlRegisterSingletonInstance and engine.addImportPath with http url results in "module not installed".

      The bug disappears when addImportPath is called with a local directory path.

      The bug is present in versions 6.5.0 and newer. It is not present in 6.4.3 and older (including 5.15.2).

          QScopedPointer<SingletonTypeExample> example(new SingletonTypeExample);
          QQmlApplicationEngine engine;
          
          // Works if path is a local one.
          engine.addImportPath(QString("http:/127.0.0.1/"));
          
          qmlRegisterSingletonInstance("Qt.example.qobjectSingleton", 1, 0, "MyApi", example.get());
          
          engine.load(QUrl("qrc:/Main.qml"));

      Attachments

        For Gerrit Dashboard: QTBUG-135334
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            r4k00 n n
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews