diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-30 12:35:54 -0500 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-01-30 12:35:54 -0500 |
commit | 4a9347a338e7f8ee47d46f24b43b435f36b07875 (patch) | |
tree | ead7e582c67d8b30e90b22f75991ce2644e7d714 /src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp | |
parent | Get the OSInterface framework up and running (template OS only at the moment) (diff) | |
download | lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.tar.gz lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.tar.bz2 lumina-4a9347a338e7f8ee47d46f24b43b435f36b07875.zip |
Merged some previous changes to lumina-pdf, mainly changing how rotating pages works
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/PrintWidget.cpp | 15 |
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(); } |