title: How to convert std::vector<uint8_t> to QByteArray?
body: <p>I am trying to create QByteArray from std::vector.. I tried; </p>
  
  <pre><code>std::vector&lt;uint8_t&gt; buf;
  QByteArray img = new QByteArray(reinterpret_cast&lt;const char&gt;(buf), buf.size());
  </code></pre>
  
  <p>However it gives error; </p>
  
  <pre><code>error: invalid cast from type 'std::vector&lt;unsigned char, std::allocator&lt;unsigned char&gt; &gt;' to type 'const char'
  </code></pre>