Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.15, 6.2, 6.5, 6.6, 6.7, 6.8
-
None
Description
When using the FacingPagesView mode of the print preview and the user zooms in enough to show only part of one of the facing pages horizontally, the internal current page is not updated when the preview is only scrolled horizontally and not vertically.
While this is probably difficult (but not impossible) to reproduce when scrolling by mouse dragging, it always is when directly using the horizontal scroll bar.
In fact, it's also reproducible with mouse dragging when reaching to the bottom of the preview, an odd number of pages is shown, and dragging is always above the bottom margin (no vertical scroll is triggered).
Steps to reproduce:
- create a QPrintPreviewDialog that makes at least three empty pages in the slot connected to the paintRequested signal;
- show the dialog and select the "Show facing pages" action in the toolbar;
- zoom in and/or resize enough to show less than two pages horizontally;
- scroll to the bottom;
- activate the horizontal scroll bar in order to show "more" of one
The result is that:
- calls to currentPage() of the preview widget are unreliable;
- the pageNumEdit line edit of QPrintPreviewDialog is not updated accordingly;
This is caused by the fact that only the vertical scroll bar valueChanged signal of the graphics view is connected to the private _q_updateCurrentPage slot.
That slot is theoretically private, but, at least in PyQt and PySide, it's possible to connect the horizontal scroll bar signal to it. I don't know about C++.
Still, it should work appropriately by default.
Another closely related issue happens when the zoom factor only allows showing just one the two facing pages, and at specific scrolling positions: when scrolling to the top left, or to the bottom right when having even numbered pages, no page is shown, but currentPage() (and therefore the line edit of the dialog) still returns the previously visible page.
I'm attaching a small PySide example that helps to demonstrate the main issue: it prints a 3 page document, then automatically sets the facing mode and scrolls down to the horizontal center; then you can just scroll horizontally to see that the current page is not updated.