QPdfPageNavigator Class
PDF 문서 내 탐색 기록. 더 보기...
Header: | #include <QPdfPageNavigator> |
Since: | Qt 6.4 |
Inherits: | QObject |
속성
|
|
공용 기능
QPdfPageNavigator(QObject *parent) | |
virtual | ~QPdfPageNavigator() override |
bool | backAvailable() const |
QPointF | currentLocation() const |
int | currentPage() const |
qreal | currentZoom() const |
bool | forwardAvailable() const |
공용 슬롯
void | back() |
void | clear() |
void | forward() |
void | jump(QPdfLink destination) |
void | jump(int page, const QPointF &location, qreal zoom = 0) |
void | update(int page, const QPointF &location, qreal zoom) |
신호
void | backAvailableChanged(bool available) |
void | currentLocationChanged(QPointF location) |
void | currentPageChanged(int page) |
void | currentZoomChanged(qreal zoom) |
void | forwardAvailableChanged(bool available) |
void | jumped(QPdfLink current) |
상세 설명
QPdfPageNavigator 클래스는 사용자가 PDF 문서에서 어떤 목적지를 방문했는지 기억하고, 앞뒤로 이동하는 기능을 제공합니다. 이 클래스는 웹 브라우저의 뒤로 가기 및 앞으로 가기 버튼과 유사한 뒤로 가기 및 앞으로 가기 동작을 구현하는 데 사용됩니다.
QPdfDocument 를참조하세요 .
속성 문서
[read-only]
backAvailable : const bool
기록에서 백 대상을 사용할 수 있는 경우, 즉 push() 또는 forward()가 호출된 경우 true
를 유지합니다.
함수에 액세스합니다:
bool | backAvailable() const |
알림 신호:
void | backAvailableChanged(bool available) |
[read-only]
currentLocation : const QPointF
이 속성은 보고 있는 페이지의 현재 위치( jump() 또는 update()에 마지막으로 지정한 위치)를 저장합니다. 기본값은 0, 0
입니다.
액세스 기능:
QPointF | currentLocation() const |
알림 신호:
void | currentLocationChanged(QPointF location) |
[read-only]
currentPage : const int
이 속성에는 현재 보고 있는 페이지가 저장됩니다. 기본값은 0
입니다.
액세스 기능:
int | currentPage() const |
알림 신호:
void | currentPageChanged(int page) |
[read-only]
currentZoom : const qreal
이 속성은 보고 있는 페이지의 확대 배율(1논리 픽셀 = 1포인트)을 저장합니다. 기본값은 1
입니다.
기능에 액세스합니다:
qreal | currentZoom() const |
알림 신호:
void | currentZoomChanged(qreal zoom) |
[read-only]
forwardAvailable : const bool
기록에서 전달 대상을 사용할 수 있는 경우, 즉 back()이 이전에 호출된 적이 있는 경우 true
을 유지합니다.
함수 액세스:
bool | forwardAvailable() const |
알림 신호:
void | forwardAvailableChanged(bool available) |
멤버 함수 문서
[explicit]
QPdfPageNavigator::QPdfPageNavigator(QObject *parent)
부모 객체로 페이지 탐색 스택을 구성합니다 parent.
[override virtual noexcept]
QPdfPageNavigator::~QPdfPageNavigator()
페이지 탐색 스택을 삭제합니다.
[slot]
void QPdfPageNavigator::back()
스택을 팝하고 currentPage, currentLocation 및 currentZoom 속성을 가장 최근에 본 대상으로 업데이트한 다음 jumped() 신호를 내보냅니다.
[slot]
void QPdfPageNavigator::clear()
기록을 지우고 currentPage, currentLocation 및 currentZoom 을 기본값으로 복원합니다.
[slot]
void QPdfPageNavigator::forward()
back()가 호출되기 전에 보고 있던 페이지, 위치 및 확대/축소 레벨로 돌아간 다음 jumped() 신호를 내보냅니다.
마지막으로 back()가 호출된 이후 새 대상이 푸시된 경우, 타임라인에 '미래'가 손실되는 분기가 있기 때문에 forward() 함수는 아무 일도 하지 않습니다.
[slot]
void QPdfPageNavigator::jump(QPdfLink destination)
지정된 destination 을 방문한 위치 기록에 추가합니다.
이 경우 PDF 보기는 뷰포트에 destination.location
을 배치하는 대신 뷰포트에 destination.rectangles
을 배치하기 위해 스크롤하여 jumped 신호에 응답합니다. 따라서 QPdfSearchModel 에서 검색 결과로 이동하려면 이 메서드를 호출하는 것이 적절합니다(직사각형이 검색된 텍스트 영역을 포함하므로). 하이퍼링크 대상으로 이동하려면 대신 jump(page, location, zoom)을 호출하세요. 이 경우 QPdfLink 객체의 rectangles
은 목적지가 아닌 하이퍼링크 시작 위치를 포함하기 때문입니다.
[slot]
void QPdfPageNavigator::jump(int page, const QPointF &location, qreal zoom = 0)
page, location, zoom 로 구성된 지정된 목적지를 방문한 위치 기록에 추가합니다.
zoom 인수는 배율을 나타냅니다(여기서 1
은 기본 배율, 1논리 픽셀 = 1포인트). zoom 이 지정되지 않거나 0
인 경우 currentZoom 은 기존 값을 유지하고 currentZoomChanged 은 출력되지 않습니다.
사용자가 링크를 따라가는 경우 location 는 QPdfLink::location()와 동일해야 하며, 대상의 왼쪽 상단 모서리로 지정되므로 일관성을 위해 항상 뷰포트의 왼쪽 상단 모서리에 보이는 위치를 포인트 단위로 사용하는 것이 가장 좋습니다.
forwardAvailable 가 true
인 경우 이 함수를 호출하면 타임라인에서 "미래"가 손실되는 분기를 나타내므로 forwardAvailable 는 false
로 변경됩니다.
[signal]
void QPdfPageNavigator::jumped(QPdfLink current)
이 신호는 current 페이지 색인, 페이지 내 위치 및 확대/축소 수준으로 갑작스러운 점프가 발생할 때 발생하지만 단순히 문서를 한 페이지씩 스크롤할 때는 발생하지 않습니다. 즉, jump(), forward() 및 back()는 이 신호를 보내지만 update()는 보내지 않습니다.
current.rectangles.length > 0
는 특정 목적지 영역을 포함하는 직사각형으로 검색 결과가 표시되어야 하며, 그렇지 않은 경우 current.location
는 page
(하이퍼링크 목적지 또는 앞으로/뒤로 탐색 중)의 목적지 위치입니다.
[slot]
void QPdfPageNavigator::update(int page, const QPointF &location, qreal zoom)
page, location 및 zoom 로 구성된 현재 대상을 수정합니다.
사용자가 문서를 수동으로 이동하는 동안 주기적으로 호출할 수 있으므로 back()가 호출된 후 forward()는 마지막으로 push()로 지정한 목적지가 아닌 가장 최근에 본 목적지로 다시 이동합니다.
currentZoomChanged
, currentPageChanged
및 currentLocationChanged
신호는 각 속성이 실제로 변경된 경우 발생합니다. jumped 신호는 발생하지 않는데, 이는 이 작업이 탐색 점프가 아닌 부드러운 이동을 나타내기 때문입니다.
© 2025 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.