Home

OFF-SOFT.net

OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

Qt (B3) Qt and doxygen

Published on| July 9th, 2009 | No Comment.
Description:
This time, Qt for document management, I would like to write.
Document management and to say, Qt software created in the (library) is a document management in the sense of a detailed design.

Software (library) as a document management such as the detailed design, Free in the most famous, doxygen.
Doxygen This was originally created in Qt is designed to manage documents. (I, until recently, did not know that. )

Therefore, doxygen is, Qt is a strong affinity with. (Of course, signals, slots and the right awareness, and then output to the document. )

This time, the use doxygen, I described how to create simple documents.


Sample source code you used here:

First, doxygen installed
doxygen download site and download the latest version of the above.
The inheritance relationship and UML diagrams including, if necessary, graphviz download as well.

Both, Windows version, so the installer, just follow the install screen.

I've provided only a simple screen.

[doxygen]



Here, you choose to accept.


Here, if you change the installation location, set above.


This specifies that the installation, special, GUI good check is not required unless all tools and samples.


Here, you specify a name to add to the Start menu.
If you do not want to add to the Start menu, "Don't create start menu folder" to check.


Especially if you have not probrem, "Install" to run the installation click.




Without major problems, Once installed, the above screen is displayed, "Next" clicking.
This screen is described as a follow-up link and check the latest version.


Finished with this screen. "Finish" and click Finish.


[graphviz]



Here, if you change the installation location, set above.


Especially you have not probrem, "Next" click to install.




Without problems, especially when you're installing, the screen above, you quit. "Close" and click Finish.


After the installation, make sure that the path is set correctly.
Screen displays the DOS prompt.
[Start] - Programs - Accessories - [Command Prompt]

Let's enter the following two commands.

C:\> doxygen -h
Doxygen version 1.5.9
Copyright Dimitri van Heesch 1997-2008
 
You can use doxygen in a number of ways:
 
1) Use doxygen to generate a template configuration file:
    doxygen [-s] -g [configName]
 
    If - is used for configName doxygen will write to standard output.
 
2) Use doxygen to update an old configuration file:
    doxygen [-s] -u [configName]
 
3) Use doxygen to generate documentation using an existing configuration file:
    doxygen [configName]
 
    If - is used for configName doxygen will read from standard input.
 
4) Use doxygen to generate a template file controlling the layout of the
   generated documentation:
    doxygen -l layoutFileName.xml
 
5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.
    RTF:   doxygen -w rtf styleSheetFile
    HTML:  doxygen -w html headerFile footerFile styleSheetFile [configFile]
    LaTeX: doxygen -w latex headerFile styleSheetFile [configFile]
 
6) Use doxygen to generate an rtf extensions file
    RTF:   doxygen -e rtf extensionsFile
 
If -s is specified the comments in the config file will be omitted.
If configName is omitted Doxyfile' will be used as a default.
 
C:\> dot -?
Usage: dot [-Vv?] [-(GNE)name=val] [-(KTlso)<val>] <dot files>
(additional options for neato)    [-x] [-n<v>]
(additional options for fdp)      [-L(gO)] [-L(nUCT)<val>]
(additional options for memtest)  [-m]
(additional options for config)  [-cv]
 
 -V          - Print version and exit
 -v          - Enable verbose mode
 -Gname=val  - Set graph attribute 'name' to 'val'
 -Nname=val  - Set node attribute 'name' to 'val'
 -Ename=val  - Set edge attribute 'name' to 'val'
 -Tv         - Set output format to 'v'
 -Kv         - Set layout engine to 'v' (overrides default based on command name)
 -lv         - Use external library 'v'
 -ofile      - Write output to 'file'
 -O          - Automatically generate an output filename based on the input 
            filename with a .'format' appended. (Causes all -ofile options to be ignored.)
 -P          - Internally generate a graph of the current plugins.
 -q[l]       - Set level of message suppression (=1)
 -s[v]       - Scale input by 'v' (=72)
 -y          - Invert y coordinate in output
 
 -n[v]       - No layout mode 'v' (=1)
 -x          - Reduce graph
 
 -Lg         - Don't use grid
 -LO         - Use old attractive force
 -Ln<i>      - Set number of iterations to i
 -LU<i>      - Set unscaled factor to i
 -LC<v>      - Set overlap expansion factor to v
 -LT[*]<v>   - Set temperature (temperature factor) to v
 
 -m          - Memory test (Observe no growth with top. Kill when done.)
 
 -c          - Configure plugins (Writes $prefix/lib/graphviz/config
               with available plugin information.  Needs write privilege.)
 -v          - Enable verbose mode
 
C:\>

If help text is displayed as described above is OK.
If not, in itself, the PATH environment variable, add the following directories.
  • % doxygen installation directory% \ bin
  • % graphviz installation directory% \ bin

Try using doxygen
Let's prepare the sample source code
doxygen sample source code you need to try.
Here, doxygen is a sample of examples \ diagrams a, Qt believe (signals, slots are added), and some, let's use something that has changed.
Class, five from the following files.
  • diagrams_a.h
    - Class A defines a
    - No original inheritance
  • diagrams_b.h
    - Class B defines the
    - Former inherits QMainWindow (Qt classes)
  • diagrams_c.h
    - Class C defines a
    - A former inheritance
  • diagrams_d.h
    - Class D define
    - Former inherit A, B
  • diagrams_e.h
    - Class E define
    - D inherited the former

[diagrams_a.h]
1
2
3
4
5
6
7
8
#ifndef _DIAGRAMS_A_H
#define _DIAGRAMS_A_H
class A 
{
public: 
	A *m_self;
};
#endif

[diagrams_b.h]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef _DIAGRAMS_B_H
#define _DIAGRAMS_B_H
#include <QMainWindow>
class A;
class B : public QMainWindow
{
	Q_OBJECT
public: 
	A *m_a;
 
protected slots: 
	void slotB(int n);
 
signals: 
	void sigB(int n);
};
#endif

[diagrams_c.h]
1
2
3
4
5
6
7
8
9
10
#ifndef _DIAGRAMS_C_H
#define _DIAGRAMS_C_H
#include "diagrams_c.h"
class D;
class C : public A 
{
public:
	D *m_d;
};
#endif

[diagrams_d.h]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef _DIAGRAM_D_H
#define _DIAGRAM_D_H
#include "diagrams_a.h"
#include "diagrams_b.h"
class C;
class D : virtual protected  A, private B 
{
	Q_OBJECT
public: 
	C m_c;
 
protected slots: 
	void slotD(int n);
 
signals: 
	void sigD(int n);
};
#endif

[diagrams_e.h]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef _DIAGRAM_E_H
#define _DIAGRAM_E_H
#include "diagrams_d.h"
class E : public D 
{
	Q_OBJECT
 
private slots: 
	void slotE(int n);
 
signals: 
	void sigE(int n);
};
#endif

doxygen's config file (parameters) Create a
Second, doxygen doxygen Try to set a parameter file (config file).
Here, doxygen is a sample of examples \ diagrams, let's use something that has changed.

Parameter name Commentary
PROJECT_NAME Specify the name of the project.
Example) "Diagrams"
OUTPUT_DIRECTORY The destination directory name (logical path).
Cases) diagrams
HAVE_DOT DOT tool (Figure) Specifies whether to use.
Cases) YES
EXTRACT_ALL All document entities (elements) you want to expand.
Cases) YES
GENERATE_LATEX LATEX output to the specified format.
Cases) NO
GENERATE_MAN MAN or specify the output format.
Cases) NO
GENERATE_RTF RTF format (MiscroSoft Word) Specifies whether output.
Cases) NO
CASE_SENSE_NAMES Doxygen or specify the output file name to uppercase. (NO: to output in lower case)
Cases) NO
ENABLE_PREPROCESSING Specify C preprocessor or evaluated.
Cases) YES
INPUT File directory (path logic).
Cases).
FILE_PATTERNS Specify a file pattern.
Cases) diagrams_ *. h
QUIET Doxygen always specify whether to display the message. (NO: to show)
Cases) YES
JAVADOC_AUTOBRIEF Specify whether to enable JvaDoc comments format.
Cases) YES
QT_AUTOBRIEF Qt Specifies whether to enable comment form.
Cases) YES
EXTRACT_PRIVATE private method, you specify whether to print the members.
Cases) YES

Roughly, if the consciousness of so many parameters, for now, you can create a document.
This, diagrams.cfg then save the file. Below are the contents. This is a simple text file.

[diagrams.cfg]
PROJECT_NAME       = "Diagrams"
OUTPUT_DIRECTORY   = diagrams
HAVE_DOT           = YES
EXTRACT_ALL        = YES
GENERATE_LATEX     = NO
GENERATE_MAN       = NO
GENERATE_RTF       = NO
CASE_SENSE_NAMES = NO
ENABLE_PREPROCESSING       = YES
INPUT              = .
FILE_PATTERNS      = diagrams_*.h
QUIET              = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF      = YES
EXTRACT_PRIVATE        = YES

Create a document with doxygen
When you're ready now, doxygen, you can create a document by typing the following command.

%diagrams.cfg Directory%> doxygen diagrams.cfg
%diagrams.cfg Directory%> 

It's easy. Just specify the file name.
When complete, the logical path of the config file as html and diagrams to be created directory.
Click index.html in it, let's see.


The following is a Class B screen is displayed.


Right, is shown in Figure inheritance relationship. The signal is displayed correctly slots.


doxygen in the other, QtAssistant can use the HELP file.
Getting this, I just have a high affinity.
So, then, QtAssistant let's use the HELP file.

Create help from project file(.qhp) to .qch file by doxygen
in doxygen, QtAssistant used in the HELP file in the config where you can automatically create a document with the normal procedure to add the following information in the file.

Parameter name Commentary
GENERATE_QHP HELP Specifies whether to create a project file.
Cases) YES
QHP_NAMESPACE HELP specifies the namespace of the project.
Cases) qthelpName
QHP_VIRTUAL_FOLDER HELP specify virtual directory name used in the project.
Cases) qthelpFolder
QHP_CUST_FILTER_NAME HELP custom filters to specify the name of the project.
Cases) sample
QHP_CUST_FILTER_ATTRS HELP attribute values specified in the list of custom filter project.
See also: Articles: Qt (8) -2 QtAssistant use in creating a file HELP
QHP_SECT_FILTER_ATTRS Project HELP section of the filter (filter defined) specified in the list of attribute values.
See also: Articles: Qt (8) -2 QtAssistant use in creating a file HELP
QCH_FILE Specify the name of the project file HELP.
If anything, index.qhp.
QHG_LOCATION Qt Help Generator command specifies the image.
Example) "qhelpgenerator"

You should be aware of the above parameters, QtHELP can create the file.
This, diagramsQt.cfg then save the file. Below are the contents. This is a simple text file.

[diagrams.cfg]
PROJECT_NAME       = "Diagrams"
OUTPUT_DIRECTORY   = diagramsQt
HAVE_DOT           = YES
EXTRACT_ALL        = YES
GENERATE_LATEX     = NO
GENERATE_MAN       = NO
GENERATE_RTF       = NO
CASE_SENSE_NAMES = NO
ENABLE_PREPROCESSING       = YES
INPUT              = .
FILE_PATTERNS      = diagrams_*.h
QUIET              = YES
#JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF      = YES
EXTRACT_PRIVATE        = YES
 
# GENERATE_QHP=YES --> QHP_VIRTUAL_FOLDER=xxx,QHP_NAMESPACE=yyy
GENERATE_QHP           = YES
QHP_NAMESPACE          = qthelpName
QHP_VIRTUAL_FOLDER     = qthelpFolder
QHP_CUST_FILTER_NAME   = sample
QHP_CUST_FILTER_ATTRS  = 
QHP_SECT_FILTER_ATTRS  = 
 
# need set of QHG_LOCATION
QCH_FILE               = 
QHG_LOCATION           = "qhelpgenerator"

Create a document with doxygen
As described in the above, you can create a document by typing the following command.

%diagramsQt.cfg Directory%> doxygen diagramsQt.cfg
%diagramsQt.cfg Directory%> 

It is the same. Just specify the file name.
When complete, the logical path of the config file as html and diagrams to be created directory.
Also, this, html Besides, qch I have created the directory.
This, QtHELP This is the directory where the file was created.
This is the project name. Qch (Diagrams.qch), you should have created a file named.

If you have not created any of the above parameters are incorrect and, qhelpgenerator Let's see if the path is set.

So, let's review the contents Diagrams.qch.
Start the QtAssistant normal.

% Qt installation directory% \ bin \ assistant.exe

Double-click Start.


QtAssistant to add the destination Diagrams.qch.


Custom filter, config file "QHP_CUST_FILTER_NAME = sample" has been specified, "Sample" it should be. Let's switch.


Content tree in the left "Diagrams" and I was shown. Let's click.
The right to screen, doxygen screen I created.



This doxygen is used to create your own library and the Qt QtAssistant will provide additional help.
Per this, VisualStudio I feel the same HTML that can be added to help.

Here, Qt was related to the introduction only, doxygen is introduced in addition to this feature, there are a lot of features. I think a good many will be tested.
In the sample, UML (class) example of output parameters to the figures (diagramsU.cfg) are included so, please help.

Comments

Leave a Reply







  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ