Quote Originally Posted by joseph View Post
Ok, I got know there is a problem
in this code
Qt Code:
  1. printer.setOutputToFile ( FALSE );
To copy to clipboard, switch view to plain text mode 
Once commented, the control goes to this
Qt Code:
  1. if ( printer.setup( this ) )
To copy to clipboard, switch view to plain text mode 
Finally to this function..
Qt Code:
  1. bool QPrinter::setup(QWidget *parent)
  2. {
  3. Q_D(QPrinter);
  4. return qt_compat_QPrinter_printSetup(this, d, parent)
  5. #ifdef Q_WS_MAC
  6. && qt_compat_QPrinter_pageSetup(this, parent);
  7. #endif
  8. ;
  9. }
To copy to clipboard, switch view to plain text mode 

The application crashes. Any idea

Ok one more thing, I get this warning QPrintDialog, Only native format supported. What to do???

-->Edit-->
Ok I have changed the code from
Qt Code:
  1. if (printer->setup(parent))
  2. ...
  3. you can rewrite it as
  4. QPrintDialog dialog(printer, parent);
  5. if (dialog.exec())
To copy to clipboard, switch view to plain text mode 
Still there is crashing, I still get QPrintDialog, Only native format supported,
In int QPrintDialog::exec() function "ep" which is "QWin32PrintEnginePrivate *ep;" is 0. Any idea???
Ok, got it... I need to do this
printer.setOutputFormat ( QPrinter::NativeFormat );
and works fine.
Is it correct????