cydside
27th January 2010, 22:21
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
is appearing in my "Application Out"!!!
Here is the code:
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;
}
What happens?
Thanks!
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
is appearing in my "Application Out"!!!
Here is the code:
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;
}
What happens?
Thanks!