aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
index d2f2cd46..145ce311 100644
--- a/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp
@@ -16,6 +16,7 @@ PrintWidget::PrintWidget(QWidget *parent) : QGraphicsView(parent), scene(0), cur
QObject::connect(this->verticalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(updateCurrentPage()));
QObject::connect(this, SIGNAL(resized()), this, SLOT(fit()));
+ QObject::connect(parent, SIGNAL(sendDocument(Poppler::Document*)), this, SLOT(receiveDocument(Poppler::Document*)));
scene = new QGraphicsScene(this);
scene->setBackgroundBrush(Qt::gray);
@@ -125,7 +126,7 @@ void PrintWidget::setCurrentPage(int pageNumber) {
}
void PrintWidget::highlightText(int pageNum, QRectF textBox) {
- PageItem *item = static_cast<PageItem*>(pages[pageNum]);
+ //PageItem *item = static_cast<PageItem*>(pages[pageNum]);
QPainter painter(this);
painter.fillRect(textBox, QColor(255, 255, 177, 128));
}
@@ -185,7 +186,7 @@ void PrintWidget::populateScene()
qDebug() << "Image paperSize" << paperSize;
for (int i = 0; i < numPages; i++) {
- PageItem* item = new PageItem(i+1, (*pictures)[i].scaled( paperSize, Qt::KeepAspectRatio, Qt::SmoothTransformation), paperSize);
+ PageItem* item = new PageItem(i+1, (*pictures)[i].scaled( paperSize, Qt::KeepAspectRatio, Qt::SmoothTransformation), paperSize, degrees);
scene->addItem(item);
pages.append(item);
}
@@ -281,6 +282,12 @@ void PrintWidget::setPictures(QHash<int, QImage> *hash) {
pictures = hash;
}
-void PrintWidget::setOrientation(QPageLayout::Orientation ori) {
- this->orientation = ori;
+void PrintWidget::receiveDocument(Poppler::Document *DOC) {
+ this->doc = DOC;
+ this->setVisible(true);
+}
+
+void PrintWidget::setDegrees(int degrees) {
+ this->degrees = degrees;
+ this->updatePreview();
}
bgstack15