Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 5235

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qtextbrowser.cpp -->
<head>
  <title>Qt 4.6: QTextBrowser Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QTextBrowser"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QTextBrowser Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QTextBrowser class provides a rich text browser with hypertext navigation. <a href="#details">More...</a></p>
<pre> #include &lt;QTextBrowser&gt;</pre><p>Inherits <a href="qtextedit.html">QTextEdit</a>.</p>
<ul>
<li><a href="qtextbrowser-members.html">List of all members, including inherited members</a></li>
<li><a href="qtextbrowser-qt3.html">Qt 3 support members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qtextbrowser.html#modified-prop">modified</a></b> : const bool</div></li>
<li><div class="fn"><b><a href="qtextbrowser.html#openExternalLinks-prop">openExternalLinks</a></b> : bool</div></li>
<li><div class="fn"><b><a href="qtextbrowser.html#openLinks-prop">openLinks</a></b> : bool</div></li>
<li><div class="fn"><b><a href="qtextbrowser.html#readOnly-prop">readOnly</a></b> : const bool</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="qtextbrowser.html#searchPaths-prop">searchPaths</a></b> : QStringList</div></li>
<li><div class="fn"><b><a href="qtextbrowser.html#source-prop">source</a></b> : QUrl</div></li>
<li><div class="fn"><b><a href="qtextbrowser.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : const bool</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>15 properties inherited from <a href="qtextedit.html#properties">QTextEdit</a></li>
<li><div bar="2" class="fn"></div>2 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li><div bar="2" class="fn"></div>6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li><div bar="2" class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#QTextBrowser">QTextBrowser</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#backwardHistoryCount">backwardHistoryCount</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#clearHistory">clearHistory</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#forwardHistoryCount">forwardHistoryCount</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#historyTitle">historyTitle</a></b> ( int <i>i</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QUrl </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#historyUrl">historyUrl</a></b> ( int <i>i</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#isBackwardAvailable">isBackwardAvailable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#isForwardAvailable">isForwardAvailable</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#openExternalLinks-prop">openExternalLinks</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#openLinks-prop">openLinks</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#searchPaths-prop">searchPaths</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#openExternalLinks-prop">setOpenExternalLinks</a></b> ( bool <i>open</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#openLinks-prop">setOpenLinks</a></b> ( bool <i>open</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#searchPaths-prop">setSearchPaths</a></b> ( const QStringList &amp; <i>paths</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QUrl </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#source-prop">source</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#loadResource">loadResource</a></b> ( int <i>type</i>, const QUrl &amp; <i>name</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>58 public functions inherited from <a href="qtextedit.html#public-functions">QTextEdit</a></li>
<li><div bar="2" class="fn"></div>17 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li><div bar="2" class="fn"></div>14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#backward">backward</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#forward">forward</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#home">home</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#reload">reload</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#source-prop">setSource</a></b> ( const QUrl &amp; <i>name</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>25 public slots inherited from <a href="qtextedit.html#public-slots">QTextEdit</a></li>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#anchorClicked">anchorClicked</a></b> ( const QUrl &amp; <i>link</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a></b> ( bool <i>available</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a></b> ( bool <i>available</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#highlighted">highlighted</a></b> ( const QUrl &amp; <i>link</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#highlighted-2">highlighted</a></b> ( const QString &amp; <i>link</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#historyChanged">historyChanged</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#sourceChanged">sourceChanged</a></b> ( const QUrl &amp; <i>src</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>7 signals inherited from <a href="qtextedit.html#signals">QTextEdit</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#focusNextPrevChild">focusNextPrevChild</a></b> ( bool <i>next</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>ev</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>ev</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qtextbrowser.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>25 protected functions inherited from <a href="qtextedit.html#protected-functions">QTextEdit</a></li>
<li><div bar="2" class="fn"></div>18 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li><div bar="2" class="fn"></div>3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li><div bar="2" class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>25 protected functions inherited from <a href="qtextedit.html#protected-functions">QTextEdit</a></li>
<li><div class="fn"></div>18 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li><div class="fn"></div>3 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li><div class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qabstractscrollarea.html#protected-slots">QAbstractScrollArea</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QTextBrowser class provides a rich text browser with hypertext navigation.</p>
<p>This class extends <a href="qtextedit.html">QTextEdit</a> (in read-only mode), adding some navigation functionality so that users can follow links in hypertext documents.</p>
<p>If you want to provide your users with an editable rich text editor, use <a href="qtextedit.html">QTextEdit</a>. If you want a text browser without hypertext navigation use <a href="qtextedit.html">QTextEdit</a>, and use <a href="qtextedit.html#readOnly-prop">QTextEdit::setReadOnly</a>() to disable editing. If you just need to display a small piece of rich text use <a href="qlabel.html">QLabel</a>.</p>
<a name="document-source-and-contents"></a>
<h3>Document Source and Contents</h3>
<p>The contents of <a href="qtextedit.html">QTextEdit</a> are set with <a href="qtextedit.html#html-prop">setHtml</a>() or <a href="qtextedit.html#plainText-prop">setPlainText</a>(), but QTextBrowser also implements the <a href="qtextbrowser.html#source-prop">setSource</a>() function, making it possible to use a named document as the source text. The name is looked up in a list of search paths and in the directory of the current document factory.</p>
<p>If a document name ends with an anchor (for example, &quot;<tt>#anchor&quot;</tt>), the text browser automatically scrolls to that position (using <a href="qtextedit.html#scrollToAnchor">scrollToAnchor</a>()). When the user clicks on a hyperlink, the browser will call <a href="qtextbrowser.html#source-prop">setSource</a>() itself with the link's <tt>href</tt> value as argument. You can track the current source by connecting to the <a href="qtextbrowser.html#sourceChanged">sourceChanged</a>() signal.</p>
<a name="navigation"></a>
<h3>Navigation</h3>
<p>QTextBrowser provides <a href="qtextbrowser.html#backward">backward</a>() and <a href="qtextbrowser.html#forward">forward</a>() slots which you can use to implement Back and Forward buttons. The <a href="qtextbrowser.html#home">home</a>() slot sets the text to the very first document displayed. The <a href="qtextbrowser.html#anchorClicked">anchorClicked</a>() signal is emitted when the user clicks an anchor. To override the default navigation behavior of the browser, call the <a href="qtextbrowser.html#source-prop">setSource</a>() function to supply new document text in a slot connected to this signal.</p>
<p>If you want to load documents stored in the Qt resource system use <tt>qrc</tt> as the scheme in the URL to load. For example, for the document resource path <tt>:/docs/index.html</tt> use <tt>qrc:/docs/index.html</tt> as the URL with <a href="qtextbrowser.html#source-prop">setSource</a>().</p>
<p>See also <a href="qtextedit.html">QTextEdit</a> and <a href="qtextdocument.html">QTextDocument</a>.</p>
<hr />
<h2>Property Documentation</h2>
<h3 class="fn"><a name="modified-prop"></a>modified : const bool</h3>
<p>This property holds whether the contents of the text browser have been modified.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/openExternalLinks"></a>
<a name="//apple_ref/cpp/instm/QTextBrowser/setOpenExternalLinks"></a>
<h3 class="fn"><a name="openExternalLinks-prop"></a>openExternalLinks : bool</h3>
<p>Specifies whether <a href="qtextbrowser.html">QTextBrowser</a> should automatically open links to external sources using <a href="qdesktopservices.html#openUrl">QDesktopServices::openUrl</a>() instead of emitting the anchorClicked signal. Links are considered external if their scheme is neither file or qrc.</p>
<p>The default value is false.</p>
<p>This property was introduced in Qt 4.2.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>openExternalLinks</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setOpenExternalLinks</b> ( bool <i>open</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QTextBrowser/openLinks"></a>
<a name="//apple_ref/cpp/instm/QTextBrowser/setOpenLinks"></a>
<h3 class="fn"><a name="openLinks-prop"></a>openLinks : bool</h3>
<p>This property specifies whether <a href="qtextbrowser.html">QTextBrowser</a> should automatically open links the user tries to activate by mouse or keyboard.</p>
<p>Regardless of the value of this property the anchorClicked signal is always emitted.</p>
<p>The default value is true.</p>
<p>This property was introduced in Qt 4.3.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b>openLinks</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setOpenLinks</b> ( bool <i>open</i> )</td></tr>
</table>
<h3 class="fn"><a name="readOnly-prop"></a>readOnly : const bool</h3>
<p>This property holds whether the text browser is read-only.</p>
<p>By default, this property is true.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/searchPaths"></a>
<a name="//apple_ref/cpp/instm/QTextBrowser/setSearchPaths"></a>
<h3 class="fn"><a name="searchPaths-prop"></a>searchPaths : <a href="qstringlist.html">QStringList</a></h3>
<p>This property holds the search paths used by the text browser to find supporting content.</p>
<p><a href="qtextbrowser.html">QTextBrowser</a> uses this list to locate images and documents.</p>
<p>By default, this property contains an empty string list.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QStringList </td><td class="memItemRight" valign="bottom"><b>searchPaths</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setSearchPaths</b> ( const QStringList &amp; <i>paths</i> )</td></tr>
</table>
<a name="//apple_ref/cpp/instm/QTextBrowser/source"></a>
<a name="//apple_ref/cpp/instm/QTextBrowser/setSource"></a>
<h3 class="fn"><a name="source-prop"></a>source : <a href="qurl.html">QUrl</a></h3>
<p>This property holds the name of the displayed document.</p>
<p>This is a an invalid url if no document is displayed or if the source is unknown.</p>
<p>When setting this property <a href="qtextbrowser.html">QTextBrowser</a> tries to find a document with the specified name in the paths of the <a href="qtextbrowser.html#searchPaths-prop">searchPaths</a> property and directory of the current source, unless the value is an absolute file path. It also checks for optional anchors and scrolls the document accordingly</p>
<p>If the first tag in the document is <tt>&lt;qt type=detail&gt;</tt>, the document is displayed as a popup rather than as new document in the browser window itself. Otherwise, the document is displayed normally in the text browser with the text set to the contents of the named document with <a href="qtextedit.html#html-prop">setHtml</a>().</p>
<p>By default, this property contains an empty URL.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QUrl </td><td class="memItemRight" valign="bottom"><b>source</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setSource</b> ( const QUrl &amp; <i>name</i> )</td></tr>
</table>
<h3 class="fn"><a name="undoRedoEnabled-prop"></a>undoRedoEnabled : const bool</h3>
<p>This property holds whether the text browser supports undo/redo operations.</p>
<p>By default, this property is false.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QTextBrowser/QTextBrowser"></a>
<h3 class="fn"><a name="QTextBrowser"></a>QTextBrowser::QTextBrowser ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs an empty <a href="qtextbrowser.html">QTextBrowser</a> with parent <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/anchorClicked"></a>
<h3 class="fn"><a name="anchorClicked"></a>void QTextBrowser::anchorClicked ( const <a href="qurl.html">QUrl</a> &amp; <i>link</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the user clicks an anchor. The URL referred to by the anchor is passed in <i>link</i>.</p>
<p>Note that the browser will automatically handle navigation to the location specified by <i>link</i> unless the <a href="qtextbrowser.html#openLinks-prop">openLinks</a> property is set to false or you call <a href="qtextbrowser.html#source-prop">setSource</a>() in a slot connected. This mechanism is used to override the default navigation features of the browser.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/backward"></a>
<h3 class="fn"><a name="backward"></a>void QTextBrowser::backward ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Changes the document displayed to the previous document in the list of documents built by navigating links. Does nothing if there is no previous document.</p>
<p>See also <a href="qtextbrowser.html#forward">forward</a>() and <a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/backwardAvailable"></a>
<h3 class="fn"><a name="backwardAvailable"></a>void QTextBrowser::backwardAvailable ( bool <i>available</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the availability of <a href="qtextbrowser.html#backward">backward</a>() changes. <i>available</i> is false when the user is at <a href="qtextbrowser.html#home">home</a>(); otherwise it is true.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/backwardHistoryCount"></a>
<h3 class="fn"><a name="backwardHistoryCount"></a>int QTextBrowser::backwardHistoryCount () const</h3>
<p>Returns the number of locations backward in the history.</p>
<p>This function was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/clearHistory"></a>
<h3 class="fn"><a name="clearHistory"></a>void QTextBrowser::clearHistory ()</h3>
<p>Clears the history of visited documents and disables the forward and backward navigation.</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextbrowser.html#backward">backward</a>() and <a href="qtextbrowser.html#forward">forward</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/event"></a>
<h3 class="fn"><a name="event"></a>bool QTextBrowser::event ( <a href="qevent.html">QEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/focusNextPrevChild"></a>
<h3 class="fn"><a name="focusNextPrevChild"></a>bool QTextBrowser::focusNextPrevChild ( bool <i>next</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/focusOutEvent"></a>
<h3 class="fn"><a name="focusOutEvent"></a>void QTextBrowser::focusOutEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>ev</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/forward"></a>
<h3 class="fn"><a name="forward"></a>void QTextBrowser::forward ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Changes the document displayed to the next document in the list of documents built by navigating links. Does nothing if there is no next document.</p>
<p>See also <a href="qtextbrowser.html#backward">backward</a>() and <a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/forwardAvailable"></a>
<h3 class="fn"><a name="forwardAvailable"></a>void QTextBrowser::forwardAvailable ( bool <i>available</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the availability of <a href="qtextbrowser.html#forward">forward</a>() changes. <i>available</i> is true after the user navigates <a href="qtextbrowser.html#backward">backward</a>() and false when the user navigates or goes <a href="qtextbrowser.html#forward">forward</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/forwardHistoryCount"></a>
<h3 class="fn"><a name="forwardHistoryCount"></a>int QTextBrowser::forwardHistoryCount () const</h3>
<p>Returns the number of locations forward in the history.</p>
<p>This function was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/highlighted"></a>
<h3 class="fn"><a name="highlighted"></a>void QTextBrowser::highlighted ( const <a href="qurl.html">QUrl</a> &amp; <i>link</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the user has selected but not activated an anchor in the document. The URL referred to by the anchor is passed in <i>link</i>.</p>
<h3 class="fn"><a name="highlighted-2"></a>void QTextBrowser::highlighted ( const <a href="qstring.html">QString</a> &amp; <i>link</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This is an overloaded function.</p>
<p>Convenience signal that allows connecting to a slot that takes just a <a href="qstring.html">QString</a>, like for example <a href="qstatusbar.html">QStatusBar</a>'s message().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/historyChanged"></a>
<h3 class="fn"><a name="historyChanged"></a>void QTextBrowser::historyChanged ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the history changes.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qtextbrowser.html#historyTitle">historyTitle</a>() and <a href="qtextbrowser.html#historyUrl">historyUrl</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/historyTitle"></a>
<h3 class="fn"><a name="historyTitle"></a><a href="qstring.html">QString</a> QTextBrowser::historyTitle ( int <i>i</i> ) const</h3>
<p>Returns the <a href="qtextedit.html#documentTitle-prop">documentTitle</a>() of the HistoryItem.</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Input</th><th>Return</th></tr></thead>
<tr valign="top" class="odd"><td><i>i</i> &lt; 0</td><td><a href="qtextbrowser.html#backward">backward</a>() history</td></tr>
<tr valign="top" class="even"><td><i>i</i> == 0</td><td>current, see <a href="qtextbrowser.html#source-prop">QTextBrowser::source</a>()</td></tr>
<tr valign="top" class="odd"><td><i>i</i> &gt; 0</td><td><a href="qtextbrowser.html#forward">forward</a>() history</td></tr>
</table></p>
<pre> backaction.setToolTip(browser.historyTitle(-1));
 forwardaction.setToolTip(browser.historyTitle(+1));</pre>
<p>This function was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/historyUrl"></a>
<h3 class="fn"><a name="historyUrl"></a><a href="qurl.html">QUrl</a> QTextBrowser::historyUrl ( int <i>i</i> ) const</h3>
<p>Returns the url of the HistoryItem.</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Input</th><th>Return</th></tr></thead>
<tr valign="top" class="odd"><td><i>i</i> &lt; 0</td><td><a href="qtextbrowser.html#backward">backward</a>() history</td></tr>
<tr valign="top" class="even"><td><i>i</i> == 0</td><td>current, see <a href="qtextbrowser.html#source-prop">QTextBrowser::source</a>()</td></tr>
<tr valign="top" class="odd"><td><i>i</i> &gt; 0</td><td><a href="qtextbrowser.html#forward">forward</a>() history</td></tr>
</table></p>
<p>This function was introduced in Qt 4.4.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/home"></a>
<h3 class="fn"><a name="home"></a>void QTextBrowser::home ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Changes the document displayed to be the first document from the history.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/isBackwardAvailable"></a>
<h3 class="fn"><a name="isBackwardAvailable"></a>bool QTextBrowser::isBackwardAvailable () const</h3>
<p>Returns true if the text browser can go backward in the document history using <a href="qtextbrowser.html#backward">backward</a>().</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a>() and <a href="qtextbrowser.html#backward">backward</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/isForwardAvailable"></a>
<h3 class="fn"><a name="isForwardAvailable"></a>bool QTextBrowser::isForwardAvailable () const</h3>
<p>Returns true if the text browser can go forward in the document history using <a href="qtextbrowser.html#forward">forward</a>().</p>
<p>This function was introduced in Qt 4.2.</p>
<p>See also <a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a>() and <a href="qtextbrowser.html#forward">forward</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/keyPressEvent"></a>
<h3 class="fn"><a name="keyPressEvent"></a>void QTextBrowser::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>ev</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<p>The event <i>ev</i> is used to provide the following keyboard shortcuts:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Keypress</th><th>Action</th></tr></thead>
<tr valign="top" class="odd"><td>Alt+Left Arrow</td><td><a href="qtextbrowser.html#backward">backward</a>()</td></tr>
<tr valign="top" class="even"><td>Alt+Right Arrow</td><td><a href="qtextbrowser.html#forward">forward</a>()</td></tr>
<tr valign="top" class="odd"><td>Alt+Up Arrow</td><td><a href="qtextbrowser.html#home">home</a>()</td></tr>
</table></p>
<a name="//apple_ref/cpp/instm/QTextBrowser/loadResource"></a>
<h3 class="fn"><a name="loadResource"></a><a href="qvariant.html">QVariant</a> QTextBrowser::loadResource ( int <i>type</i>, const <a href="qurl.html">QUrl</a> &amp; <i>name</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qtextedit.html#loadResource">QTextEdit::loadResource</a>().</p>
<p>This function is called when the document is loaded and for each image in the document. The <i>type</i> indicates the type of resource to be loaded. An invalid <a href="qvariant.html">QVariant</a> is returned if the resource cannot be loaded.</p>
<p>The default implementation ignores <i>type</i> and tries to locate the resources by interpreting <i>name</i> as a file name. If it is not an absolute path it tries to find the file in the paths of the <a href="qtextbrowser.html#searchPaths-prop">searchPaths</a> property and in the same directory as the current source. On success, the result is a <a href="qvariant.html">QVariant</a> that stores a <a href="qbytearray.html">QByteArray</a> with the contents of the file.</p>
<p>If you reimplement this function, you can return other <a href="qvariant.html">QVariant</a> types. The table below shows which variant types are supported depending on the resource type:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>ResourceType</th><th><a href="qvariant.html#Type-enum">QVariant::Type</a></th></tr></thead>
<tr valign="top" class="odd"><td><a href="qtextdocument.html#ResourceType-enum">QTextDocument::HtmlResource</a></td><td><a href="qstring.html">QString</a> or <a href="qbytearray.html">QByteArray</a></td></tr>
<tr valign="top" class="even"><td><a href="qtextdocument.html#ResourceType-enum">QTextDocument::ImageResource</a></td><td><a href="qimage.html">QImage</a>, <a href="qpixmap.html">QPixmap</a> or <a href="qbytearray.html">QByteArray</a></td></tr>
<tr valign="top" class="odd"><td><a href="qtextdocument.html#ResourceType-enum">QTextDocument::StyleSheetResource</a></td><td><a href="qstring.html">QString</a> or <a href="qbytearray.html">QByteArray</a></td></tr>
</table></p>
<a name="//apple_ref/cpp/instm/QTextBrowser/mouseMoveEvent"></a>
<h3 class="fn"><a name="mouseMoveEvent"></a>void QTextBrowser::mouseMoveEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/mousePressEvent"></a>
<h3 class="fn"><a name="mousePressEvent"></a>void QTextBrowser::mousePressEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/mouseReleaseEvent"></a>
<h3 class="fn"><a name="mouseReleaseEvent"></a>void QTextBrowser::mouseReleaseEvent ( <a href="qmouseevent.html">QMouseEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/paintEvent"></a>
<h3 class="fn"><a name="paintEvent"></a>void QTextBrowser::paintEvent ( <a href="qpaintevent.html">QPaintEvent</a> * <i>e</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/reload"></a>
<h3 class="fn"><a name="reload"></a>void QTextBrowser::reload ()&nbsp;&nbsp;<tt> [virtual slot]</tt></h3>
<p>Reloads the current set source.</p>
<a name="//apple_ref/cpp/instm/QTextBrowser/sourceChanged"></a>
<h3 class="fn"><a name="sourceChanged"></a>void QTextBrowser::sourceChanged ( const <a href="qurl.html">QUrl</a> &amp; <i>src</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the source has changed, <i>src</i> being the new source.</p>
<p>Source changes happen both programmatically when calling <a href="qtextbrowser.html#source-prop">setSource</a>(), <a href="qtextbrowser.html#forward">forward</a>(), backword() or <a href="qtextbrowser.html#home">home</a>() or when the user clicks on links or presses the equivalent key sequences.</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>