A representation of text search results within a PDF Document. 更多...
| import 语句: | import QtQuick.Pdf 5.15 |
| Since: | Qt 5.15 |
PdfSearchModel provides the ability to search for text strings within a document and get the geometric locations of matches on each page.
The page on which currentMatchGeometry should provide filtered search results.
A set of paths in a form that can be bound to the
paths
property of a
PathMultiline
instance to render a batch of rectangles around all the regions where search results are found on
currentPage
:
PdfDocument {
id: doc
}
PdfSearchModel {
id: searchModel
document: doc
}
Shape {
ShapePath {
PathMultiline {
paths: searchModel.matchGeometry(view.currentPage)
}
}
}
另请参阅 PathMultiline .
The result index on currentPage 其中 currentResultBoundingPolygons should provide the regions to highlight.
A set of paths in a form that can be bound to the
paths
property of a
PathMultiline
instance to render a batch of rectangles around the regions comprising the search result
currentResult
on
currentPage
. This is normally used to highlight one search result at a time, in a UI that allows stepping through the results:
PdfDocument {
id: doc
}
PdfSearchModel {
id: searchModel
document: doc
currentPage: view.currentPage
currentResult: ...
}
Shape {
ShapePath {
PathMultiline {
paths: searchModel.currentResultBoundingPolygons
}
}
}
另请参阅 PathMultiline .
The bounding box containing all currentResultBoundingPolygons .
When this property changes, a scrollable view should automatically scroll itself in such a way as to ensure that this region is visible; for example, it could try to position the upper-left corner near the upper-left of its own viewport, subject to the constraints of the scrollable area.
The string to search for.