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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdeclarativeerror.cpp -->
<title>Qt 4.8: QDeclarativeError Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtdeclarative.html">QtDeclarative</a></li>
<li>QDeclarativeError</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QDeclarativeError Class Reference</h1>
<!-- $$$QDeclarativeError-brief -->
<p>The QDeclarativeError class encapsulates a QML error. <a href="#details">More...</a></p>
<!-- @@@QDeclarativeError -->
<pre class="cpp"> <span class="preprocessor">#include <QDeclarativeError></span></pre><p>This class was introduced in Qt 4.7.</p>
<ul>
<li><a href="qdeclarativeerror-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#QDeclarativeError">QDeclarativeError</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#QDeclarativeError-2">QDeclarativeError</a></b> ( const QDeclarativeError & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#column">column</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#description">description</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#line">line</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#setColumn">setColumn</a></b> ( int <i>column</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#setDescription">setDescription</a></b> ( const QString & <i>description</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#setLine">setLine</a></b> ( int <i>line</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#setUrl">setUrl</a></b> ( const QUrl & <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#toString">toString</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#url">url</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeError & </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#operator-eq">operator=</a></b> ( const QDeclarativeError & <i>other</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDebug </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeerror.html#operator-lt-lt-183">operator<<</a></b> ( QDebug <i>debug</i>, const QDeclarativeError & <i>error</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDeclarativeError-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDeclarativeError class encapsulates a QML error.</p>
<p>QDeclarativeError includes a textual description of the error, as well as location information (the file, line, and column). The <a href="qdeclarativeerror.html#toString">toString</a>() method creates a single-line, human-readable string containing all of this information, for example:</p>
<pre class="cpp"> file:<span class="comment">///home/user/test.qml:7:8: Invalid property assignment: double expected</span></pre>
<p>You can use <a href="qtglobal.html#qDebug">qDebug</a>() or <a href="qtglobal.html#qWarning">qWarning</a>() to output errors to the console. This method will attempt to open the file indicated by the error and include additional contextual information.</p>
<pre class="cpp"> file:<span class="comment">///home/user/test.qml:7:8: Invalid property assignment: double expected</span>
y: <span class="string">"hello"</span>
<span class="operator">^</span></pre>
</div>
<p><b>See also </b><a href="qdeclarativeview.html#errors">QDeclarativeView::errors</a>() and <a href="qdeclarativecomponent.html#errors">QDeclarativeComponent::errors</a>().</p>
<!-- @@@QDeclarativeError -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDeclarativeError[overload1]$$$QDeclarativeError -->
<h3 class="fn"><a name="QDeclarativeError"></a>QDeclarativeError::<span class="name">QDeclarativeError</span> ()</h3>
<p>Creates an empty error object.</p>
<!-- @@@QDeclarativeError -->
<!-- $$$QDeclarativeError$$$QDeclarativeErrorconstQDeclarativeError& -->
<h3 class="fn"><a name="QDeclarativeError-2"></a>QDeclarativeError::<span class="name">QDeclarativeError</span> ( const <span class="type">QDeclarativeError</span> & <i>other</i> )</h3>
<p>Creates a copy of <i>other</i>.</p>
<!-- @@@QDeclarativeError -->
<!-- $$$column[overload1]$$$column -->
<h3 class="fn"><a name="column"></a><span class="type">int</span> QDeclarativeError::<span class="name">column</span> () const</h3>
<p>Returns the error column number.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#setColumn">setColumn</a>().</p>
<!-- @@@column -->
<!-- $$$description[overload1]$$$description -->
<h3 class="fn"><a name="description"></a><span class="type"><a href="qstring.html">QString</a></span> QDeclarativeError::<span class="name">description</span> () const</h3>
<p>Returns the error description.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#setDescription">setDescription</a>().</p>
<!-- @@@description -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDeclarativeError::<span class="name">isValid</span> () const</h3>
<p>Returns true if this error is valid, otherwise false.</p>
<!-- @@@isValid -->
<!-- $$$line[overload1]$$$line -->
<h3 class="fn"><a name="line"></a><span class="type">int</span> QDeclarativeError::<span class="name">line</span> () const</h3>
<p>Returns the error line number.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#setLine">setLine</a>().</p>
<!-- @@@line -->
<!-- $$$setColumn[overload1]$$$setColumnint -->
<h3 class="fn"><a name="setColumn"></a><span class="type">void</span> QDeclarativeError::<span class="name">setColumn</span> ( <span class="type">int</span> <i>column</i> )</h3>
<p>Sets the error <i>column</i> number.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#column">column</a>().</p>
<!-- @@@setColumn -->
<!-- $$$setDescription[overload1]$$$setDescriptionconstQString& -->
<h3 class="fn"><a name="setDescription"></a><span class="type">void</span> QDeclarativeError::<span class="name">setDescription</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>description</i> )</h3>
<p>Sets the error <i>description</i>.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#description">description</a>().</p>
<!-- @@@setDescription -->
<!-- $$$setLine[overload1]$$$setLineint -->
<h3 class="fn"><a name="setLine"></a><span class="type">void</span> QDeclarativeError::<span class="name">setLine</span> ( <span class="type">int</span> <i>line</i> )</h3>
<p>Sets the error <i>line</i> number.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#line">line</a>().</p>
<!-- @@@setLine -->
<!-- $$$setUrl[overload1]$$$setUrlconstQUrl& -->
<h3 class="fn"><a name="setUrl"></a><span class="type">void</span> QDeclarativeError::<span class="name">setUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> & <i>url</i> )</h3>
<p>Sets the <i>url</i> for the file that caused this error.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#url">url</a>().</p>
<!-- @@@setUrl -->
<!-- $$$toString[overload1]$$$toString -->
<h3 class="fn"><a name="toString"></a><span class="type"><a href="qstring.html">QString</a></span> QDeclarativeError::<span class="name">toString</span> () const</h3>
<p>Returns the error as a human readable string.</p>
<!-- @@@toString -->
<!-- $$$url[overload1]$$$url -->
<h3 class="fn"><a name="url"></a><span class="type"><a href="qurl.html">QUrl</a></span> QDeclarativeError::<span class="name">url</span> () const</h3>
<p>Returns the url for the file that caused this error.</p>
<p><b>See also </b><a href="qdeclarativeerror.html#setUrl">setUrl</a>().</p>
<!-- @@@url -->
<!-- $$$operator=[overload1]$$$operator=constQDeclarativeError& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QDeclarativeError</span> & QDeclarativeError::<span class="name">operator=</span> ( const <span class="type">QDeclarativeError</span> & <i>other</i> )</h3>
<p>Assigns <i>other</i> to this error object.</p>
<!-- @@@operator= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDebugconstQDeclarativeError& -->
<h3 class="fn"><a name="operator-lt-lt-183"></a><span class="type"><a href="qdebug.html">QDebug</a></span> <span class="name">operator<<</span> ( <span class="type"><a href="qdebug.html">QDebug</a></span> <i>debug</i>, const <span class="type">QDeclarativeError</span> & <i>error</i> )</h3>
<p>Outputs a human readable version of <i>error</i> to <i>debug</i>.</p>
<!-- @@@operator<< -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
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.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|