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

"Follow Symbol Under Cursor" does not make a jump from QML to the definition in C++ if it uses QML_SINGLETON

    XMLWordPrintable

Details

    • Linux/Wayland, Windows

    Description

      "Follow Symbol Under Cursor" (Tools -> QML/JS -> Follow Symbol Under Cursor, or pressing F2) does not make a jump, if you run it on QML file to jumpt to a singleton defined in C++. 
      This issue was reproduced with Qt Creator 15.0.0 / 14.0.1 / 13.0.2 + Qt 6.8.1 / Qt 6.6.3.

      Reproducer 1: 
      File System Explorer example application provided with Qt

      "Follow Symbol Under Cursor" does not work for FileSystemModel class, which uses QML_ELEMENT and QML_SINGLETON macro.
      If you press "F2" on "FileSystemModel" in FileSystemView.qml, it raises an error with the message below : 

      'Could not open "filesystemmodel.h" for reading. Either the file does not exist or you do not have the permissions to open it'

      This is not reproduced with LineNumberModel class, which only uses QML_ELEMENT macro.
      You can jump from "LineNumberModel" in Editor.qml to the class definition in linenumbermodel.h, if the project once built.

      Reproducer 2:
      Attached reproducer (singleton_logger)

      You cannot jump from "Logger" in Main.qml to logger.h by pressing F2, with the error below :
      'Could not open "logger.h" for reading. Either the file does not exist or you do not have the permissions to open it'

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              hitoshiito Hitoshi Ito
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change