PdfLinkModel QML Type

PDF 문서 내의 링크 표현입니다. 더 보기...

Import Statement: import QtQuick.Pdf

속성

상세 설명

PdfLinkModel은 지정된 page 에 포함된 각 링크의 지오메트리와 대상을 제공합니다.

사용 가능한 모델 역할은 다음과 같습니다:

상수설명
rectangle링크를 둘러싼 바운딩 사각형입니다.
url링크가 웹 링크인 경우 해당 링크의 URL, 그렇지 않으면 빈 URL입니다.
page링크가 내부 링크인 경우 링크가 이동해야 하는 페이지 번호, 그렇지 않으면 -1 입니다.
location링크가 내부 링크인 경우 링크가 점프해야 하는 페이지의 위치입니다.
zoom링크가 내부 링크인 경우 대상 페이지에서 의도한 확대/축소 수준입니다.

일반적으로 Repeater 와 함께 사용하여 링크를 시각화하고 클릭할 수 있는 기능을 제공합니다:

Repeater {
    model: PdfLinkModel {
        document: root.document
        page: image.currentFrame
    }
    delegate: Rectangle {
        required property rect rectangle
        required property url url
        required property int page
        color: "transparent"
        border.color: "lightgrey"
        x: rectangle.x
        y: rectangle.y
        width: rectangle.width
        height: rectangle.height
        HoverHandler { cursorShape: Qt.PointingHandCursor }
        TapHandler {
            onTapped: {
                if (page >= 0)
                    image.currentFrame = page
                else
                    Qt.openUrlExternally(url)
            }
        }
    }
}

참고: 범용 PDF 보기 기능은 PdfScrollablePageViewPdfMultiPageView 에서 제공합니다. PdfLinkModel은 PDF 보기 컴포넌트를 처음부터 작성할 때만 필요합니다.

속성 문서

document : PdfDocument

이 속성은 링크를 찾을 PDF 문서를 보유합니다.


page : int

이 속성에는 링크를 찾을 페이지 번호가 저장됩니다.


© 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.