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

QML Module Not Found on C++ Singleton

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 3.3.0
    • Qt Creator 3.2.2
    • Quick / QML Support
    • None
    • Windows 7 Ultimate/64

    Description

      When importing a valid C++ singleton class in QML. The import statement is underlined in red and hovering shows a QML module not found error.
      The class works as expected. When registering an instantiable class the import does not produce this error.

      C++ registration

      qmlRegisterSingletonType<MySingleton>("com.swatteam.singleton",1,0,"MySingleton",
                                                MySingleton::mySingletonProvider);

      QML Usage that shows red underline error:

      import com.swatteam.singleton 1.0
      property string some_string : MySingleton.appTitle

      Code that works
      C++

      mlRegisterType<Tile>("com.swatteam.tiling",1,0,"Tile");

      QML

      import com.swatteam.tiling 1.0

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            rolias Tod Gentille
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes