PdfSelection QML Type
PDF ドキュメント内のテキスト選択の表現。詳細...
Import Statement: | import QtQuick.Pdf |
Inherits: |
プロパティ
- document : PdfDocument
- from : point
- geometry : list<list<point>>
- hold : bool
- page : int
- renderScale : real
- text : string
- to : point
方法
- void clear()
- void copyToClipboard()
- void selectAll()
詳細な説明
PdfSelection は、テキスト文字列とそのジオメトリを、ある点から別の点までのバウンディングボックス内に提供します。
マウスを使用して選択範囲を変更するには、from とto を入力ハンドラの適切なプロパティにバインドして、それぞれドラッグ ジェスチャの開始位置と終了位置に設定します。また、hold プロパティをバインドして、ドラッグ ジェスチャ中はtrue
に設定し、ジェスチャが終了するとfalse
に設定します。
PdfSelectionは、iOSなどのプラットフォームでテキスト選択ハンドルを使用できるように、Inputメソッドのクエリも直接処理します。このためには、キーボードフォーカスが必要です。
プロパティ Documentation
document : PdfDocument |
このプロパティは、テキストを選択するPDF文書を保持します。
from : point |
選択されたテキストを見つけるための、ページの左上隅からの開始位置をピクセル単位で指定します。これはDragHandler のcentroid.pressPosition
にバインドすることができ、例えばユーザーがマウスボタンを押してドラッグを開始した位置からテキストを選択し始めることができます。
geometry : list<list<point>> |
PathMultiline インスタンスのpaths
プロパティにバインドして、選択範囲に含まれるテキスト領域の周囲に一括して矩形を描画することができるフォーム内のパスの集合:
PdfDocument { id: doc } PdfSelection { id: selection document: doc from: textSelectionDrag.centroid.pressPosition to: textSelectionDrag.centroid.position hold: !textSelectionDrag.active } Shape { ShapePath { PathMultiline { paths: selection.geometry } } } DragHandler { id: textSelectionDrag acceptedDevices: PointerDevice.Mouse | PointerDevice.Stylus target: null }
PathMultilineも参照してください 。
hold : bool |
page : int |
検索ページ番号。
renderScale : real |
to : point |
ページの左上隅か ら ピ ク セル単位で、 選択 し た テ キ ス ト を見つけ る 終了位置。こ れをDragHandler のcentroid.position
にバ イ ン ド し て、 た と えばユーザーが現在マ ウ ス を ド ラ ッ グ し てい る位置でテ キ ス ト の選択を終了 さ せ る こ と がで き ます。
メソッド ドキュメント
void clear() |
現在の選択範囲をクリアします。
void copyToClipboard() |
text プロパティからシステムのクリップボードにプレーンテキストをコピーします。
void selectAll() |
現在のpage のすべてのテキストを選択します。
© 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.