1

How can I figure out how to solve this bug message?

I am trying to rewrite a Qt3 working code into Qt4 for converting IplImage to QImage and found the "right conversion types" however my code as below results in "ISO C++ forbids declaration of 'QImage' with no type" compile message.

  QImage* convertIplImageToQImage(...){
            ...
            QImage *qqImage;  
  if (this->data->nChannels == 1) {

        QVector<QRgb> myColorTable;
        for (int i = 0; i < 256; i++)
            myColorTable.push_back(qRgb(i, i, i));

        qqImage = new QImage(qImageBuffer, width, height,
    QImage::Format_Indexed8);  
  }  else {

        qqImage = new QImage(qImageBuffer, width, height,
  QImage::Format_RGB32);

    }

    return qqImage;

  }
halfer
  • 19,824
  • 17
  • 99
  • 186
luhfluh
  • 487
  • 2
  • 8
  • 26

1 Answers1

1

Check that you added #include to your cpp file. I usually get this error if an include header is missing.

elle
  • 16,125
  • 3
  • 15
  • 4
  • Thanks Elle for your suggestion, worked great, but now got other issues to resolve, Thanks again! – luhfluh Jun 26 '11 at 13:53