Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115214

Lack of inseparable frame for QTextDocument

XMLWordPrintable

      For example, the following pseudo-code:
      //Insert a frame here
      QTextCursor::insertFrame(QTextFrameFormat);
      //Insert a text here (maybe format too, does not matter)
      QTextCursor::insertText(Some text here)
      //Insert an image here
      QTextCursor::insertImage(QTextImageFormat);

      It is possible that text and image are separated into 2 pages, i.e. test is on one page, but image is on the other, even though they are grouped into the same frame. The current breaking policy is not enough to avoid such issue.
      QTextFormat::PageBreak_Auto - No. This is the default and causing the issue.
      QTextFormat::PageBreak_AlwaysBefore and QTextFormat::PageBreak_AlwaysAfter - No. We don't want unnecessary breaks.

      The ideal behavior is:
      If text and image can be put on one page, then put them on one page (which is what Auto does in most cases). And if text and image cannot be put on one page, move both to the next page (which is NOT what Auto does - Auto moves only image to the next page if text can be fit into the current page). The key is to make a frame inseperable.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            esabraha Eskil Abrahamsen Blomfeldt
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes