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

Method addHighlightPath

modules/QtPDF/src/PDFDocumentView.cpp:319–333  ·  view source on GitHub ↗

path in PDF coordinates

Source from the content-addressed store, hash-verified

317
318// path in PDF coordinates
319QGraphicsPathItem * PDFDocumentView::addHighlightPath(const size_type page, const QPainterPath & path, const QBrush & brush, const QPen & pen /* = Qt::NoPen */)
320{
321 if (!_pdf_scene)
322 return nullptr;
323
324 PDFPageGraphicsItem * pageItem = dynamic_cast<PDFPageGraphicsItem*>(_pdf_scene->pageAt(static_cast<int>(page)));
325 if (!pageItem || !PDFDocumentScene::isPageItem(pageItem))
326 return nullptr;
327
328 QGraphicsPathItem * highlightItem = new QGraphicsPathItem(path, pageItem);
329 highlightItem->setBrush(brush);
330 highlightItem->setPen(pen);
331 highlightItem->setTransform(pageItem->pointScale());
332 return highlightItem;
333}
334
335void PDFDocumentView::fitInView(const QRectF & rect, Qt::AspectRatioMode aspectRatioMode /* = Qt::IgnoreAspectRatio */)
336{

Callers 1

syncFromSourceMethod · 0.80

Calls 2

pageAtMethod · 0.80
pointScaleMethod · 0.80

Tested by

no test coverage detected