Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportView.cpp
Show All 24 Lines | |||||
25 | #include "KReportRendererBase.h" | 25 | #include "KReportRendererBase.h" | ||
26 | #include "kreport_debug.h" | 26 | #include "kreport_debug.h" | ||
27 | 27 | | |||
28 | #include <QLabel> | 28 | #include <QLabel> | ||
29 | #include <QBoxLayout> | 29 | #include <QBoxLayout> | ||
30 | #include <QScrollArea> | 30 | #include <QScrollArea> | ||
31 | #include <QLayout> | 31 | #include <QLayout> | ||
32 | #include <QPainter> | 32 | #include <QPainter> | ||
33 | #include <QPointer> | ||||
33 | #include <QPrintDialog> | 34 | #include <QPrintDialog> | ||
34 | #include <QPrinter> | 35 | #include <QPrinter> | ||
35 | #include <QGraphicsView> | 36 | #include <QGraphicsView> | ||
36 | #include <QGraphicsScene> | 37 | #include <QGraphicsScene> | ||
37 | #include <QScrollBar> | 38 | #include <QScrollBar> | ||
38 | 39 | | |||
39 | //! @internal | 40 | //! @internal | ||
40 | class KReportView::Private | 41 | class KReportView::Private | ||
41 | { | 42 | { | ||
42 | public: | 43 | public: | ||
43 | explicit Private() | 44 | explicit Private() | ||
44 | : reportDocument(0) | 45 | : reportPage(0) | ||
45 | , reportPage(0) | | |||
46 | , currentPage(1) | 46 | , currentPage(1) | ||
47 | , pageCount(0) | 47 | , pageCount(0) | ||
48 | {} | 48 | {} | ||
49 | 49 | | |||
50 | ~Private() | 50 | ~Private() | ||
51 | {} | 51 | {} | ||
52 | 52 | | |||
53 | //! Move to page @a page (counted from 1) | 53 | //! Move to page @a page (counted from 1) | ||
54 | void moveToPage(int page) | 54 | void moveToPage(int page) | ||
55 | { | 55 | { | ||
56 | if (page != currentPage && page >= 1 && page <= pageCount) { | 56 | if (page != currentPage && page >= 1 && page <= pageCount) { | ||
57 | currentPage = page; | 57 | currentPage = page; | ||
58 | reportPage->renderPage(currentPage); | 58 | reportPage->renderPage(currentPage); | ||
59 | } | 59 | } | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | ORODocument *reportDocument; | 62 | QPointer<ORODocument> reportDocument; | ||
63 | QGraphicsView *reportView; | 63 | QGraphicsView *reportView; | ||
64 | QGraphicsScene *reportScene; | 64 | QGraphicsScene *reportScene; | ||
65 | KReportPage *reportPage; | 65 | KReportPage *reportPage; | ||
66 | 66 | | |||
67 | int currentPage; | 67 | int currentPage; | ||
68 | int pageCount; | 68 | int pageCount; | ||
69 | 69 | | |||
70 | KReportRendererFactory factory; | 70 | KReportRendererFactory factory; | ||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |