Wiki » History » Version 32

Version 31 (Kevin Tanguy, 21/02/2014 03:25 pm) → Version 32/33 (Kevin Tanguy, 22/04/2014 01:21 pm)

h1. Welcome

{{>toc}}

You are welcome to contribute to the wiki if you register/use openid login.

h2. Quick install with binaries

Visit the "Files":/projects/qtcreator-doxygen/files section and find the package that applies to you or if you are using Nokia Qt SDK, Nokia SDK or just a plain Qt Creator, here are binaries for you:
* Binary for Linux x86:        "for qtcreator 2.8.x":/attachments/download/72/qtcreator-doxygen-0.3.7-qtcreator-2.8.x-linux-x86.tar.gz | "for qtcreator 3.0.x":/attachments/download/75/qtcreator-doxygen-0.3.8-qtcreator-3.0.x-linux-x86.tar.gz | "for qtcreator 3.1.x":/attachments/download/81/qtcreator-doxygen-0.3.9-qtcreator-3.1.x-linux-x86.tar.gz
* Binary for Linux x86_64:  "for qtcreator 2.8.x":/attachments/download/71/qtcreator-doxygen-0.3.7-qtcreator-2.8.x-linux-x86_64.tar.gz | "for qtcreator 3.0.x":/attachments/download/76/qtcreator-doxygen-0.3.8-qtcreator-3.0.x-linux-x86_64.tar.gz | "for qtcreator 3.1.x":/attachments/download/80/qtcreator-doxygen-0.3.9-qtcreator-3.1.x-linux-x86_64.tar.gz
* Binary for Windows x86:  "for qtcreator 2.8.x":/attachments/download/70/qtcreator-doxygen-0.3.7-qtcreator-2.8.x-msvc32.zip | "for qtcreator 3.0.x":/attachments/download/77/qtcreator-doxygen-0.3.8-qtcreator-3.0.x-msvc32-VS10.zip | "for qtcreator 3.1.x":/attachments/download/83/qtcreator-doxygen-0.3.9-qtcreator-3.1.x-msvc32-VS10.zip
* Binary for Mac x86_64:    "for qtcreator 2.8.x":/attachments/download/73/qtcreator-doxygen-0.3.7-qtcreator-2.8.x-macosx-x86_64.tar.gz | "for qtcreator 3.0.x":/attachments/download/79/qtcreator-doxygen-0.3.8-qtcreator-3.0.x-macosx-x86_64.tar.gz | "for qtcreator 3.1.x":/attachments/download/82/qtcreator-doxygen-0.3.9-qtcreator-3.1.x-macosx-x86_64.tar.gz

For Linux and Windows, extract in _$path_to_qtcreator$_/lib/qtcreator/plugins/ and you should be good to go.
For Mac OS X, extract in e.g. /Applications/Qt Creator.app/Contents/PlugIns/
_Note that if Qt Creator is complaining at startup about wrong version numbers (patch number, not major or minor) for the plug-in dependencies, editing the Doxygen.pluginspec file and replacing the wrong version numbers should be enough to get it working._

h2. Usage

* Generate Doxygen tags: CTRL+SHIFT+F3 and the context menu -> "Create Doxygen Documentation"
* Generate Doxygen tags for a whole file: CTRL+SHIFT+F5 and the context menu -> "Document whole file"
* Building project documentation: CTRL+SHIFT+F4 and the "Tools/Doxygen" menu -> "Build Doxygen Documentation".
If you didn't create and configure a Doxyfile at your project root, the default one will be generated and used.
* Edit Doxyfile with doxywizard: CTRL+SHIFT+F6

bq. Don't forget to configure the "doxygen" and "doxywizard" commands in "Settings/Documentation/Doxygen Plugin" if it is not in your _$PATH_.

h2. Output example

Consider this meaningless snippet of code:
<pre><code class="cpp">
typedef bool ILoveToPolluteTheMainNamespace;
enum {
bob,
mark,
louis
};

class Hello
{
public:
Hello(Feeling &iloveyou, bool wontyou, QList<Sentences> tellme, Person *your, const QString &name);
bool initialize(const QStringList &arguments, QString *error_message);
bool needSomething(QList<Something> &things);
virtual void bye() = 0;
QMap<QString, QList> randomMethod() const;
//...
};
</code></pre>

That would become:
<pre><code class="cpp">
/*!
\brief

*/
typedef bool ILoveToPolluteTheMainNamespace;
/*!
\brief

*/
enum {
bob,
mark,
louis
};

/*!
\brief

*/
class Hello
{
public:
/*!
\brief

\param iloveyou
\param wontyou
\param tellme
\param your
\param name
*/
Hello(Feeling &iloveyou, bool wontyou, QList<Sentences> tellme, Person *your, const QString &name);
/*!
\brief

\param arguments
\param error_message
\return bool
*/
bool initialize(const QStringList &arguments, QString *error_message);
/*!
\brief

\param things
\return bool
*/
bool needSomething(QList<Something> &things);
/*!
\brief

*/
virtual void bye() = 0;
/*!
\brief

\return QMap<QString, QList>
*/
QMap<QString, QList> randomMethod() const;
//...
};
</code></pre>

For a more visual feel about the plugin's work, see [[Screenshots]].

h1. Compilation from sources

h2. Get the source

You can get the source code either by using your favourite subversion client or by http.

h3. svn download

The repository is world readable so it should be pretty straightforward, for downloading trunk from the command line:

*user@host $* svn co http://svn.kofee.org/svn/qtcreator-doxygen/trunk qtcreator-doxygen

And to get a specific revision use the @rev_number syntax, e.g. for the source for qtcreator-2.0.1:

*user@host $* svn co http://svn.kofee.org/svn/qtcreator-doxygen/trunk@32 qtcreator-doxygen

h3. http download

If you want latest source: "grab an archive of the trunk":http://svn.kofee.org/dl.php?repname=QtCreator-Doxygen&path=%2Ftrunk%2F&isdir=1
If you want a specific revision, then either select it manually on "websvn":http://svn.kofee.org/listing.php?repname=QtCreator-Doxygen or append &rev=$rev_number to the download link, e.g. for the source for qtcreator-2.0.1:

http://svn.kofee.org/dl.php?repname=QtCreator-Doxygen&path=%2Ftrunk%2F&isdir=1&rev=32

h2. Compile

Once in the source directory, you have two choices:

* Edit the pro file to tweak it to your platform (paths, libs)
* Pass arguments to qmake (revision r34 and up):
*QTC_SOURCE_DIR*: The directory containing qtcreator source code
*QTC_BUILD_DIR*: The directory where we build the plugin
*LIBSROOT*: The root of the built qtcreator lib directory
*DEST*: The directory where the shared library and the plugin spec files will be moved to

Example passing arguments to qmake:

*user@host <notextile>~</notextile>/qtcreator-doxygen $* qmake QTC_SOURCE_DIR=/home/kofee/Dev/Qt/qt-creator-2.1.0-src \
QTC_BUILD_DIR=/home/kofee/qtcdox_build \
LIBSROOT=/home/kofee/qtcreator-2.1.0/lib \
DEST=/home/kofee/qtcreator-2.1.0/lib/qtcreator/plugins/Kofee

You should see:

bq. Project MESSAGE: QTC_SOURCE_DIR = /home/kofee/Dev/Qt/qt-creator-2.1.0-src
Project MESSAGE: IDE_SOURCE_TREE = /home/kofee/Dev/Qt/qt-creator-2.1.0-src
Project MESSAGE: QTC_BUILD_DIR = /home/kofee/qtcdox_build
Project MESSAGE: IDE_BUILD_TREE = /home/kofee/qtcdox_build
Project MESSAGE: DESTDIR = /home/kofee/qtcreator-2.1.0/lib/qtcreator/plugins/Kofee
Project MESSAGE: Good luck with make... :-D

And finally, do make:

*user@host <notextile>~</notextile>/qtcreator-doxygen $* make

If all goes well, it should be installed and (re)starting qtcreator will be enough to use the plugin.

h2. Against Nokia binaries (Linux)

It almost compiles out of the box against the binaries distributed by Nokia, you just have to create few symbolic links for it to link properly. So short version in a bash shell:

*user@host <notextile>~</notextile> $* cd qtcreator-2.1.0/lib/qtcreator
*user@host <notextile>~</notextile>/qtcreator-2.1.0/lib/qtcreator $* for i in *.so.1; do ln -s $i ${i/.so.1/.so}; done

And no more problem with finding -lAggregation and friends.

h2. Against Nokia binaries (Mac OS X)

Compilation isn't the issue but telling the plugin to load Qt dylibs shipped with Qt Creator/the SDK can be (else, prepare to segfault):

*long prompt stuff $* install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore /Applications/Qt\ Creator.app/Contents/PlugIns/Kofee/libDoxygen.dylib
*long prompt stuff $* install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui /Applications/Qt\ Creator.app/Contents/PlugIns/Kofee/libDoxygen.dylib

h2. Against a Gentoo install (qt-creator-2.1.0 here)

We already have the sources of qt-creator and the tools to manipulate them, so let's use it:

*root@host <notextile>~</notextile>/qtcreator-doxygen #* ebuild /usr/portage/dev-util/qt-creator/qt-creator-2.1.0.ebuild unpack
*root@host <notextile>~</notextile>/qtcreator-doxygen #* qmake QTC_SOURCE_DIR=/var/tmp/portage/dev-util/qt-creator-2.1.0/work/qt-creator-2.1.0-src/ LIBSROOT=/usr/lib/ DEST=/usr/lib/qtcreator/plugins/Kofee/
*root@host <notextile>~</notextile>/qtcreator-doxygen #* make
*root@host <notextile>~</notextile>/qtcreator-doxygen #* make clean
*root@host <notextile>~</notextile>/qtcreator-doxygen #* ebuild /usr/portage/dev-util/qt-creator/qt-creator-2.1.0.ebuild clean

Restart qt-creator :)

h1. Thanks

* The Trolls indeed, -and therefore Nokia.-
* "Nicolas Arnaud-Cormos":http://gitorious.org/creator-plugins got me started.
* "VCreate Logic":http://www.vcreatelogic.com/ gave me some more info.