Results 1 to 2 of 2

Thread: First QTextBlockFormat not picked up in QTextFragment

  1. #1
    Join Date
    Aug 2009
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default First QTextBlockFormat not picked up in QTextFragment

    I am trying to produce a print version of a QTextDocument, prDoc, by adding some headers and footers around fragments of a QTextDocument, doc, displaying properly.

    Even when the QTextCursor used to define the selection has anchor position 0 the QTextFragment, when inserted in prDoc, does not have the tabs defined in the QBlockFormat of that first block in doc.

    Any suggestions what I could be doing wrong?

    Second, but less pressing, question. Is there a way to stop Qt printing pagenumbers when printing a document. The page number, together with more info is already in my footer.

    Thanks,
    Enno

  2. #2
    Join Date
    Aug 2009
    Posts
    24
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: First QTextBlockFormat not picked up in QTextFragment

    My error was not reading the documentation. QTextFragment is more concerned with character than block formats. Explicitly obtaining the doc's block format and insering the selection into a new block in prDoc with that block format set solves that problem. It appears in this case useful that the block formats of all subsequent blocks in the selection are transferred.

    That leaves the second part of the question. Can I stop Qt inserting page numbers when printing. Any suggestions?

    Enno.

Similar Threads

  1. Replies: 0
    Last Post: 13th July 2007, 22:45

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.