KReport
21 #include "KReportView.h"
22 #include "KReportPage.h"
23 #include "KReportRenderObjects.h"
24 #include "KReportPreRenderer.h"
25 #include "KReportRendererBase.h"
26 #include "kreport_debug.h"
30 #include <QScrollArea>
34 #include <QGraphicsView>
35 #include <QGraphicsScene>
52 void moveToPage(
int page)
54 if (page != currentPage && page >= 1 && page <= pageCount) {
56 reportPage->renderPage(currentPage);
72 KReportView::KReportView(
QWidget *parent)
73 :
QWidget(parent), d(new Private())
85 layout()->addWidget(d->reportView);
88 d->reportScene->setSceneRect(0,0,1000,2000);
89 d->reportView->setScene(d->reportScene);
91 d->reportScene->setBackgroundBrush(palette().brush(
QPalette::Dark));
94 KReportView::~KReportView()
100 void KReportView::moveToFirstPage()
105 void KReportView::moveToLastPage()
107 d->moveToPage(d->pageCount);
110 void KReportView::moveToNextPage()
112 d->moveToPage(d->currentPage + 1);
115 void KReportView::moveToPreviousPage()
117 d->moveToPage(d->currentPage - 1);
127 return d->currentPage;
130 int KReportView::pageCount()
const
137 d->reportDocument = doc;
140 delete d->reportPage;
145 d->reportPage =
new KReportPage(
this, d->reportDocument);
148 d->reportScene->setSceneRect(0,0,d->reportPage->rect().width() + 40, d->reportPage->rect().height() + 40);
149 d->reportScene->addItem(d->reportPage);
150 d->reportPage->setPos(20,20);
151 d->reportView->centerOn(0,0);
157 return d->reportView;
160 void KReportView::refreshCurrentPage()
164 d->reportPage->renderPage(d->currentPage);
Factory for creating renderers.
Provides a widget that renders a specific page of an ORODocument The widget is sized to the document ...
void setMargin(int margin)
Represents a single document containing one or more OROPage elements.
Provides a simple widget for viewing a rendered report on screen.
int pageCount() const
Return the total number of pages in the document.
void moveToPage(int page)
Moves to page page (counted from 1)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Nov 30 2023 04:08:55 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.