如何让 Qt Creator 以与 Qt 库中的函数相同的方式显示我的函数的弹出文档? [英] How to make Qt Creator to show pop-up documentation of my functions the same way it does for the functions from the Qt library?

查看:48
本文介绍了如何让 Qt Creator 以与 Qt 库中的函数相同的方式显示我的函数的弹出文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您将鼠标指针放在任何 Qt 函数/类上时,它会显示一个弹出窗口,其中包含对其功能的简短描述,取自函数/类上方注释中的文档.

When you place the mouse pointer over any Qt function/class it shows a pop-up with short description of what it does, taken from the docs in the comment above the function/class.

对于我的函数/类,我有 doxygen 格式的文档:

For my functions/classes I have documentation in the doxygen format:

/**
  Returns foo
*/
QString getFoo() {
  return "foo";
}

使用该函数时,我想在鼠标指针悬停在函数名称上时,查看与我的文档相同类型的弹出窗口.

When this function is used, I want to view the same type of pop-up with my docs when the mouse pointer is over the function name.

Qt Creator 是否可以做到这一点?

Is it possible to do that with Qt Creator?

推荐答案

遗憾的是,Qt Creator(从最近发布的 2.4 版开始)无法即时拾取标签.但是,可能有效的是让 doxygen 运行,并告诉它创建 qch 文件.如果您注册创建的 qch 文件,您应该获得鼠标悬停,甚至是适当的帮助文件.参见 http://www.ogre3d.org/tikiwiki/Integrating+API+documentation+into+Qt+Creator+Help 了解 Ogre3D 是如何做到的.YMMV,如果这对于一个快速变化的项目来说是值得的.对于(半)稳定的库来说,这当然是个好主意.

Unfortunately it's not possible for Qt Creator (as of the recently release 2.4) to pick up the tags on-the-fly. However, what might work is to let doxygen run, and tell it to create qch files. If you register the created qch file, you should get mouse-over and even a proper help file. See http://www.ogre3d.org/tikiwiki/Integrating+API+documentation+into+Qt+Creator+Help for how Ogre3D does it. YMMV if that's worth it for a fast-changing project. It's certainly a good idea for a (semi-)stable library.

相关错误报告:https://bugreports.qt.io/browse/QTCREATORBUG-4557

这篇关于如何让 Qt Creator 以与 Qt 库中的函数相同的方式显示我的函数的弹出文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆