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

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


FYI,

This is a bug in Qt. Everything worked when I commented out the line:
printer.setPaperSize(QPrinter::Letter);

Josh

> 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...
> }
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list