Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5074

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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" />
<!-- qdeclarativecontext.cpp -->
  <title>Qt 4.8: QDeclarativeContext 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 &amp; 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>&nbsp;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 &amp; 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>QDeclarativeContext</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="#details">Detailed Description</a></li>
<li class="level2"><a href="#the-context-hierarchy">The Context Hierarchy</a></li>
</ul>
</div>
<h1 class="title">QDeclarativeContext Class Reference</h1>
<!-- $$$QDeclarativeContext-brief -->
<p>The QDeclarativeContext class defines a context within a QML engine. <a href="#details">More...</a></p>
<!-- @@@QDeclarativeContext -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDeclarativeContext&gt;</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="qdeclarativecontext-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="qdeclarativecontext.html#QDeclarativeContext">QDeclarativeContext</a></b> ( QDeclarativeEngine * <i>engine</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#QDeclarativeContext-2">QDeclarativeContext</a></b> ( QDeclarativeContext * <i>parentContext</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#dtor.QDeclarativeContext">~QDeclarativeContext</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#baseUrl">baseUrl</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QObject * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#contextObject">contextObject</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#contextProperty">contextProperty</a></b> ( const QString &amp; <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeEngine * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#engine">engine</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeContext * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#parentContext">parentContext</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#resolvedUrl">resolvedUrl</a></b> ( const QUrl &amp; <i>src</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#setBaseUrl">setBaseUrl</a></b> ( const QUrl &amp; <i>baseUrl</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#setContextObject">setContextObject</a></b> ( QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a></b> ( const QString &amp; <i>name</i>, QObject * <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecontext.html#setContextProperty-2">setContextProperty</a></b> ( const QString &amp; <i>name</i>, const QVariant &amp; <i>value</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">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">1 signal inherited from <a href="qobject.html#signals">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>
<!-- $$$QDeclarativeContext-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDeclarativeContext class defines a context within a QML engine.</p>
<p>Contexts allow data to be exposed to the QML components instantiated by the QML engine.</p>
<p>Each QDeclarativeContext contains a set of properties, distinct from its <a href="qobject.html">QObject</a> properties, that allow data to be explicitly bound to a context by name. The context properties are defined and updated by calling <a href="qdeclarativecontext.html#setContextProperty">QDeclarativeContext::setContextProperty</a>(). The following example shows a Qt model being bound to a context and then accessed from a QML file.</p>
<pre class="cpp"> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> engine;
 <span class="type"><a href="qstringlistmodel.html">QStringListModel</a></span> modelData;
 <span class="type">QDeclarativeContext</span> <span class="operator">*</span>context <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeContext</span>(engine<span class="operator">.</span>rootContext());
 context<span class="operator">-</span><span class="operator">&gt;</span><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a>(<span class="string">&quot;myModel&quot;</span><span class="operator">,</span> <span class="operator">&amp;</span>modelData);

 <span class="type"><a href="qdeclarativecomponent.html">QDeclarativeComponent</a></span> component(<span class="operator">&amp;</span>engine);
 component<span class="operator">.</span>setData(<span class="string">&quot;import QtQuick 1.0\nListView { model: myModel }&quot;</span><span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>());
 <span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>window <span class="operator">=</span> component<span class="operator">.</span>create(context);</pre>
<p>Note it is the responsibility of the creator to delete any QDeclarativeContext it constructs. If the <tt>context</tt> object in the example is no longer needed when the <tt>window</tt> component instance is destroyed, the <tt>context</tt> must be destroyed explicitly. The simplest way to ensure this is to set <tt>window</tt> as the parent of <tt>context</tt>.</p>
<p>To simplify binding and maintaining larger data sets, a context object can be set on a QDeclarativeContext. All the properties of the context object are available by name in the context, as though they were all individually added through calls to <a href="qdeclarativecontext.html#setContextProperty">QDeclarativeContext::setContextProperty</a>(). Changes to the property's values are detected through the property's notify signal. Setting a context object is both faster and easier than manually adding and maintaing context property values.</p>
<p>The following example has the same effect as the previous one, but it uses a context object.</p>
<pre class="cpp"> <span class="keyword">class</span> MyDataSet : <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> {
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     Q_PROPERTY(<span class="type"><a href="qabstractitemmodel.html">QAbstractItemModel</a></span> <span class="operator">*</span>myModel READ model NOTIFY modelChanged)
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 };

 MyDataSet myDataSet;
 <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> engine;
 <span class="type">QDeclarativeContext</span> <span class="operator">*</span>context <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeContext</span>(engine<span class="operator">.</span>rootContext());
 context<span class="operator">-</span><span class="operator">&gt;</span><a href="qdeclarativecontext.html#setContextObject">setContextObject</a>(<span class="operator">&amp;</span>myDataSet);

 <span class="type"><a href="qdeclarativecomponent.html">QDeclarativeComponent</a></span> component(<span class="operator">&amp;</span>engine);
 component<span class="operator">.</span>setData(<span class="string">&quot;import QtQuick 1.0\nListView { model: myModel }&quot;</span><span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>());
 component<span class="operator">.</span>create(context);</pre>
<p>All properties added explicitly by <a href="qdeclarativecontext.html#setContextProperty">QDeclarativeContext::setContextProperty</a>() take precedence over the context object's properties.</p>
<a name="the-context-hierarchy"></a>
<h4>The Context Hierarchy</h4>
<p>Contexts form a hierarchy. The root of this hierarchy is the QML engine's <a href="qdeclarativeengine.html#rootContext">root context</a>. Child contexts inherit the context properties of their parents; if a child context sets a context property that already exists in its parent, the new context property overrides that of the parent.</p>
<p>The following example defines two contexts - <tt>context1</tt> and <tt>context2</tt>. The second context overrides the &quot;b&quot; context property inherited from the first with a new value.</p>
<pre class="cpp"> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> engine;
 <span class="type">QDeclarativeContext</span> <span class="operator">*</span>context1 <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeContext</span>(engine<span class="operator">.</span>rootContext());
 <span class="type">QDeclarativeContext</span> <span class="operator">*</span>context2 <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeContext</span>(context1);

 context1<span class="operator">-</span><span class="operator">&gt;</span><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a>(<span class="string">&quot;a&quot;</span><span class="operator">,</span> <span class="number">12</span>);
 context1<span class="operator">-</span><span class="operator">&gt;</span><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a>(<span class="string">&quot;b&quot;</span><span class="operator">,</span> <span class="number">12</span>);

 context2<span class="operator">-</span><span class="operator">&gt;</span><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a>(<span class="string">&quot;b&quot;</span><span class="operator">,</span> <span class="number">15</span>);</pre>
<p>While QML objects instantiated in a context are not strictly owned by that context, their bindings are. If a context is destroyed, the property bindings of outstanding QML objects will stop evaluating.</p>
<p><b>Warning:</b> Setting the context object or adding new context properties after an object has been created in that context is an expensive operation (essentially forcing all bindings to reevaluate). Thus whenever possible you should complete &quot;setup&quot; of the context before using it to create any objects.</p>
</div>
<p><b>See also </b><a href="qtbinding.html">Using QML Bindings in C++ Applications</a>.</p>
<!-- @@@QDeclarativeContext -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDeclarativeContext[overload1]$$$QDeclarativeContextQDeclarativeEngine*QObject* -->
<h3 class="fn"><a name="QDeclarativeContext"></a>QDeclarativeContext::<span class="name">QDeclarativeContext</span> ( <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a new <a href="qdeclarativecontext.html">QDeclarativeContext</a> as a child of <i>engine</i>'s root context, and the <a href="qobject.html">QObject</a> <i>parent</i>.</p>
<!-- @@@QDeclarativeContext -->
<!-- $$$QDeclarativeContext$$$QDeclarativeContextQDeclarativeContext*QObject* -->
<h3 class="fn"><a name="QDeclarativeContext-2"></a>QDeclarativeContext::<span class="name">QDeclarativeContext</span> ( <span class="type">QDeclarativeContext</span> * <i>parentContext</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a new <a href="qdeclarativecontext.html">QDeclarativeContext</a> with the given <i>parentContext</i>, and the <a href="qobject.html">QObject</a> <i>parent</i>.</p>
<!-- @@@QDeclarativeContext -->
<!-- $$$~QDeclarativeContext[overload1]$$$~QDeclarativeContext -->
<h3 class="fn"><a name="dtor.QDeclarativeContext"></a>QDeclarativeContext::<span class="name">~QDeclarativeContext</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qdeclarativecontext.html">QDeclarativeContext</a>.</p>
<p>Any expressions, or sub-contexts dependent on this context will be invalidated, but not destroyed (unless they are parented to the <a href="qdeclarativecontext.html">QDeclarativeContext</a> object).</p>
<!-- @@@~QDeclarativeContext -->
<!-- $$$baseUrl[overload1]$$$baseUrl -->
<h3 class="fn"><a name="baseUrl"></a><span class="type"><a href="qurl.html">QUrl</a></span> QDeclarativeContext::<span class="name">baseUrl</span> () const</h3>
<p>Returns the base url of the component, or the containing component if none is set.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#setBaseUrl">setBaseUrl</a>().</p>
<!-- @@@baseUrl -->
<!-- $$$contextObject[overload1]$$$contextObject -->
<h3 class="fn"><a name="contextObject"></a><span class="type"><a href="qobject.html">QObject</a></span> * QDeclarativeContext::<span class="name">contextObject</span> () const</h3>
<p>Return the context object, or 0 if there is no context object.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#setContextObject">setContextObject</a>().</p>
<!-- @@@contextObject -->
<!-- $$$contextProperty[overload1]$$$contextPropertyconstQString& -->
<h3 class="fn"><a name="contextProperty"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDeclarativeContext::<span class="name">contextProperty</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i> ) const</h3>
<p>Returns the value of the <i>name</i> property for this context as a <a href="qvariant.html">QVariant</a>.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#setContextProperty">setContextProperty</a>().</p>
<!-- @@@contextProperty -->
<!-- $$$engine[overload1]$$$engine -->
<h3 class="fn"><a name="engine"></a><span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * QDeclarativeContext::<span class="name">engine</span> () const</h3>
<p>Return the context's <a href="qdeclarativeengine.html">QDeclarativeEngine</a>, or 0 if the context has no <a href="qdeclarativeengine.html">QDeclarativeEngine</a> or the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> was destroyed.</p>
<!-- @@@engine -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QDeclarativeContext::<span class="name">isValid</span> () const</h3>
<p>Returns whether the context is valid.</p>
<p>To be valid, a context must have a engine, and it's <a href="qdeclarativecontext.html#contextObject">contextObject</a>(), if any, must not have been deleted.</p>
<!-- @@@isValid -->
<!-- $$$parentContext[overload1]$$$parentContext -->
<h3 class="fn"><a name="parentContext"></a><span class="type">QDeclarativeContext</span> * QDeclarativeContext::<span class="name">parentContext</span> () const</h3>
<p>Return the context's parent <a href="qdeclarativecontext.html">QDeclarativeContext</a>, or 0 if this context has no parent or if the parent has been destroyed.</p>
<!-- @@@parentContext -->
<!-- $$$resolvedUrl[overload1]$$$resolvedUrlconstQUrl& -->
<h3 class="fn"><a name="resolvedUrl"></a><span class="type"><a href="qurl.html">QUrl</a></span> QDeclarativeContext::<span class="name">resolvedUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>src</i> )</h3>
<p>Resolves the URL <i>src</i> relative to the URL of the containing component.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#baseUrl">QDeclarativeEngine::baseUrl</a>() and <a href="qdeclarativecontext.html#setBaseUrl">setBaseUrl</a>().</p>
<!-- @@@resolvedUrl -->
<!-- $$$setBaseUrl[overload1]$$$setBaseUrlconstQUrl& -->
<h3 class="fn"><a name="setBaseUrl"></a><span class="type">void</span> QDeclarativeContext::<span class="name">setBaseUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>baseUrl</i> )</h3>
<p>Explicitly sets the url <a href="qdeclarativecontext.html#resolvedUrl">resolvedUrl</a>() will use for relative references to <i>baseUrl</i>.</p>
<p>Calling this function will override the url of the containing component used by default.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#baseUrl">baseUrl</a>() and <a href="qdeclarativecontext.html#resolvedUrl">resolvedUrl</a>().</p>
<!-- @@@setBaseUrl -->
<!-- $$$setContextObject[overload1]$$$setContextObjectQObject* -->
<h3 class="fn"><a name="setContextObject"></a><span class="type">void</span> QDeclarativeContext::<span class="name">setContextObject</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )</h3>
<p>Set the context <i>object</i>.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#contextObject">contextObject</a>().</p>
<!-- @@@setContextObject -->
<!-- $$$setContextProperty[overload1]$$$setContextPropertyconstQString&QObject* -->
<h3 class="fn"><a name="setContextProperty"></a><span class="type">void</span> QDeclarativeContext::<span class="name">setContextProperty</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>value</i> )</h3>
<p>Set the <i>value</i> of the <i>name</i> property on this context.</p>
<p><a href="qdeclarativecontext.html">QDeclarativeContext</a> does <b>not</b> take ownership of <i>value</i>.</p>
<p><b>See also </b><a href="qdeclarativecontext.html#contextProperty">contextProperty</a>().</p>
<!-- @@@setContextProperty -->
<!-- $$$setContextProperty$$$setContextPropertyconstQString&constQVariant& -->
<h3 class="fn"><a name="setContextProperty-2"></a><span class="type">void</span> QDeclarativeContext::<span class="name">setContextProperty</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> &amp; <i>value</i> )</h3>
<p>Set a the <i>value</i> of the <i>name</i> property on this context.</p>
<!-- @@@setContextProperty -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>