Results 1 to 6 of 6

Thread: Pratical example of QPrintPreviewDialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Pratical example of QPrintPreviewDialog

    Thanks to patrik08 by your help.

    I think that the objective of this forum be help the persons and not depreciate the questions, by more samples that they be.

  2. #2
    Join Date
    Apr 2010
    Posts
    17
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Pratical example of QPrintPreviewDialog

    hi.
    why the printer in this function:
    Qt Code:
    1. void dlg_account::on_btn_print_clicked()
    2. {
    3. QPrinter printer(QPrinter::HighResolution);
    4. printer.setFullPage( true );
    5. QPrintPreviewDialog preview(&printer, this);
    6. preview.setWindowFlags ( Qt::Window );
    7. connect(&preview, SIGNAL(paintRequested(QPrinter* )), SLOT(print(QPrinter* )));
    8. preview.exec();
    9. }
    To copy to clipboard, switch view to plain text mode 
    isnt recognised in the:
    Qt Code:
    1. void dlg_account::print( QPrinter* printer)
    2. {
    3. QPainter *painter=new QPainter(printer);
    4. QRect paper = printer->pageRect();
    5. painter->setPen(Qt::black);
    6. painter->setFont(QFont("Sans",14,0,0));
    7. painter->drawText(QRect(0,0,100,100),Qt::AlignLeft||Qt::AlignTop,"page1");
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Qt 4.4.0 Problem with QPrintPreviewDialog
    By ad5xj in forum Qt Programming
    Replies: 2
    Last Post: 30th May 2008, 14:01

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.