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

Lack of inseparable frame for QTextDocument

    XMLWordPrintable

Details

    Description

      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.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes