You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qt3/doc/html/assistant-6.html

130 lines
11 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/tools/assistant/book/assistant.leaf:369 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Customizing Qt Assistant</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><p align="right">[<a href="assistant-5.html">Prev: Full Text Searching</a>] [<a href="assistant.html">Home</a>]</p>
<h2 align="center">Customizing Qt Assistant</h2>
<p><em>Qt Assistant</em> can be customized by adding and removing documentation from its documentation set. In addition, <em>Qt Assistant</em> introduces the profiles option, which enables its properties to change, for example, the default startup page, and application icon.</p>
<h3><a name="1"></a>Modifying the Default Documentation Set</h3>
<p>When it is started without any options, <em>Qt Assistant</em> displays a default set of documentation. When Qt is installed, the default documentation set in <em>Qt Assistant</em> contains the Qt reference documentation as well as the tools that come with Qt, such as <em>Qt Designer</em> and qmake.</p>
<p>Documentation can be added or removed from <em>Qt Assistant</em> by adding and removing the content files. The format of the content files are specified below. To add a content file, type the following command line option: <tt>-addContentFile docfile</tt>. To remove a content file from the default set, type the following command line option: <tt>-removeContentFile docfile</tt>. For example:</p>
<pre>
1: &gt; assistant -addContentFile file.dcf
2: &gt; assistant
3: &gt; assistant -removeContentFile file.dcf
</pre>
<p>In line one, we add the content file <tt>file.dcf</tt>. In line two, we start <em>Qt Assistant</em>. The default set will now be extended with the doc file <tt>file.dcf</tt>. In line three we remove the file <tt>file.dcf</tt> from the default documentation set so that subsequent use of <em>Qt Assistant</em> will not contain this file.</p>
<h4><a name="1-1"></a>Documentation Content File Format</h4>
<p>The Documentation Content File must contain the documentation's table of contents and all important keywords for the index. In addition, it may inherit an icon for the documentation which is displayed in the <em>Qt Assistant</em> toolbar. You can also specify an extra directory path for additional images used in the documentation.</p>
<p>An example of a content file that uses all the available tags and attributes is shown below:</p>
<pre>
&lt;assistantconfig version="3.2.0"&gt;
&lt;DCF ref="demo.html" icon="handbook.png" imagedir="../img/"
title="Development Demo Handbook"&gt;
&lt;section ref="./chap1/chap1.html" title="Chapter1"&gt;
&lt;section ref="./chap1/section1.html" title="Section1"&gt;
&lt;keyword ref="./chap1/section1.html#foo"&gt;foo&lt;/keyword&gt;
&lt;keyword ref="./chap1/section1.html#bla"&gt;bla&lt;/keyword&gt;
&lt;section ref="./chap1/section1.html#subsection1" title="Subsection 1"/&gt;
&lt;section ref="./chap1/section1.html#subsection2" title="Subsection 2"/&gt;
&lt;section ref="./chap1/section1.html#subsection3" title="Subsection 3"/&gt;
&lt;/section&gt;
&lt;section ref="./chap1/section2" title="Section2"&gt;
&lt;section ref="./chap1/section2.html#subsection1" title="Subsection 1"/&gt;
&lt;section ref="./chap1/section2.html#subsection2" title="Subsection 2"/&gt;
&lt;section ref="./chap1/section2.html#subsection3" title="Subsection 3"/&gt;
&lt;/section&gt;
&lt;/section&gt;
&lt;section ref="./chap2/chap2.html" title="Chapter2"&gt;
&lt;keyword ref="./chap2/chap2.html#foo"&gt;foo&lt;/keyword&gt;
&lt;section ref="./chap2/section1.html" title="Section1"/&gt;
&lt;/section&gt;
&lt;/DCF&gt;
&lt;/assistantconfig&gt;
</pre>
<p>Sections may be nested as deeply as necessary. All references should be related.</p>
<p>Note that any <tt>keyword</tt> tags for a given section must appear <em>before</em> any sections nested within the given section.</p>
<p>The paths in the <tt>refs</tt> attribute are always written Unix-style (forward slashes) and are relative to the location of the documentation content file itself.</p>
<p>Since the introduction of the new root tag <tt>assistantconfig</tt> in the fileformat from Qt version 3.2.0, it is possible to specify multiple DCF tags in one file. Note that the old document contents file format, used up to Qt 3.2 is still valid.</p>
<h3><a name="2"></a>Profiles</h3>
<p>Profiles enable <em>Qt Assistant</em> to act as a specialized help tool for displaying documentation for applications. With profiles, the documentation writer can change properties such as <em>Qt Assistant</em>'s title, application icons, and 'about' dialogs. In addition, profiles can be used to run specialized documentation sets that are separate from the Qt docs. <em>Qt Assistant</em> can be customized by changing the following properties:</p>
<ul><li><p>Name- This property is used to name the profile. If multiple profiles are used for the same installation of <em>Qt Assistant</em>, this parameter is crucial to keep their profile specific settings apart. The property name is <tt>name</tt></p>
<li><p>Title- This property is used to specify a caption for <em>Qt Assistant</em>. The property name is <tt>title</tt></p>
<li><p>Application Icon- This property describes an icon that will be used as <em>Qt Assistant</em> application icon. The location of the icon is relative to the location of the profile. The property name is <tt>applicationicon</tt></p>
<li><p>Start Page- This property specifies which page <em>Qt Assistant</em> should initially display when the profile is used. Usually, this is the HTML file which contains the documentation's table of contents. This property also describes the default location to go to when pressing the home button in <em>Qt Assistant</em>'s main user interface. The start page is specified relative to the location of the profile. The property name is <tt>startpage</tt></p>
<li><p>About Menu Text- This property describes the text that appears in the <b>Help</b> menu, e.g. About Application. The property name is <tt>aboutmenutext</tt></p>
<li><p>About URL- This property can be used to point to an HTML file that describes the contents in the About dialog that is opened for the <b>Help</b> menu, e.g. About Application. The url is specified relative to the location of the profile. The property name is <tt>abouturl</tt></p>
<li><p><em>Qt Assistant</em> Documentation- This property describes the location of the <em>Qt Assistant</em> documentation. This is required since <em>Qt Assistant</em> provides self help, such as the full text search help and the <em>Qt Assistant</em> Manual option in the <b>Help</b> menu. The location is a directory relative to the location of the profile. The property name is <tt>assistantdocs</tt>.</p>
</ul><p>To define a profile, one needs to specify a <em>Qt Assistant</em> Document Profile, usually abbreviated <tt>.adp</tt>. The profile is an extension of the Documentation Content File described above. We add a <tt>profile</tt> tag containing <tt>property</tt> tags to the format.</p>
<p>An example of a document profile file is shown below:</p>
<p><tt>helpdemo.adp</tt></p>
<pre>
&lt;assistantconfig version="3.2.0"&gt;
&lt;profile&gt;
&lt;property name="name"&gt;HelpExample&lt;/property&gt;
&lt;property name="title"&gt;Help Example&lt;/property&gt;
&lt;property name="applicationicon"&gt;logo.png&lt;/property&gt;
&lt;property name="startpage"&gt;index.html&lt;/property&gt;
&lt;property name="aboutmenutext"&gt;About Help&lt;/property&gt;
&lt;property name="abouturl"&gt;../about.txt&lt;/property&gt;
&lt;property name="assistantdocs"&gt;../../../doc/html&lt;/property&gt;
&lt;/profile&gt;
&lt;DCF ref="index.html" icon="handbook.png" title="Help example"&gt;
&lt;section ref="./manual.html" title="How to use this Example"&gt;
&lt;keyword ref="./manual.html#installdocs"&gt;Install Docs&lt;/keyword&gt;
&lt;keyword ref="./manual.html#onlydoc"&gt;Example Profile&lt;/keyword&gt;
&lt;keyword ref="./manual.html#hide"&gt;Hide Sidebar&lt;/keyword&gt;
&lt;keyword ref="./manual.html#openqabutton"&gt;Open&lt;/keyword&gt;
&lt;keyword ref="./manual.html#closeqabutton"&gt;Close&lt;/keyword&gt;
&lt;keyword ref="./manual.html#display"&gt;Display&lt;/keyword&gt;
&lt;/section&gt;
&lt;/DCF&gt;
&lt;/assistantconfig&gt;
</pre>
<p>These files are XML files. Characters such as <tt>&lt;</tt>, <tt>&gt;</tt>, and <tt>&amp;</tt> must be written as entities (e.g., <tt>&amp;lt;</tt>, <tt>&amp;gt;</tt>, <tt>&amp;amp;</tt>).</p>
<h4><a name="2-1"></a>Using Profiles</h4>
<p>To use a profile, run <em>Qt Assistant</em> with the option <tt>-profile filename</tt>. This will load the profile specified in the file and will customize <em>Qt Assistant</em> accordingly. For example, to run <em>Qt Assistant</em> with the example file above, <tt>helpdemo.adp</tt>, we would run the command as follows:</p>
<pre>
&gt; assistant -profile helpdemo.adp
</pre>
<p>See the HelpDemo example in the Qt distribution for a demonstration on how to use <em>Qt Assistant</em> with profiles for your own applications.</p>
<p>When distributing <em>Qt Assistant</em> with your application, you will also need to copy the icon files from the <tt>QTDIR/tools/assistant/images</tt> directory so that <em>Qt Assistant</em> finds its icons.</p>
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>