QT风格评论(Intellisense?)(QT Style Comments (Intellisense?))

编程入门 行业动态 更新时间:2024-10-26 14:30:39
QT风格评论(Intellisense?)(QT Style Comments (Intellisense?))

我在QTCreator的2.1中注意到,他们现在有一种类似于Visual Studio的智能感知。 我知道intellisense是微软的这个有用的工具提示概念的名称,弹出给你一个方法,参数等的描述,所以我不知道这实际上叫什么。 有谁知道如何将这些类型的弹出式注释添加到QT中的方法和类中?

再次澄清我在说什么就像javadoc注释或C#中的“/ /”。 我希望QT的开发者可以为用户提供自己的评论。

谢谢您的帮助,

JEC

I noticed in 2.1 of QTCreator, that they now have a sort of intellisense similar to that of Visual Studio. I know intellisense is Microsoft's name for this concept of the helpful tooltip that pops up giving you a description of the method, parameters etc so i don't know what this is actually called. Does anyone know how to add these type of pop-up comments to methods and classes in QT?

Again to clarify what i'm talking about are like javadoc comments or the "///" in C#. I'm hoping the devs of QT have a way for the users to make their own comments.

Thanks for the help,

Jec

最满意答案

我一直想要这样做。

我在qtCentre.org上发现了这个主题,其中有人将他们自己的文档集成到QT Creator工具提示中。 我没有自己测试过,但这听起来很合理:

http://www.qtcentre.org/archive/index.php/t-40324.html?s=98d48c38547da14b0725e5106d83c315

要在Qt助手(以及Qt Creator帮助中)使用自己的文档,您需要创建Qt压缩帮助文件(.qch(http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer .html#displays-custom-documentation))并将其注册到Assistant和Creator中。 Doxygen为Qt准备了几款工具。 它的配置文件中有标签,可以帮助您按照需要创建文档。 例如,使用GENERATE_QHP标记,您可以创建ready qhp(http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer.html#creating-a-custom-help-collection-file)( Qt帮助项目)文件(你需要这个来生成.qch)。 如果您在创建.qhc之前不需要手动编辑此文件,则可以将QHG_LOCATION标记的值设置为qhelpgenerator.exe的位置(通常位于此处(在Windows中)):/mingw/bin/qhelpgenerator.exe ),它会生成现成的文档。 注册到Qt助手(可选)和创建者,你就完成了。 在此之后,所有记录的类型,功能,成员等都将拥有F1按钮提示的工具提示。 当然推F1会显示你的记录帮助。

I've been wanting to do this as well.

I found this thread over on qtCentre.org where someone has integrated their own docs into the QT Creator Tooltips. I haven't tested it myself, but it sounds reasonable:

http://www.qtcentre.org/archive/index.php/t-40324.html?s=98d48c38547da14b0725e5106d83c315

To use your own documentation in Qt Assistant (and in Qt Creator help as well) you need to create Qt Compressed Help file (.qch (http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer.html#displaying-custom-documentation)) and register it in Assistant and Creator. Doxygen has several tools exactly for Qt. There are tags in it's config file, that help you to create the documentation exactly the way you need. E.g. with GENERATE_QHP tag you can make it create the ready qhp (http://doc.qt.nokia.com/4.7/assistant-custom-help-viewer.html#creating-a-custom-help-collection-file) (Qt Help Project) file (you need this to generate the .qch). If you don't need to edit this file manually before creating the .qhc, you can set the value of QHG_LOCATION tag to the location of your qhelpgenerator.exe (usually it's here (in Windows): /mingw/bin/qhelpgenerator.exe) and it will generate the ready documentation. Register it in Qt Assistant (optional) and Creator and you're done. After this all your documented types, functions, members, etc. will have the tooltip with F1 button hint. And of course pushing F1 will show your documented help for it.

更多推荐

本文发布于:2023-08-01 02:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1350512.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:风格   QT   Intellisense   Comments   Style

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!