Hello,
I have Qt 5.1 and I am trying to display pictures I get from a scanner into a window.
My 8 bit grey scale image comes as an array called m_raw_data of type unsigned char *, and I know that its dimensions are 320x480.

I want to create a QImage structure to wrap it up so I can paint my widget.
I have the problem that the following code does not compile
Qt Code:
  1. QVector<QRgb> colorTable;
  2. for(int i = 0; i < 256; i++){
  3. colorTable.append(qRgb(i,i,i));
  4. }
  5. memset(m_raw_data, 0, DEFAULT_IMAGE_WIDTH*DEFAULT_IMAGE_HEIGHT);
  6. m_image = new QImage(m_raw_data, DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT,QImage::Format_Indexed8);
  7. m_image->setColorTable(colorTable);
To copy to clipboard, switch view to plain text mode 
The compiler says that the constructor QImage is ambiguous, and I am willing to supply the extra arguments, but I dont really dont know what they mean, as the documentation just says
typedef QImageCleanupFunction
A function with the following signature that can be used to implement basic image memory management:

void myImageCleanupHandler(void *info);
This typedef was introduced in QtGui 5.0.

This description is so short as to leave me speechless. There is no example either.
Thankyou for your attention
Henri