IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

PdfSearchModel QML Type

A representation of text search results within a PDF Document.

This type was introduced in Qt 5.15.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

PdfSearchModel QML Type

  • Import Statement: import QtQuick.Pdf

  • Since:: Qt 5.15

  • Group: PdfSearchModel is part of pdf

Detailed Description

PdfSearchModel provides the ability to search for text strings within a document and get the geometric locations of matches on each page.

Property Documentation

 

currentPage : int

The page on which currentResultBoundingPolygons should provide filtered search results.

currentPageBoundingPolygons : list<list<point>>

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:

 
Sélectionnez
PdfDocument {
    id: doc
}
PdfSearchModel {
    id: searchModel
    document: doc
}
Shape {
    ShapePath {
        PathMultiline {
            paths: searchModel.matchGeometry(view.currentPage)
        }
    }
}
See Also

See also PathMultiline

currentResult : int

The result index within the whole set of search results, for which currentResultBoundingPolygons should provide the regions to highlight if currentPage matches currentResultLink.page.

currentResultBoundingPolygons : list<list<point>>

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:

 
Sélectionnez
PdfDocument {
    id: doc
}
PdfSearchModel {
    id: searchModel
    document: doc
    currentPage: view.currentPage
    currentResult: ...
}
Shape {
    ShapePath {
        PathMultiline {
            paths: searchModel.currentResultBoundingPolygons
        }
    }
}

It becomes empty whenever currentPage != currentResultLink.page.

See Also

See also PathMultiline

currentResultBoundingRect : point

The bounding box containing all currentResultBoundingPolygons, if currentPage == currentResultLink.page; otherwise, an invalid rectangle.

currentResultLink : QPdfLink

searchString : string

The string to search for.

Method Documentation

 

list<list<point>> boundingPolygonsOnPage(int page)

Returns a set of paths in a form that can be bound to the paths property of a PathMultiline instance, which is used to render a batch of rectangles around all the matching locations on the page:

 
Sélectionnez
PdfDocument {
    id: doc
}
PdfSearchModel {
    id: searchModel
    document: doc
}
Shape {
    ShapePath {
        PathMultiline {
            paths: searchModel.matchGeometry(view.currentPage)
        }
    }
}
See Also

See also PathMultiline

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+