File: qstringref.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (465 lines) | stat: -rw-r--r-- 44,063 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
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QStringRef Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStringRef Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstringref.html#QStringRef">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstringref.html#QStringRef-2">__init__</a></b> (<i>self</i>, QString&#160;<i>aString</i>, int&#160;<i>aPosition</i>, int&#160;<i>aSize</i>)</li><li><div class="fn" /><b><a href="qstringref.html#QStringRef-3">__init__</a></b> (<i>self</i>, QString&#160;<i>aString</i>)</li><li><div class="fn" /><b><a href="qstringref.html#QStringRef-4">__init__</a></b> (<i>self</i>, QStringRef&#160;<i>other</i>)</li><li><div class="fn" />QStringRef <b><a href="qstringref.html#appendTo">appendTo</a></b> (<i>self</i>, QString&#160;<i>string</i>)</li><li><div class="fn" />QChar <b><a href="qstringref.html#at">at</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qstringref.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#compare">compare</a></b> (<i>self</i>, QString&#160;<i>other</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#compare-2">compare</a></b> (<i>self</i>, QStringRef&#160;<i>other</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#compare-3">compare</a></b> (<i>self</i>, QLatin1String&#160;<i>other</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />QChar <b><a href="qstringref.html#constData">constData</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#contains">contains</a></b> (<i>self</i>, QString&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#contains-2">contains</a></b> (<i>self</i>, QLatin1String&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#contains-3">contains</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#count">count</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#count-2">count</a></b> (<i>self</i>, QString&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#count-3">count</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />QChar <b><a href="qstringref.html#data">data</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#endsWith">endsWith</a></b> (<i>self</i>, QString&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#endsWith-2">endsWith</a></b> (<i>self</i>, QLatin1String&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#endsWith-3">endsWith</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#indexOf">indexOf</a></b> (<i>self</i>, QString&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#indexOf-2">indexOf</a></b> (<i>self</i>, QLatin1String&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#indexOf-3">indexOf</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#lastIndexOf">lastIndexOf</a></b> (<i>self</i>, QString&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#lastIndexOf-2">lastIndexOf</a></b> (<i>self</i>, QLatin1String&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#lastIndexOf-3">lastIndexOf</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#length">length</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#localeAwareCompare">localeAwareCompare</a></b> (<i>self</i>, QString&#160;<i>s</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#localeAwareCompare-2">localeAwareCompare</a></b> (<i>self</i>, QStringRef&#160;<i>s</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#position">position</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#size">size</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#startsWith">startsWith</a></b> (<i>self</i>, QString&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#startsWith-2">startsWith</a></b> (<i>self</i>, QLatin1String&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />bool <b><a href="qstringref.html#startsWith-3">startsWith</a></b> (<i>self</i>, QStringRef&#160;<i>str</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />QString <b><a href="qstringref.html#string">string</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qstringref.html#toAscii">toAscii</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qstringref.html#toLatin1">toLatin1</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qstringref.html#toLocal8Bit">toLocal8Bit</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qstringref.html#toString">toString</a></b> (<i>self</i>)</li><li><div class="fn" />unknown-type <b><a href="qstringref.html#toUcs4">toUcs4</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qstringref.html#toUtf8">toUtf8</a></b> (<i>self</i>)</li><li><div class="fn" />QChar <b><a href="qstringref.html#unicode">unicode</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />int <b><a href="qstringref.html#compare-4">compare</a></b> (QStringRef&#160;<i>s1</i>, QString&#160;<i>s2</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#compare-5">compare</a></b> (QStringRef&#160;<i>s1</i>, QStringRef&#160;<i>s2</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#compare-6">compare</a></b> (QStringRef&#160;<i>s1</i>, QLatin1String&#160;<i>s2</i>, Qt.CaseSensitivity&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</li><li><div class="fn" />int <b><a href="qstringref.html#localeAwareCompare-3">localeAwareCompare</a></b> (QStringRef&#160;<i>s1</i>, QString&#160;<i>s2</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#localeAwareCompare-4">localeAwareCompare</a></b> (QStringRef&#160;<i>s1</i>, QStringRef&#160;<i>s2</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />bool <b><a href="qstringref.html#__eq__">__eq__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__eq__-2">__eq__</a></b> (<i>self</i>, QString&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__eq__-3">__eq__</a></b> (<i>self</i>, QLatin1String&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__ge__">__ge__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__gt__">__gt__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__le__">__le__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />int <b><a href="qstringref.html#__len__">__len__</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__lt__">__lt__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__ne__">__ne__</a></b> (<i>self</i>, QStringRef&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__ne__-2">__ne__</a></b> (<i>self</i>, QString&#160;<i>s2</i>)</li><li><div class="fn" />bool <b><a href="qstringref.html#__ne__-3">__ne__</a></b> (<i>self</i>, QLatin1String&#160;<i>s2</i>)</li><li><div class="fn" />object <b><a href="qstringref.html#__str__">__str__</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStringRef class provides a thin wrapper around <a href="qstring.html">QString</a> substrings.</p>
<p>QStringRef provides a read-only subset of the <a href="qstring.html">QString</a> API.</p>
<p>A string reference explicitly references a portion of a <a href="qstringref.html#string">string</a>() with a given <a href="qstringref.html#size">size</a>(), starting at a specific <a href="qstringref.html#position">position</a>(). Calling <a href="qstringref.html#toString">toString</a>() returns a copy of the
data as a real <a href="qstring.html">QString</a> instance.</p>
<p>This class is designed to improve the performance of substring
handling when manipulating substrings obtained from existing
<a href="qstring.html">QString</a> instances. QStringRef avoids the
memory allocation and reference counting overhead of a standard
<a href="qstring.html">QString</a> by simply referencing a part of
the original string. This can prove to be advantageous in low level
code, such as that used in a parser, at the expense of potentially
more complex code.</p>
<p>For most users, there are no semantic benefits to using
QStringRef instead of <a href="qstring.html">QString</a> since
QStringRef requires attention to be paid to memory management
issues, potentially making code more complex to write and
maintain.</p>
<p><b>Warning:</b> A QStringRef is only valid as long as the
referenced string exists. If the original string is deleted, the
string reference points to an invalid memory location.</p>
<p>We suggest that you only use this class in stable code where
profiling has clearly identified that performance improvements can
be made by replacing standard string operations with the optimized
substring handling provided by this class.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStringRef" />QStringRef.__init__ (<i>self</i>)</h3><p>Constructs an empty string reference.</p>


<h3 class="fn"><a name="QStringRef-2" />QStringRef.__init__ (<i>self</i>, QString&#160;<i>aString</i>, int&#160;<i>aPosition</i>, int&#160;<i>aSize</i>)</h3><p>Constructs a string reference to the range of characters in the
given <i>string</i> specified by the starting <i>position</i> and
<i>length</i> in characters.</p>
<p><b>Warning:</b> This function exists to improve performance as
much as possible, and performs no bounds checking. For program
correctness, <i>position</i> and <i>length</i> must describe a
valid substring of <i>string</i>.</p>
<p>This means that the starting <i>position</i> must be positive or
0 and smaller than <i>string</i>'s length, and <i>length</i> must
be positive or 0 but smaller than the string's length minus the
starting <i>position</i>; i.e, 0 &lt;= position &lt;
string-&gt;<a href="qstringref.html#length">length</a>() and 0
&lt;= length &lt;= string-&gt;<a href="qstringref.html#length">length</a>() - position must both be
satisfied.</p>


<h3 class="fn"><a name="QStringRef-3" />QStringRef.__init__ (<i>self</i>, QString&#160;<i>aString</i>)</h3><p>Constructs a string reference to the given <i>string</i>.</p>


<h3 class="fn"><a name="QStringRef-4" />QStringRef.__init__ (<i>self</i>, QStringRef&#160;<i>other</i>)</h3><p>Constructs a copy of the <i>other</i> string reference.</p>


<h3 class="fn"><a name="appendTo" />QStringRef QStringRef.appendTo (<i>self</i>, QString&#160;<i>string</i>)</h3><p>Appends the string reference to <i>string</i>, and returns a new
reference to the combined string data.</p>


<h3 class="fn"><a name="at" />QChar QStringRef.at (<i>self</i>, int&#160;<i>i</i>)</h3><p>Returns the character at the given index <i>position</i> in the
string reference.</p>
<p>The <i>position</i> must be a valid index position in the string
(i.e., 0 &lt;= <i>position</i> &lt; <a href="qstringref.html#size">size</a>()).</p>


<h3 class="fn"><a name="clear" />QStringRef.clear (<i>self</i>)</h3><p>Clears the contents of the string reference by making it null
and empty.</p>
<p><b>See also</b> <a href="qstringref.html#isEmpty">isEmpty</a>()
and <a href="qstringref.html#isNull">isNull</a>().</p>


<h3 class="fn"><a name="compare" />int QStringRef.compare (<i>self</i>, QString&#160;<i>other</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Compares the string <i>s1</i> with the string <i>s2</i> and
returns an integer less than, equal to, or greater than zero if
<i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="compare-2" />int QStringRef.compare (<i>self</i>, QStringRef&#160;<i>other</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and
returns an integer less than, equal to, or greater than zero if
<i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="compare-3" />int QStringRef.compare (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>other</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This is an overloaded function.</p>
<p>Compares the string <i>s1</i> with the string <i>s2</i> and
returns an integer less than, equal to, or greater than zero if
<i>s1</i> is less than, equal to, or greater than <i>s2</i>.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="compare-4" />int QStringRef.compare (QStringRef&#160;<i>s1</i>, QString&#160;<i>s2</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an
integer less than, equal to, or greater than zero if this string is
less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qstring.html#compare">QString.compare</a>().</p>


<h3 class="fn"><a name="compare-5" />int QStringRef.compare (QStringRef&#160;<i>s1</i>, QStringRef&#160;<i>s2</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an
integer less than, equal to, or greater than zero if this string is
less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qstring.html#compare">QString.compare</a>().</p>


<h3 class="fn"><a name="compare-6" />int QStringRef.compare (QStringRef&#160;<i>s1</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>s2</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an
integer less than, equal to, or greater than zero if this string is
less than, equal to, or greater than the <i>other</i> string.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a>, the
comparison is case sensitive; otherwise the comparison is case
insensitive.</p>
<p>Equivalent to <tt>compare(*this, other, cs)</tt>.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qstring.html#compare">QString.compare</a>().</p>


<h3 class="fn"><a name="constData" />QChar QStringRef.constData (<i>self</i>)</h3><p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>


<h3 class="fn"><a name="contains" />bool QStringRef.contains (<i>self</i>, QString&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns true if this string reference contains an occurrence of
the string <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#indexOf">indexOf</a>()
and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="contains-2" />bool QStringRef.contains (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string contains an occurrence of the
character <i>ch</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>


<h3 class="fn"><a name="contains-3" />bool QStringRef.contains (<i>self</i>, QStringRef&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#contains">contains</a>().</p>
<p>Returns true if this string reference contains an occurrence of
the string reference <i>str</i>; otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#indexOf">indexOf</a>()
and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="count" />int QStringRef.count (<i>self</i>)</h3><p>Returns the number of characters referred to by the string
reference. Equivalent to <a href="qstringref.html#size">size</a>()
and <a href="qstringref.html#length">length</a>().</p>
<p><b>See also</b> <a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="count-2" />int QStringRef.count (<i>self</i>, QString&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns the number of (potentially overlapping) occurrences of
the string <i>str</i> in this string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#count">QString.count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>


<h3 class="fn"><a name="count-3" />int QStringRef.count (<i>self</i>, QStringRef&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#count">count</a>().</p>
<p>Returns the number of occurrences of the character <i>ch</i> in
the string reference.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#count">QString.count</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#indexOf">indexOf</a>().</p>


<h3 class="fn"><a name="data" />QChar QStringRef.data (<i>self</i>)</h3><p>Same as <a href="qstringref.html#unicode">unicode</a>().</p>


<h3 class="fn"><a name="endsWith" />bool QStringRef.endsWith (<i>self</i>, QString&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns true if the string reference ends with <i>str</i>;
otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#endsWith">QString.endsWith</a>() and <a href="qstringref.html#startsWith">startsWith</a>().</p>


<h3 class="fn"><a name="endsWith-2" />bool QStringRef.endsWith (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>Returns true if the string reference ends with <i>ch</i>;
otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#endsWith">QString.endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>


<h3 class="fn"><a name="endsWith-3" />bool QStringRef.endsWith (<i>self</i>, QStringRef&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#endsWith">endsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#endsWith">QString.endsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>


<h3 class="fn"><a name="indexOf" />int QStringRef.indexOf (<i>self</i>, QString&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns the index position of the first occurrence of the string
<i>str</i> in this string reference, searching forward from index
position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character;
if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#indexOf">QString.indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="indexOf-2" />int QStringRef.indexOf (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns the index position of the first occurrence of the string
<i>str</i> in this string reference, searching forward from index
position <i>from</i>. Returns -1 if <i>str</i> is not found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>If <i>from</i> is -1, the search starts at the last character;
if it is -2, at the next to last character and so on.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#indexOf">QString.indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="indexOf-3" />int QStringRef.indexOf (<i>self</i>, QStringRef&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;0, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#indexOf">indexOf</a>().</p>
<p>Returns the index position of the first occurrence of the
character <i>ch</i> in the string reference, searching forward from
index position <i>from</i>. Returns -1 if <i>ch</i> could not be
found.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#indexOf">QString.indexOf</a>(), <a href="qstringref.html#lastIndexOf">lastIndexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="isEmpty" />bool QStringRef.isEmpty (<i>self</i>)</h3><p>Returns true if the string reference has no characters;
otherwise returns false.</p>
<p>A string reference is empty if its size is zero.</p>
<p><b>See also</b> <a href="qstringref.html#size">size</a>().</p>


<h3 class="fn"><a name="isNull" />bool QStringRef.isNull (<i>self</i>)</h3><p>Returns true if <a href="qstringref.html#string">string</a>()
returns a null pointer or a pointer to a null string; otherwise
returns true.</p>
<p><b>See also</b> <a href="qstringref.html#size">size</a>().</p>


<h3 class="fn"><a name="lastIndexOf" />int QStringRef.lastIndexOf (<i>self</i>, QString&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns the index position of the last occurrence of the string
<i>str</i> in this string reference, searching backward from index
position <i>from</i>. If <i>from</i> is -1 (default), the search
starts at the last character; if <i>from</i> is -2, at the next to
last character and so on. Returns -1 if <i>str</i> is not
found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#lastIndexOf">QString.lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="lastIndexOf-2" />int QStringRef.lastIndexOf (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the
character <i>ch</i>, searching backward from position
<i>from</i>.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#lastIndexOf">QString.lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="lastIndexOf-3" />int QStringRef.lastIndexOf (<i>self</i>, QStringRef&#160;<i>str</i>, int&#160;<i>from</i>&#160;=&#160;-1, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#lastIndexOf">lastIndexOf</a>().</p>
<p>Returns the index position of the last occurrence of the string
<i>str</i> in this string reference, searching backward from index
position <i>from</i>. If <i>from</i> is -1 (default), the search
starts at the last character; if <i>from</i> is -2, at the next to
last character and so on. Returns -1 if <i>str</i> is not
found.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#lastIndexOf">QString.lastIndexOf</a>(), <a href="qstringref.html#indexOf">indexOf</a>(), <a href="qstringref.html#contains">contains</a>(), and <a href="qstringref.html#count">count</a>().</p>


<h3 class="fn"><a name="length" />int QStringRef.length (<i>self</i>)</h3><p>Returns the number of characters referred to by the string
reference. Equivalent to <a href="qstringref.html#size">size</a>()
and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also</b> <a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="localeAwareCompare" />int QStringRef.localeAwareCompare (<i>self</i>, QString&#160;<i>s</i>)</h3><p>Compares <i>s1</i> with <i>s2</i> and returns an integer less
than, equal to, or greater than zero if <i>s1</i> is less than,
equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also
platform-dependent manner. Use this function to present sorted
lists of strings to the user.</p>
<p>On Mac OS X, this function compares according the "Order for
sorted lists" setting in the International prefereces panel.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <a href="qstringref.html#compare">compare</a>()
and <a class="compat" href="qtextcodec-qt3.html#locale">QTextCodec.locale</a>().</p>


<h3 class="fn"><a name="localeAwareCompare-2" />int QStringRef.localeAwareCompare (<i>self</i>, QStringRef&#160;<i>s</i>)</h3><p>This is an overloaded function.</p>
<p>Compares <i>s1</i> with <i>s2</i> and returns an integer less
than, equal to, or greater than zero if <i>s1</i> is less than,
equal to, or greater than <i>s2</i>.</p>
<p>The comparison is performed in a locale- and also
platform-dependent manner. Use this function to present sorted
lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="localeAwareCompare-3" />int QStringRef.localeAwareCompare (QStringRef&#160;<i>s1</i>, QString&#160;<i>s2</i>)</h3><p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an
integer less than, equal to, or greater than zero if this string is
less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also
platform-dependent manner. Use this function to present sorted
lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="localeAwareCompare-4" />int QStringRef.localeAwareCompare (QStringRef&#160;<i>s1</i>, QStringRef&#160;<i>s2</i>)</h3><p>This is an overloaded function.</p>
<p>Compares this string with the <i>other</i> string and returns an
integer less than, equal to, or greater than zero if this string is
less than, equal to, or greater than the <i>other</i> string.</p>
<p>The comparison is performed in a locale- and also
platform-dependent manner. Use this function to present sorted
lists of strings to the user.</p>
<p>This function was introduced in Qt 4.5.</p>


<h3 class="fn"><a name="position" />int QStringRef.position (<i>self</i>)</h3><p>Returns the starting position in the referenced string that is
referred to by the string reference.</p>
<p><b>See also</b> <a href="qstringref.html#size">size</a>() and
<a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="size" />int QStringRef.size (<i>self</i>)</h3><p>Returns the number of characters referred to by the string
reference. Equivalent to <a href="qstringref.html#length">length</a>() and <a href="qstringref.html#count">count</a>().</p>
<p><b>See also</b> <a href="qstringref.html#position">position</a>() and <a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="startsWith" />bool QStringRef.startsWith (<i>self</i>, QString&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>Returns true if the string reference starts with <i>str</i>;
otherwise returns false.</p>
<p>If <i>cs</i> is <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitive</a> (default), the
search is case sensitive; otherwise the search is case
insensitive.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#startsWith">QString.startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>


<h3 class="fn"><a name="startsWith-2" />bool QStringRef.startsWith (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#startsWith">QString.startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>


<h3 class="fn"><a name="startsWith-3" />bool QStringRef.startsWith (<i>self</i>, QStringRef&#160;<i>str</i>, <a href="qt.html#CaseSensitivity-enum">Qt.CaseSensitivity</a>&#160;<i>cs</i>&#160;=&#160;Qt.CaseSensitive)</h3><p>This function overloads <a href="qstringref.html#startsWith">startsWith</a>().</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstring.html#startsWith">QString.startsWith</a>() and <a href="qstringref.html#endsWith">endsWith</a>().</p>


<h3 class="fn"><a name="string" />QString QStringRef.string (<i>self</i>)</h3><p>Returns a pointer to the string referred to by the string
reference, or 0 if it does not reference a string.</p>
<p><b>See also</b> <a href="qstringref.html#unicode">unicode</a>().</p>


<h3 class="fn"><a name="toAscii" /><a href="qbytearray.html">QByteArray</a> QStringRef.toAscii (<i>self</i>)</h3><p>Returns an 8-bit representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>If a codec has been set using <a href="qtextcodec.html#setCodecForCStrings">QTextCodec.setCodecForCStrings</a>(),
it is used to convert Unicode to 8-bit char; otherwise this
function does the same as <a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>Note that, despite the name, this function does not necessarily
return an US-ASCII (ANSI X3.4-1986) string and its result may not
be US-ASCII compatible.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>


<h3 class="fn"><a name="toLatin1" /><a href="qbytearray.html">QByteArray</a> QStringRef.toLatin1 (<i>self</i>)</h3><p>Returns a Latin-1 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>The returned byte array is undefined if the string contains
non-Latin1 characters. Those characters may be suppressed or
replaced with a question mark.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#toAscii">toAscii</a>(),
<a href="qstringref.html#toUtf8">toUtf8</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>


<h3 class="fn"><a name="toLocal8Bit" /><a href="qbytearray.html">QByteArray</a> QStringRef.toLocal8Bit (<i>self</i>)</h3><p>Returns the local 8-bit representation of the string as a
<a href="qbytearray.html">QByteArray</a>. The returned byte array
is undefined if the string contains characters not supported by the
local 8-bit encoding.</p>
<p><a href="qtextcodec.html#codecForLocale">QTextCodec.codecForLocale</a>()
is used to perform the conversion from Unicode. If the locale
encoding could not be determined, this function does the same as
<a href="qstringref.html#toLatin1">toLatin1</a>().</p>
<p>If this string contains any characters that cannot be encoded in
the locale, the returned byte array is undefined. Those characters
may be suppressed or replaced by another.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#toAscii">toAscii</a>(),
<a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toUtf8">toUtf8</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>


<h3 class="fn"><a name="toString" />QString QStringRef.toString (<i>self</i>)</h3><p>Returns a copy of the string reference as a <a href="qstring.html">QString</a> object.</p>
<p>If the string reference is not a complete reference of the
string (meaning that <a href="qstringref.html#position">position</a>() is 0 and <a href="qstringref.html#size">size</a>() equals <a href="qstringref.html#string">string</a>()-&gt;<a href="qstringref.html#size">size</a>()), this function will allocate a
new string to return.</p>
<p><b>See also</b> <a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="toUcs4" />unknown-type QStringRef.toUcs4 (<i>self</i>)</h3><p>Returns a UCS-4/UTF-32 representation of the string as a
<a href="qvector.html">QVector</a>&lt;uint&gt;.</p>
<p>UCS-4 is a Unicode codec and is lossless. All characters from
this string can be encoded in UCS-4.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#toAscii">toAscii</a>(),
<a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>


<h3 class="fn"><a name="toUtf8" /><a href="qbytearray.html">QByteArray</a> QStringRef.toUtf8 (<i>self</i>)</h3><p>Returns a UTF-8 representation of the string as a <a href="qbytearray.html">QByteArray</a>.</p>
<p>UTF-8 is a Unicode codec and can represent all characters in a
Unicode string like <a href="qstring.html">QString</a>.</p>
<p>However, in the Unicode range, there are certain codepoints that
are not considered characters. The Unicode standard reserves the
last two codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE,
U+1FFFF, U+2FFFE, etc.), as well as 16 codepoints in the range
U+FDD0..U+FDDF, inclusive, as non-characters. If any of those
appear in the string, they may be discarded and will not appear in
the UTF-8 representation, or they may be replaced by one or more
replacement characters.</p>
<p>This function was introduced in Qt 4.8.</p>
<p><b>See also</b> <a href="qstringref.html#toAscii">toAscii</a>(),
<a href="qstringref.html#toLatin1">toLatin1</a>(), <a href="qstringref.html#toLocal8Bit">toLocal8Bit</a>(), and <a href="qtextcodec.html">QTextCodec</a>.</p>


<h3 class="fn"><a name="unicode" />QChar QStringRef.unicode (<i>self</i>)</h3><p>Returns a Unicode representation of the string reference. Since
the data stems directly from the referenced string, it is not
null-terminated unless the string reference includes the string's
null terminator.</p>
<p><b>See also</b> <a href="qstringref.html#string">string</a>().</p>


<h3 class="fn"><a name="__eq__" />bool QStringRef.__eq__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__eq__-2" />bool QStringRef.__eq__ (<i>self</i>, QString&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__eq__-3" />bool QStringRef.__eq__ (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__ge__" />bool QStringRef.__ge__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__gt__" />bool QStringRef.__gt__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__le__" />bool QStringRef.__le__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__len__" />int QStringRef.__len__ (<i>self</i>)</h3><h3 class="fn"><a name="__lt__" />bool QStringRef.__lt__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__ne__" />bool QStringRef.__ne__ (<i>self</i>, QStringRef&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__ne__-2" />bool QStringRef.__ne__ (<i>self</i>, QString&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__ne__-3" />bool QStringRef.__ne__ (<i>self</i>, <a href="qlatin1string.html">QLatin1String</a>&#160;<i>s2</i>)</h3><h3 class="fn"><a name="__str__" />object QStringRef.__str__ (<i>self</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.12.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qt.io">The Qt Company</a> 2015</td><td align="right" width="25%">Qt&#160;4.8.7</td></tr></table></div></address></body></html>