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

Method pageNumFor

modules/QtPDF/src/PDFDocumentScene.cpp:201–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201PDFDocumentScene::size_type PDFDocumentScene::pageNumFor(const PDFPageGraphicsItem * const graphicsItem) const
202{
203#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
204 // Note: since we store QGraphicsItem* in _pages, we need to remove the const
205 // or else indexOf() complains during compilation. Since we don't do anything
206 // with the pointer, this should be safe to do while still remaining the
207 // const'ness of `graphicsItem`, however.
208 return _pages.indexOf(const_cast<PDFPageGraphicsItem *>(graphicsItem));
209#else
210 return _pages.indexOf(graphicsItem);
211#endif
212}
213
214PDFDocumentScene::size_type PDFDocumentScene::lastPage() { return _lastPage; }
215

Callers 2

goToPageMethod · 0.80
jumpToSourceMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected