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

QtPdf: deal with non-numeric page numbers

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Not Evaluated Not Evaluated
    • 6.4.0 Beta1
    • 6.4.0 FF
    • PDF
    • None
    • 35697c1ded (qt/qtwebengine/dev) 35697c1ded (qt/tqtc-qtwebengine/dev) 35697c1ded (qt/qtwebengine/6.4) 35697c1ded (qt/tqtc-qtwebengine/6.4), b8419577e (dev)

      So far we have been using only a zero-based page index, and in the UI we add 1 to it so that it becomes one-based (because most PDF files start on page 1). But actually many PDF files can have different sections with different numbering schemes: a book might have a preface with Roman numerals and then the actual content starts later on a nominal "page 1", and the index and appendices might be different sections with prefixes (like A1 for the first appendix page). So really a page number should be available as a string, and that's what we should display in the UI. SpinBox and QSpinBox are capable of showing strings. At the simplest, we just need an accessor in QPdfDocument to get the string for a page index. But we should also harmonize the API: any property of the form "int page" could be renamed to "int pageIndex" or "int pageNumber" so that we can reserve "page" to be the string form. QPdfBookmarkModel::PageNumberRole might or might not need renaming; etc.

        For Gerrit Dashboard: QTBUG-102271
        # Subject Branch Project Status CR V

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes