MCPcopy Create free account
hub / github.com/KDE/okular / openAnnotationWindow

Method openAnnotationWindow

part/pageview.cpp:845–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845void PageView::openAnnotationWindow(Okular::Annotation *annotation, int pageNumber)
846{
847 if (!annotation) {
848 return;
849 }
850
851 // find the annot window
852 AnnotWindow *existWindow = nullptr;
853 for (AnnotWindow *aw : std::as_const(d->m_annowindows)) {
854 if (aw->annotation() == annotation) {
855 existWindow = aw;
856 break;
857 }
858 }
859
860 if (existWindow == nullptr) {
861 const auto initialViewportBounds = viewportBoundsForAnnotationWindows();
862 existWindow = new AnnotWindow(this, initialViewportBounds, annotation, d->document, pageNumber);
863 connect(existWindow, &QObject::destroyed, this, &PageView::slotAnnotationWindowDestroyed);
864
865 d->m_annowindows << existWindow;
866 } else {
867 existWindow->raise();
868 existWindow->findChild<KTextEdit *>()->setFocus();
869 }
870
871 existWindow->show();
872}
873
874void PageView::slotAnnotationWindowDestroyed(QObject *window)
875{

Callers 1

Calls 2

showMethod · 0.80
annotationMethod · 0.45

Tested by

no test coverage detected