Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
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.