Hello!

I am using Qt4.2.3.

Please help me with pointers and correct this piece of code. And if possible, put some explanation on why I enounter errors such as "functional cast expression list treated as compound expression" and "no matching call' errors. Thanks in advance

Qt Code:
  1. void MainWinow::doFunction1()
  2. {
  3. QImage *image = new QImage(QSize(100,100), QImage::Format_RGB32);
  4.  
  5. int x = 0;
  6. int y = 0;
  7. for (x= 0; x < image->width(); x++){
  8. for (y = 0; y < image->height(); y++){
  9. image->setPixel(x, y, QRgb(255,0,0));
  10. }
  11. }
  12.  
  13. item->setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
  14. item->setFlag(QGraphicsItem::ItemIsMovable);
  15. scene->addPixmap(QPixmap::fromImage(&image));
  16.  
  17. //graphicsViewVis is globally declared
  18. graphicsViewVis->setScene(scene);
  19. graphicsViewVis->show();
  20.  
  21. }
To copy to clipboard, switch view to plain text mode