aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/doc/html/class_context_property.html
blob: 8a762374e3fee2223886a845815cfe179e2ab24e (plain)
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>libcontextsubscriber: ContextProperty Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>ContextProperty Class Reference</h1><!-- doxytag: class="ContextProperty" -->The <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> class allows access to keys and their values.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="contextproperty_8h-source.html">contextproperty.h</a>&gt;</code>
<p>

<p>
<a href="class_context_property-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Signals</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49">valueChanged</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Emitted whenever the value of the property changes and the property is subscribed.  <a href="#dee3726fee9fbbcb92c7fb3ba2e04c49"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#79283034949fe9cf79106b7ea221439a">ContextProperty</a> (const QString &amp;key, QObject *parent=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a new <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> for <em>key</em> and subscribes to it.  <a href="#79283034949fe9cf79106b7ea221439a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#ddc93c0539a8ffd2c2c9439e5ccd8628">~ContextProperty</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unsubscribes from the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> and destroys it.  <a href="#ddc93c0539a8ffd2c2c9439e5ccd8628"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QString&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#fc2a01b6895b75e73a049e9143a16a22">key</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the key.  <a href="#fc2a01b6895b75e73a049e9143a16a22"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QVariant&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#9853332036f43724b65162acc432753a">value</a> (const QVariant &amp;def) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the current value, or the value <em>def</em> if the current value is <code>null</code>.  <a href="#9853332036f43724b65162acc432753a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">QVariant&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#4c295fefdf793557472959f9e2f3e18c">value</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the current value.  <a href="#4c295fefdf793557472959f9e2f3e18c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const <a class="el" href="class_context_property_info.html">ContextPropertyInfo</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#f5d07cd67b0c7a94d0912900e2729cbb">info</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the metadata about this property, please refer to <a class="el" href="introspection.html">Introspection</a> for details.  <a href="#f5d07cd67b0c7a94d0912900e2729cbb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#5e6f52ce5ba6e7d07240ce84c2cc7326">subscribe</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Starts subscribtion to the context property, if it isn't subscribed already.  <a href="#5e6f52ce5ba6e7d07240ce84c2cc7326"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#fa0ef21efe3c1c5d2b5936cda8feb350">unsubscribe</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unsubscribes from the context property, if it is currently subscribed.  <a href="#fa0ef21efe3c1c5d2b5936cda8feb350"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888">waitForSubscription</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Suspends the execution of the current thread until subcription is complete for this context property.  <a href="#8377eacd97cfccf349b7167f33414888"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#8654f1a0b2e6e3e58d6fc2830a5fbb8b">ignoreCommander</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets all of the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances immune to 'external commanding'.  <a href="#8654f1a0b2e6e3e58d6fc2830a5fbb8b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#47a70ecc83ea7b819728a3430d860100">setTypeCheck</a> (bool typeCheck)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables or disables all of the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances' type-check feature.  <a href="#47a70ecc83ea7b819728a3430d860100"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="struct_context_property_private.html">ContextPropertyPrivate</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_context_property.html#de52af7df11f1b01893f99aef56ecd10">priv</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> class allows access to keys and their values. 
<p>
The value is available with the <a class="el" href="class_context_property.html#9853332036f43724b65162acc432753a" title="Returns the current value, or the value def if the current value is null.">value()</a> member function and change notifications are delivered via the <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signal.<p>
You can explicity subscribe and unsubscribe using the <a class="el" href="class_context_property.html#5e6f52ce5ba6e7d07240ce84c2cc7326" title="Starts subscribtion to the context property, if it isn&#39;t subscribed already.">subscribe()</a> and <a class="el" href="class_context_property.html#fa0ef21efe3c1c5d2b5936cda8feb350" title="Unsubscribes from the context property, if it is currently subscribed.">unsubscribe()</a> member functions. A <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> is initially subscribed.<p>
When a <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> is in the unsubscribed state, it usually keeps its last value. This is not guaranteed however: more than one <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> might exist in your process for the same key, and as long as one of them is subscribed, all of them might receive new values. The <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signal is never emitted if the property is unsubscribed.<p>
A <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> is generally asynchronous and relies on a running event loop. Subscriptions and unsubcriptions are only handled and new values are only received when your program enters the event loop.<p>
<a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> objects can be created only after the Q(Core)Application is constructed.<p>
When a <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> is first created or goes from the unsubcribed to the subscribed state later on, it is temporarily in an intermediate 'subscribing' state. This state lasts until the negotiations with the provider of the key are over (or an error occurs) and the key's current value is known to the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a>.<p>
Thus, there is a time after creating a <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> (or subscribing it again) where <a class="el" href="class_context_property.html#9853332036f43724b65162acc432753a" title="Returns the current value, or the value def if the current value is null.">value()</a> might be out of sync with the provider of the key. If you need to wait for this time to be over, you can not rely on the <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signal being emitted. This signal is only emitted when the value actually changes, which might not happen when subscription is over.<p>
Instead, you can use the <a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888" title="Suspends the execution of the current thread until subcription is complete for this...">waitForSubscription()</a> member function. This function runs a recursive event loop, if necessary, until the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> is fully subscribed.<p>
Thus, the recommended way is to first create all <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances that your program needs and QObject::connect their <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signals, then to call <a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888" title="Suspends the execution of the current thread until subcription is complete for this...">waitForSubscription()</a> on those values that are needed to create the initial user interface.<p>
It is important to create all needed <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances before calling <a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888" title="Suspends the execution of the current thread until subcription is complete for this...">waitForSubscription()</a> on any of them. Subscriptions are usually bundled together behind the scenes so that they can all be done with a single round trip to the provider. Interleaving creation of ContextProperties with calls to <a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888" title="Suspends the execution of the current thread until subcription is complete for this...">waitForSubscription()</a> would prevent this optimization.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <code><a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a></code> class follows the usual QObject rules for non-GUI classes in multi-threaded programs. In Qt terminology, the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> class is reentrant but not thread-safe. This means that you can create <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances in any thread and then freely use these instance in their threads, but you can not use a single instance concurrently from multiple threads.<p>
Please pay special attention to how signals and slots work in a multi-threaded program: by default, a slot is emitted in the thread that called QObject::connect(). For this to happen reliably, the thread needs to run a event loop.<p>
See the Qt documentation for <code>QThread</code> and related classes for more details. </dd></dl>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="79283034949fe9cf79106b7ea221439a"></a><!-- doxytag: member="ContextProperty::ContextProperty" ref="79283034949fe9cf79106b7ea221439a" args="(const QString &amp;key, QObject *parent=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ContextProperty::ContextProperty           </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QObject *&nbsp;</td>
          <td class="paramname"> <em>parent</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructs a new <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> for <em>key</em> and subscribes to it. 
<p>

</div>
</div><p>
<a class="anchor" name="ddc93c0539a8ffd2c2c9439e5ccd8628"></a><!-- doxytag: member="ContextProperty::~ContextProperty" ref="ddc93c0539a8ffd2c2c9439e5ccd8628" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ContextProperty::~ContextProperty           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unsubscribes from the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> and destroys it. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="8654f1a0b2e6e3e58d6fc2830a5fbb8b"></a><!-- doxytag: member="ContextProperty::ignoreCommander" ref="8654f1a0b2e6e3e58d6fc2830a5fbb8b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::ignoreCommander           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets all of the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances immune to 'external commanding'. 
<p>
This is only intended to be used by the Context Commander itself, so that it can use ContextProperties without tripping over itself. Don't use this. 
</div>
</div><p>
<a class="anchor" name="f5d07cd67b0c7a94d0912900e2729cbb"></a><!-- doxytag: member="ContextProperty::info" ref="f5d07cd67b0c7a94d0912900e2729cbb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="class_context_property_info.html">ContextPropertyInfo</a> * ContextProperty::info           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the metadata about this property, please refer to <a class="el" href="introspection.html">Introspection</a> for details. 
<p>

</div>
</div><p>
<a class="anchor" name="fc2a01b6895b75e73a049e9143a16a22"></a><!-- doxytag: member="ContextProperty::key" ref="fc2a01b6895b75e73a049e9143a16a22" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QString ContextProperty::key           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the key. 
<p>

</div>
</div><p>
<a class="anchor" name="47a70ecc83ea7b819728a3430d860100"></a><!-- doxytag: member="ContextProperty::setTypeCheck" ref="47a70ecc83ea7b819728a3430d860100" args="(bool typeCheck)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::setTypeCheck           </td>
          <td>(</td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>newTypeCheck</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enables or disables all of the <a class="el" href="class_context_property.html" title="The ContextProperty class allows access to keys and their values.">ContextProperty</a> instances' type-check feature. 
<p>
If it is enabled and the received value from the provider doesn't match the expected type, you will get an error message on the stderr and the value won't be updated. If you use this method, you have to use it before starting any threads. 
</div>
</div><p>
<a class="anchor" name="5e6f52ce5ba6e7d07240ce84c2cc7326"></a><!-- doxytag: member="ContextProperty::subscribe" ref="5e6f52ce5ba6e7d07240ce84c2cc7326" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::subscribe           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Starts subscribtion to the context property, if it isn't subscribed already. 
<p>
If you need to wait for it to be complete, use <a class="el" href="class_context_property.html#8377eacd97cfccf349b7167f33414888" title="Suspends the execution of the current thread until subcription is complete for this...">waitForSubscription()</a>. 
</div>
</div><p>
<a class="anchor" name="fa0ef21efe3c1c5d2b5936cda8feb350"></a><!-- doxytag: member="ContextProperty::unsubscribe" ref="fa0ef21efe3c1c5d2b5936cda8feb350" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::unsubscribe           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unsubscribes from the context property, if it is currently subscribed. 
<p>
Unsubscribing informs the rest of the system that no effort needs to be spent to keep the value up-to-date. However, the value might still change when it can happen 'for free'. In this case the <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signal won't be emitted. 
</div>
</div><p>
<a class="anchor" name="4c295fefdf793557472959f9e2f3e18c"></a><!-- doxytag: member="ContextProperty::value" ref="4c295fefdf793557472959f9e2f3e18c" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QVariant ContextProperty::value           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the current value. 
<p>

</div>
</div><p>
<a class="anchor" name="9853332036f43724b65162acc432753a"></a><!-- doxytag: member="ContextProperty::value" ref="9853332036f43724b65162acc432753a" args="(const QVariant &amp;def) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QVariant ContextProperty::value           </td>
          <td>(</td>
          <td class="paramtype">const QVariant &amp;&nbsp;</td>
          <td class="paramname"> <em>def</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the current value, or the value <em>def</em> if the current value is <code>null</code>. 
<p>

</div>
</div><p>
<a class="anchor" name="dee3726fee9fbbcb92c7fb3ba2e04c49"></a><!-- doxytag: member="ContextProperty::valueChanged" ref="dee3726fee9fbbcb92c7fb3ba2e04c49" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::valueChanged           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [signal]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Emitted whenever the value of the property changes and the property is subscribed. 
<p>

</div>
</div><p>
<a class="anchor" name="8377eacd97cfccf349b7167f33414888"></a><!-- doxytag: member="ContextProperty::waitForSubscription" ref="8377eacd97cfccf349b7167f33414888" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ContextProperty::waitForSubscription           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Suspends the execution of the current thread until subcription is complete for this context property. 
<p>
This might cause the main event loop of your program to run and consequently signals might get emitted (including the <a class="el" href="class_context_property.html#dee3726fee9fbbcb92c7fb3ba2e04c49" title="Emitted whenever the value of the property changes and the property is subscribed...">valueChanged()</a> signal of this property). Calling this function while the subscription is not in progress (because it has completed already or because the property is currently unsubscribed) does nothing. Calling this function from a thread which is not the main thread results in busy looping. 
</div>
</div><p>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="de52af7df11f1b01893f99aef56ecd10"></a><!-- doxytag: member="ContextProperty::priv" ref="de52af7df11f1b01893f99aef56ecd10" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_context_property_private.html">ContextPropertyPrivate</a>* <a class="el" href="class_context_property.html#de52af7df11f1b01893f99aef56ecd10">ContextProperty::priv</a><code> [private]</code>          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="contextproperty_8h-source.html">contextproperty.h</a><li><a class="el" href="contextproperty_8cpp.html">contextproperty.cpp</a><li><a class="el" href="mocs_8cpp.html">mocs.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 23 08:59:23 2009 for libcontextsubscriber by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>