Hi to all,
I'm now compiling, without errors, a project using the latest Qt release (4.6) and created with the previous Qt 4.5.4 release (Windows).
I'm coding my function using the example reported in "The Graphics View Framework" included in the Qt Help but now it isn't working. The message :

Qt Code:
  1. QPainter::begin: Paint device returned engine == 0, type: 2
To copy to clipboard, switch view to plain text mode 

is appearing in my "Application Out"!!!

Here is the code:

Qt Code:
  1. void frmStats::creaFileHtml()
  2. {
  3. QString intestazioneFile =
  4. "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN "
  5. "http://www.w3.org/TR/html4/strict.dtd\">\n"
  6. "<html>\n"
  7. "<head>\n"
  8. "<meta content=\"text/html;"
  9. "charset=UTF-8\" http-equiv=\"content-type\">\n"
  10. "<title></title>\n"
  11. "</head>\n"
  12. "<body>\n";
  13.  
  14. QString chiusuraFile =
  15. "</body>\n"
  16. "</html>\n";
  17.  
  18. html.clear();
  19.  
  20. html += intestazioneFile;
  21.  
  22. QPixmap pixmap(endX, endY);
  23. QPainter painter(&pixmap);
  24. painter.setRenderHint(QPainter::Antialiasing);
  25. scene->render(&painter); // scene = new QGraphicsScene(QRect(0, 0, endX, endY), this);
  26. painter.end();
  27. pixmap.save(QDir::currentPath() + "/statistiche.png");
  28.  
  29. html += "<img src=\"" + QDir::currentPath() +
  30. "/statistiche.png\" ALIGN=\"center\">\n<br>\n";
  31.  
  32. html += chiusuraFile;
  33. // qDebug() << "HTML: " << html;
  34. }
To copy to clipboard, switch view to plain text mode 

What happens?

Thanks!