QPdfPageNavigation Class

The QPdfPageNavigation class handles the navigation through a PDF document. More...

Header: #include <QPdfPageNavigation>
Since: Qt 5.10
Inherits: QObject

Properties

Public Functions

QPdfPageNavigation(QObject *parent)
virtual ~QPdfPageNavigation()
bool canGoToNextPage() const
bool canGoToPreviousPage() const
int currentPage() const
QPdfDocument *document() const
int pageCount() const
void setCurrentPage(int page)
void setDocument(QPdfDocument *document)

Public Slots

Signals

void canGoToNextPageChanged(bool canGo)
void canGoToPreviousPageChanged(bool canGo)
void currentPageChanged(int currentPage)
void documentChanged(QPdfDocument *document)
void pageCountChanged(int pageCount)

Detailed Description

See also QPdfDocument.

Property Documentation

[read-only] canGoToNextPage : const bool

Indicates whether there is a page after the current page.

Access functions:

bool canGoToNextPage() const

Notifier signal:

void canGoToNextPageChanged(bool canGo)

See also canGoToNextPage() and goToNextPage().

[read-only] canGoToPreviousPage : const bool

Indicates whether there is a page before the current page.

Access functions:

bool canGoToPreviousPage() const

Notifier signal:

void canGoToPreviousPageChanged(bool canGo)

See also canGoToPreviousPage() and goToPreviousPage().

currentPage : int

This property holds the current page number in the document.

Access functions:

int currentPage() const
void setCurrentPage(int page)

Notifier signal:

void currentPageChanged(int currentPage)

See also currentPage() and setCurrentPage().

document : QPdfDocument*

This property holds the document instance on which this object navigates.

By default, this property is nullptr.

Access functions:

QPdfDocument *document() const
void setDocument(QPdfDocument *document)

Notifier signal:

void documentChanged(QPdfDocument *document)

See also document(), setDocument(), and QPdfDocument.

[read-only] pageCount : const int

This property holds the number of pages in the document.

Access functions:

int pageCount() const

Notifier signal:

void pageCountChanged(int pageCount)

See also pageCount().

Member Function Documentation

QPdfPageNavigation::QPdfPageNavigation(QObject *parent)

Constructs a page navigation object with parent object parent.

[slot] void QPdfPageNavigation::goToNextPage()

Changes the current page to the next page.

If there is no next page in the document, nothing happens.

See also canGoToNextPage.

[slot] void QPdfPageNavigation::goToPreviousPage()

Changes the current page to the previous page.

If there is no previous page in the document, nothing happens.

See also canGoToPreviousPage.

[virtual] QPdfPageNavigation::~QPdfPageNavigation()

Destroys the page navigation object.

bool QPdfPageNavigation::canGoToNextPage() const

Returns whether there is a page after the current one.

Note: Getter function for property canGoToNextPage.

bool QPdfPageNavigation::canGoToPreviousPage() const

Returns whether there is a page before the current one.

Note: Getter function for property canGoToPreviousPage.

int QPdfPageNavigation::currentPage() const

Returns the current page number or 0 if there is no document set.

After a document has been loaded, the currentPage will always be 0.

Note: Getter function for property currentPage.

See also setCurrentPage().

QPdfDocument *QPdfPageNavigation::document() const

Returns the document on which this object navigates, or a nullptr if none has set before.

Note: Getter function for property document.

See also setDocument() and QPdfDocument.

int QPdfPageNavigation::pageCount() const

Returns the number of pages in the document or 0 if there is no document set.

Note: Getter function for property pageCount.

void QPdfPageNavigation::setCurrentPage(int page)

Sets the current page number.

Note: Setter function for property currentPage.

See also currentPage().

void QPdfPageNavigation::setDocument(QPdfDocument *document)

Sets the document this object navigates on.

After a new document has been set, the currentPage will be 0.

Note: Setter function for property document.

See also document() and QPdfDocument.

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.