Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-27243

Incorrect inline error message in editor when registering a type

    XMLWordPrintable

Details

    • Windows
    • 627f6a2916 (qt-creator/qt-creator/8.0) 627f6a2916 (qt-creator/qt-creator/master) 627f6a2916 (qt-creator/tqtc-qt-creator/8.0)

    Description

      When registering a singleton instance using a named variable as the URI, the editor wrongly produces the inline error "QML module not found". However, when running the application, everything works as expected. 

      For example, with the following code in the main.cpp. 

      const char GUI_MAIN_URI[] = "Qt.example.Compile"; qmlRegisterSingletonInstance(GUI_MAIN_URI, 1, 0, "MyApi", example.get());

      This produces and inline error message when trying to import the QML type as shown 

      import Qt.example.Compile 1.0

      If one uses the string directly, like shown below. This error message goes away.

      qmlRegisterSingletonInstance("Qt.example.Compile", 1, 0, "MyApi", example.get());

      Note that both method will run correctly, so despite getting an inline error message, no error is produced at run time. I attached an example of this behavior.

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-27243
        # Subject Branch Project Status CR V

        Activity

          People

            madwinter Marcus Tillmanns
            benjamin.hadra Benjamin Hadra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes