Changeset View
Changeset View
Standalone View
Standalone View
autotests/format/FormatTest.cpp
Show All 25 Lines | |||||
26 | #include "KReportLabelElement.h" | 26 | #include "KReportLabelElement.h" | ||
27 | #include "KReportDocument.h" | 27 | #include "KReportDocument.h" | ||
28 | #include "KReportDesignerSectionDetail.h" | 28 | #include "KReportDesignerSectionDetail.h" | ||
29 | #include "KReportSection.h" | 29 | #include "KReportSection.h" | ||
30 | #include "KReportDesignerItemLine.h" | 30 | #include "KReportDesignerItemLine.h" | ||
31 | #include "KReportItemLine.h" | 31 | #include "KReportItemLine.h" | ||
32 | #include "KReportDesignerItemRectBase.h" | 32 | #include "KReportDesignerItemRectBase.h" | ||
33 | #include "KReportUnit.h" | 33 | #include "KReportUnit.h" | ||
34 | #include <KReportDpi> | | |||
35 | #include <KReportDesign> | 34 | #include <KReportDesign> | ||
36 | 35 | | |||
37 | #include <QPointF> | 36 | #include <QPointF> | ||
38 | #include <QSizeF> | 37 | #include <QSizeF> | ||
39 | #include <QDomDocument> | 38 | #include <QDomDocument> | ||
40 | #include <QScreen> | 39 | #include <QScreen> | ||
41 | #include <QDir> | 40 | #include <QDir> | ||
42 | #include <QTest> | 41 | #include <QTest> | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 90 | #if 0 | |||
98 | 97 | | |||
99 | KReportPreRenderer renderer( designer.document() ); | 98 | KReportPreRenderer renderer( designer.document() ); | ||
100 | renderer.generate(); | 99 | renderer.generate(); | ||
101 | ReportPageOptions opt = renderer.reportData()->pageOptions(); | 100 | ReportPageOptions opt = renderer.reportData()->pageOptions(); | ||
102 | 101 | | |||
103 | QCOMPARE(opt.getPageSize(), QString("A5")); | 102 | QCOMPARE(opt.getPageSize(), QString("A5")); | ||
104 | QScreen *srn = QApplication::screens().at(0); | 103 | QScreen *srn = QApplication::screens().at(0); | ||
105 | const qreal dpiY = srn->logicalDotsPerInchY(); | 104 | const qreal dpiY = srn->logicalDotsPerInchY(); | ||
106 | qDebug() << opt.getMarginBottom() << INCH_TO_POINT(opt.getMarginBottom()) << KReportDpi::dpiY() << dpiY << KReportUnit::parseValue("1.5cm"); | 105 | qDebug() << opt.getMarginBottom() << INCH_TO_POINT(opt.getMarginBottom()) << KReportPrivate::dpiY() << dpiY << KReportUnit::parseValue("1.5cm"); | ||
107 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginBottom()) / KReportDpi::dpiY(), KReportUnit::parseValue("1.5cm"), 0.2); | 106 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginBottom()) / KReportPrivate::dpiY(), KReportUnit::parseValue("1.5cm"), 0.2); | ||
108 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginTop()) / KReportDpi::dpiY(), KReportUnit::parseValue("2.0cm"), 0.2); | 107 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginTop()) / KReportPrivate::dpiY(), KReportUnit::parseValue("2.0cm"), 0.2); | ||
109 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginLeft()) / KReportDpi::dpiX(), KReportUnit::parseValue("3.0cm"), 0.2); | 108 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginLeft()) / KReportPrivate::dpiX(), KReportUnit::parseValue("3.0cm"), 0.2); | ||
110 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginRight()) / KReportDpi::dpiX(), KReportUnit::parseValue("4.0cm"), 0.3); | 109 | QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginRight()) / KReportPrivate::dpiX(), KReportUnit::parseValue("4.0cm"), 0.3); | ||
111 | #endif | 110 | #endif | ||
112 | } | 111 | } | ||
113 | 112 | | |||
114 | void FormatTest::testLineElement() | 113 | void FormatTest::testLineElement() | ||
115 | { | 114 | { | ||
116 | #if 0 // todo | 115 | #if 0 // todo | ||
117 | KReportDesign design; | 116 | KReportDesign design; | ||
118 | QString errorMessage; | 117 | QString errorMessage; | ||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |