aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2018-04-04 16:55:48 -0400
committerZackaryWelch <welch.zackary@gmail.com>2018-04-04 16:55:48 -0400
commit0e00960a81337b407898728e01f44373d0537aab (patch)
tree44cad19e23e31052e9741c77ec25338d6475b63b /src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
parentAdded support for internal links. Code added for Poppler backend but not enab... (diff)
downloadlumina-0e00960a81337b407898728e01f44373d0537aab.tar.gz
lumina-0e00960a81337b407898728e01f44373d0537aab.tar.bz2
lumina-0e00960a81337b407898728e01f44373d0537aab.zip
Added propper text annotation handling and changed how links and annotations are shown
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
index 73e47091..e9a0ed34 100644
--- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
@@ -224,22 +224,18 @@ void PrintWidget::populateScene()
for (int i = 0; i < pages.size(); i++){
scene->removeItem(pages.at(i));
}
- for(int i = 0; i < links.size(); i++) {
- if(links[i].size() > 0) {
- qDeleteAll(links[i]);
- links[i].clear();
- }
- }
- links.clear();
qDeleteAll(pages);
pages.clear();
+ //links.clear();
+ //annots.clear();
int numPages = BACKEND->numPages();
if(BACKEND->hashSize() < numPages){ return; } //nothing to show yet
for (int i = 0; i < numPages; i++) {
QImage pagePicture = BACKEND->imageHash(i);
QSize paperSize = pagePicture.size();
- QList<QGraphicsItem*> linkLocations;
+ //QList<QGraphicsItem*> linkLocations;
+ //QList<QGraphicsItem*> annotLocations;
if(pagePicture.isNull()) {
qDebug() << "NULL IMAGE ON PAGE " << i;
@@ -254,9 +250,17 @@ void PrintWidget::populateScene()
for(int k = 0; k < BACKEND->linkSize(i); k++) {
LinkItem *lItem = new LinkItem(item, BACKEND->linkList(i, k));
lItem->setOpacity(0.1);
- linkLocations.append(lItem);
+ //linkLocations.append(lItem);
+ }
+ //qDebug() << "Creating annotations for:" << i;
+ for(int k = 0; k < BACKEND->annotSize(i); k++) {
+ AnnotItem *aItem = new AnnotItem(item, BACKEND->annotList(i, k), BACKEND->annotLoc(i, k));
+ AnnotZone *aZone = new AnnotZone(item, BACKEND->annotLoc(i, k), aItem);
+ aItem->setVisible(false);
+ //annotLocations.append(aItem);
}
- links.insert(i, linkLocations);
+ //links.insert(i, linkLocations);
+ //annots.insert(i, annotLocations);
}
}
}
bgstack15