Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesigner.cpp
Show First 20 Lines • Show All 838 Lines • ▼ Show 20 Line(s) | 805 | { | |||
---|---|---|---|---|---|
839 | 839 | | |||
840 | h += d->hruler->height(); | 840 | h += d->hruler->height(); | ||
841 | 841 | | |||
842 | return QSize(w, h); | 842 | return QSize(w, h); | ||
843 | } | 843 | } | ||
844 | 844 | | |||
845 | int KReportDesigner::pageWidthPx() const | 845 | int KReportDesigner::pageWidthPx() const | ||
846 | { | 846 | { | ||
847 | QPageLayout layout; | 847 | QPageLayout layout = QPageLayout(QPageSize(KReportPageSize::pageSize(d->set->property("page-size").value().toString())), d->set->property("print-orientation").value().toString() == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape, QMarginsF(0,0,0,0));; | ||
848 | layout.setPageSize(QPageSize(KReportPageSize::pageSize(d->set->property("page-size").value().toString()))); | 848 | | ||
849 | layout.setOrientation(d->set->property("print-orientation").value().toString() == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape); | | |||
850 | QSize pageSizePx = layout.fullRectPixels(KReportPrivate::dpiX()).size(); | 849 | QSize pageSizePx = layout.fullRectPixels(KReportPrivate::dpiX()).size(); | ||
851 | 850 | | |||
852 | int width = pageSizePx.width(); | 851 | int width = pageSizePx.width(); | ||
853 | width = width - POINT_TO_INCH(d->set->property("margin-left").value().toDouble()) * KReportPrivate::dpiX(); | 852 | width = width - POINT_TO_INCH(d->set->property("margin-left").value().toDouble()) * KReportPrivate::dpiX(); | ||
854 | width = width - POINT_TO_INCH(d->set->property("margin-right").value().toDouble()) * KReportPrivate::dpiX(); | 853 | width = width - POINT_TO_INCH(d->set->property("margin-right").value().toDouble()) * KReportPrivate::dpiX(); | ||
855 | 854 | | |||
856 | return width; | 855 | return width; | ||
857 | } | 856 | } | ||
▲ Show 20 Lines • Show All 677 Lines • Show Last 20 Lines |