5#include <QtCore/qloggingcategory.h>
27 this, &QQuickPdfSearchModel::onResultsChanged);
37 return m_quickDocument;
85 if (
result.page() != m_currentPage)
102 if (
result.page() != m_currentPage)
104 auto rects =
result.rectangles();
105 if (!rects.isEmpty()) {
106 ret = rects.takeFirst();
107 for (
auto rect : rects)
113void QQuickPdfSearchModel::onResultsChanged()
212 if (!m_suspendSignals) {
230 const int currentResultWas = m_currentResult;
231 const int currentPageWas = m_currentPage;
232 const int resultCount =
rowCount({});
249 qCDebug(qLcSearch) <<
"currentResult was" << currentResultWas
250 <<
"requested" <<
currentResult <<
"on page" << currentPageWas
251 <<
"->" << m_currentResult <<
"on page" << m_currentPage;
275#include "moc_qquickpdfsearchmodel_p.cpp"
int pageCount
This property holds the number of pages in the loaded document or 0 if no document is loaded.
The QPdfLink class defines a link between a region on a page (such as a hyperlink or a search result)...
int page
This property holds the page number.
Q_PDF_EXPORT bool isValid() const
The QPdfSearchModel class searches for a string in a PDF document and holds the results.
QString searchString
the string to search for
int rowCount(const QModelIndex &parent) const override
\reimp
QPdfLink resultAtIndex(int index) const
Returns a result found by index in the \l document, regardless of the page on which it was found.
void setDocument(QPdfDocument *document)
void updatePage(int page)
void searchStringChanged()
QList< QPdfLink > resultsOnPage(int page) const
Returns the list of all results found on the given page.
The QPolygonF class provides a list of points using floating point precision.
QPdfLink currentResultLink
void currentResultChanged()
QQuickPdfDocument * document
QList< QPolygonF > currentPageBoundingPolygons
void setCurrentResult(int currentResult)
\qmlproperty int PdfSearchModel::currentResult
void currentResultLinkChanged()
void currentResultBoundingPolygonsChanged()
QRectF currentResultBoundingRect
~QQuickPdfSearchModel() override
Q_INVOKABLE QList< QPolygonF > boundingPolygonsOnPage(int page)
\qmlmethod list<list<point>> PdfSearchModel::boundingPolygonsOnPage(int page)
QList< QPolygonF > currentResultBoundingPolygons
void currentResultBoundingRectChanged()
void currentPageBoundingPolygonsChanged()
void setCurrentPage(int currentPage)
\qmlproperty int PdfSearchModel::currentPage
void currentPageChanged()
\inmodule QtCore\reentrant
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent