PDA

View Full Version : //! [0] marks



Netich
1st September 2009, 15:52
Maybe its a stupid question, but what are these marks in demo programs?

//! [0]
//! [1]
...

I cant search anywhere because search engines doesn't allow these characters.

Thanks!

wysota
1st September 2009, 16:00
They are marks for qdoc3 application to identify code snippets that are later embedded into documentation.

Boron
1st September 2009, 16:07
The comments are used by Qt Software's tool for extracting code documentations. Just like Doxygen does (or do the trolls even use Doxygen?).
Normally the doxygen comments work only outside any function/method. Doxygen comments inside a function are ignored by the tool.

These special comments work inside functions.
They can divide code into paragraphs that can be displayed independently inside the documentation.

Example:
If you have a look athe QSahredMemory example (http://qt.nokia.com/doc/4.5/ipc-sharedmemory.html) you see that the method code of void Dialog::loadFromFile() is divided in to two parts (about in middle of the whole page).
When you now have a look at the source code examples\ipc\sharedmemory\dialog.cpp you see these special comments at exactly the place where the documentation shows the code paragraphs.

Netich
1st September 2009, 16:17
Thanks for the quick reply!. I thought maybe it was some navigation or debbuging thing i could use in my own programs.