Hi

i am using Qt4.4.3 over linux (fedora 8).
I need to facilitate the auto-printing in my desktop application . So i dont want to show Print dialog to user. I such scenario to print the doc i did following:


#ifndef QT_NO_PRINTER
QPrinter printerObj(QPrinter::HighResolution);
printerObj.setOrientation(QPrinter::Portrait);
printerObj.setPageSize(QPrinter::A4);
printerObj.setFullPage(true);
printerObj.setNumCopies(1);

QPainter painter(&printerObj);
QTextDocument textDocument;
textDocument.setHtml(msgStr);
textDocument.print(&printerObj);
#endif

but by doing so its showing me following error message ( while running):

QPainter::begin: A paint device can only be painted by one painter at a time.

And sometimes its even crashing after that.

Please suggest...