在 QML 代码中移动

查找 QML 方法和类型,并移动到 QML 类型的 C++ 实现。

查找 QML 方法

查找 QML 方法

  1. Ctrl+K激活定位器。
  2. 键入 m,后加空格。

    定位器中的 m 过滤器

  3. 双击列表中的 QML 方法,在编辑器中移动到该方法。

查找 QML 类型

要在项目中查找 QML 类型的实例,可将光标放在该类型上,然后执行以下操作之一:

  • Ctrl+Shift+U
  • 转到Tools >QML/JS >Find References to Symbol Under Cursor

检查 QML 和 JavaScript

要检查 QML 和 JavaScript 属性、方法和枚举,请将光标放在它们上面,然后转到Tools >QML/JS >Inspect API for Element Under Cursor

在 QML 和 C++ 之间移动

要在代码编辑器中移动到 QML 类型的 C++ 实现,请将光标放在该类型上,然后执行以下操作之一:

  • F2
  • 在上下文菜单中转入Follow Symbol Under Cursor

另请参阅 如何:编辑代码Clangd编辑模式使用定位器导航

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.