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

Method annotationsReady

modules/QtPDF/src/InfoWidgets.cpp:669–690  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669void PDFAnnotationsInfoWidget::annotationsReady(int index)
670{
671 Q_ASSERT(_table != nullptr);
672 int i{_table->rowCount()};
673 _table->setRowCount(static_cast<decltype(_table->rowCount())>(i + _annotWatcher.resultAt(index).count()));
674
675
676 foreach(QSharedPointer<Annotation::AbstractAnnotation> pdfAnnot, _annotWatcher.resultAt(index)) {
677 // we only use valid markup annotation here
678 if (!pdfAnnot || !pdfAnnot->isMarkup())
679 continue;
680 Annotation::Markup * annot = dynamic_cast<Annotation::Markup*>(pdfAnnot.data());
681 QSharedPointer<Backend::Page> page(annot->page().toStrongRef());
682 if (page)
683 _table->setItem(i, 0, new QTableWidgetItem(QString::number(page->pageNum() + 1)));
684 _table->setItem(i, 1, new QTableWidgetItem(annot->subject()));
685 _table->setItem(i, 2, new QTableWidgetItem(annot->author()));
686 _table->setItem(i, 3, new QTableWidgetItem(annot->contents()));
687 ++i;
688 }
689 _table->setRowCount(i);
690}
691
692void PDFAnnotationsInfoWidget::clear()
693{

Callers

nothing calls this directly

Calls 10

resultAtMethod · 0.80
foreachFunction · 0.70
rowCountMethod · 0.45
isMarkupMethod · 0.45
dataMethod · 0.45
pageMethod · 0.45
pageNumMethod · 0.45
subjectMethod · 0.45
authorMethod · 0.45
contentsMethod · 0.45

Tested by

no test coverage detected