使用Qt Creator自动记录我自己的功能? [英] Using automatic documentation of my own function with Qt Creator?

查看:162
本文介绍了使用Qt Creator自动记录我自己的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Qt Creator,我决定我要记录一个我写的功能,所以我将光标放在我的函数定义上方,并键入 / **< ENTER> 像这样:

  / **< ENTER> 
void MyClass :: myFunction(int myArg)
{
...

Qt Creator自动展开该评论:

  / ** 
* @brief MyClass :: myFunction
* @param myArg
* /
void MyClass :: myFunction(int myArg)
{
...

这是什么?它在哪里记录?



我可以使用它来生成自己的Qt助手 qch 帮助文件还是什么? / p>

解决方案

应该记录 here 这里,但不是...



所以这里有一些关于它的信息:



这个设置功能在这里找到:



Windows:



Qt创建者>工具>选项>文本编辑器>完成>文档注释



Mac OS X:



Qt创建者>首选项>文本编辑器>完成>文档注释



它列出的三个选项是:




  • 启用Doxygen阻止

  • 生成简要说明

  • 添加前导星号



(发现在Qt 2.6,但也可能在早期版本中,或者它可能是某些时候默认插件的一部分。)



创建的存根是Doxygen样式存根。



您可以使用doxygen来运行源代码并创建一些花哨的文档,无论是在chm文件和html文档和pdf。



http://www.stack.nl/~dimitri/doxygen/



http://www.stack.nl/~dimitri/doxygen/manual/output.html (包括qch文件)



这是Qt Creator的相关插件:



http://dev.kofee.org/projects/qtcreator-doxygen/wiki



并在您自己的程序中使用 QHelpEngine ...



http://qt-project.org/doc/qt-4.8/qthelp-framework.html



最后,您可以使用QDesktopServices来处理帮助样式的URL:



http://doc-snapshot.qt-project.org/4.8/qdesktopservices.html#url-handlers



希望有所帮助。


I was using Qt Creator and I decided I wanted to document a function I had written so I positioned my cursor above my function definition and typed /**<ENTER> like so:

/**<ENTER>
void MyClass::myFunction(int myArg)
{
...

Qt Creator auto-expanded that comment:

/**
 * @brief MyClass::myFunction
 * @param myArg
 */
void MyClass::myFunction(int myArg)
{
...

What is this? Where is it documented?

Can I use this to generate my own Qt Assistant qch help files or something?

解决方案

It should be documented here or here, but its not...

So here is some info about it:

The settings for this feature are found here:

Windows:

Qt Creator > Tools > Options > Text Editor > Completion > Documentation Comments

Mac OS X:

Qt Creator > Preferences > Text Editor > Completion > Documentation Comments

The three options it lists are:

  • Enable Doxygen blocks
  • Generate brief description
  • Add leading asterisks

(Found in Qt 2.6, but possibly in earlier versions, too?, or it may be part of the default plugin set at some point.)

The stubs that are created are Doxygen style stubs.

You can use doxygen to run through your source code and create some fancy documentation, both in a chm file and in a html document and pdf.

http://www.stack.nl/~dimitri/doxygen/

http://www.stack.nl/~dimitri/doxygen/manual/output.html (includes qch files)

Here is a related plugin for Qt Creator:

http://dev.kofee.org/projects/qtcreator-doxygen/wiki

And using the QHelpEngine in your own program...

http://qt-project.org/doc/qt-4.8/qthelp-framework.html

And finally, you can use QDesktopServices to handle a help styled url:

http://doc-snapshot.qt-project.org/4.8/qdesktopservices.html#url-handlers

Hope that helps.

这篇关于使用Qt Creator自动记录我自己的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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