Results 1 to 3 of 3

Thread: Print QGraphicsScene in more than one page

  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Print QGraphicsScene in more than one page

    Hi,

    I'm trying to print a QGraphicsScene and I don't know how to solve a size problem.

    The scene can be large, really large, but when rendering the scene it always use only one page, resizing it if necessary.

    I tried with QPrintPreviewDialog instead, but, obviously, it just previews, it doesn't cut it in different pages.

    Maybe I can solve it just calculating the sceneRect width/height and splitting the scene manually, but it should be different according the page width/height and this is set up later, on the dialog.

    I'm diving trough QtAssistant and I don't find any other way to do it. But seems like it has something like that; am I missing something?

    thanks!


    EDIT: another question. When printing the scene is printed on the top of the page. I can print on another place of the paper changing the parameter "QRectF & target" of QGraphicsScene::render, but; how I could get the QRectF of the page and, with that, calculate what's the center point of the page?
    Last edited by jano_alex_es; 16th November 2009 at 15:41.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Print QGraphicsScene in more than one page

    You could use QGraphicsScene::render in combination with the print sizes and print parts of scene to the printer.
    Have a look at the documentation.

  3. #3
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Print QGraphicsScene in more than one page

    I did :P Please read the edit.

Similar Threads

  1. print preview
    By wbt_ph in forum Qt Programming
    Replies: 4
    Last Post: 1st August 2009, 06:41
  2. Replies: 1
    Last Post: 7th July 2009, 16:46
  3. Replies: 1
    Last Post: 5th July 2009, 10:10
  4. Replies: 0
    Last Post: 5th March 2009, 06:54
  5. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07

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.