[Qt-interest] Qt 4.6.1 QPrintPreviewDialog not working in Windows XP

Joshua Grauman jnfo-c at grauman.com
Sun Jan 24 02:47:00 CET 2010


Hello,

I just got my app to compile on Windows. Everything looks like it's more 
or less working except the QPrintPreviewDialog isn't working. This code 
works fine under Linux, but the preview is empty/blank under Windows XP. 
I'm using Qt 4.6.1 under both Linux and XP. Any thoughts???

Josh

void myClass::printPreview(void)
{
   QPrinter printer(QPrinter::HighResolution);
   printer.setPaperSize(QPrinter::Letter);
   printer.setPageMargins(0.5,0.5,0.5,0.5,QPrinter::Inch);

   QPrintPreviewDialog preview(&printer, this, Qt::Window);
   connect(&preview, SIGNAL(paintRequested(QPrinter *)), this, SLOT(print(QPrinter *)));
   preview.exec();
}

void myClass::print(QPrinter *printer)
{
   textEdit1->print(printer); //this is a QTextEdit...
}



More information about the Qt-interest-old mailing list