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

        1. Screenshot.png
          86 kB
          Hitoshi Ito
        2. singleton_logger.zip
          3 kB
          Hitoshi Ito
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes