Results 1 to 2 of 2

Thread: Make QPrinter setPrintRange working

  1. #1
    Join Date
    Dec 2010
    Posts
    20
    Thanks
    9
    Thanked 3 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Make QPrinter setPrintRange working

    Hi all,

    I want to print just some pages from a collection of pages from QPrintPreviewWidget.

    I have a QPrinter object (consider as "printer") and a QPrintPreviewWidget object (consider as "printPreviewWidget"). Then I pass printer as my printPreviewWidget's contructor argument.

    Code.. code.. and code..

    Then I write this code

    consider I have 10 pages in my printPreviewWidget

    printer->setPrintRange(QPrinter::PageRange);
    printer->setFromTo(2,3);
    printPreviewWidget.updatePreview();
    printPreviewWidget.print();
    These codes don't work at all, still all pages is printed. Someone got any solution?

    printer->setCopyCount(2) <- doesn't work either
    Last edited by rivci; 31st May 2011 at 07:36.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Make QPrinter setPrintRange working

    Does your rendering code, when it responds to the paintRequested() signal, taking any notice of the print range reported by the printer?

Similar Threads

  1. Replies: 6
    Last Post: 10th March 2011, 16:42
  2. Replies: 1
    Last Post: 5th March 2011, 18:23
  3. Replies: 1
    Last Post: 15th December 2010, 13:20
  4. Replies: 11
    Last Post: 31st May 2007, 01:11
  5. QPrinter::PrinterMode and QPrinter::setResolution??
    By SkripT in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2006, 11:59

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.