366 lines
26 KiB
HTML
366 lines
26 KiB
HTML
<?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" />
|
|
<!-- qdeclarativeexpression.cpp -->
|
|
<title>Qt 4.8: QDeclarativeExpression Class Reference</title>
|
|
<link rel="stylesheet" type="text/css" href="style/style.css" />
|
|
<script src="scripts/jquery.js" type="text/javascript"></script>
|
|
<script src="scripts/functions.js" type="text/javascript"></script>
|
|
<link rel="stylesheet" type="text/css" href="style/superfish.css" />
|
|
<link rel="stylesheet" type="text/css" href="style/narrow.css" />
|
|
<!--[if IE]>
|
|
<meta name="MSSmartTagsPreventParsing" content="true">
|
|
<meta http-equiv="imagetoolbar" content="no">
|
|
<![endif]-->
|
|
<!--[if lt IE 7]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
|
|
<![endif]-->
|
|
<!--[if IE 7]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
|
|
<![endif]-->
|
|
<!--[if IE 8]>
|
|
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
|
|
<![endif]-->
|
|
|
|
<script src="scripts/superfish.js" type="text/javascript"></script>
|
|
<script src="scripts/narrow.js" type="text/javascript"></script>
|
|
|
|
</head>
|
|
<body class="" onload="CheckEmptyAndLoadList();">
|
|
<div class="header" id="qtdocheader">
|
|
<div class="content">
|
|
<div id="nav-logo">
|
|
<a href="index.html">Home</a></div>
|
|
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
|
|
<div id="narrowsearch"></div>
|
|
<div id="nav-topright">
|
|
<ul>
|
|
<li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
|
|
<li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
|
|
<li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
|
|
DOC</a></li>
|
|
<li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="shortCut">
|
|
<ul>
|
|
<li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
|
|
<li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li>
|
|
</ul>
|
|
</div>
|
|
<ul class="sf-menu" id="narrowmenu">
|
|
<li><a href="#">API Lookup</a>
|
|
<ul>
|
|
<li><a href="classes.html">Class index</a></li>
|
|
<li><a href="functions.html">Function index</a></li>
|
|
<li><a href="modules.html">Modules</a></li>
|
|
<li><a href="namespaces.html">Namespaces</a></li>
|
|
<li><a href="qtglobal.html">Global Declarations</a></li>
|
|
<li><a href="qdeclarativeelements.html">QML elements</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#">Qt Topics</a>
|
|
<ul>
|
|
<li><a href="qt-basic-concepts.html">Programming with Qt</a></li>
|
|
<li><a href="qtquick.html">Device UIs & Qt Quick</a></li>
|
|
<li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
|
|
<li><a href="supported-platforms.html">Supported Platforms</a></li>
|
|
<li><a href="technology-apis.html">Qt and Key Technologies</a></li>
|
|
<li><a href="best-practices.html">How-To's and Best Practices</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#">Examples</a>
|
|
<ul>
|
|
<li><a href="all-examples.html">Examples</a></li>
|
|
<li><a href="tutorials.html">Tutorials</a></li>
|
|
<li><a href="demos.html">Demos</a></li>
|
|
<li><a href="qdeclarativeexamples.html">QML Examples</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="wrapper">
|
|
<div class="hd">
|
|
<span></span>
|
|
</div>
|
|
<div class="bd group">
|
|
<div class="sidebar">
|
|
<div class="searchlabel">
|
|
Search index:</div>
|
|
<div class="search" id="sidebarsearch">
|
|
<form id="qtdocsearch" action="" onsubmit="return false;">
|
|
<fieldset>
|
|
<input type="text" name="searchstring" id="pageType" value="" />
|
|
<div id="resultdialog">
|
|
<a href="#" id="resultclose">Close</a>
|
|
<p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p>
|
|
<p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p>
|
|
<ul id="resultlist" class="all">
|
|
</ul>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
<div class="box first bottombar" id="lookup">
|
|
<h2 title="API Lookup"><span></span>
|
|
API Lookup</h2>
|
|
<div id="list001" class="list">
|
|
<ul id="ul001" >
|
|
<li class="defaultLink"><a href="classes.html">Class index</a></li>
|
|
<li class="defaultLink"><a href="functions.html">Function index</a></li>
|
|
<li class="defaultLink"><a href="modules.html">Modules</a></li>
|
|
<li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
|
|
<li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
|
|
<li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="box bottombar" id="topics">
|
|
<h2 title="Qt Topics"><span></span>
|
|
Qt Topics</h2>
|
|
<div id="list002" class="list">
|
|
<ul id="ul002" >
|
|
<li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li>
|
|
<li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li>
|
|
<li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li>
|
|
<li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>
|
|
<li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li>
|
|
<li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="box" id="examples">
|
|
<h2 title="Examples"><span></span>
|
|
Examples</h2>
|
|
<div id="list003" class="list">
|
|
<ul id="ul003">
|
|
<li class="defaultLink"><a href="all-examples.html">Examples</a></li>
|
|
<li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
|
|
<li class="defaultLink"><a href="demos.html">Demos</a></li>
|
|
<li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="wrap">
|
|
<div class="toolbar">
|
|
<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>QDeclarativeExpression</li>
|
|
</ul>
|
|
</div>
|
|
<div class="toolbuttons toolblock">
|
|
<ul>
|
|
<li id="smallA" class="t_button">A</li>
|
|
<li id="medA" class="t_button active">A</li>
|
|
<li id="bigA" class="t_button">A</li>
|
|
<li id="print" class="t_button"><a href="javascript:this.print();">
|
|
<span>Print</span></a></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="#signals">Signals</a></li>
|
|
<li class="level1"><a href="#details">Detailed Description</a></li>
|
|
</ul>
|
|
</div>
|
|
<h1 class="title">QDeclarativeExpression Class Reference</h1>
|
|
<!-- $$$QDeclarativeExpression-brief -->
|
|
<p>The QDeclarativeExpression class evaluates JavaScript in a QML context. <a href="#details">More...</a></p>
|
|
<!-- @@@QDeclarativeExpression -->
|
|
<pre class="cpp"> <span class="preprocessor">#include <QDeclarativeExpression></span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
|
|
<p>This class was introduced in Qt 4.7.</p>
|
|
<ul>
|
|
<li><a href="qdeclarativeexpression-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="qdeclarativeexpression.html#QDeclarativeExpression">QDeclarativeExpression</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#QDeclarativeExpression-2">QDeclarativeExpression</a></b> ( QDeclarativeContext * <i>ctxt</i>, QObject * <i>scope</i>, const QString & <i>expression</i>, QObject * <i>parent</i> = 0 )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#dtor.QDeclarativeExpression">~QDeclarativeExpression</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#clearError">clearError</a></b> ()</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeContext * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#context">context</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeEngine * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#engine">engine</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeError </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#error">error</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#evaluate">evaluate</a></b> ( bool * <i>valueIsUndefined</i> = 0 )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#expression">expression</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#hasError">hasError</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#lineNumber">lineNumber</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#notifyOnValueChanged">notifyOnValueChanged</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QObject * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#scopeObject">scopeObject</a></b> () const</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#setExpression">setExpression</a></b> ( const QString & <i>expression</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#setNotifyOnValueChanged">setNotifyOnValueChanged</a></b> ( bool <i>notifyOnChange</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#setSourceLocation">setSourceLocation</a></b> ( const QString & <i>url</i>, int <i>line</i> )</td></tr>
|
|
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#sourceFile">sourceFile</a></b> () const</td></tr>
|
|
</table>
|
|
<ul>
|
|
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
|
|
</ul>
|
|
<a name="signals"></a>
|
|
<h2>Signals</h2>
|
|
<table class="alignedsummary">
|
|
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeexpression.html#valueChanged">valueChanged</a></b> ()</td></tr>
|
|
</table>
|
|
<ul>
|
|
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
|
|
</ul>
|
|
<h3>Additional Inherited Members</h3>
|
|
<ul>
|
|
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
|
|
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
|
|
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
|
|
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
|
|
</ul>
|
|
<a name="details"></a>
|
|
<!-- $$$QDeclarativeExpression-description -->
|
|
<div class="descr">
|
|
<h2>Detailed Description</h2>
|
|
<p>The QDeclarativeExpression class evaluates JavaScript in a QML context.</p>
|
|
<p>For example, given a file <tt>main.qml</tt> like this:</p>
|
|
<pre class="qml"> import QtQuick 1.0
|
|
|
|
<span class="type"><a href="qml-item.html">Item</a></span> {
|
|
<span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>: <span class="number">200</span>
|
|
}</pre>
|
|
<p>The following code evaluates a JavaScript expression in the context of the above QML:</p>
|
|
<pre class="cpp"> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> <span class="operator">*</span>engine <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span>;
|
|
<span class="type"><a href="qdeclarativecomponent.html">QDeclarativeComponent</a></span> component(engine<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(<span class="string">"main.qml"</span>));
|
|
|
|
<span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>myObject <span class="operator">=</span> component<span class="operator">.</span>create();
|
|
<span class="type">QDeclarativeExpression</span> <span class="operator">*</span>expr <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeExpression</span>(engine<span class="operator">-</span><span class="operator">></span>rootContext()<span class="operator">,</span> myObject<span class="operator">,</span> <span class="string">"width * 2"</span>);
|
|
<span class="type">int</span> result <span class="operator">=</span> expr<span class="operator">-</span><span class="operator">></span><a href="qdeclarativeexpression.html#evaluate">evaluate</a>()<span class="operator">.</span>toInt(); <span class="comment">// result = 400</span></pre>
|
|
</div>
|
|
<!-- @@@QDeclarativeExpression -->
|
|
<div class="func">
|
|
<h2>Member Function Documentation</h2>
|
|
<!-- $$$QDeclarativeExpression[overload1]$$$QDeclarativeExpression -->
|
|
<h3 class="fn"><a name="QDeclarativeExpression"></a>QDeclarativeExpression::<span class="name">QDeclarativeExpression</span> ()</h3>
|
|
<p>Create an invalid <a href="qdeclarativeexpression.html">QDeclarativeExpression</a>.</p>
|
|
<p>As the expression will not have an associated <a href="qdeclarativecontext.html">QDeclarativeContext</a>, this will be a null expression object and its value will always be an invalid <a href="qvariant.html">QVariant</a>.</p>
|
|
<!-- @@@QDeclarativeExpression -->
|
|
<!-- $$$QDeclarativeExpression$$$QDeclarativeExpressionQDeclarativeContext*QObject*constQString&QObject* -->
|
|
<h3 class="fn"><a name="QDeclarativeExpression-2"></a>QDeclarativeExpression::<span class="name">QDeclarativeExpression</span> ( <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>ctxt</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>scope</i>, const <span class="type"><a href="qstring.html">QString</a></span> & <i>expression</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
|
|
<p>Create a <a href="qdeclarativeexpression.html">QDeclarativeExpression</a> object that is a child of <i>parent</i>.</p>
|
|
<p>The <i>expression</i> JavaScript will be executed in the <i>ctxt</i> <a href="qdeclarativecontext.html">QDeclarativeContext</a>. If specified, the <i>scope</i> object's properties will also be in scope during the expression's execution.</p>
|
|
<!-- @@@QDeclarativeExpression -->
|
|
<!-- $$$~QDeclarativeExpression[overload1]$$$~QDeclarativeExpression -->
|
|
<h3 class="fn"><a name="dtor.QDeclarativeExpression"></a>QDeclarativeExpression::<span class="name">~QDeclarativeExpression</span> ()<tt> [virtual]</tt></h3>
|
|
<p>Destroy the <a href="qdeclarativeexpression.html">QDeclarativeExpression</a> instance.</p>
|
|
<!-- @@@~QDeclarativeExpression -->
|
|
<!-- $$$clearError[overload1]$$$clearError -->
|
|
<h3 class="fn"><a name="clearError"></a><span class="type">void</span> QDeclarativeExpression::<span class="name">clearError</span> ()</h3>
|
|
<p>Clear any expression errors. Calls to <a href="qdeclarativeexpression.html#hasError">hasError</a>() following this will return false.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#hasError">hasError</a>() and <a href="qdeclarativeexpression.html#error">error</a>().</p>
|
|
<!-- @@@clearError -->
|
|
<!-- $$$context[overload1]$$$context -->
|
|
<h3 class="fn"><a name="context"></a><span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * QDeclarativeExpression::<span class="name">context</span> () const</h3>
|
|
<p>Returns the <a href="qdeclarativecontext.html">QDeclarativeContext</a> this expression is associated with, or 0 if there is no association or the <a href="qdeclarativecontext.html">QDeclarativeContext</a> has been destroyed.</p>
|
|
<!-- @@@context -->
|
|
<!-- $$$engine[overload1]$$$engine -->
|
|
<h3 class="fn"><a name="engine"></a><span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * QDeclarativeExpression::<span class="name">engine</span> () const</h3>
|
|
<p>Returns the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> this expression is associated with, or 0 if there is no association or the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> has been destroyed.</p>
|
|
<!-- @@@engine -->
|
|
<!-- $$$error[overload1]$$$error -->
|
|
<h3 class="fn"><a name="error"></a><span class="type"><a href="qdeclarativeerror.html">QDeclarativeError</a></span> QDeclarativeExpression::<span class="name">error</span> () const</h3>
|
|
<p>Return any error from the last call to <a href="qdeclarativeexpression.html#evaluate">evaluate</a>(). If there was no error, this returns an invalid <a href="qdeclarativeerror.html">QDeclarativeError</a> instance.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#hasError">hasError</a>() and <a href="qdeclarativeexpression.html#clearError">clearError</a>().</p>
|
|
<!-- @@@error -->
|
|
<!-- $$$evaluate[overload1]$$$evaluatebool* -->
|
|
<h3 class="fn"><a name="evaluate"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeExpression::<span class="name">evaluate</span> ( <span class="type">bool</span> * <i>valueIsUndefined</i> = 0 )</h3>
|
|
<p>Evaulates the expression, returning the result of the evaluation, or an invalid <a href="qvariant.html">QVariant</a> if the expression is invalid or has an error.</p>
|
|
<p><i>valueIsUndefined</i> is set to true if the expression resulted in an undefined value.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#hasError">hasError</a>() and <a href="qdeclarativeexpression.html#error">error</a>().</p>
|
|
<!-- @@@evaluate -->
|
|
<!-- $$$expression[overload1]$$$expression -->
|
|
<h3 class="fn"><a name="expression"></a><span class="type"><a href="qstring.html">QString</a></span> QDeclarativeExpression::<span class="name">expression</span> () const</h3>
|
|
<p>Returns the expression string.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#setExpression">setExpression</a>().</p>
|
|
<!-- @@@expression -->
|
|
<!-- $$$hasError[overload1]$$$hasError -->
|
|
<h3 class="fn"><a name="hasError"></a><span class="type">bool</span> QDeclarativeExpression::<span class="name">hasError</span> () const</h3>
|
|
<p>Returns true if the last call to <a href="qdeclarativeexpression.html#evaluate">evaluate</a>() resulted in an error, otherwise false.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#error">error</a>() and <a href="qdeclarativeexpression.html#clearError">clearError</a>().</p>
|
|
<!-- @@@hasError -->
|
|
<!-- $$$lineNumber[overload1]$$$lineNumber -->
|
|
<h3 class="fn"><a name="lineNumber"></a><span class="type">int</span> QDeclarativeExpression::<span class="name">lineNumber</span> () const</h3>
|
|
<p>Returns the source file line number for this expression. The source location must have been previously set by calling <a href="qdeclarativeexpression.html#setSourceLocation">setSourceLocation</a>().</p>
|
|
<!-- @@@lineNumber -->
|
|
<!-- $$$notifyOnValueChanged[overload1]$$$notifyOnValueChanged -->
|
|
<h3 class="fn"><a name="notifyOnValueChanged"></a><span class="type">bool</span> QDeclarativeExpression::<span class="name">notifyOnValueChanged</span> () const</h3>
|
|
<p>Returns true if the <a href="qdeclarativeexpression.html#valueChanged">valueChanged</a>() signal is emitted when the expression's evaluated value changes.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#setNotifyOnValueChanged">setNotifyOnValueChanged</a>().</p>
|
|
<!-- @@@notifyOnValueChanged -->
|
|
<!-- $$$scopeObject[overload1]$$$scopeObject -->
|
|
<h3 class="fn"><a name="scopeObject"></a><span class="type"><a href="qobject.html">QObject</a></span> * QDeclarativeExpression::<span class="name">scopeObject</span> () const</h3>
|
|
<p>Returns the expression's scope object, if provided, otherwise 0.</p>
|
|
<p>In addition to data provided by the expression's <a href="qdeclarativecontext.html">QDeclarativeContext</a>, the scope object's properties are also in scope during the expression's evaluation.</p>
|
|
<!-- @@@scopeObject -->
|
|
<!-- $$$setExpression[overload1]$$$setExpressionconstQString& -->
|
|
<h3 class="fn"><a name="setExpression"></a><span class="type">void</span> QDeclarativeExpression::<span class="name">setExpression</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>expression</i> )</h3>
|
|
<p>Set the expression to <i>expression</i>.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#expression">expression</a>().</p>
|
|
<!-- @@@setExpression -->
|
|
<!-- $$$setNotifyOnValueChanged[overload1]$$$setNotifyOnValueChangedbool -->
|
|
<h3 class="fn"><a name="setNotifyOnValueChanged"></a><span class="type">void</span> QDeclarativeExpression::<span class="name">setNotifyOnValueChanged</span> ( <span class="type">bool</span> <i>notifyOnChange</i> )</h3>
|
|
<p>Sets whether the <a href="qdeclarativeexpression.html#valueChanged">valueChanged</a>() signal is emitted when the expression's evaluated value changes.</p>
|
|
<p>If <i>notifyOnChange</i> is true, the <a href="qdeclarativeexpression.html">QDeclarativeExpression</a> will monitor properties involved in the expression's evaluation, and emit <a href="qdeclarativeexpression.html#valueChanged">QDeclarativeExpression::valueChanged</a>() if they have changed. This allows an application to ensure that any value associated with the result of the expression remains up to date.</p>
|
|
<p>If <i>notifyOnChange</i> is false (default), the <a href="qdeclarativeexpression.html">QDeclarativeExpression</a> will not montitor properties involved in the expression's evaluation, and <a href="qdeclarativeexpression.html#valueChanged">QDeclarativeExpression::valueChanged</a>() will never be emitted. This is more efficient if an application wants a "one off" evaluation of the expression.</p>
|
|
<p><b>See also </b><a href="qdeclarativeexpression.html#notifyOnValueChanged">notifyOnValueChanged</a>().</p>
|
|
<!-- @@@setNotifyOnValueChanged -->
|
|
<!-- $$$setSourceLocation[overload1]$$$setSourceLocationconstQString&int -->
|
|
<h3 class="fn"><a name="setSourceLocation"></a><span class="type">void</span> QDeclarativeExpression::<span class="name">setSourceLocation</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>url</i>, <span class="type">int</span> <i>line</i> )</h3>
|
|
<p>Set the location of this expression to <i>line</i> of <i>url</i>. This information is used by the script engine.</p>
|
|
<!-- @@@setSourceLocation -->
|
|
<!-- $$$sourceFile[overload1]$$$sourceFile -->
|
|
<h3 class="fn"><a name="sourceFile"></a><span class="type"><a href="qstring.html">QString</a></span> QDeclarativeExpression::<span class="name">sourceFile</span> () const</h3>
|
|
<p>Returns the source file URL for this expression. The source location must have been previously set by calling <a href="qdeclarativeexpression.html#setSourceLocation">setSourceLocation</a>().</p>
|
|
<!-- @@@sourceFile -->
|
|
<!-- $$$valueChanged[overload1]$$$valueChanged -->
|
|
<h3 class="fn"><a name="valueChanged"></a><span class="type">void</span> QDeclarativeExpression::<span class="name">valueChanged</span> ()<tt> [signal]</tt></h3>
|
|
<p>Emitted each time the expression value changes from the last time it was evaluated. The expression must have been evaluated at least once (by calling <a href="qdeclarativeexpression.html#evaluate">QDeclarativeExpression::evaluate</a>()) before this signal will be emitted.</p>
|
|
<!-- @@@valueChanged -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="ft">
|
|
<span></span>
|
|
</div>
|
|
</div>
|
|
<div class="footer">
|
|
<p>
|
|
<acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd.
|
|
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>
|
|
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. <a title="Privacy Policy"
|
|
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
|
|
</div>
|
|
|
|
<script src="scripts/functions.js" type="text/javascript"></script>
|
|
</body>
|
|
</html>
|