title: how to create a new QImage from an array of floats
body: <p>I have an array of floats that represents an Image.(column first).
  I want to show the image on a QGraphicsSecene as a QPixmap. In order to do that I tried to create anew image from my array with the QImage constructor - QImage ( const uchar * data, int width, int height, Format format ).
  I first created a new unsigned char and casted every value from my original array to new unsigned char one, and then tried to create a new image with the following code:</p>
  
  <pre><code>unsigned char * data = new unsigned char[fres.length()];
  for (int i =0; i &lt; fres.length();i++)
      data[i] = char(fres.dataPtr()[i]);
  
  bcg = new QImage(data,fres.cols(),fres.rows(),1,QImage::Format_Mono);
  </code></pre>
  
  <p>The problem is when I try to access the information in the following way: </p>
  
  <p>bcg->pixel(i,j);</p>
  
  <p>I get only the value 12345.
  How can I create a viewable image from my array.
  Thanks</p>