File: qdbusargument.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (580 lines) | stat: -rw-r--r-- 62,636 bytes parent folder | download
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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
<?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" />
<!-- qdbusargument.cpp -->
  <title>Qt 4.8: QDBusArgument 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="qtdbus.html">QtDBus</a></li>
<li>QDBusArgument</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-types">Public Types</a></li>
<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">QDBusArgument Class Reference</h1>
<!-- $$$QDBusArgument-brief -->
<p>The QDBusArgument class is used to marshall and demarshall D-Bus arguments. <a href="#details">More...</a></p>
<!-- @@@QDBusArgument -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDBusArgument&gt;</span></pre><p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qdbusargument-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#ElementType-enum">ElementType</a></b> { BasicType, VariantType, ArrayType, StructureType, ..., UnknownType }</td></tr>
</table>
<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="qdbusargument.html#QDBusArgument">QDBusArgument</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#QDBusArgument-2">QDBusArgument</a></b> ( const QDBusArgument &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#dtor.QDBusArgument">~QDBusArgument</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#asVariant">asVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#atEnd">atEnd</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginArray">beginArray</a></b> ( int <i>id</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginArray-2">beginArray</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginMap">beginMap</a></b> ( int <i>kid</i>, int <i>vid</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginMap-2">beginMap</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginMapEntry">beginMapEntry</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginMapEntry-2">beginMapEntry</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginStructure">beginStructure</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#beginStructure-2">beginStructure</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ElementType </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#currentType">currentType</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endArray">endArray</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endArray-2">endArray</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endMap">endMap</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endMap-2">endMap</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endMapEntry">endMapEntry</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endMapEntry-2">endMapEntry</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endStructure">endStructure</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#endStructure-2">endStructure</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt">operator&lt;&lt;</a></b> ( uchar <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-2">operator&lt;&lt;</a></b> ( bool <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-3">operator&lt;&lt;</a></b> ( short <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-4">operator&lt;&lt;</a></b> ( ushort <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-5">operator&lt;&lt;</a></b> ( int <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-6">operator&lt;&lt;</a></b> ( uint <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-7">operator&lt;&lt;</a></b> ( qlonglong <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-8">operator&lt;&lt;</a></b> ( qulonglong <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-9">operator&lt;&lt;</a></b> ( double <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-10">operator&lt;&lt;</a></b> ( const QString &amp; <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-14">operator&lt;&lt;</a></b> ( const QDBusVariant &amp; <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-15">operator&lt;&lt;</a></b> ( const QStringList &amp; <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-lt-lt-16">operator&lt;&lt;</a></b> ( const QByteArray &amp; <i>arg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-eq">operator=</a></b> ( const QDBusArgument &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt">operator&gt;&gt;</a></b> ( uchar &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-2">operator&gt;&gt;</a></b> ( bool &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-3">operator&gt;&gt;</a></b> ( ushort &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-4">operator&gt;&gt;</a></b> ( short &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-5">operator&gt;&gt;</a></b> ( int &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-6">operator&gt;&gt;</a></b> ( uint &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-7">operator&gt;&gt;</a></b> ( qlonglong &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-8">operator&gt;&gt;</a></b> ( qulonglong &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-9">operator&gt;&gt;</a></b> ( double &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-10">operator&gt;&gt;</a></b> ( QString &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-14">operator&gt;&gt;</a></b> ( QDBusVariant &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-15">operator&gt;&gt;</a></b> ( QStringList &amp; <i>arg</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QDBusArgument &amp; </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#operator-gt-gt-16">operator&gt;&gt;</a></b> ( QByteArray &amp; <i>arg</i> ) const</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#qDBusRegisterMetaType">qDBusRegisterMetaType</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qdbusargument.html#qdbus_cast">qdbus_cast</a></b> ( const QDBusArgument &amp; <i>argument</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QDBusArgument-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDBusArgument class is used to marshall and demarshall D-Bus arguments.</p>
<p>The class is used to send arguments over D-Bus to remote applications and to receive them back. D-Bus offers an extensible type system, based on a few primitive types and associations of them. See the <a href="qdbustypesystem.html">QtDBus type system</a> page for more information on the type system.</p>
<p>QDBusArgument is the central class in the <a href="qtdbus.html">QtDBus</a> type system, providing functions to marshall and demarshall the primitive types. The compound types are then created by association of one or more of the primitive types in arrays, dictionaries or structures.</p>
<p>The following example illustrates how a structure containing an integer and a string can be constructed using the <a href="qdbustypesystem.html">QtDBus type system</a>:</p>
<pre class="cpp"> <span class="keyword">struct</span> MyStructure
 {
     <span class="type">int</span> count;
     <span class="type"><a href="qstring.html">QString</a></span> name;
 };
 <a href="qmetatype.html#Q_DECLARE_METATYPE">Q_DECLARE_METATYPE</a>(MyStructure)

 <span class="comment">// Marshall the MyStructure data into a D-Bus argument</span>
 <span class="type">QDBusArgument</span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type">QDBusArgument</span> <span class="operator">&amp;</span>argument<span class="operator">,</span> <span class="keyword">const</span> MyStructure <span class="operator">&amp;</span>mystruct)
 {
     argument<span class="operator">.</span>beginStructure();
     argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>count <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>name;
     argument<span class="operator">.</span>endStructure();
     <span class="keyword">return</span> argument;
 }

 <span class="comment">// Retrieve the MyStructure data from the D-Bus argument</span>
 <span class="keyword">const</span> <span class="type">QDBusArgument</span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span>(<span class="keyword">const</span> <span class="type">QDBusArgument</span> <span class="operator">&amp;</span>argument<span class="operator">,</span> MyStructure <span class="operator">&amp;</span>mystruct)
 {
     argument<span class="operator">.</span>beginStructure();
     argument <span class="operator">&gt;</span><span class="operator">&gt;</span> mystruct<span class="operator">.</span>count <span class="operator">&gt;</span><span class="operator">&gt;</span> mystruct<span class="operator">.</span>name;
     argument<span class="operator">.</span>endStructure();
     <span class="keyword">return</span> argument;
 }</pre>
<p>The type has to be registered with <a href="qdbusargument.html#qDBusRegisterMetaType">qDBusRegisterMetaType</a>() before it can be used with QDBusArgument. Therefore, somewhere in your program, you should add the following code:</p>
<pre class="cpp"> qDBusRegisterMetaType<span class="operator">&lt;</span>MyStructure<span class="operator">&gt;</span>();</pre>
<p>Once registered, a type can be used in outgoing method calls (placed with <a href="qdbusabstractinterface.html#call">QDBusAbstractInterface::call</a>()), signal emissions from registered objects or in incoming calls from remote applications.</p>
<p>It is important to note that the <tt>operator&lt;&lt;</tt> and <tt>operator&gt;&gt;</tt> streaming functions must always produce the same number of entries in case of structures, both in reading and in writing (marshalling and demarshalling), otherwise calls and signals may start to silently fail.</p>
<p>The following example illustrates this wrong usage in context of a class that may contain invalid data:</p>
<pre class="cpp"> // Wrongly marshall the MyTime data into a D-Bus argument
 QDBusArgument &amp;operator&lt;&lt;(QDBusArgument &amp;argument, const MyTime &amp;mytime)
 {
     argument.beginStructure();
     if (mytime.isValid)
         argument &lt;&lt; true &lt;&lt; mytime.hour
                  &lt;&lt; mytime.minute &lt;&lt; mytime.second;
     else
         argument &lt;&lt; false;
     argument.endStructure();
     return argument;
 }</pre>
<p>In this example, both the <tt>operator&lt;&lt;</tt> and the <tt>operator&gt;&gt;</tt> functions may produce a different number of reads/writes. This can confuse the <a href="qtdbus.html">QtDBus</a> type system and should be avoided.</p>
</div>
<p><b>See also </b><a href="qdbusabstractinterface.html">QDBusAbstractInterface</a>, <a href="qdbustypesystem.html">The QtDBus type system</a>, <a href="usingadaptors.html">Using Adaptors</a>, and <a href="qdbusargument.html#qdbus_cast">qdbus_cast</a>().</p>
<!-- @@@QDBusArgument -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ElementType$$$BasicType$$$VariantType$$$ArrayType$$$StructureType$$$MapType$$$MapEntryType$$$UnknownType -->
<h3 class="fn"><a name="ElementType-enum"></a>enum QDBusArgument::<span class="name">ElementType</span></h3>
<p>This enum describes the type of element held by the argument.</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QDBusArgument::BasicType</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">A basic element, which is understood by <a href="qvariant.html">QVariant</a>. The following types are considered basic: bool, byte, short, ushort, int, uint, qint64, quint64, double, <a href="qstring.html">QString</a>, <a href="qbytearray.html">QByteArray</a>, <a href="qdbusobjectpath.html">QDBusObjectPath</a>, <a href="qdbussignature.html">QDBusSignature</a></td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::VariantType</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The variant element (<a href="qdbusvariant.html">QDBusVariant</a>)</td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::ArrayType</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">An array element, usually represented by <a href="qlist.html">QList</a>&lt;T&gt; or <a href="qvector.html">QVector</a>&lt;T&gt;. Note: <a href="qbytearray.html">QByteArray</a> and associative maps are not considered arrays, even if the D-Bus protocol transports them as such.</td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::StructureType</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">A custom type represented by a structure, like <a href="qdatetime.html">QDateTime</a>, <a href="qpoint.html">QPoint</a>, etc.</td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::MapType</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">An associative container, like <a href="qmap.html">QMap</a>&lt;Key, Value&gt; or <a href="qhash.html">QHash</a>&lt;Key, Value&gt;</td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::MapEntryType</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">One entry in an associative container: both the key and the value form one map-entry type.</td></tr>
<tr><td class="topAlign"><tt>QDBusArgument::UnknownType</tt></td><td class="topAlign"><tt>-1</tt></td><td class="topAlign">The type is unknown or we have reached the end of the list.</td></tr>
</table>
<p>This enum was introduced or modified in Qt 4.5.</p>
<p><b>See also </b><a href="qdbusargument.html#currentType">currentType</a>().</p>
<!-- @@@ElementType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDBusArgument[overload1]$$$QDBusArgument -->
<h3 class="fn"><a name="QDBusArgument"></a>QDBusArgument::<span class="name">QDBusArgument</span> ()</h3>
<p>Constructs an empty <a href="qdbusargument.html">QDBusArgument</a> argument.</p>
<p>An empty <a href="qdbusargument.html">QDBusArgument</a> object does not allow either reading or writing to be performed.</p>
<!-- @@@QDBusArgument -->
<!-- $$$QDBusArgument$$$QDBusArgumentconstQDBusArgument& -->
<h3 class="fn"><a name="QDBusArgument-2"></a>QDBusArgument::<span class="name">QDBusArgument</span> ( const <span class="type">QDBusArgument</span> &amp; <i>other</i> )</h3>
<p>Constructs a copy of the <i>other</i> <a href="qdbusargument.html">QDBusArgument</a> object.</p>
<p>Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.</p>
<!-- @@@QDBusArgument -->
<!-- $$$~QDBusArgument[overload1]$$$~QDBusArgument -->
<h3 class="fn"><a name="dtor.QDBusArgument"></a>QDBusArgument::<span class="name">~QDBusArgument</span> ()</h3>
<p>Disposes of the resources associated with this <a href="qdbusargument.html">QDBusArgument</a> object.</p>
<!-- @@@~QDBusArgument -->
<!-- $$$asVariant[overload1]$$$asVariant -->
<h3 class="fn"><a name="asVariant"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QDBusArgument::<span class="name">asVariant</span> () const</h3>
<p>Returns the current argument in the form of a <a href="qvariant.html">QVariant</a>. Basic types will be decoded and returned in the <a href="qvariant.html">QVariant</a>, but for complex types, this function will return a <a href="qdbusargument.html">QDBusArgument</a> object in the <a href="qvariant.html">QVariant</a>. It is the caller's responsibility to decode the argument (for example, by calling asVariant() in it).</p>
<p>For example, if the current argument is an INT32, this function will return a <a href="qvariant.html">QVariant</a> with an argument of type <a href="qvariant.html#Type-enum">QVariant::Int</a>. For an array of INT32, it will return a <a href="qvariant.html">QVariant</a> containing a <a href="qdbusargument.html">QDBusArgument</a>.</p>
<p>If an error occurs or if there are no more arguments to decode (i.e&#x2e;, we are at the end of the argument list), this function will return an invalid <a href="qvariant.html">QVariant</a>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qdbusargument.html#atEnd">atEnd</a>().</p>
<!-- @@@asVariant -->
<!-- $$$atEnd[overload1]$$$atEnd -->
<h3 class="fn"><a name="atEnd"></a><span class="type">bool</span> QDBusArgument::<span class="name">atEnd</span> () const</h3>
<p>Returns true if there are no more elements to be extracted from this <a href="qdbusargument.html">QDBusArgument</a>. This function is usually used in <a href="qdbusargument.html">QDBusArgument</a> objects returned from <a href="qdbusargument.html#beginMap">beginMap</a>() and <a href="qdbusargument.html#beginArray">beginArray</a>().</p>
<!-- @@@atEnd -->
<!-- $$$beginArray[overload1]$$$beginArrayint -->
<h3 class="fn"><a name="beginArray"></a><span class="type">void</span> QDBusArgument::<span class="name">beginArray</span> ( <span class="type">int</span> <i>id</i> )</h3>
<p>Opens a new D-Bus array suitable for appending elements of meta-type <i>id</i>.</p>
<p>This function is used usually in <tt>operator&lt;&lt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="comment">// append an array of MyElement types</span>
 <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> <span class="keyword">const</span> MyArray <span class="operator">&amp;</span>myarray)
 {
     argument<span class="operator">.</span>beginArray( <a href="qmetatype.html#qMetaTypeId">qMetaTypeId</a><span class="operator">&lt;</span>MyElement<span class="operator">&gt;</span>() );
     <span class="keyword">for</span> ( <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> myarray<span class="operator">.</span>length; <span class="operator">+</span><span class="operator">+</span>i )
         argument <span class="operator">&lt;</span><span class="operator">&lt;</span> myarray<span class="operator">.</span>elements<span class="operator">[</span>i<span class="operator">]</span>;
     argument<span class="operator">.</span>endArray();
     <span class="keyword">return</span> argument;
 }</pre>
<p>If the type you want to marshall is a <a href="qlist.html">QList</a>, <a href="qvector.html">QVector</a> or any of the Qt's <a href="containers.html">Container Classes</a> that take one template parameter, you need not declare an <tt>operator&lt;&lt;</tt> function for it, since <a href="qtdbus.html">QtDBus</a> provides generic templates to do the job of marshalling the data. The same applies for STL's sequence containers, such as <tt>std::list</tt>, <tt>std::vector</tt>, etc.</p>
<p><b>See also </b><a href="qdbusargument.html#endArray">endArray</a>(), <a href="qdbusargument.html#beginStructure">beginStructure</a>(), and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginArray -->
<!-- $$$beginArray$$$beginArray -->
<h3 class="fn"><a name="beginArray-2"></a><span class="type">void</span> QDBusArgument::<span class="name">beginArray</span> () const</h3>
<p>Recurses into the D-Bus array to allow extraction of the array elements.</p>
<p>This function is used usually in <tt>operator&gt;&gt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="comment">// extract a MyArray array of MyElement elements</span>
 <span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span>(<span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> MyArray <span class="operator">&amp;</span>myarray)
 {
     argument<span class="operator">.</span>beginArray();
     myarray<span class="operator">.</span>clear();

     <span class="keyword">while</span> ( <span class="operator">!</span>argument<span class="operator">.</span>atEnd() ) {
         MyElement element;
         argument <span class="operator">&gt;</span><span class="operator">&gt;</span> element;
         myarray<span class="operator">.</span>append( element );
     }

     argument<span class="operator">.</span>endArray();
     <span class="keyword">return</span> argument;
 }</pre>
<p>If the type you want to demarshall is a <a href="qlist.html">QList</a>, <a href="qvector.html">QVector</a> or any of the Qt's <a href="containers.html">Container Classes</a> that take one template parameter, you need not declare an <tt>operator&gt;&gt;</tt> function for it, since <a href="qtdbus.html">QtDBus</a> provides generic templates to do the job of demarshalling the data. The same applies for STL's sequence containers, such as <tt>std::list</tt>, <tt>std::vector</tt>, etc.</p>
<p><b>See also </b><a href="qdbusargument.html#atEnd">atEnd</a>(), <a href="qdbusargument.html#beginStructure">beginStructure</a>(), and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginArray -->
<!-- $$$beginMap[overload1]$$$beginMapintint -->
<h3 class="fn"><a name="beginMap"></a><span class="type">void</span> QDBusArgument::<span class="name">beginMap</span> ( <span class="type">int</span> <i>kid</i>, <span class="type">int</span> <i>vid</i> )</h3>
<p>Opens a new D-Bus map suitable for appending elements. Maps are containers that associate one entry (the key) to another (the value), such as Qt's <a href="qmap.html">QMap</a> or <a href="qhash.html">QHash</a>. The ids of the map's key and value meta types must be passed in <i>kid</i> and <i>vid</i> respectively.</p>
<p>This function is used usually in <tt>operator&lt;&lt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="comment">// append a dictionary that associates ints to MyValue types</span>
 <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> <span class="keyword">const</span> MyDictionary <span class="operator">&amp;</span>mydict)
 {
     argument<span class="operator">.</span>beginMap( <span class="type"><a href="qvariant.html">QVariant</a></span><span class="operator">::</span>Int<span class="operator">,</span> <a href="qmetatype.html#qMetaTypeId">qMetaTypeId</a><span class="operator">&lt;</span>MyValue<span class="operator">&gt;</span>() );
     <span class="keyword">for</span> ( <span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> mydict<span class="operator">.</span>length; <span class="operator">+</span><span class="operator">+</span>i ) {
         argument<span class="operator">.</span>beginMapEntry();
         argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mydict<span class="operator">.</span>data<span class="operator">[</span>i<span class="operator">]</span><span class="operator">.</span>key <span class="operator">&lt;</span><span class="operator">&lt;</span> mydict<span class="operator">.</span>data<span class="operator">[</span>i<span class="operator">]</span><span class="operator">.</span>value;
         argument<span class="operator">.</span>endMapEntry();
     }
     argument<span class="operator">.</span>endMap();
     <span class="keyword">return</span> argument;
 }</pre>
<p>If the type you want to marshall is a <a href="qmap.html">QMap</a> or <a href="qhash.html">QHash</a>, you need not declare an <tt>operator&lt;&lt;</tt> function for it, since <a href="qtdbus.html">QtDBus</a> provides generic templates to do the job of marshalling the data.</p>
<p><b>See also </b><a href="qdbusargument.html#endMap">endMap</a>(), <a href="qdbusargument.html#beginStructure">beginStructure</a>(), <a href="qdbusargument.html#beginArray">beginArray</a>(), and <a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>().</p>
<!-- @@@beginMap -->
<!-- $$$beginMap$$$beginMap -->
<h3 class="fn"><a name="beginMap-2"></a><span class="type">void</span> QDBusArgument::<span class="name">beginMap</span> () const</h3>
<p>Recurses into the D-Bus map to allow extraction of the map's elements.</p>
<p>This function is used usually in <tt>operator&gt;&gt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="comment">// extract a MyDictionary map that associates ints to MyValue elements</span>
 <span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span>(<span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> MyDictionary <span class="operator">&amp;</span>mydict)
 {
     argument<span class="operator">.</span>beginMap();
     mydict<span class="operator">.</span>clear();

     <span class="keyword">while</span> ( <span class="operator">!</span>argMap<span class="operator">.</span>atEnd() ) {
         <span class="type">int</span> key;
         MyValue value;
         argument<span class="operator">.</span>beginMapEntry();
         argument <span class="operator">&gt;</span><span class="operator">&gt;</span> key <span class="operator">&gt;</span><span class="operator">&gt;</span> value;
         argument<span class="operator">.</span>endMapEntry();
         mydict<span class="operator">.</span>append( key<span class="operator">,</span> value );
     }

     argument<span class="operator">.</span>endMap();
     <span class="keyword">return</span> argument;
 }</pre>
<p>If the type you want to demarshall is a <a href="qmap.html">QMap</a> or <a href="qhash.html">QHash</a>, you need not declare an <tt>operator&gt;&gt;</tt> function for it, since <a href="qtdbus.html">QtDBus</a> provides generic templates to do the job of demarshalling the data.</p>
<p><b>See also </b><a href="qdbusargument.html#endMap">endMap</a>(), <a href="qdbusargument.html#beginStructure">beginStructure</a>(), <a href="qdbusargument.html#beginArray">beginArray</a>(), and <a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>().</p>
<!-- @@@beginMap -->
<!-- $$$beginMapEntry[overload1]$$$beginMapEntry -->
<h3 class="fn"><a name="beginMapEntry"></a><span class="type">void</span> QDBusArgument::<span class="name">beginMapEntry</span> ()</h3>
<p>Opens a D-Bus map entry suitable for appending the key and value entries. This function is only valid when a map has been opened with <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<p>See <a href="qdbusargument.html#beginMap">beginMap</a>() for an example of usage of this function.</p>
<p><b>See also </b><a href="qdbusargument.html#endMapEntry">endMapEntry</a>() and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginMapEntry -->
<!-- $$$beginMapEntry$$$beginMapEntry -->
<h3 class="fn"><a name="beginMapEntry-2"></a><span class="type">void</span> QDBusArgument::<span class="name">beginMapEntry</span> () const</h3>
<p>Recurses into the D-Bus map entry to allow extraction of the key and value pair.</p>
<p>See <a href="qdbusargument.html#beginMap">beginMap</a>() for an example of how this function is usually used.</p>
<p><b>See also </b><a href="qdbusargument.html#endMapEntry">endMapEntry</a>() and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginMapEntry -->
<!-- $$$beginStructure[overload1]$$$beginStructure -->
<h3 class="fn"><a name="beginStructure"></a><span class="type">void</span> QDBusArgument::<span class="name">beginStructure</span> ()</h3>
<p>Opens a new D-Bus structure suitable for appending new arguments.</p>
<p>This function is used usually in <tt>operator&lt;&lt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> <span class="keyword">const</span> MyStructure <span class="operator">&amp;</span>mystruct)
 {
     argument<span class="operator">.</span>beginStructure();
     argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member1 <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member2 <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span> ;
     argument<span class="operator">.</span>endStructure();
     <span class="keyword">return</span> argument;
 }</pre>
<p>Structures can contain other structures, so the following code is also valid:</p>
<pre class="cpp"> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> <span class="keyword">const</span> MyStructure <span class="operator">&amp;</span>mystruct)
 {
     argument<span class="operator">.</span>beginStructure();
     argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member1 <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member2;

     argument<span class="operator">.</span>beginStructure();
     argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member3<span class="operator">.</span>subMember1 <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member3<span class="operator">.</span>subMember2;
     argument<span class="operator">.</span>endStructure();

     argument <span class="operator">&lt;</span><span class="operator">&lt;</span> mystruct<span class="operator">.</span>member4;
     argument<span class="operator">.</span>endStructure();
     <span class="keyword">return</span> argument;
 }</pre>
<p><b>See also </b><a href="qdbusargument.html#endStructure">endStructure</a>(), <a href="qdbusargument.html#beginArray">beginArray</a>(), and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginStructure -->
<!-- $$$beginStructure$$$beginStructure -->
<h3 class="fn"><a name="beginStructure-2"></a><span class="type">void</span> QDBusArgument::<span class="name">beginStructure</span> () const</h3>
<p>Opens a D-Bus structure suitable for extracting elements.</p>
<p>This function is used usually in <tt>operator&gt;&gt;</tt> streaming operators, as in the following example:</p>
<pre class="cpp"> <span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span>(<span class="keyword">const</span> <span class="type"><a href="qdbusargument.html">QDBusArgument</a></span> <span class="operator">&amp;</span>argument<span class="operator">,</span> MyStructure <span class="operator">&amp;</span>mystruct)
 {
     argument<span class="operator">.</span>beginStructure()
     argument <span class="operator">&gt;</span><span class="operator">&gt;</span> mystruct<span class="operator">.</span>member1 <span class="operator">&gt;</span><span class="operator">&gt;</span> mystruct<span class="operator">.</span>member2 <span class="operator">&gt;</span><span class="operator">&gt;</span> mystruct<span class="operator">.</span>member3 <span class="operator">&gt;</span><span class="operator">&gt;</span> <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>;
     argument<span class="operator">.</span>endStructure();
     <span class="keyword">return</span> argument;
 }</pre>
<p><b>See also </b><a href="qdbusargument.html#endStructure">endStructure</a>(), <a href="qdbusargument.html#beginArray">beginArray</a>(), and <a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@beginStructure -->
<!-- $$$currentType[overload1]$$$currentType -->
<h3 class="fn"><a name="currentType"></a><span class="type"><a href="qdbusargument.html#ElementType-enum">ElementType</a></span> QDBusArgument::<span class="name">currentType</span> () const</h3>
<p>Returns the classification of the current element type. If an error decoding the type occurs or if we're at the end of the argument, this function returns <a href="qdbusargument.html#ElementType-enum">QDBusArgument::UnknownType</a>.</p>
<p>This function only makes sense when demarshalling arguments. If it is used while marshalling, it will always return <a href="qdbusargument.html#ElementType-enum">UnknownType</a>.</p>
<p>This function was introduced in Qt 4.5.</p>
<!-- @@@currentType -->
<!-- $$$endArray[overload1]$$$endArray -->
<h3 class="fn"><a name="endArray"></a><span class="type">void</span> QDBusArgument::<span class="name">endArray</span> ()</h3>
<p>Closes a D-Bus array opened with <a href="qdbusargument.html#beginArray">beginArray</a>(). This function must be called same number of times that <a href="qdbusargument.html#beginArray">beginArray</a>() is called.</p>
<p><b>See also </b><a href="qdbusargument.html#beginArray">beginArray</a>(), <a href="qdbusargument.html#endStructure">endStructure</a>(), and <a href="qdbusargument.html#endMap">endMap</a>().</p>
<!-- @@@endArray -->
<!-- $$$endArray$$$endArray -->
<h3 class="fn"><a name="endArray-2"></a><span class="type">void</span> QDBusArgument::<span class="name">endArray</span> () const</h3>
<p>Closes the D-Bus array and allow extracting of the next element after the array.</p>
<p><b>See also </b><a href="qdbusargument.html#beginArray">beginArray</a>().</p>
<!-- @@@endArray -->
<!-- $$$endMap[overload1]$$$endMap -->
<h3 class="fn"><a name="endMap"></a><span class="type">void</span> QDBusArgument::<span class="name">endMap</span> ()</h3>
<p>Closes a D-Bus map opened with <a href="qdbusargument.html#beginMap">beginMap</a>(). This function must be called same number of times that <a href="qdbusargument.html#beginMap">beginMap</a>() is called.</p>
<p><b>See also </b><a href="qdbusargument.html#beginMap">beginMap</a>(), <a href="qdbusargument.html#endStructure">endStructure</a>(), and <a href="qdbusargument.html#endArray">endArray</a>().</p>
<!-- @@@endMap -->
<!-- $$$endMap$$$endMap -->
<h3 class="fn"><a name="endMap-2"></a><span class="type">void</span> QDBusArgument::<span class="name">endMap</span> () const</h3>
<p>Closes the D-Bus map and allow extracting of the next element after the map.</p>
<p><b>See also </b><a href="qdbusargument.html#beginMap">beginMap</a>().</p>
<!-- @@@endMap -->
<!-- $$$endMapEntry[overload1]$$$endMapEntry -->
<h3 class="fn"><a name="endMapEntry"></a><span class="type">void</span> QDBusArgument::<span class="name">endMapEntry</span> ()</h3>
<p>Closes a D-Bus map entry opened with <a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>(). This function must be called same number of times that <a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>() is called.</p>
<p><b>See also </b><a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>().</p>
<!-- @@@endMapEntry -->
<!-- $$$endMapEntry$$$endMapEntry -->
<h3 class="fn"><a name="endMapEntry-2"></a><span class="type">void</span> QDBusArgument::<span class="name">endMapEntry</span> () const</h3>
<p>Closes the D-Bus map entry and allow extracting of the next element on the map.</p>
<p><b>See also </b><a href="qdbusargument.html#beginMapEntry">beginMapEntry</a>().</p>
<!-- @@@endMapEntry -->
<!-- $$$endStructure[overload1]$$$endStructure -->
<h3 class="fn"><a name="endStructure"></a><span class="type">void</span> QDBusArgument::<span class="name">endStructure</span> ()</h3>
<p>Closes a D-Bus structure opened with <a href="qdbusargument.html#beginStructure">beginStructure</a>(). This function must be called same number of times that <a href="qdbusargument.html#beginStructure">beginStructure</a>() is called.</p>
<p><b>See also </b><a href="qdbusargument.html#beginStructure">beginStructure</a>(), <a href="qdbusargument.html#endArray">endArray</a>(), and <a href="qdbusargument.html#endMap">endMap</a>().</p>
<!-- @@@endStructure -->
<!-- $$$endStructure$$$endStructure -->
<h3 class="fn"><a name="endStructure-2"></a><span class="type">void</span> QDBusArgument::<span class="name">endStructure</span> () const</h3>
<p>Closes the D-Bus structure and allow extracting of the next element after the structure.</p>
<p><b>See also </b><a href="qdbusargument.html#beginStructure">beginStructure</a>().</p>
<!-- @@@endStructure -->
<!-- $$$operator<<[overload1]$$$operator<<uchar -->
<h3 class="fn"><a name="operator-lt-lt"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> <i>arg</i> )</h3>
<p>Appends the primitive value <i>arg</i> of type <tt>BYTE</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<bool -->
<h3 class="fn"><a name="operator-lt-lt-2"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type">bool</span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>BOOLEAN</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<short -->
<h3 class="fn"><a name="operator-lt-lt-3"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type">short</span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>INT16</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<ushort -->
<h3 class="fn"><a name="operator-lt-lt-4"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>UINT16</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<int -->
<h3 class="fn"><a name="operator-lt-lt-5"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type">int</span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>INT32</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<uint -->
<h3 class="fn"><a name="operator-lt-lt-6"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>UINT32</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<qlonglong -->
<h3 class="fn"><a name="operator-lt-lt-7"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qtglobal.html#qlonglong-typedef">qlonglong</a></span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>INT64</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<qulonglong -->
<h3 class="fn"><a name="operator-lt-lt-8"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qtglobal.html#qulonglong-typedef">qulonglong</a></span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>UINT64</tt> to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<double -->
<h3 class="fn"><a name="operator-lt-lt-9"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( <span class="type">double</span> <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>DOUBLE</tt> (double-precision floating-point) to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<constQString& -->
<h3 class="fn"><a name="operator-lt-lt-10"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>STRING</tt> (Unicode character string) to the D-Bus stream.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<constQDBusVariant& -->
<h3 class="fn"><a name="operator-lt-lt-14"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( const <span class="type"><a href="qdbusvariant.html">QDBusVariant</a></span> &amp; <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the primitive value <i>arg</i> of type <tt>VARIANT</tt> to the D-Bus stream.</p>
<p>A D-Bus variant type can contain any type, including other variants. It is similar to the Qt <a href="qvariant.html">QVariant</a> type.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<constQStringList& -->
<h3 class="fn"><a name="operator-lt-lt-15"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the <a href="qstringlist.html">QStringList</a> given by <i>arg</i> as <tt>ARRAY of STRING</tt> to the D-Bus stream.</p>
<p><a href="qstringlist.html">QStringList</a> and <a href="qbytearray.html">QByteArray</a> are the only two non-primitive types that are supported directly by <a href="qdbusargument.html">QDBusArgument</a> because of their widespread usage in Qt applications.</p>
<p>Other arrays are supported through compound types in <a href="qtdbus.html">QtDBus</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<constQByteArray& -->
<h3 class="fn"><a name="operator-lt-lt-16"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&lt;&lt;</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>arg</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the <a href="qbytearray.html">QByteArray</a> given by <i>arg</i> as <tt>ARRAY of BYTE</tt> to the D-Bus stream.</p>
<p><a href="qstringlist.html">QStringList</a> and <a href="qbytearray.html">QByteArray</a> are the only two non-primitive types that are supported directly by <a href="qdbusargument.html">QDBusArgument</a> because of their widespread usage in Qt applications.</p>
<p>Other arrays are supported through compound types in <a href="qtdbus.html">QtDBus</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator=[overload1]$$$operator=constQDBusArgument& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator=</span> ( const <span class="type">QDBusArgument</span> &amp; <i>other</i> )</h3>
<p>Copies the <i>other</i> <a href="qdbusargument.html">QDBusArgument</a> object into this one.</p>
<p>Both objects will therefore contain the same state from this point forward. QDBusArguments are explicitly shared and, therefore, any modification to either copy will affect the other one too.</p>
<!-- @@@operator= -->
<!-- $$$operator>>[overload1]$$$operator>>uchar& -->
<h3 class="fn"><a name="operator-gt-gt"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> &amp; <i>arg</i> ) const</h3>
<p>Extracts one D-BUS primitive argument of type <tt>BYTE</tt> from the D-BUS stream and puts it into <i>arg</i>.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>bool& -->
<h3 class="fn"><a name="operator-gt-gt-2"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type">bool</span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>BOOLEAN</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>ushort& -->
<h3 class="fn"><a name="operator-gt-gt-3"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qtglobal.html#ushort-typedef">ushort</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>UINT16</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>short& -->
<h3 class="fn"><a name="operator-gt-gt-4"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type">short</span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>INT16</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>int& -->
<h3 class="fn"><a name="operator-gt-gt-5"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type">int</span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>INT32</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>uint& -->
<h3 class="fn"><a name="operator-gt-gt-6"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qtglobal.html#uint-typedef">uint</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>UINT32</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>qlonglong& -->
<h3 class="fn"><a name="operator-gt-gt-7"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qtglobal.html#qlonglong-typedef">qlonglong</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>INT64</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>qulonglong& -->
<h3 class="fn"><a name="operator-gt-gt-8"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qtglobal.html#qulonglong-typedef">qulonglong</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>UINT64</tt> from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>double& -->
<h3 class="fn"><a name="operator-gt-gt-9"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type">double</span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>DOUBLE</tt> (double-precision floating pount) from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>QString& -->
<h3 class="fn"><a name="operator-gt-gt-10"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>STRING</tt> (Unicode character string) from the D-Bus stream.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>QDBusVariant& -->
<h3 class="fn"><a name="operator-gt-gt-14"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdbusvariant.html">QDBusVariant</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts one D-Bus primitive argument of type <tt>VARIANT</tt> from the D-Bus stream.</p>
<p>A D-Bus variant type can contain any type, including other variants. It is similar to the Qt <a href="qvariant.html">QVariant</a> type.</p>
<p>In case the variant contains a type not directly supported by <a href="qdbusargument.html">QDBusArgument</a>, the value of the returned <a href="qdbusvariant.html">QDBusVariant</a> will contain another <a href="qdbusargument.html">QDBusArgument</a>. It is your responsibility to further demarshall it into another type.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>QStringList& -->
<h3 class="fn"><a name="operator-gt-gt-15"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts an array of strings from the D-Bus stream and return it as a <a href="qstringlist.html">QStringList</a>.</p>
<p><a href="qstringlist.html">QStringList</a> and <a href="qbytearray.html">QByteArray</a> are the only two non-primitive types that are supported directly by <a href="qdbusargument.html">QDBusArgument</a> because of their widespread usage in Qt applications.</p>
<p>Other arrays are supported through compound types in <a href="qtdbus.html">QtDBus</a>.</p>
<!-- @@@operator>> -->
<!-- $$$operator>>$$$operator>>QByteArray& -->
<h3 class="fn"><a name="operator-gt-gt-16"></a>const <span class="type">QDBusArgument</span> &amp; QDBusArgument::<span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>arg</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Extracts an array of bytes from the D-Bus stream and return it as a <a href="qbytearray.html">QByteArray</a>.</p>
<p><a href="qstringlist.html">QStringList</a> and <a href="qbytearray.html">QByteArray</a> are the only two non-primitive types that are supported directly by <a href="qdbusargument.html">QDBusArgument</a> because of their widespread usage in Qt applications.</p>
<p>Other arrays are supported through compound types in <a href="qtdbus.html">QtDBus</a>.</p>
<!-- @@@operator>> -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qDBusRegisterMetaType[overload1]$$$qDBusRegisterMetaType -->
<h3 class="fn"><a name="qDBusRegisterMetaType"></a><span class="type">int</span> <span class="name">qDBusRegisterMetaType</span> ()</h3>
<p>Registers <tt>T</tt> with the <a href="qdbustypesystem.html">QtDBus type system</a> and the Qt <a href="qmetatype.html">meta-type system</a>, if it's not already registered.</p>
<p>To register a type, it must be declared as a meta-type with the <a href="qmetatype.html#Q_DECLARE_METATYPE">Q_DECLARE_METATYPE</a>() macro, and then registered as in the following example:</p>
<pre class="cpp"> <span class="preprocessor">#include &lt;QDBusMetaType&gt;</span>
 qDBusRegisterMetaType<span class="operator">&lt;</span>MyClass<span class="operator">&gt;</span>();</pre>
<p>If <tt>T</tt> isn't a type derived from one of Qt's <a href="containers.html">container classes</a>, the <tt>operator&lt;&lt;</tt> and <tt>operator&gt;&gt;</tt> streaming operators between <tt>T</tt> and <a href="qdbusargument.html">QDBusArgument</a> must be already declared. See the <a href="qdbustypesystem.html">QtDBus type system</a> page for more information on how to declare such types.</p>
<p>This function returns the Qt meta type id for the type (the same value that is returned from <a href="qmetatype.html#qRegisterMetaType">qRegisterMetaType</a>()).</p>
<p><b>Note:</b> This function is <a href="threads-reentrancy.html#thread-safe">thread-safe</a>.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qdbustypesystem.html">QtDBus type system</a>, <a href="qmetatype.html#qRegisterMetaType">qRegisterMetaType</a>(), and <a href="qmetatype.html">QMetaType</a>.</p>
<!-- @@@qDBusRegisterMetaType -->
<!-- $$$qdbus_cast[overload1]$$$qdbus_castconstQDBusArgument& -->
<h3 class="fn"><a name="qdbus_cast"></a><span class="type">T</span> <span class="name">qdbus_cast</span> ( const <span class="type">QDBusArgument</span> &amp; <i>argument</i> )</h3>
<p>Attempts to demarshall the contents of <i>argument</i> into the type <tt>T</tt>. For example:</p>
<pre class="cpp"> MyType item <span class="operator">=</span> qdbus_cast<span class="operator">&lt;</span>Type<span class="operator">&gt;</span>(argument);</pre>
<p>Note that it is equivalent to the following:</p>
<pre class="cpp"> MyType item;
 argument <span class="operator">&gt;</span><span class="operator">&gt;</span> item;</pre>
<p>This function was introduced in Qt 4.2.</p>
<!-- @@@qdbus_cast -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>