Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 957

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qvarlengtharray.qdoc -->
  <title>QVarLengthArray Class | Qt Core 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QVarLengthArray</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<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>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QVarLengthArray Class</h1>
<!-- $$$QVarLengthArray-brief -->
<p>The <a href="qvarlengtharray.html">QVarLengthArray</a> class provides a low-level variable-length array. <a href="#details">More...</a></p>
<!-- @@@QVarLengthArray -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QVarLengthArray&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += core</td></tr></table></div><ul>
<li><a href="qvarlengtharray-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#const_iterator-typedef">const_iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#const_pointer-typedef">const_pointer</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#const_reference-typedef">const_reference</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#const_reverse_iterator-typedef">const_reverse_iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#difference_type-typedef">difference_type</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#iterator-typedef">iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#pointer-typedef">pointer</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#reference-typedef">reference</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#reverse_iterator-typedef">reverse_iterator</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#size_type-typedef">size_type</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> typedef </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#value_type-typedef">value_type</a></b></td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></b>(int <i>size</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#QVarLengthArray-1">QVarLengthArray</a></b>(const QVarLengthArray&lt;T, Prealloc&gt; &amp;<i>other</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#QVarLengthArray-2">QVarLengthArray</a></b>(std::initializer_list&lt;T&gt; <i>args</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#dtor.QVarLengthArray">~QVarLengthArray</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#append">append</a></b>(const T &amp;<i>t</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#append-1">append</a></b>(T &amp;&amp;<i>t</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#append-2">append</a></b>(const T *<i>buf</i>, int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#at">at</a></b>(int <i>i</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#back">back</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#back-1">back</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#begin">begin</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#begin-1">begin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#capacity">capacity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#cbegin">cbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#cend">cend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#constBegin">constBegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T *</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#constData">constData</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#constEnd">constEnd</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#contains">contains</a></b>(const T &amp;<i>value</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#count">count</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#crbegin">crbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#crend">crend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T *</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#data">data</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T *</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#data-1">data</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#empty">empty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#end">end</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#end-1">end</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#erase">erase</a></b>(QVarLengthArray::const_iterator <i>pos</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#erase-1">erase</a></b>(QVarLengthArray::const_iterator <i>begin</i>, QVarLengthArray::const_iterator <i>end</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#first">first</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#first-1">first</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#front">front</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#front-1">front</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#indexOf">indexOf</a></b>(const T &amp;<i>value</i>, int <i>from</i> = ...) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert">insert</a></b>(int <i>i</i>, T &amp;&amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert-1">insert</a></b>(int <i>i</i>, const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert-2">insert</a></b>(int <i>i</i>, int <i>count</i>, const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert-3">insert</a></b>(QVarLengthArray::const_iterator <i>before</i>, int <i>count</i>, const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert-4">insert</a></b>(QVarLengthArray::const_iterator <i>before</i>, T &amp;&amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#insert-5">insert</a></b>(QVarLengthArray::const_iterator <i>before</i>, const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#isEmpty">isEmpty</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#last">last</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#last-1">last</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#lastIndexOf">lastIndexOf</a></b>(const T &amp;<i>value</i>, int <i>from</i> = ...) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#length">length</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#pop_back">pop_back</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#prepend">prepend</a></b>(T &amp;&amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#prepend-1">prepend</a></b>(const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#push_back">push_back</a></b>(const T &amp;<i>t</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#push_back-1">push_back</a></b>(T &amp;&amp;<i>t</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#rbegin">rbegin</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#rbegin-1">rbegin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#remove">remove</a></b>(int <i>i</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#remove-1">remove</a></b>(int <i>i</i>, int <i>count</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#removeLast">removeLast</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#rend">rend</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray::const_reverse_iterator </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#rend-1">rend</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#replace">replace</a></b>(int <i>i</i>, const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#reserve">reserve</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#resize">resize</a></b>(int <i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#shrink_to_fit">shrink_to_fit</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#size">size</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#squeeze">squeeze</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#value">value</a></b>(int <i>i</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#value-1">value</a></b>(int <i>i</i>, const T &amp;<i>defaultValue</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-2b-eq">operator+=</a></b>(const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-2b-eq-1">operator+=</a></b>(T &amp;&amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-lt-lt">operator&lt;&lt;</a></b>(const T &amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-lt-lt-1">operator&lt;&lt;</a></b>(T &amp;&amp;<i>value</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-eq">operator=</a></b>(const QVarLengthArray&lt;T, Prealloc&gt; &amp;<i>other</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVarLengthArray&lt;T, Prealloc&gt; &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-eq-1">operator=</a></b>(std::initializer_list&lt;T&gt; <i>list</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-5b-5d">operator[]</a></b>(int <i>i</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const T &amp;</td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-5b-5d-1">operator[]</a></b>(int <i>i</i>) const</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-not-eq">operator!=</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>left</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>right</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-lt">operator&lt;</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>lhs</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>rhs</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-lt-eq">operator&lt;=</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>lhs</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>rhs</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-eq-eq">operator==</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>left</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>right</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-gt">operator&gt;</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>lhs</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>rhs</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvarlengtharray.html#operator-gt-eq">operator&gt;=</a></b>(const QVarLengthArray&lt;T, Prealloc1&gt; &amp;<i>lhs</i> = ..., const QVarLengthArray&lt;T, Prealloc2&gt; &amp;<i>rhs</i> = ...)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QVarLengthArray-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qvarlengtharray.html">QVarLengthArray</a> class provides a low-level variable-length array.</p>
<p>The C++ language doesn't support variable-length arrays on the stack. For example, the following code won't compile:</p>
<pre class="cpp">

  <span class="type">int</span> myfunc(<span class="type">int</span> n)
  {
      <span class="type">int</span> table<span class="operator">[</span>n <span class="operator">+</span> <span class="number">1</span><span class="operator">]</span>;  <span class="comment">// WRONG</span>
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
      <span class="keyword">return</span> table<span class="operator">[</span>n<span class="operator">]</span>;
  }

</pre>
<p>The alternative is to allocate the array on the heap (with <code>new</code>):</p>
<pre class="cpp">

  <span class="type">int</span> myfunc(<span class="type">int</span> n)
  {
      <span class="type">int</span> <span class="operator">*</span>table <span class="operator">=</span> <span class="keyword">new</span> <span class="type">int</span><span class="operator">[</span>n <span class="operator">+</span> <span class="number">1</span><span class="operator">]</span>;
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
      <span class="type">int</span> ret <span class="operator">=</span> table<span class="operator">[</span>n<span class="operator">]</span>;
      <span class="keyword">delete</span><span class="operator">[</span><span class="operator">]</span> table;
      <span class="keyword">return</span> ret;
  }

</pre>
<p>However, if myfunc() is called very frequently from the application's inner loop, heap allocation can be a major source of slowdown.</p>
<p><a href="qvarlengtharray.html">QVarLengthArray</a> is an attempt to work around this gap in the C++ language. It allocates a certain number of elements on the stack, and if you resize the array to a larger size, it automatically uses the heap instead. Stack allocation has the advantage that it is much faster than heap allocation.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type">int</span> myfunc(<span class="type">int</span> n)
  {
      <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">,</span> <span class="number">1024</span><span class="operator">&gt;</span> array(n <span class="operator">+</span> <span class="number">1</span>);
      <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
      <span class="keyword">return</span> array<span class="operator">[</span>n<span class="operator">]</span>;
  }

</pre>
<p>In the example above, <a href="qvarlengtharray.html">QVarLengthArray</a> will preallocate 1024 elements on the stack and use them unless <code>n + 1</code> is greater than 1024. If you omit the second template argument, <a href="qvarlengtharray.html">QVarLengthArray</a>'s default of 256 is used.</p>
<p><a href="qvarlengtharray.html">QVarLengthArray</a>'s value type must be an <a href="containers.html#assignable-data-type">assignable data type</a>. This covers most data types that are commonly used, but the compiler won't let you, for example, store a <a href="../qtwidgets/qwidget.html">QWidget</a> as a value; instead, store a <a href="../qtwidgets/qwidget.html">QWidget</a> *.</p>
<p><a href="qvarlengtharray.html">QVarLengthArray</a>, like <a href="qvector.html">QVector</a>, provides a resizable array data structure. The main differences between the two classes are:</p>
<ul>
<li><a href="qvarlengtharray.html">QVarLengthArray</a>'s API is much more low-level and it lacks some of <a href="qvector.html">QVector</a>'s functionality.</li>
<li><a href="qvarlengtharray.html">QVarLengthArray</a> doesn't initialize the memory if the value is a basic type. (<a href="qvector.html">QVector</a> always does.)</li>
<li><a href="qvector.html">QVector</a> uses <a href="implicit-sharing.html">implicit sharing</a> as a memory optimization. <a href="qvarlengtharray.html">QVarLengthArray</a> doesn't provide that feature; however, it usually produces slightly better performance due to reduced overhead, especially in tight loops.</li>
</ul>
<p>In summary, <a href="qvarlengtharray.html">QVarLengthArray</a> is a low-level optimization class that only makes sense in very specific cases. It is used a few places inside Qt and was added to Qt's public API for the convenience of advanced users.</p>
</div>
<p><b>See also </b><a href="qvector.html">QVector</a>, <a href="qlist.html">QList</a>, and <a href="qlinkedlist.html">QLinkedList</a>.</p>
<!-- @@@QVarLengthArray -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$const_iterator -->
<h3 class="fn" id="const_iterator-typedef"><a name="const_iterator-typedef"></a>typedef QVarLengthArray::<span class="name">const_iterator</span></h3>
<p>Typedef for const T *. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@const_iterator -->
<!-- $$$const_pointer -->
<h3 class="fn" id="const_pointer-typedef"><a name="const_pointer-typedef"></a>typedef QVarLengthArray::<span class="name">const_pointer</span></h3>
<p>Typedef for const T *. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@const_pointer -->
<!-- $$$const_reference -->
<h3 class="fn" id="const_reference-typedef"><a name="const_reference-typedef"></a>typedef QVarLengthArray::<span class="name">const_reference</span></h3>
<p>Typedef for const T &amp;. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@const_reference -->
<!-- $$$const_reverse_iterator -->
<h3 class="fn" id="const_reverse_iterator-typedef"><a name="const_reverse_iterator-typedef"></a>typedef QVarLengthArray::<span class="name">const_reverse_iterator</span></h3>
<p>Typedef for <code>std::reverse_iterator&lt;const T*&gt;</code>. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 5.6.</p>
<!-- @@@const_reverse_iterator -->
<!-- $$$difference_type -->
<h3 class="fn" id="difference_type-typedef"><a name="difference_type-typedef"></a>typedef QVarLengthArray::<span class="name">difference_type</span></h3>
<p>Typedef for ptrdiff_t. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@difference_type -->
<!-- $$$iterator -->
<h3 class="fn" id="iterator-typedef"><a name="iterator-typedef"></a>typedef QVarLengthArray::<span class="name">iterator</span></h3>
<p>Typedef for T *. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@iterator -->
<!-- $$$pointer -->
<h3 class="fn" id="pointer-typedef"><a name="pointer-typedef"></a>typedef QVarLengthArray::<span class="name">pointer</span></h3>
<p>Typedef for T *. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@pointer -->
<!-- $$$reference -->
<h3 class="fn" id="reference-typedef"><a name="reference-typedef"></a>typedef QVarLengthArray::<span class="name">reference</span></h3>
<p>Typedef for T &amp;. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@reference -->
<!-- $$$reverse_iterator -->
<h3 class="fn" id="reverse_iterator-typedef"><a name="reverse_iterator-typedef"></a>typedef QVarLengthArray::<span class="name">reverse_iterator</span></h3>
<p>Typedef for <code>std::reverse_iterator&lt;T*&gt;</code>. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 5.6.</p>
<!-- @@@reverse_iterator -->
<!-- $$$size_type -->
<h3 class="fn" id="size_type-typedef"><a name="size_type-typedef"></a>typedef QVarLengthArray::<span class="name">size_type</span></h3>
<p>Typedef for int. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@size_type -->
<!-- $$$value_type -->
<h3 class="fn" id="value_type-typedef"><a name="value_type-typedef"></a>typedef QVarLengthArray::<span class="name">value_type</span></h3>
<p>Typedef for T. Provided for STL compatibility.</p>
<p>This typedef was introduced in  Qt 4.7.</p>
<!-- @@@value_type -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$ -->
<div class="fngroup">
<h3 class="fn fngroupitem" id="insert-5"><a name="insert-5"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">insert</span>(<span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>before</i>, const <span class="type">T</span> &amp;<i>value</i>)</h3><h3 class="fn fngroupitem" id="insert-4"><a name="insert-4"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">insert</span>(<span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>before</i>, <span class="type">T</span> &amp;&amp;<i>value</i>)</h3></div>
<p>This is an overloaded function.</p>
<p>Inserts <i>value</i> in front of the item pointed to by the iterator <i>before</i>. Returns an iterator pointing at the inserted item.</p>
<p>This documentation was introduced in  Qt 4.8.</p>
<!-- @@@ -->
<!-- $$$ -->
<div class="fngroup">
<h3 class="fn fngroupitem" id="insert-1"><a name="insert-1"></a><span class="type">void</span> QVarLengthArray::<span class="name">insert</span>(<span class="type">int</span> <i>i</i>, const <span class="type">T</span> &amp;<i>value</i>)</h3><h3 class="fn fngroupitem" id="insert"><a name="insert"></a><span class="type">void</span> QVarLengthArray::<span class="name">insert</span>(<span class="type">int</span> <i>i</i>, <span class="type">T</span> &amp;&amp;<i>value</i>)</h3></div>
<p>Inserts <i>value</i> at index position <i>i</i> in the array. If <i>i</i> is 0, the value is prepended to the vector. If <i>i</i> is <a href="qvarlengtharray.html#size">size</a>(), the value is appended to the vector.</p>
<p>For large arrays, this operation can be slow (<a href="containers.html#linear-time">linear time</a>), because it requires moving all the items at indexes <i>i</i> and above by one position further in memory. If you want a container class that provides a fast <a href="qvarlengtharray.html#insert">insert</a>() function, use <a href="qlinkedlist.html">QLinkedList</a> instead.</p>
<p>This documentation was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#remove">remove</a>().</p>
<!-- @@@ -->
<!-- $$$ -->
<div class="fngroup">
<h3 class="fn fngroupitem" id="prepend-1"><a name="prepend-1"></a><span class="type">void</span> QVarLengthArray::<span class="name">prepend</span>(const <span class="type">T</span> &amp;<i>value</i>)</h3><h3 class="fn fngroupitem" id="prepend"><a name="prepend"></a><span class="type">void</span> QVarLengthArray::<span class="name">prepend</span>(<span class="type">T</span> &amp;&amp;<i>value</i>)</h3></div>
<p>Inserts <i>value</i> at the beginning of the array.</p>
<p>This is the same as vector.insert(0, <i>value</i>).</p>
<p>For large arrays, this operation can be slow (<a href="containers.html#linear-time">linear time</a>), because it requires moving all the items in the vector by one position further in memory. If you want a container class that provides a fast <a href="qvarlengtharray.html#prepend">prepend</a>() function, use <a href="qlist.html">QList</a> or <a href="qlinkedlist.html">QLinkedList</a> instead.</p>
<p>This documentation was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>() and <a href="qvarlengtharray.html#insert">insert</a>().</p>
<!-- @@@ -->
<!-- $$$QVarLengthArray[overload1]$$$QVarLengthArrayint -->
<h3 class="fn" id="QVarLengthArray"><a name="QVarLengthArray"></a>QVarLengthArray::<span class="name">QVarLengthArray</span>(<span class="type">int</span> <i>size</i> = 0)</h3>
<p>Constructs an array with an initial size of <i>size</i> elements.</p>
<p>If the value type is a primitive type (e.g&#x2e;, char, int, float) or a pointer type (e.g&#x2e;, <a href="../qtwidgets/qwidget.html">QWidget</a> *), the elements are not initialized. For other types, the elements are initialized with a <a href="containers.html#default-constructed-value">default-constructed value</a>.</p>
<!-- @@@QVarLengthArray -->
<!-- $$$QVarLengthArray$$$QVarLengthArrayconstQVarLengthArray<T,Prealloc>& -->
<h3 class="fn" id="QVarLengthArray-1"><a name="QVarLengthArray-1"></a>QVarLengthArray::<span class="name">QVarLengthArray</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;<i>other</i> = ...)</h3>
<p>Constructs a copy of <i>other</i>.</p>
<!-- @@@QVarLengthArray -->
<!-- $$$QVarLengthArray$$$QVarLengthArraystd::initializer_list<T> -->
<h3 class="fn" id="QVarLengthArray-2"><a name="QVarLengthArray-2"></a>QVarLengthArray::<span class="name">QVarLengthArray</span>(<span class="type">std::initializer_list</span>&lt;<span class="type">T</span>&gt; <i>args</i>)</h3>
<p>Constructs an array from the std::initializer_list given by <i>args</i>.</p>
<p>This constructor is only enabled if the compiler supports C++11 initializer lists.</p>
<p>This function was introduced in  Qt 5.5.</p>
<!-- @@@QVarLengthArray -->
<!-- $$$~QVarLengthArray[overload1]$$$~QVarLengthArray -->
<h3 class="fn" id="dtor.QVarLengthArray"><a name="dtor.QVarLengthArray"></a>QVarLengthArray::<span class="name">~QVarLengthArray</span>()</h3>
<p>Destroys the array.</p>
<!-- @@@~QVarLengthArray -->
<!-- $$$append[overload1]$$$appendconstT& -->
<h3 class="fn" id="append"><a name="append"></a><span class="type">void</span> QVarLengthArray::<span class="name">append</span>(const <span class="type">T</span> &amp;<i>t</i>)</h3>
<p>Appends item <i>t</i> to the array, extending the array if necessary.</p>
<p><b>See also </b><a href="qvarlengtharray.html#removeLast">removeLast</a>().</p>
<!-- @@@append -->
<!-- $$$append$$$appendT&& -->
<h3 class="fn" id="append-1"><a name="append-1"></a><span class="type">void</span> QVarLengthArray::<span class="name">append</span>(<span class="type">T</span> &amp;&amp;<i>t</i>)</h3>
<p>This function overloads <a href="qvarlengtharray.html#append">append</a>.</p>
<p><b>Note: </b>Unlike the lvalue overload of <a href="qvarlengtharray.html#append">append</a>(), passing a reference to an object that is already an element of <code>*this</code> leads to undefined behavior:</p><pre class="cpp">

  vla<span class="operator">.</span>append(std<span class="operator">::</span>move(vla<span class="operator">[</span><span class="number">0</span><span class="operator">]</span>)); <span class="comment">// BUG: passing an object that is already in the container</span>

</pre>
<p>This function was introduced in  Qt 5.9.</p>
<!-- @@@append -->
<!-- $$$append$$$appendconstT*int -->
<h3 class="fn" id="append-2"><a name="append-2"></a><span class="type">void</span> QVarLengthArray::<span class="name">append</span>(const <span class="type">T</span> *<i>buf</i>, <span class="type">int</span> <i>size</i>)</h3>
<p>Appends <i>size</i> amount of items referenced by <i>buf</i> to this array.</p>
<!-- @@@append -->
<!-- $$$at[overload1]$$$atint -->
<h3 class="fn" id="at"><a name="at"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">at</span>(<span class="type">int</span> <i>i</i>) const</h3>
<p>Returns a reference to the item at index position <i>i</i>.</p>
<p><i>i</i> must be a valid index position in the array (i.e&#x2e;, 0 &lt;= <i>i</i> &lt; <a href="qvarlengtharray.html#size">size</a>()).</p>
<p><b>See also </b><a href="qvarlengtharray.html#value">value</a>() and <a href="qvarlengtharray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@at -->
<!-- $$$back[overload1]$$$back -->
<h3 class="fn" id="back"><a name="back"></a><span class="type">T</span> &amp;QVarLengthArray::<span class="name">back</span>()</h3>
<p>Same as <a href="qvarlengtharray.html#last">last</a>(). Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@back -->
<!-- $$$back$$$back -->
<h3 class="fn" id="back-1"><a name="back-1"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">back</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@back -->
<!-- $$$begin[overload1]$$$begin -->
<h3 class="fn" id="begin"><a name="begin"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">begin</span>()</h3>
<p>Returns an <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the first item in the array.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#constBegin">constBegin</a>() and <a href="qvarlengtharray.html#end">end</a>().</p>
<!-- @@@begin -->
<!-- $$$begin$$$begin -->
<h3 class="fn" id="begin-1"><a name="begin-1"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">begin</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@begin -->
<!-- $$$capacity[overload1]$$$capacity -->
<h3 class="fn" id="capacity"><a name="capacity"></a><span class="type">int</span> QVarLengthArray::<span class="name">capacity</span>() const</h3>
<p>Returns the maximum number of elements that can be stored in the array without forcing a reallocation.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qvarlengtharray.html">QVarLengthArray</a>'s memory usage. In general, you will rarely ever need to call this function. If you want to know how many items are in the array, call <a href="qvarlengtharray.html#size">size</a>().</p>
<p><b>See also </b><a href="qvarlengtharray.html#reserve">reserve</a>() and <a href="qvarlengtharray.html#squeeze">squeeze</a>().</p>
<!-- @@@capacity -->
<!-- $$$cbegin[overload1]$$$cbegin -->
<h3 class="fn" id="cbegin"><a name="cbegin"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">cbegin</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the first item in the array.</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>See also </b><a href="qvarlengtharray.html#begin">begin</a>() and <a href="qvarlengtharray.html#cend">cend</a>().</p>
<!-- @@@cbegin -->
<!-- $$$cend[overload1]$$$cend -->
<h3 class="fn" id="cend"><a name="cend"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">cend</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the imaginary item after the last item in the array.</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>See also </b><a href="qvarlengtharray.html#cbegin">cbegin</a>() and <a href="qvarlengtharray.html#end">end</a>().</p>
<!-- @@@cend -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QVarLengthArray::<span class="name">clear</span>()</h3>
<p>Removes all the elements from the array.</p>
<p>Same as resize(0).</p>
<!-- @@@clear -->
<!-- $$$constBegin[overload1]$$$constBegin -->
<h3 class="fn" id="constBegin"><a name="constBegin"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">constBegin</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the first item in the array.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#begin">begin</a>() and <a href="qvarlengtharray.html#constEnd">constEnd</a>().</p>
<!-- @@@constBegin -->
<!-- $$$constData[overload1]$$$constData -->
<h3 class="fn" id="constData"><a name="constData"></a>const <span class="type">T</span> *QVarLengthArray::<span class="name">constData</span>() const</h3>
<p>Returns a const pointer to the data stored in the array. The pointer can be used to access the items in the array. The pointer remains valid as long as the array isn't reallocated.</p>
<p>This function is mostly useful to pass an array to a function that accepts a plain C++ array.</p>
<p><b>See also </b><a href="qvarlengtharray.html#data">data</a>() and <a href="qvarlengtharray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@constData -->
<!-- $$$constEnd[overload1]$$$constEnd -->
<h3 class="fn" id="constEnd"><a name="constEnd"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">constEnd</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the imaginary item after the last item in the array.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#constBegin">constBegin</a>() and <a href="qvarlengtharray.html#end">end</a>().</p>
<!-- @@@constEnd -->
<!-- $$$contains[overload1]$$$containsconstT& -->
<h3 class="fn" id="contains"><a name="contains"></a><span class="type">bool</span> QVarLengthArray::<span class="name">contains</span>(const <span class="type">T</span> &amp;<i>value</i>) const</h3>
<p>Returns <code>true</code> if the array contains an occurrence of <i>value</i>; otherwise returns <code>false</code>.</p>
<p>This function requires the value type to have an implementation of <code>operator==()</code>.</p>
<p>This function was introduced in  Qt 5.3.</p>
<p><b>See also </b><a href="qvarlengtharray.html#indexOf">indexOf</a>() and <a href="qvarlengtharray.html#lastIndexOf">lastIndexOf</a>().</p>
<!-- @@@contains -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn" id="count"><a name="count"></a><span class="type">int</span> QVarLengthArray::<span class="name">count</span>() const</h3>
<p>Same as <a href="qvarlengtharray.html#size">size</a>().</p>
<p><b>See also </b><a href="qvarlengtharray.html#isEmpty">isEmpty</a>() and <a href="qvarlengtharray.html#resize">resize</a>().</p>
<!-- @@@count -->
<!-- $$$crbegin[overload1]$$$crbegin -->
<h3 class="fn" id="crbegin"><a name="crbegin"></a><span class="type"><a href="qvarlengtharray.html#const_reverse_iterator-typedef">QVarLengthArray::const_reverse_iterator</a></span> QVarLengthArray::<span class="name">crbegin</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style</a> reverse iterator pointing to the first item in the variable length array, in reverse order.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qvarlengtharray.html#begin">begin</a>(), <a href="qvarlengtharray.html#rbegin">rbegin</a>(), and <a href="qvarlengtharray.html#rend">rend</a>().</p>
<!-- @@@crbegin -->
<!-- $$$crend[overload1]$$$crend -->
<h3 class="fn" id="crend"><a name="crend"></a><span class="type"><a href="qvarlengtharray.html#const_reverse_iterator-typedef">QVarLengthArray::const_reverse_iterator</a></span> QVarLengthArray::<span class="name">crend</span>() const</h3>
<p>Returns a const <a href="containers.html#stl-style-iterators">STL-style</a> reverse iterator pointing to one past the last item in the variable length array, in reverse order.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qvarlengtharray.html#end">end</a>(), <a href="qvarlengtharray.html#rend">rend</a>(), and <a href="qvarlengtharray.html#rbegin">rbegin</a>().</p>
<!-- @@@crend -->
<!-- $$$data[overload1]$$$data -->
<h3 class="fn" id="data"><a name="data"></a><span class="type">T</span> *QVarLengthArray::<span class="name">data</span>()</h3>
<p>Returns a pointer to the data stored in the array. The pointer can be used to access and modify the items in the array.</p>
<p>Example:</p>
<pre class="cpp">

  <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span><span class="operator">&lt;</span><span class="type">int</span><span class="operator">&gt;</span> array(<span class="number">10</span>);
  <span class="type">int</span> <span class="operator">*</span>data <span class="operator">=</span> array<span class="operator">.</span>data();
  <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> <span class="number">10</span>; <span class="operator">+</span><span class="operator">+</span>i)
      data<span class="operator">[</span>i<span class="operator">]</span> <span class="operator">=</span> <span class="number">2</span> <span class="operator">*</span> i;

</pre>
<p>The pointer remains valid as long as the array isn't reallocated.</p>
<p>This function is mostly useful to pass an array to a function that accepts a plain C++ array.</p>
<p><b>See also </b><a href="qvarlengtharray.html#constData">constData</a>() and <a href="qvarlengtharray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@data -->
<!-- $$$data$$$data -->
<h3 class="fn" id="data-1"><a name="data-1"></a>const <span class="type">T</span> *QVarLengthArray::<span class="name">data</span>() const</h3>
<p>This is an overloaded function.</p>
<!-- @@@data -->
<!-- $$$empty[overload1]$$$empty -->
<h3 class="fn" id="empty"><a name="empty"></a><span class="type">bool</span> QVarLengthArray::<span class="name">empty</span>() const</h3>
<p>Returns <code>true</code> if the array has size 0; otherwise returns <code>false</code>.</p>
<p>Same as <a href="qvarlengtharray.html#isEmpty">isEmpty</a>(). Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@empty -->
<!-- $$$end[overload1]$$$end -->
<h3 class="fn" id="end"><a name="end"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">end</span>()</h3>
<p>Returns an <a href="containers.html#stl-style-iterators">STL-style iterator</a> pointing to the imaginary item after the last item in the array.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#begin">begin</a>() and <a href="qvarlengtharray.html#constEnd">constEnd</a>().</p>
<!-- @@@end -->
<!-- $$$end$$$end -->
<h3 class="fn" id="end-1"><a name="end-1"></a><span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> QVarLengthArray::<span class="name">end</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@end -->
<!-- $$$erase[overload1]$$$eraseQVarLengthArray::const_iterator -->
<h3 class="fn" id="erase"><a name="erase"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">erase</span>(<span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>pos</i>)</h3>
<p>Removes the item pointed to by the iterator <i>pos</i> from the vector, and returns an iterator to the next item in the vector (which may be <a href="qvarlengtharray.html#end">end</a>()).</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#insert">insert</a>() and <a href="qvarlengtharray.html#remove">remove</a>().</p>
<!-- @@@erase -->
<!-- $$$erase$$$eraseQVarLengthArray::const_iteratorQVarLengthArray::const_iterator -->
<h3 class="fn" id="erase-1"><a name="erase-1"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">erase</span>(<span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>begin</i>, <span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>end</i>)</h3>
<p>This is an overloaded function.</p>
<p>Removes all the items from <i>begin</i> up to (but not including) <i>end</i>. Returns an iterator to the same item that <i>end</i> referred to before the call.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@erase -->
<!-- $$$first[overload1]$$$first -->
<h3 class="fn" id="first"><a name="first"></a><span class="type">T</span> &amp;QVarLengthArray::<span class="name">first</span>()</h3>
<p>Returns a reference to the first item in the array. The array must not be empty. If the array can be empty, check <a href="qvarlengtharray.html#isEmpty">isEmpty</a>() before calling this function.</p>
<p><b>See also </b><a href="qvarlengtharray.html#last">last</a>() and <a href="qvarlengtharray.html#isEmpty">isEmpty</a>().</p>
<!-- @@@first -->
<!-- $$$first$$$first -->
<h3 class="fn" id="first-1"><a name="first-1"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">first</span>() const</h3>
<p>This is an overloaded function.</p>
<!-- @@@first -->
<!-- $$$front[overload1]$$$front -->
<h3 class="fn" id="front"><a name="front"></a><span class="type">T</span> &amp;QVarLengthArray::<span class="name">front</span>()</h3>
<p>Same as <a href="qvarlengtharray.html#first">first</a>(). Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@front -->
<!-- $$$front$$$front -->
<h3 class="fn" id="front-1"><a name="front-1"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">front</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@front -->
<!-- $$$indexOf[overload1]$$$indexOfconstT&int -->
<h3 class="fn" id="indexOf"><a name="indexOf"></a><span class="type">int</span> QVarLengthArray::<span class="name">indexOf</span>(const <span class="type">T</span> &amp;<i>value</i>, <span class="type">int</span> <i>from</i> = ...) const</h3>
<p>Returns the index position of the first occurrence of <i>value</i> in the array, searching forward from index position <i>from</i>. Returns -1 if no item matched.</p>
<p>This function requires the value type to have an implementation of <code>operator==()</code>.</p>
<p>This function was introduced in  Qt 5.3.</p>
<p><b>See also </b><a href="qvarlengtharray.html#lastIndexOf">lastIndexOf</a>() and <a href="qvarlengtharray.html#contains">contains</a>().</p>
<!-- @@@indexOf -->
<!-- $$$insert$$$insertintintconstT& -->
<h3 class="fn" id="insert-2"><a name="insert-2"></a><span class="type">void</span> QVarLengthArray::<span class="name">insert</span>(<span class="type">int</span> <i>i</i>, <span class="type">int</span> <i>count</i>, const <span class="type">T</span> &amp;<i>value</i>)</h3>
<p>This is an overloaded function.</p>
<p>Inserts <i>count</i> copies of <i>value</i> at index position <i>i</i> in the vector.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@insert -->
<!-- $$$insert$$$insertQVarLengthArray::const_iteratorintconstT& -->
<h3 class="fn" id="insert-3"><a name="insert-3"></a><span class="type"><a href="qvarlengtharray.html#iterator-typedef">QVarLengthArray::iterator</a></span> QVarLengthArray::<span class="name">insert</span>(<span class="type"><a href="qvarlengtharray.html#const_iterator-typedef">QVarLengthArray::const_iterator</a></span> <i>before</i>, <span class="type">int</span> <i>count</i>, const <span class="type">T</span> &amp;<i>value</i>)</h3>
<p>Inserts <i>count</i> copies of <i>value</i> in front of the item pointed to by the iterator <i>before</i>. Returns an iterator pointing at the first of the inserted items.</p>
<p>This function was introduced in  Qt 4.8.</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn" id="isEmpty"><a name="isEmpty"></a><span class="type">bool</span> QVarLengthArray::<span class="name">isEmpty</span>() const</h3>
<p>Returns <code>true</code> if the array has size 0; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="qvarlengtharray.html#size">size</a>() and <a href="qvarlengtharray.html#resize">resize</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$last[overload1]$$$last -->
<h3 class="fn" id="last"><a name="last"></a><span class="type">T</span> &amp;QVarLengthArray::<span class="name">last</span>()</h3>
<p>Returns a reference to the last item in the array. The array must not be empty. If the array can be empty, check <a href="qvarlengtharray.html#isEmpty">isEmpty</a>() before calling this function.</p>
<p><b>See also </b><a href="qvarlengtharray.html#first">first</a>() and <a href="qvarlengtharray.html#isEmpty">isEmpty</a>().</p>
<!-- @@@last -->
<!-- $$$last$$$last -->
<h3 class="fn" id="last-1"><a name="last-1"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">last</span>() const</h3>
<p>This is an overloaded function.</p>
<!-- @@@last -->
<!-- $$$lastIndexOf[overload1]$$$lastIndexOfconstT&int -->
<h3 class="fn" id="lastIndexOf"><a name="lastIndexOf"></a><span class="type">int</span> QVarLengthArray::<span class="name">lastIndexOf</span>(const <span class="type">T</span> &amp;<i>value</i>, <span class="type">int</span> <i>from</i> = ...) const</h3>
<p>Returns the index position of the last occurrence of the value <i>value</i> in the array, searching backward from index position <i>from</i>. If <i>from</i> is -1 (the default), the search starts at the last item. Returns -1 if no item matched.</p>
<p>This function requires the value type to have an implementation of <code>operator==()</code>.</p>
<p>This function was introduced in  Qt 5.3.</p>
<p><b>See also </b><a href="qvarlengtharray.html#indexOf">indexOf</a>() and <a href="qvarlengtharray.html#contains">contains</a>().</p>
<!-- @@@lastIndexOf -->
<!-- $$$length[overload1]$$$length -->
<h3 class="fn" id="length"><a name="length"></a><span class="type">int</span> QVarLengthArray::<span class="name">length</span>() const</h3>
<p>Same as <a href="qvarlengtharray.html#size">size</a>().</p>
<p>This function was introduced in  Qt 5.0.</p>
<p><b>See also </b><a href="qvarlengtharray.html#isEmpty">isEmpty</a>() and <a href="qvarlengtharray.html#resize">resize</a>().</p>
<!-- @@@length -->
<!-- $$$pop_back[overload1]$$$pop_back -->
<h3 class="fn" id="pop_back"><a name="pop_back"></a><span class="type">void</span> QVarLengthArray::<span class="name">pop_back</span>()</h3>
<p>Same as <a href="qvarlengtharray.html#removeLast">removeLast</a>(). Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@pop_back -->
<!-- $$$push_back[overload1]$$$push_backconstT& -->
<h3 class="fn" id="push_back"><a name="push_back"></a><span class="type">void</span> QVarLengthArray::<span class="name">push_back</span>(const <span class="type">T</span> &amp;<i>t</i>)</h3>
<p>Appends item <i>t</i> to the array, extending the array if necessary. Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@push_back -->
<!-- $$$push_back$$$push_backT&& -->
<h3 class="fn" id="push_back-1"><a name="push_back-1"></a><span class="type">void</span> QVarLengthArray::<span class="name">push_back</span>(<span class="type">T</span> &amp;&amp;<i>t</i>)</h3>
<p>This function overloads <a href="qvarlengtharray.html#push_back">push_back</a>.</p>
<p><b>Note: </b>Unlike the lvalue overload of <a href="qvarlengtharray.html#push_back">push_back</a>(), passing a reference to an object that is already an element of <code>*this</code> leads to undefined behavior:</p><pre class="cpp">

  vla<span class="operator">.</span>push_back(std<span class="operator">::</span>move(vla<span class="operator">[</span><span class="number">0</span><span class="operator">]</span>)); <span class="comment">// BUG: passing an object that is already in the container</span>

</pre>
<p>This function was introduced in  Qt 5.9.</p>
<!-- @@@push_back -->
<!-- $$$rbegin[overload1]$$$rbegin -->
<h3 class="fn" id="rbegin"><a name="rbegin"></a><span class="type"><a href="qvarlengtharray.html#reverse_iterator-typedef">QVarLengthArray::reverse_iterator</a></span> QVarLengthArray::<span class="name">rbegin</span>()</h3>
<p>Returns a <a href="containers.html#stl-style-iterators">STL-style</a> reverse iterator pointing to the first item in the variable length array, in reverse order.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qvarlengtharray.html#begin">begin</a>(), <a href="qvarlengtharray.html#crbegin">crbegin</a>(), and <a href="qvarlengtharray.html#rend">rend</a>().</p>
<!-- @@@rbegin -->
<!-- $$$rbegin$$$rbegin -->
<h3 class="fn" id="rbegin-1"><a name="rbegin-1"></a><span class="type"><a href="qvarlengtharray.html#const_reverse_iterator-typedef">QVarLengthArray::const_reverse_iterator</a></span> QVarLengthArray::<span class="name">rbegin</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@rbegin -->
<!-- $$$remove[overload1]$$$removeint -->
<h3 class="fn" id="remove"><a name="remove"></a><span class="type">void</span> QVarLengthArray::<span class="name">remove</span>(<span class="type">int</span> <i>i</i>)</h3>
<p>This is an overloaded function.</p>
<p>Removes the element at index position <i>i</i>.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#insert">insert</a>() and <a href="qvarlengtharray.html#replace">replace</a>().</p>
<!-- @@@remove -->
<!-- $$$remove$$$removeintint -->
<h3 class="fn" id="remove-1"><a name="remove-1"></a><span class="type">void</span> QVarLengthArray::<span class="name">remove</span>(<span class="type">int</span> <i>i</i>, <span class="type">int</span> <i>count</i>)</h3>
<p>This is an overloaded function.</p>
<p>Removes <i>count</i> elements from the middle of the array, starting at index position <i>i</i>.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#insert">insert</a>() and <a href="qvarlengtharray.html#replace">replace</a>().</p>
<!-- @@@remove -->
<!-- $$$removeLast[overload1]$$$removeLast -->
<h3 class="fn" id="removeLast"><a name="removeLast"></a><span class="type">void</span> QVarLengthArray::<span class="name">removeLast</span>()</h3>
<p>Decreases the size of the array by one. The allocated size is not changed.</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>().</p>
<!-- @@@removeLast -->
<!-- $$$rend[overload1]$$$rend -->
<h3 class="fn" id="rend"><a name="rend"></a><span class="type"><a href="qvarlengtharray.html#reverse_iterator-typedef">QVarLengthArray::reverse_iterator</a></span> QVarLengthArray::<span class="name">rend</span>()</h3>
<p>Returns a <a href="containers.html#stl-style-iterators">STL-style</a> reverse iterator pointing to one past the last item in the variable length array, in reverse order.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qvarlengtharray.html#end">end</a>(), <a href="qvarlengtharray.html#crend">crend</a>(), and <a href="qvarlengtharray.html#rbegin">rbegin</a>().</p>
<!-- @@@rend -->
<!-- $$$rend$$$rend -->
<h3 class="fn" id="rend-1"><a name="rend-1"></a><span class="type"><a href="qvarlengtharray.html#const_reverse_iterator-typedef">QVarLengthArray::const_reverse_iterator</a></span> QVarLengthArray::<span class="name">rend</span>() const</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@rend -->
<!-- $$$replace[overload1]$$$replaceintconstT& -->
<h3 class="fn" id="replace"><a name="replace"></a><span class="type">void</span> QVarLengthArray::<span class="name">replace</span>(<span class="type">int</span> <i>i</i>, const <span class="type">T</span> &amp;<i>value</i>)</h3>
<p>Replaces the item at index position <i>i</i> with <i>value</i>.</p>
<p><i>i</i> must be a valid index position in the array (i.e&#x2e;, 0 &lt;= <i>i</i> &lt; <a href="qvarlengtharray.html#size">size</a>()).</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#operator-5b-5d">operator[]</a>() and <a href="qvarlengtharray.html#remove">remove</a>().</p>
<!-- @@@replace -->
<!-- $$$reserve[overload1]$$$reserveint -->
<h3 class="fn" id="reserve"><a name="reserve"></a><span class="type">void</span> QVarLengthArray::<span class="name">reserve</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Attempts to allocate memory for at least <i>size</i> elements. If you know in advance how large the array can get, you can call this function and if you call <a href="qvarlengtharray.html#resize">resize</a>() often, you are likely to get better performance. If <i>size</i> is an underestimate, the worst that will happen is that the <a href="qvarlengtharray.html">QVarLengthArray</a> will be a bit slower.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qvarlengtharray.html">QVarLengthArray</a>'s memory usage. In general, you will rarely ever need to call this function. If you want to change the size of the array, call <a href="qvarlengtharray.html#resize">resize</a>().</p>
<p><b>See also </b><a href="qvarlengtharray.html#capacity">capacity</a>() and <a href="qvarlengtharray.html#squeeze">squeeze</a>().</p>
<!-- @@@reserve -->
<!-- $$$resize[overload1]$$$resizeint -->
<h3 class="fn" id="resize"><a name="resize"></a><span class="type">void</span> QVarLengthArray::<span class="name">resize</span>(<span class="type">int</span> <i>size</i>)</h3>
<p>Sets the size of the array to <i>size</i>. If <i>size</i> is greater than the current size, elements are added to the end. If <i>size</i> is less than the current size, elements are removed from the end.</p>
<p>If the value type is a primitive type (e.g&#x2e;, char, int, float) or a pointer type (e.g&#x2e;, <a href="../qtwidgets/qwidget.html">QWidget</a> *), new elements are not initialized. For other types, the elements are initialized with a <a href="containers.html#default-constructed-value">default-constructed value</a>.</p>
<p><b>See also </b><a href="qvarlengtharray.html#size">size</a>() and <a href="qvarlengtharray.html#squeeze">squeeze</a>().</p>
<!-- @@@resize -->
<!-- $$$shrink_to_fit[overload1]$$$shrink_to_fit -->
<h3 class="fn" id="shrink_to_fit"><a name="shrink_to_fit"></a><span class="type">void</span> QVarLengthArray::<span class="name">shrink_to_fit</span>()</h3>
<p>Same as <a href="qvarlengtharray.html#squeeze">squeeze</a>(). Provided for STL-compatibility.</p>
<p>This function was introduced in  Qt 5.10.</p>
<!-- @@@shrink_to_fit -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn" id="size"><a name="size"></a><span class="type">int</span> QVarLengthArray::<span class="name">size</span>() const</h3>
<p>Returns the number of elements in the array.</p>
<p><b>See also </b><a href="qvarlengtharray.html#isEmpty">isEmpty</a>() and <a href="qvarlengtharray.html#resize">resize</a>().</p>
<!-- @@@size -->
<!-- $$$squeeze[overload1]$$$squeeze -->
<h3 class="fn" id="squeeze"><a name="squeeze"></a><span class="type">void</span> QVarLengthArray::<span class="name">squeeze</span>()</h3>
<p>Releases any memory not required to store the items. If the container can fit its storage on the stack allocation, it will free the heap allocation and copy the elements back to the stack.</p>
<p>The sole purpose of this function is to provide a means of fine tuning <a href="qvarlengtharray.html">QVarLengthArray</a>'s memory usage. In general, you will rarely ever need to call this function.</p>
<p>This function was introduced in  Qt 5.1.</p>
<p><b>See also </b><a href="qvarlengtharray.html#reserve">reserve</a>(), <a href="qvarlengtharray.html#capacity">capacity</a>(), and <a href="qvarlengtharray.html#resize">resize</a>().</p>
<!-- @@@squeeze -->
<!-- $$$value[overload1]$$$valueint -->
<h3 class="fn" id="value"><a name="value"></a><span class="type">T</span> QVarLengthArray::<span class="name">value</span>(<span class="type">int</span> <i>i</i>) const</h3>
<p>Returns the value at index position <i>i</i>.</p>
<p>If the index <i>i</i> is out of bounds, the function returns a <a href="containers.html#default-constructed-value">default-constructed value</a>. If you are certain that <i>i</i> is within bounds, you can use <a href="qvarlengtharray.html#at">at</a>() instead, which is slightly faster.</p>
<p><b>See also </b><a href="qvarlengtharray.html#at">at</a>() and <a href="qvarlengtharray.html#operator-5b-5d">operator[]</a>().</p>
<!-- @@@value -->
<!-- $$$value$$$valueintconstT& -->
<h3 class="fn" id="value-1"><a name="value-1"></a><span class="type">T</span> QVarLengthArray::<span class="name">value</span>(<span class="type">int</span> <i>i</i>, const <span class="type">T</span> &amp;<i>defaultValue</i>) const</h3>
<p>This is an overloaded function.</p>
<p>If the index <i>i</i> is out of bounds, the function returns <i>defaultValue</i>.</p>
<!-- @@@value -->
<!-- $$$operator+=[overload1]$$$operator+=constT& -->
<h3 class="fn" id="operator-2b-eq"><a name="operator-2b-eq"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator+=</span>(const <span class="type">T</span> &amp;<i>value</i>)</h3>
<p>Appends <i>value</i> to the array and returns a reference to this vector.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>() and <a href="qvarlengtharray.html#operator-lt-lt">operator&lt;&lt;</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=T&& -->
<h3 class="fn" id="operator-2b-eq-1"><a name="operator-2b-eq-1"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator+=</span>(<span class="type">T</span> &amp;&amp;<i>value</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>() and <a href="qvarlengtharray.html#operator-lt-lt">operator&lt;&lt;</a>().</p>
<!-- @@@operator+= -->
<!-- $$$operator<<[overload1]$$$operator<<constT& -->
<h3 class="fn" id="operator-lt-lt"><a name="operator-lt-lt"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator&lt;&lt;</span>(const <span class="type">T</span> &amp;<i>value</i>)</h3>
<p>Appends <i>value</i> to the array and returns a reference to this vector.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>() and <a href="qvarlengtharray.html#operator-2b-eq">operator+=</a>().</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<T&& -->
<h3 class="fn" id="operator-lt-lt-1"><a name="operator-lt-lt-1"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator&lt;&lt;</span>(<span class="type">T</span> &amp;&amp;<i>value</i>)</h3>
<p>This is an overloaded function.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qvarlengtharray.html#append">append</a>() and <a href="qvarlengtharray.html#operator-2b-eq">operator+=</a>().</p>
<!-- @@@operator<< -->
<!-- $$$operator=[overload1]$$$operator=constQVarLengthArray<T,Prealloc>& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator=</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;<i>other</i> = ...)</h3>
<p>Assigns <i>other</i> to this array and returns a reference to this array.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=std::initializer_list<T> -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc</span>&gt; &amp;QVarLengthArray::<span class="name">operator=</span>(<span class="type">std::initializer_list</span>&lt;<span class="type">T</span>&gt; <i>list</i>)</h3>
<p>Assigns the values of <i>list</i> to this array, and returns a reference to this array.</p>
<p>This constructor is only enabled if the compiler supports C++11 initializer lists.</p>
<p>This function was introduced in  Qt 5.5.</p>
<!-- @@@operator= -->
<!-- $$$operator[][overload1]$$$operator[]int -->
<h3 class="fn" id="operator-5b-5d"><a name="operator-5b-5d"></a><span class="type">T</span> &amp;QVarLengthArray::<span class="name">operator[]</span>(<span class="type">int</span> <i>i</i>)</h3>
<p>Returns a reference to the item at index position <i>i</i>.</p>
<p><i>i</i> must be a valid index position in the array (i.e&#x2e;, 0 &lt;= <i>i</i> &lt; <a href="qvarlengtharray.html#size">size</a>()).</p>
<p><b>See also </b><a href="qvarlengtharray.html#data">data</a>() and <a href="qvarlengtharray.html#at">at</a>().</p>
<!-- @@@operator[] -->
<!-- $$$operator[]$$$operator[]int -->
<h3 class="fn" id="operator-5b-5d-1"><a name="operator-5b-5d-1"></a>const <span class="type">T</span> &amp;QVarLengthArray::<span class="name">operator[]</span>(<span class="type">int</span> <i>i</i>) const</h3>
<p>This is an overloaded function.</p>
<!-- @@@operator[] -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=[overload1]$$$operator!=constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> <span class="name">operator!=</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>left</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>right</i> = ...)</h3>
<p>Returns <code>true</code> if the two arrays, specified by <i>left</i> and <i>right</i>, are <i>not</i> equal.</p>
<p>Two arrays are considered equal if they contain the same values in the same order.</p>
<p>This function requires the value type to have an implementation of <code>operator==()</code>.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qchar.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator<[overload1]$$$operator<constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-lt"><a name="operator-lt"></a><span class="type">bool</span> <span class="name">operator&lt;</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>lhs</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>rhs</i> = ...)</h3>
<p>Returns <code>true</code> if variable length array <i>lhs</i> is <a href="http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare">lexicographically less than</a> <i>rhs</i>; otherwise returns <code>false</code>.</p>
<p>This function requires the value type to have an implementation of <code>operator&lt;()</code>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@operator< -->
<!-- $$$operator<=[overload1]$$$operator<=constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-lt-eq"><a name="operator-lt-eq"></a><span class="type">bool</span> <span class="name">operator&lt;=</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>lhs</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>rhs</i> = ...)</h3>
<p>Returns <code>true</code> if variable length array <i>lhs</i> is <a href="http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare">lexicographically less than or equal to</a> <i>rhs</i>; otherwise returns <code>false</code>.</p>
<p>This function requires the value type to have an implementation of <code>operator&lt;()</code>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@operator<= -->
<!-- $$$operator==[overload1]$$$operator==constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> <span class="name">operator==</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>left</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>right</i> = ...)</h3>
<p>Returns <code>true</code> if the two arrays, specified by <i>left</i> and <i>right</i>, are equal.</p>
<p>Two arrays are considered equal if they contain the same values in the same order.</p>
<p>This function requires the value type to have an implementation of <code>operator==()</code>.</p>
<p>This function was introduced in  Qt 4.8.</p>
<p><b>See also </b><a href="qchar.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
<!-- $$$operator>[overload1]$$$operator>constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-gt"><a name="operator-gt"></a><span class="type">bool</span> <span class="name">operator&gt;</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>lhs</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>rhs</i> = ...)</h3>
<p>Returns <code>true</code> if variable length array <i>lhs</i> is <a href="http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare">lexicographically greater than</a> <i>rhs</i>; otherwise returns <code>false</code>.</p>
<p>This function requires the value type to have an implementation of <code>operator&lt;()</code>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@operator> -->
<!-- $$$operator>=[overload1]$$$operator>=constQVarLengthArray<T,Prealloc1>&constQVarLengthArray<T,Prealloc2>& -->
<h3 class="fn" id="operator-gt-eq"><a name="operator-gt-eq"></a><span class="type">bool</span> <span class="name">operator&gt;=</span>(const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc1</span>&gt; &amp;<i>lhs</i> = ..., const <span class="type"><a href="qvarlengtharray.html#QVarLengthArray">QVarLengthArray</a></span>&lt;<span class="type">T</span>, <span class="type">Prealloc2</span>&gt; &amp;<i>rhs</i> = ...)</h3>
<p>Returns <code>true</code> if variable length array <i>lhs</i> is <a href="http://en.cppreference.com/w/cpp/algorithm/lexicographical_compare">lexicographically greater than or equal to</a> <i>rhs</i>; otherwise returns <code>false</code>.</p>
<p>This function requires the value type to have an implementation of <code>operator&lt;()</code>.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@operator>= -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>