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

Method jumpToSource

src/PDFDocumentWindow.cpp:999–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999void PDFDocumentWindow::jumpToSource()
1000{
1001 QAction *act = qobject_cast<QAction*>(sender());
1002 if (!act || !pdfWidget)
1003 return;
1004
1005 QPoint eventPos = act->data().toPoint();
1006 QPointF scenePos = pdfWidget->mapToScene(pdfWidget->mapFrom(this, eventPos));
1007
1008 // Map to scene, then map to page
1009 QtPDF::PDFDocumentScene * scene = qobject_cast<QtPDF::PDFDocumentScene*>(pdfWidget->scene());
1010 if (!scene)
1011 return;
1012 QtPDF::PDFPageGraphicsItem * page = dynamic_cast<QtPDF::PDFPageGraphicsItem*>(scene->pageAt(scenePos));
1013 if (!page)
1014 return;
1015
1016 syncClick(scene->pageNumFor(page), page->mapToPage(page->mapFromScene(scenePos)));
1017}
1018
1019void PDFDocumentWindow::doFindDialog()
1020{

Callers

nothing calls this directly

Calls 4

pageAtMethod · 0.80
pageNumForMethod · 0.80
dataMethod · 0.45
mapToPageMethod · 0.45

Tested by

no test coverage detected