Changeset View
Changeset View
Standalone View
Standalone View
examples/window.cpp
Show All 13 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License | ||
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to | ||
16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "window.h" | 20 | #include "window.h" | ||
21 | #include "DesignerWidget.h" | 21 | #include "DesignerWidget.h" | ||
22 | #include "KReportExampleDataSource.h" | ||||
22 | 23 | | |||
23 | #include <KReportRenderObjects> | 24 | #include <KReportRenderObjects> | ||
24 | #include <KReportPluginManager> | 25 | #include <KReportPluginManager> | ||
25 | #include <KReportRendererBase> | 26 | #include <KReportRendererBase> | ||
26 | 27 | | |||
27 | #include <QApplication> | 28 | #include <QApplication> | ||
28 | #include <QDebug> | 29 | #include <QDebug> | ||
29 | #include <QFile> | 30 | #include <QFile> | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
116 | 117 | | |||
117 | void Window::showDesign(const QDomElement &design) | 118 | void Window::showDesign(const QDomElement &design) | ||
118 | { | 119 | { | ||
119 | KReportPreRenderer preRenderer(design); | 120 | KReportPreRenderer preRenderer(design); | ||
120 | if (!preRenderer.isValid()) { | 121 | if (!preRenderer.isValid()) { | ||
121 | return; | 122 | return; | ||
122 | } | 123 | } | ||
123 | 124 | | |||
124 | preRenderer.setSourceData(new KReportExampleData()); | 125 | preRenderer.setSourceData(new KReportExampleDataSource()); | ||
125 | preRenderer.setName("example_report"); | 126 | preRenderer.setName("example_report"); | ||
126 | 127 | | |||
127 | if (preRenderer.generateDocument()) { | 128 | if (preRenderer.generateDocument()) { | ||
128 | m_reportView->setDocument(preRenderer.document()); | 129 | m_reportView->setDocument(preRenderer.document()); | ||
129 | m_reportView->moveToFirstPage(); | 130 | m_reportView->moveToFirstPage(); | ||
130 | } | 131 | } | ||
131 | } | 132 | } |