MCPcopy Create free account
hub / github.com/TeXworks/texworks / searchProgressValueChanged

Method searchProgressValueChanged

modules/QtPDF/src/PDFDocumentView.cpp:954–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952}
953
954void PDFDocumentView::searchProgressValueChanged(PDFSearcher::size_type progressValue)
955{
956 // Inform the rest of the world of our progress (in %, and how many
957 // occurrences were found so far)
958 // NOTE: the searchProgressValueChanged slot is not necessarily synchronized
959 // with the searchResultReady slot. I.e., it can happen that
960 // searchProgressValueChanged reports 100% with 0 search results (before
961 // searchResultReady is called for the first time). Thus, searchResultReady
962 // is also set up to emit searchProgressChanged. In summary,
963 // searchProgressValueChanged is intended primarily for informing the user
964 // of the progress when no matches are found, whereas searchResultReady is
965 // primarily intended for informing the user of the progress when matches are
966 // found.
967 if (_searcher.progressMaximum() == _searcher.progressMinimum())
968 emit searchProgressChanged(100, _searchResults.count());
969 else
970 emit searchProgressChanged(static_cast<int>(100 * (progressValue - _searcher.progressMinimum()) / (_searcher.progressMaximum() - _searcher.progressMinimum())), _searchResults.count());
971}
972
973void PDFDocumentView::maybeUpdateSceneRect() {
974 if (!_pdf_scene || (_pageMode != PageMode_SinglePage && _pageMode != PageMode_Presentation))

Callers

nothing calls this directly

Calls 2

progressMaximumMethod · 0.80
progressMinimumMethod · 0.80

Tested by

no test coverage detected