Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 4155

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtextbrowser.cpp -->
  <title>QTextBrowser Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QTextBrowser</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#document-source-and-contents">Document Source and Contents</a></li>
<li class="level2"><a href="#navigation">Navigation</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QTextBrowser Class</h1>
<!-- $$$QTextBrowser-brief -->
<p>The <a href="qtextbrowser.html">QTextBrowser</a> class provides a rich text browser with hypertext navigation. <a href="#details">More...</a></p>
<!-- @@@QTextBrowser -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QTextBrowser&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qtextedit.html">QTextEdit</a></td></tr></table></div><ul>
<li><a href="qtextbrowser-members.html">List of all members, including inherited members</a></li>
<li><a href="qtextbrowser-obsolete.html">Obsolete members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextbrowser.html#modified-prop">modified</a></b> : const bool</li>
<li class="fn"><b><a href="qtextbrowser.html#openExternalLinks-prop">openExternalLinks</a></b> : bool</li>
<li class="fn"><b><a href="qtextbrowser.html#openLinks-prop">openLinks</a></b> : bool</li>
<li class="fn"><b><a href="qtextbrowser.html#readOnly-prop">readOnly</a></b> : const bool</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qtextbrowser.html#searchPaths-prop">searchPaths</a></b> : QStringList</li>
<li class="fn"><b><a href="qtextbrowser.html#source-prop">source</a></b> : QUrl</li>
<li class="fn"><b><a href="qtextbrowser.html#undoRedoEnabled-prop">undoRedoEnabled</a></b> : const bool</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">17 properties inherited from <a href="qtextedit.html#properties">QTextEdit</a></li>
<li class="fn">3 properties inherited from <a href="qabstractscrollarea.html#properties">QAbstractScrollArea</a></li>
<li class="fn">6 properties inherited from <a href="qframe.html#properties">QFrame</a></li>
<li class="fn">59 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#QTextBrowser">QTextBrowser</a></b>(QWidget *<i>parent</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#backwardHistoryCount">backwardHistoryCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#clearHistory">clearHistory</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#forwardHistoryCount">forwardHistoryCount</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#historyTitle">historyTitle</a></b>(int <i>i</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#historyUrl">historyUrl</a></b>(int <i>i</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#isBackwardAvailable">isBackwardAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#isForwardAvailable">isForwardAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#openExternalLinks-prop">openExternalLinks</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#openLinks-prop">openLinks</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#searchPaths-prop">searchPaths</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#openExternalLinks-prop">setOpenExternalLinks</a></b>(bool <i>open</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#openLinks-prop">setOpenLinks</a></b>(bool <i>open</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#searchPaths-prop">setSearchPaths</a></b>(const QStringList &amp;<i>paths</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#source-prop">source</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#loadResource">loadResource</a></b>(int <i>type</i>, const QUrl &amp;<i>name</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">62 public functions inherited from <a href="qtextedit.html#public-functions">QTextEdit</a></li>
<li class="fn">20 public functions inherited from <a href="qabstractscrollarea.html#public-functions">QAbstractScrollArea</a></li>
<li class="fn">14 public functions inherited from <a href="qframe.html#public-functions">QFrame</a></li>
<li class="fn">214 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">14 public functions inherited from <a href="../qtgui/qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#backward">backward</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#forward">forward</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#home">home</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#reload">reload</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#source-prop">setSource</a></b>(const QUrl &amp;<i>name</i>)</td></tr>
</table></div>
<ul>
<li class="fn">25 public slots inherited from <a href="qtextedit.html#public-slots">QTextEdit</a></li>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#anchorClicked">anchorClicked</a></b>(const QUrl &amp;<i>link</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a></b>(bool <i>available</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a></b>(bool <i>available</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#highlighted">highlighted</a></b>(const QUrl &amp;<i>link</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#highlighted-1">highlighted</a></b>(const QString &amp;<i>link</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#historyChanged">historyChanged</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#sourceChanged">sourceChanged</a></b>(const QUrl &amp;<i>src</i>)</td></tr>
</table></div>
<ul>
<li class="fn">7 signals inherited from <a href="qtextedit.html#signals">QTextEdit</a></li>
<li class="fn">3 signals inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">5 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#event">event</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#focusNextPrevChild">focusNextPrevChild</a></b>(bool <i>next</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#keyPressEvent">keyPressEvent</a></b>(QKeyEvent *<i>ev</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#mouseMoveEvent">mouseMoveEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#mousePressEvent">mousePressEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#mouseReleaseEvent">mouseReleaseEvent</a></b>(QMouseEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qtextbrowser.html#paintEvent">paintEvent</a></b>(QPaintEvent *<i>e</i>) override</td></tr>
</table></div>
<ul>
<li class="fn">24 protected functions inherited from <a href="qtextedit.html#protected-functions">QTextEdit</a></li>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">24 protected functions inherited from <a href="qtextedit.html#protected-functions">QTextEdit</a></li>
<li class="fn">20 protected functions inherited from <a href="qabstractscrollarea.html#protected-functions">QAbstractScrollArea</a></li>
<li class="fn">4 protected functions inherited from <a href="qframe.html#protected-functions">QFrame</a></li>
<li class="fn">35 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="../qtgui/qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QTextBrowser-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qtextbrowser.html">QTextBrowser</a> 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 id="document-source-and-contents">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#setPlainText">setPlainText</a>(), but <a href="qtextbrowser.html">QTextBrowser</a> 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;<code>#anchor&quot;</code>), 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 <code>href</code> 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 id="navigation">Navigation</h3>
<p><a href="qtextbrowser.html">QTextBrowser</a> 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 <code>qrc</code> as the scheme in the URL to load. For example, for the document resource path <code>:/docs/index.html</code> use <code>qrc:/docs/index.html</code> as the URL with <a href="qtextbrowser.html#source-prop">setSource</a>().</p>
</div>
<p><b>See also </b><a href="qtextedit.html">QTextEdit</a> and <a href="../qtgui/qtextdocument.html">QTextDocument</a>.</p>
<!-- @@@QTextBrowser -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$modified-prop -->
<h3 class="fn" id="modified-prop"><a name="modified-prop"></a><span class="name">modified</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the contents of the text browser have been modified</p>
<!-- @@@modified -->
<!-- $$$openExternalLinks-prop$$$openExternalLinks$$$setOpenExternalLinksbool -->
<h3 class="fn" id="openExternalLinks-prop"><a name="openExternalLinks-prop"></a><span class="name">openExternalLinks</span> : <span class="type">bool</span></h3>
<p>Specifies whether <a href="qtextbrowser.html">QTextBrowser</a> should automatically open links to external sources using <a href="../qtgui/qdesktopservices.html#openUrl">QDesktopServices::openUrl</a>() instead of emitting the <a href="qtextbrowser.html#anchorClicked">anchorClicked</a> 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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>openExternalLinks</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOpenExternalLinks</b></span>(bool <i>open</i>)</td></tr>
</table></div>
<!-- @@@openExternalLinks -->
<!-- $$$openLinks-prop$$$openLinks$$$setOpenLinksbool -->
<h3 class="fn" id="openLinks-prop"><a name="openLinks-prop"></a><span class="name">openLinks</span> : <span class="type">bool</span></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 <a href="qtextbrowser.html#anchorClicked">anchorClicked</a> 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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>openLinks</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOpenLinks</b></span>(bool <i>open</i>)</td></tr>
</table></div>
<!-- @@@openLinks -->
<!-- $$$readOnly-prop -->
<h3 class="fn" id="readOnly-prop"><a name="readOnly-prop"></a><span class="name">readOnly</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the text browser is read-only</p>
<p>By default, this property is <code>true</code>.</p>
<!-- @@@readOnly -->
<!-- $$$searchPaths-prop$$$searchPaths$$$setSearchPathsconstQStringList& -->
<h3 class="fn" id="searchPaths-prop"><a name="searchPaths-prop"></a><span class="name">searchPaths</span> : <span class="type"><a href="../qtcore/qstringlist.html">QStringList</a></span></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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QStringList </td><td class="memItemRight bottomAlign"><span class="name"><b>searchPaths</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSearchPaths</b></span>(const QStringList &amp;<i>paths</i>)</td></tr>
</table></div>
<!-- @@@searchPaths -->
<!-- $$$source-prop$$$source$$$setSourceconstQUrl& -->
<h3 class="fn" id="source-prop"><a name="source-prop"></a><span class="name">source</span> : <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span></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 <code>&lt;qt type=detail&gt;</code>, 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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QUrl </td><td class="memItemRight bottomAlign"><span class="name"><b>source</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setSource</b></span>(const QUrl &amp;<i>name</i>)</td></tr>
</table></div>
<!-- @@@source -->
<!-- $$$undoRedoEnabled-prop -->
<h3 class="fn" id="undoRedoEnabled-prop"><a name="undoRedoEnabled-prop"></a><span class="name">undoRedoEnabled</span> : const <span class="type">bool</span></h3>
<p>This property holds whether the text browser supports undo/redo operations</p>
<p>By default, this property is <code>false</code>.</p>
<!-- @@@undoRedoEnabled -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QTextBrowser[overload1]$$$QTextBrowserQWidget* -->
<h3 class="fn" id="QTextBrowser"><a name="QTextBrowser"></a>QTextBrowser::<span class="name">QTextBrowser</span>(<span class="type"><a href="qwidget.html#QWidget">QWidget</a></span> *<i>parent</i> = nullptr)</h3>
<p>Constructs an empty <a href="qtextbrowser.html">QTextBrowser</a> with parent <i>parent</i>.</p>
<!-- @@@QTextBrowser -->
<!-- $$$anchorClicked[overload1]$$$anchorClickedconstQUrl& -->
<h3 class="fn" id="anchorClicked"><a name="anchorClicked"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">anchorClicked</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>link</i>)</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>
<!-- @@@anchorClicked -->
<!-- $$$backward[overload1]$$$backward -->
<h3 class="fn" id="backward"><a name="backward"></a><code>[virtual slot] </code><span class="type">void</span> QTextBrowser::<span class="name">backward</span>()</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><b>See also </b><a href="qtextbrowser.html#forward">forward</a>() and <a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a>().</p>
<!-- @@@backward -->
<!-- $$$backwardAvailable[overload1]$$$backwardAvailablebool -->
<h3 class="fn" id="backwardAvailable"><a name="backwardAvailable"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">backwardAvailable</span>(<span class="type">bool</span> <i>available</i>)</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>
<!-- @@@backwardAvailable -->
<!-- $$$backwardHistoryCount[overload1]$$$backwardHistoryCount -->
<h3 class="fn" id="backwardHistoryCount"><a name="backwardHistoryCount"></a><span class="type">int</span> QTextBrowser::<span class="name">backwardHistoryCount</span>() const</h3>
<p>Returns the number of locations backward in the history.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@backwardHistoryCount -->
<!-- $$$clearHistory[overload1]$$$clearHistory -->
<h3 class="fn" id="clearHistory"><a name="clearHistory"></a><span class="type">void</span> QTextBrowser::<span class="name">clearHistory</span>()</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><b>See also </b><a href="qtextbrowser.html#backward">backward</a>() and <a href="qtextbrowser.html#forward">forward</a>().</p>
<!-- @@@clearHistory -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual protected] </code><span class="type">bool</span> QTextBrowser::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>e</i>)</h3>
<!-- @@@event -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn" id="focusNextPrevChild"><a name="focusNextPrevChild"></a><code>[override virtual protected] </code><span class="type">bool</span> QTextBrowser::<span class="name">focusNextPrevChild</span>(<span class="type">bool</span> <i>next</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#focusNextPrevChild">QTextEdit::focusNextPrevChild</a>().</p>
<!-- @@@focusNextPrevChild -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#focusOutEvent">QTextEdit::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$forward[overload1]$$$forward -->
<h3 class="fn" id="forward"><a name="forward"></a><code>[virtual slot] </code><span class="type">void</span> QTextBrowser::<span class="name">forward</span>()</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><b>See also </b><a href="qtextbrowser.html#backward">backward</a>() and <a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a>().</p>
<!-- @@@forward -->
<!-- $$$forwardAvailable[overload1]$$$forwardAvailablebool -->
<h3 class="fn" id="forwardAvailable"><a name="forwardAvailable"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">forwardAvailable</span>(<span class="type">bool</span> <i>available</i>)</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>
<!-- @@@forwardAvailable -->
<!-- $$$forwardHistoryCount[overload1]$$$forwardHistoryCount -->
<h3 class="fn" id="forwardHistoryCount"><a name="forwardHistoryCount"></a><span class="type">int</span> QTextBrowser::<span class="name">forwardHistoryCount</span>() const</h3>
<p>Returns the number of locations forward in the history.</p>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@forwardHistoryCount -->
<!-- $$$highlighted[overload1]$$$highlightedconstQUrl& -->
<h3 class="fn" id="highlighted"><a name="highlighted"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">highlighted</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>link</i>)</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>
<p><b>Note:</b> Signal <i>highlighted</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(textBrowser<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="keyword">const</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> <span class="operator">&amp;</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qtextbrowser.html#QTextBrowser">QTextBrowser</a></span><span class="operator">::</span>highlighted)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> <span class="operator">&amp;</span>link){ <span class="comment">/* ... */</span> });

</pre>
<!-- @@@highlighted -->
<!-- $$$highlighted$$$highlightedconstQString& -->
<h3 class="fn" id="highlighted-1"><a name="highlighted-1"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">highlighted</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>link</i>)</h3>
<p>This is an overloaded function.</p>
<p>Convenience signal that allows connecting to a slot that takes just a <a href="../qtcore/qstring.html">QString</a>, like for example <a href="qstatusbar.html">QStatusBar</a>'s message().</p>
<p><b>Note:</b> Signal <i>highlighted</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(textBrowser<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&amp;</span><span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qtextbrowser.html#QTextBrowser">QTextBrowser</a></span><span class="operator">::</span>highlighted)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="keyword">const</span> <span class="type"><a href="../qtcore/qstring.html">QString</a></span> <span class="operator">&amp;</span>link){ <span class="comment">/* ... */</span> });

</pre>
<!-- @@@highlighted -->
<!-- $$$historyChanged[overload1]$$$historyChanged -->
<h3 class="fn" id="historyChanged"><a name="historyChanged"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">historyChanged</span>()</h3>
<p>This signal is emitted when the history changes.</p>
<p>This function was introduced in  Qt 4.4.</p>
<p><b>See also </b><a href="qtextbrowser.html#historyTitle">historyTitle</a>() and <a href="qtextbrowser.html#historyUrl">historyUrl</a>().</p>
<!-- @@@historyChanged -->
<!-- $$$historyTitle[overload1]$$$historyTitleint -->
<h3 class="fn" id="historyTitle"><a name="historyTitle"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QTextBrowser::<span class="name">historyTitle</span>(<span class="type">int</span> <i>i</i>) const</h3>
<p>Returns the <a href="qtextedit.html#documentTitle-prop">documentTitle</a>() of the HistoryItem.</p>
<div class="table"><table class="generic">
 <thead><tr 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></div>
<pre class="cpp">

  backaction<span class="operator">.</span>setToolTip(browser<span class="operator">.</span>historyTitle(<span class="operator">-</span><span class="number">1</span>));
  forwardaction<span class="operator">.</span>setToolTip(browser<span class="operator">.</span>historyTitle(<span class="operator">+</span><span class="number">1</span>));

</pre>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@historyTitle -->
<!-- $$$historyUrl[overload1]$$$historyUrlint -->
<h3 class="fn" id="historyUrl"><a name="historyUrl"></a><span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> QTextBrowser::<span class="name">historyUrl</span>(<span class="type">int</span> <i>i</i>) const</h3>
<p>Returns the url of the HistoryItem.</p>
<div class="table"><table class="generic">
 <thead><tr 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></div>
<p>This function was introduced in  Qt 4.4.</p>
<!-- @@@historyUrl -->
<!-- $$$home[overload1]$$$home -->
<h3 class="fn" id="home"><a name="home"></a><code>[virtual slot] </code><span class="type">void</span> QTextBrowser::<span class="name">home</span>()</h3>
<p>Changes the document displayed to be the first document from the history.</p>
<!-- @@@home -->
<!-- $$$isBackwardAvailable[overload1]$$$isBackwardAvailable -->
<h3 class="fn" id="isBackwardAvailable"><a name="isBackwardAvailable"></a><span class="type">bool</span> QTextBrowser::<span class="name">isBackwardAvailable</span>() const</h3>
<p>Returns <code>true</code> 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><b>See also </b><a href="qtextbrowser.html#backwardAvailable">backwardAvailable</a>() and <a href="qtextbrowser.html#backward">backward</a>().</p>
<!-- @@@isBackwardAvailable -->
<!-- $$$isForwardAvailable[overload1]$$$isForwardAvailable -->
<h3 class="fn" id="isForwardAvailable"><a name="isForwardAvailable"></a><span class="type">bool</span> QTextBrowser::<span class="name">isForwardAvailable</span>() const</h3>
<p>Returns <code>true</code> 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><b>See also </b><a href="qtextbrowser.html#forwardAvailable">forwardAvailable</a>() and <a href="qtextbrowser.html#forward">forward</a>().</p>
<!-- @@@isForwardAvailable -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn" id="keyPressEvent"><a name="keyPressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">keyPressEvent</span>(<span class="type"><a href="../qtgui/qkeyevent.html">QKeyEvent</a></span> *<i>ev</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#keyPressEvent">QTextEdit::keyPressEvent</a>().</p>
<p>The event <i>ev</i> is used to provide the following keyboard shortcuts:</p>
<div class="table"><table class="generic">
 <thead><tr 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></div>
<!-- @@@keyPressEvent -->
<!-- $$$loadResource[overload1]$$$loadResourceintconstQUrl& -->
<h3 class="fn" id="loadResource"><a name="loadResource"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QTextBrowser::<span class="name">loadResource</span>(<span class="type">int</span> <i>type</i>, const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>name</i>)</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="../qtcore/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="../qtcore/qvariant.html">QVariant</a> that stores a <a href="../qtcore/qbytearray.html">QByteArray</a> with the contents of the file.</p>
<p>If you reimplement this function, you can return other <a href="../qtcore/qvariant.html">QVariant</a> types. The table below shows which variant types are supported depending on the resource type:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >ResourceType</th><th >QVariant::Type</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="../qtgui/qtextdocument.html#ResourceType-enum">QTextDocument::HtmlResource</a></td><td ><a href="../qtcore/qstring.html">QString</a> or <a href="../qtcore/qbytearray.html">QByteArray</a></td></tr>
<tr valign="top" class="even"><td ><a href="../qtgui/qtextdocument.html#ResourceType-enum">QTextDocument::ImageResource</a></td><td ><a href="../qtgui/qimage.html">QImage</a>, <a href="../qtgui/qpixmap.html">QPixmap</a> or <a href="../qtcore/qbytearray.html">QByteArray</a></td></tr>
<tr valign="top" class="odd"><td ><a href="../qtgui/qtextdocument.html#ResourceType-enum">QTextDocument::StyleSheetResource</a></td><td ><a href="../qtcore/qstring.html">QString</a> or <a href="../qtcore/qbytearray.html">QByteArray</a></td></tr>
</table></div>
<!-- @@@loadResource -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn" id="mouseMoveEvent"><a name="mouseMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">mouseMoveEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#mouseMoveEvent">QTextEdit::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn" id="mousePressEvent"><a name="mousePressEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">mousePressEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#mousePressEvent">QTextEdit::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn" id="mouseReleaseEvent"><a name="mouseReleaseEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">mouseReleaseEvent</span>(<span class="type"><a href="../qtgui/qmouseevent.html">QMouseEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#mouseReleaseEvent">QTextEdit::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn" id="paintEvent"><a name="paintEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QTextBrowser::<span class="name">paintEvent</span>(<span class="type"><a href="../qtgui/qpaintevent.html">QPaintEvent</a></span> *<i>e</i>)</h3>
<p>Reimplemented from <a href="qtextedit.html#paintEvent">QTextEdit::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$reload[overload1]$$$reload -->
<h3 class="fn" id="reload"><a name="reload"></a><code>[virtual slot] </code><span class="type">void</span> QTextBrowser::<span class="name">reload</span>()</h3>
<p>Reloads the current set source.</p>
<!-- @@@reload -->
<!-- $$$sourceChanged[overload1]$$$sourceChangedconstQUrl& -->
<h3 class="fn" id="sourceChanged"><a name="sourceChanged"></a><code>[signal] </code><span class="type">void</span> QTextBrowser::<span class="name">sourceChanged</span>(const <span class="type"><a href="../qtcore/qurl.html">QUrl</a></span> &amp;<i>src</i>)</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>
<!-- @@@sourceChanged -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>