title: Create mask from QImage using non-transparent pixels
body: <p>I'm trying to create a monochrome <a href="http://qt-project.org/doc/qt-4.8/qbitmap.html" rel="nofollow">QBitmap</a> from a QImage. Pixels with an alpha greater than 0 should get turned on in the bitmap. It seems that this should be possible without explicitly looping through all the pixels.</p>
  
  <p>I've gotten close by doing <code>QBitmap.fromImage(QImage(imagePath).createAlphaMask()</code>. However, only the pixels with an alpha of 1 get turned on.</p>