Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesignerSectionScene.cpp
Show All 15 Lines | |||||
16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | #include "KReportDesignerSectionScene.h" | 19 | #include "KReportDesignerSectionScene.h" | ||
20 | #include "KReportPageOptions.h" | 20 | #include "KReportPageOptions.h" | ||
21 | #include "KReportDesignerItemRectBase.h" | 21 | #include "KReportDesignerItemRectBase.h" | ||
22 | #include "KReportDesigner.h" | 22 | #include "KReportDesigner.h" | ||
23 | #include "KReportLabelSizeInfo.h" | 23 | #include "KReportLabelSizeInfo.h" | ||
24 | #include "KReportPageFormat.h" | 24 | #include "KReportDpi.h" | ||
25 | #include "kreport_debug.h" | 25 | #include "kreport_debug.h" | ||
26 | 26 | | |||
27 | #include <QPainter> | 27 | #include <QPainter> | ||
28 | #include <QScreen> | | |||
29 | #include <QApplication> | 28 | #include <QApplication> | ||
30 | #include <QGraphicsItem> | 29 | #include <QGraphicsItem> | ||
31 | #include <QGraphicsSceneMouseEvent> | 30 | #include <QGraphicsSceneMouseEvent> | ||
32 | 31 | | |||
33 | KReportDesignerSectionScene::KReportDesignerSectionScene(qreal w, qreal h, KReportDesigner *rd) | 32 | KReportDesignerSectionScene::KReportDesignerSectionScene(qreal w, qreal h, KReportDesigner *rd) | ||
34 | : QGraphicsScene(0, 0, w, h, rd) | 33 | : QGraphicsScene(0, 0, w, h, rd) | ||
35 | { | 34 | { | ||
36 | m_rd = rd; | 35 | m_rd = rd; | ||
37 | m_minorSteps = 0; | 36 | m_minorSteps = 0; | ||
38 | 37 | m_dpiX = KReportDpi::dpiX(); | |||
39 | QScreen *srn = QApplication::screens().at(0); | 38 | m_dpiY = KReportDpi::dpiY(); | ||
40 | | ||||
41 | m_dpiX = srn->logicalDotsPerInchX(); | | |||
42 | m_dpiY = srn->logicalDotsPerInchY(); | | |||
43 | 39 | | |||
44 | if (m_unit.type() != m_rd->pageUnit().type()) { | 40 | if (m_unit.type() != m_rd->pageUnit().type()) { | ||
45 | m_unit = m_rd->pageUnit(); | 41 | m_unit = m_rd->pageUnit(); | ||
46 | if (m_unit.type() == KReportUnit::Cicero || | 42 | if (m_unit.type() == KReportUnit::Cicero || | ||
47 | m_unit.type() == KReportUnit::Pica || | 43 | m_unit.type() == KReportUnit::Pica || | ||
48 | m_unit.type() == KReportUnit::Millimeter) { | 44 | m_unit.type() == KReportUnit::Millimeter) { | ||
49 | m_majorX = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiX; | 45 | m_majorX = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiX; | ||
50 | m_majorY = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiY; | 46 | m_majorY = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiY; | ||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |