1. Feb 20, 2020
    • Shawn Rutledge's avatar
      PdfMultiPageView: use TableView; horz. scroll; control page position · f467edc9
      Shawn Rutledge authored
      
      TableView is missing some features compared to ListView; so finding out
      where we currently are (which row) and programmatic positioning on a
      specific y coordinate of a specific row require some workarounds for now,
      including helpers in PdfDocument.
      
      TableView also assumes (and sporadically enforces) that all cells in a
      column have the same width.  So we need a placeholder Item for each page.
      This also helps with rotation: the placeholder is now as wide as the
      window or the image, whichever is wider, and the "paper" is centered
      within; thus there's always room to rotate it.
      
      There's still some problem with setting contentY in goToPage() after
      the page has been zoomed to a size larger than the window: the values
      look correct, but it scrolls too far.
      
      But on the plus side, horizontal scrolling works.  So now we attempt to
      control the horizontal position too: NavigationStack tracks it, and can
      go back to a previous position; and links can in theory jump to specific
      positions and zoom levels, scrolling horizontally such that a specific x
      coordinate is visible.
      
      Includes minor UI tweaks to make it look better on iOS.
      
      Change-Id: I643d8ef48ef815aeb49cae77dcb84c3682563d56
      Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@qt.io>
      f467edc9
  2. Feb 19, 2020
    • Shawn Rutledge's avatar
      QtPdf examples: use test.pdf from resources if no file given · 1acd9ad2
      Shawn Rutledge authored
      
      On iOS, the native FileDialog doesn't work, sharing doesn't work, and
      packaging files along with the application requires manual effort; so
      a PDF file in resources seems to be the easiest alternative to make
      the examples demo-able.
      
      QPdfDocument wants a file path, because it uses QFile; but we like
      to use URLs in Qt Quick.  So it's a bit of an impedance mismatch,
      there are several choices about when and where to do the conversion,
      and it's hard to say which way is more correct.  This way happens
      to work for now.
      
      Also do the rest of the things necessary to get this working on iOS.
      
      Change-Id: Icb8614d5eed2510f101aefba534ef80cf890518f
      Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@qt.io>
      1acd9ad2
  3. Jan 30, 2020
  4. Jan 23, 2020
    • Shawn Rutledge's avatar
      Add QPdfSearchModel, QML PdfSearchModel and PdfPageView · b6dd845e
      Shawn Rutledge authored
      
      This enables searching a PDF for a text string and getting the
      boundaries of the areas where it is found.  The boundaries are returned
      as polygons intended to be rendered with PathMultiline.
      
      PdfPageView is a QML component intended to be a drop-in viewer for use
      in applications that need the most common PDF viewing functionality.
      More advanced applications are free to use it as a starting point for
      customization.
      
      Task-number: QTBUG-77507
      Task-number: QTBUG-77514
      Change-Id: Id08ac30224e41b6cdfb9300cc4288d5750259f78
      Reviewed-by: default avatarShawn Rutledge <shawn.rutledge@qt.io>
      b6dd845e
  5. Jan 21, 2020