Hello, I have the following lines of code:

Qt Code:
  1. QImage tImage(50,50,QImage::Format_Indexed8);
  2. tImage.fill(0);
  3. QPixmap tempImagePix = QPixmap::fromImage(tImage);
To copy to clipboard, switch view to plain text mode 

When I run this it crashes saying:

Debug error!
Module: 4.5.0
File: global\qglobal.cpp
Line:1994

ASSERT failure in QVector<T>::at: "index out of range", file
...\include\qtcore\../../src/corelib/tools/qvector.h, line 327

What is causing the problem? Thank you.