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 :
QPainter::begin: Paint device returned engine
== 0, type
: 2
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:
void frmStats::creaFileHtml()
{
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN "
"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<html>\n"
"<head>\n"
"<meta content=\"text/html;"
"charset=UTF-8\" http-equiv=\"content-type\">\n"
"<title></title>\n"
"</head>\n"
"<body>\n";
"</body>\n"
"</html>\n";
html.clear();
html += intestazioneFile;
painter.
setRenderHint(QPainter::Antialiasing);
scene->render(&painter); // scene = new QGraphicsScene(QRect(0, 0, endX, endY), this);
painter.end();
pixmap.
save(QDir::currentPath() + "/statistiche.png");
html
+= "<img src=\"" + QDir::currentPath() + "/statistiche.png\" ALIGN=\"center\">\n<br>\n";
html += chiusuraFile;
// qDebug() << "HTML: " << html;
}
void frmStats::creaFileHtml()
{
QString intestazioneFile =
"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN "
"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<html>\n"
"<head>\n"
"<meta content=\"text/html;"
"charset=UTF-8\" http-equiv=\"content-type\">\n"
"<title></title>\n"
"</head>\n"
"<body>\n";
QString chiusuraFile =
"</body>\n"
"</html>\n";
html.clear();
html += intestazioneFile;
QPixmap pixmap(endX, endY);
QPainter painter(&pixmap);
painter.setRenderHint(QPainter::Antialiasing);
scene->render(&painter); // scene = new QGraphicsScene(QRect(0, 0, endX, endY), this);
painter.end();
pixmap.save(QDir::currentPath() + "/statistiche.png");
html += "<img src=\"" + QDir::currentPath() +
"/statistiche.png\" ALIGN=\"center\">\n<br>\n";
html += chiusuraFile;
// qDebug() << "HTML: " << html;
}
To copy to clipboard, switch view to plain text mode
What happens?
Thanks!
Bookmarks