Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportPage.cpp
Show All 14 Lines | |||||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "KReportPage.h" | 18 | #include "KReportPage.h" | ||
19 | 19 | | |||
20 | #include "KReportRendererBase.h" | 20 | #include "KReportRendererBase.h" | ||
21 | #include "KReportUnit.h" | 21 | #include "KReportUnit.h" | ||
22 | #include "KReportRenderObjects.h" | 22 | #include "KReportRenderObjects.h" | ||
23 | #include "KReportDpi.h" | ||||
23 | #include "kreport_debug.h" | 24 | #include "kreport_debug.h" | ||
24 | 25 | | |||
25 | #include <QWidget> | 26 | #include <QWidget> | ||
26 | #include <QPixmap> | 27 | #include <QPixmap> | ||
27 | #include <QPainter> | 28 | #include <QPainter> | ||
28 | #include <QTimer> | 29 | #include <QTimer> | ||
29 | 30 | | |||
30 | //! @internal | 31 | //! @internal | ||
Show All 24 Lines | 55 | KReportPage::KReportPage(QWidget *parent, ORODocument *document) | |||
55 | : QObject(parent), QGraphicsRectItem() | 56 | : QObject(parent), QGraphicsRectItem() | ||
56 | , d(new Private(document)) | 57 | , d(new Private(document)) | ||
57 | { | 58 | { | ||
58 | Q_ASSERT(document); | 59 | Q_ASSERT(document); | ||
59 | 60 | | |||
60 | int pageWidth; | 61 | int pageWidth; | ||
61 | int pageHeight; | 62 | int pageHeight; | ||
62 | 63 | | |||
63 | QString pageSize = d->reportDocument->pageOptions().getPageSize(); | 64 | QString pageSize = d->reportDocument->pageLayout().pageSize().name(); | ||
64 | 65 | | |||
66 | pageWidth = d->reportDocument->pageLayout().fullRectPixels(KReportDpi::dpiX()).width(); | ||||
67 | pageHeight = d->reportDocument->pageLayout().fullRectPixels(KReportDpi::dpiX()).height(); | ||||
68 | | ||||
69 | //TODO remove after check | ||||
70 | #if 0 | ||||
65 | if (pageSize == QLatin1String("Custom")) { | 71 | if (pageSize == QLatin1String("Custom")) { | ||
66 | // if this is custom sized sheet of paper we will just use those values | 72 | // if this is custom sized sheet of paper we will just use those values | ||
67 | pageWidth = (int)(d->reportDocument->pageOptions().getCustomWidth()); | 73 | | ||
68 | pageHeight = (int)(d->reportDocument->pageOptions().getCustomHeight()); | | |||
69 | } else { | 74 | } else { | ||
70 | // lookup the correct size information for the specified size paper | 75 | // lookup the correct size information for the specified size paper | ||
71 | pageWidth = d->reportDocument->pageOptions().pixelSize().width(); | 76 | pageWidth = d->reportDocument->pageOptions().pixelSize().width(); | ||
72 | pageHeight = d->reportDocument->pageOptions().pixelSize().height(); | 77 | pageHeight = d->reportDocument->pageOptions().pixelSize().height(); | ||
73 | } | 78 | } | ||
79 | #endif | ||||
74 | 80 | | |||
75 | setRect(0, 0, pageWidth, pageHeight); | 81 | setRect(0, 0, pageWidth, pageHeight); | ||
76 | //kreportDebug() << "PAGE IS " << pageWidth << "x" << pageHeight; | 82 | //kreportDebug() << "PAGE IS " << pageWidth << "x" << pageHeight; | ||
77 | d->pixmap = QPixmap(pageWidth, pageHeight); | 83 | d->pixmap = QPixmap(pageWidth, pageHeight); | ||
78 | d->renderer = d->factory.createInstance(QLatin1String("screen")); | 84 | d->renderer = d->factory.createInstance(QLatin1String("screen")); | ||
79 | connect(d->reportDocument, SIGNAL(updated(int)), this, SLOT(pageUpdated(int))); | 85 | connect(d->reportDocument, SIGNAL(updated(int)), this, SLOT(pageUpdated(int))); | ||
80 | 86 | | |||
81 | d->renderTimer.setSingleShot(true); | 87 | d->renderTimer.setSingleShot(true); | ||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |