File: qassistantclient.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (66 lines) | stat: -rw-r--r-- 14,085 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QAssistantClient Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QAssistantClient Class Reference<br /><sup><sup>[<a href="qtassistant.html">QtAssistant</a> module]</sup></sup></h1><p>The QAssistantClient class provides a means of using Qt Assistant as an application's help tool. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qassistantclient.html#QAssistantClient">__init__</a></b> (<i>self</i>, QString, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qassistantclient.html#closeAssistant">closeAssistant</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qassistantclient.html#isOpen">isOpen</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qassistantclient.html#openAssistant">openAssistant</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qassistantclient.html#setArguments">setArguments</a></b> (<i>self</i>, QStringList)</li><li><div class="fn" /><b><a href="qassistantclient.html#showPage">showPage</a></b> (<i>self</i>, QString)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qassistantclient.html#assistantClosed">assistantClosed</a></b> ()</li><li><div class="fn" />void <b><a href="qassistantclient.html#assistantOpened">assistantOpened</a></b> ()</li><li><div class="fn" />void <b><a href="qassistantclient.html#error">error</a></b> (const QString&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QAssistantClient class provides a means of using Qt Assistant as an application's help tool.</p>
<p><b>Note:</b> <i>This class is obsolete and only required when using the old Qt Assistant, now called assistant_adp. If you want to use the new Qt Assistant as a remote help viewer, simple create a <a href="qprocess.html">QProcess</a> instance and specify <tt>assistant</tt> as its executable. The following code shows how to start Qt Assistant and request a certain page to be shown:</i></p>
<pre>         QProcess *process = new QProcess(this);
         QString app = QLibraryInfo.location(QLibraryInfo.BinariesPath)
             + QLatin1String("/assistant");

         process-&gt;start(app, QStringList() &lt;&lt; QLatin1String("-enableRemoteControl"));
         if (!process-&gt;waitForStarted()) {
             QMessageBox.critical(this, tr("Remote Control"),
                 tr("Could not start Qt Assistant from %1.").arg(app));
             return;
         }

         <span class="comment">// show index page</span>
         QTextStream str(process);
         str &lt;&lt; QLatin1String("SetSource qthelp:<span class="comment">//mycompany.com/doc/index.html")</span>
             &lt;&lt; QLatin1Char('\0') &lt;&lt; endl;
     }</pre>
<p><i>For a complete example using the Qt Assistant remotely, see the <a href="help-remotecontrol.html">Remote Control</a> example.</i></p>
<p>In order to make Qt Assistant act as a customized help tool for your application, you must provide your application with a QAssistantClient object in addition to a <a href="assistant-manual.html">Qt Assistant Document Profile</a> (<tt>.adp</tt> file) and the associated documentation.</p>
<p>Note that the QAssistantClient class is not included in the Qt library. To use it you must add the following line to your pro file:</p>
<pre>         CONFIG += assistant</pre>
<p>A QAssistantClient instance can open or close Qt Assistant whenever it is required.</p>
<p>Once you have created a QAssistantClient instance, specifying the path to the Qt Assistant executable, using Qt Assistant is simple: You can either call the <a href="qassistantclient.html#openAssistant">openAssistant</a>() slot to show the defined start page of the documentation, or you can call the <a href="qassistantclient.html#showPage">showPage</a>() slot to show a particular help page. When you call <a href="qassistantclient.html#openAssistant">openAssistant</a>() and <a href="qassistantclient.html#showPage">showPage</a>(), Qt Assistant will be launched if it isn't already running. When Qt Assistant is running, the <a href="qassistantclient.html#open-prop">isOpen</a>() function returns true.</p>
<p>When calling <a href="qassistantclient.html#showPage">showPage</a>() the Qt Assistant instance will also be brought to the foreground if its hidden. The <a href="qassistantclient.html#showPage">showPage</a>() slot can be called multiple times, while calling <a href="qassistantclient.html#openAssistant">openAssistant</a>() several times without closing the application in between, will have no effect.</p>
<p>You can close Qt Assistant at any time using the <a href="qassistantclient.html#closeAssistant">closeAssistant</a>() slot. When you call <a href="qassistantclient.html#openAssistant">openAssistant</a>(), or you call <a href="qassistantclient.html#showPage">showPage</a>() without a previous call to <a href="qassistantclient.html#openAssistant">openAssistant</a>(), the <a href="qassistantclient.html#assistantOpened">assistantOpened</a>() signal is emitted. Similarly when <a href="qassistantclient.html#closeAssistant">closeAssistant</a>() is called, <a href="qassistantclient.html#assistantClosed">assistantClosed</a>() is emitted. In either case, if an error occurs, <a href="qassistantclient.html#error">error</a>() is emitted.</p>
<p>One QAssistantClient instance interacts with one Qt Assistant instance, so every time you call <a href="qassistantclient.html#openAssistant">openAssistant</a>(), <a href="qassistantclient.html#showPage">showPage</a>() or <a href="qassistantclient.html#closeAssistant">closeAssistant</a>() they are applied to the particular Qt Assistant instance associated with the QAssistantClient.</p>
<p>Qt Assistant's documentation set can be altered using the command line arguments that are passed to the application when it is launched. When started without any options, Qt Assistant displays a default set of documentation. When Qt is installed, the default documentation set in Qt Assistant contains the Qt reference documentation as well as the tools that come with Qt, such as <i>Qt Designer</i> and <tt>qmake</tt>.</p>
<p>Use the <a href="qassistantclient.html#setArguments">setArguments</a>() function to specify the command line arguments. You can add or remove documentation from Qt Assistant by adding and removing the relevant content files: The command line arguments are <tt>-addContentFile file.dcf</tt> and <tt>-removeContentFile file.dcf</tt> respectively. You can make Qt Assistant run customized documentation sets that are separate from the Qt documentation, by specifying a profile: <tt>-profile myapplication.adp</tt>. The profile format can also be used to alter several of Qt Assistant's properties such as its title and startpage.</p>
<p>The Documentation Content File (<tt>.dcf</tt>) and Qt Assistant Documentation Profile (<tt>.adp</tt>) formats are documented in the <a href="assistant-manual.html">Qt Assistant Manual</a>.</p>
<p>For a complete example using the QAssistantClient class, see the <i>Simple Text Viewer</i> example. The example shows how you can make Qt Assistant act as a customized help tool for your application using the QAssistantClient class combined with a Qt Assistant Document Profile.</p>
<p>See also <a href="assistant-manual.html">Qt Assistant Manual</a> and <a href="help-simpletextviewer.html">Simple Text Viewer Example</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QAssistantClient" />QAssistantClient.__init__ (<i>self</i>, QString, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an assistant client with the specified <i>parent</i>. For systems other than Mac OS, <i>path</i> specifies the path to the Qt Assistant executable. For Mac OS, <i>path</i> specifies a directory containing a valid assistant.app bundle. If <i>path</i> is the empty string, the system path (<tt>%PATH%</tt> or <tt>$PATH</tt>) is used.</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/~QAssistantClient" />
<h3 class="fn"><a name="closeAssistant" />QAssistantClient.closeAssistant (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void closeAssistant()</tt>.</p><p>Closes the Qt Assistant instance.</p>
<p>See also <a href="qassistantclient.html#openAssistant">openAssistant</a>() and <a href="qassistantclient.html#assistantClosed">assistantClosed</a>().</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/error" />
<h3 class="fn"><a name="isOpen" />bool QAssistantClient.isOpen (<i>self</i>)</h3><h3 class="fn"><a name="openAssistant" />QAssistantClient.openAssistant (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void openAssistant()</tt>.</p><p>Opens Qt Assistant, i.e. sets up the client-server communication between the application and Qt Assistant, and shows the start page specified by the current <a href="assistant-manual.html">Qt Assistant Document Profile</a>. If there is no specfied profile, and Qt is installed, the default start page is the Qt Reference Documentation's index page.</p>
<p>If the connection is already established, this function does nothing. Use the <a href="qassistantclient.html#showPage">showPage</a>() function to show another page. If an error occurs, the <a href="qassistantclient.html#error">error</a>() signal is emitted.</p>
<p>See also <a href="qassistantclient.html#showPage">showPage</a>() and <a href="qassistantclient.html#assistantOpened">assistantOpened</a>().</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/setArguments" />
<h3 class="fn"><a name="setArguments" />QAssistantClient.setArguments (<i>self</i>, QStringList)</h3><p>Sets the command line <i>arguments</i> that are passed to Qt Assistant when it is launched.</p>
<p>The command line arguments can be used to alter Qt Assistant's documentation set. When started without any options, Qt Assistant displays a default set of documentation. When Qt is installed, the default documentation set in Qt Assistant contains the Qt reference documentation as well as the tools that come with Qt, such as Qt Designer and qmake.</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/showPage" />
<h3 class="fn"><a name="showPage" />QAssistantClient.showPage (<i>self</i>, QString)</h3><p>This method is also a Qt slot with the C++ signature <tt>void showPage(const QString&amp;)</tt>.</p><p>Brings Qt Assistant to the foreground showing the given <i>page</i>. The <i>page</i> parameter is a path to an HTML file (e.g., <a href="qlatin1string.html">QLatin1String</a>("/home/pasquale/superproduct/docs/html/intro.html")).</p>
<p>If Qt Assistant hasn't been opened yet, this function will call the <a href="qassistantclient.html#openAssistant">openAssistant</a>() slot with the specified page as the start page.</p>
<p><b>Note:</b> The first time Qt Assistant is started, its window will open in front of the application's windows. Subsequent calls to this function will only load the specified pages in Qt Assistant and will not display its window in front of the application's windows.</p>
<p>See also <a href="qassistantclient.html#openAssistant">openAssistant</a>().</p>
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="assistantClosed" />void assistantClosed ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the connection to Qt Assistant is closed. This happens when the user exits Qt Assistant, if an error in the server or client occurs, or if <a href="qassistantclient.html#closeAssistant">closeAssistant</a>() is called.</p>
<p>See also <a href="qassistantclient.html#closeAssistant">closeAssistant</a>().</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/assistantOpened" />
<h3 class="fn"><a name="assistantOpened" />void assistantOpened ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when Qt Assistant is opened and the client-server communication is set up.</p>
<p>See also <a href="qassistantclient.html#openAssistant">openAssistant</a>() and <a href="qassistantclient.html#showPage">showPage</a>().</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/closeAssistant" />
<h3 class="fn"><a name="error" />void error (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted if Qt Assistant cannot be started, or if an error occurs during the initialization of the connection between Qt Assistant and the calling application. The <i>message</i> provides an explanation of the error.</p>
<a name="//apple_ref/cpp/instm/QAssistantClient/openAssistant" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>