Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportDesigner.cpp
Show First 20 Lines • Show All 859 Lines • ▼ Show 20 Line(s) | 826 | { | |||
---|---|---|---|---|---|
860 | 860 | | |||
861 | h += d->hruler->height(); | 861 | h += d->hruler->height(); | ||
862 | 862 | | |||
863 | return QSize(w, h); | 863 | return QSize(w, h); | ||
864 | } | 864 | } | ||
865 | 865 | | |||
866 | int KReportDesigner::pageWidthPx() const | 866 | int KReportDesigner::pageWidthPx() const | ||
867 | { | 867 | { | ||
868 | KReportPageOptions po; | 868 | QPageLayout layout; | ||
869 | po.setPageSize(d->set->property("page-size").value().toString()); | 869 | layout.setPageSize(QPageSize(KReportPageSize::pageSize(d->set->property("page-size").value().toString()))); | ||
870 | po.setPortrait(d->set->property("print-orientation").value().toString() == QLatin1String("portrait")); | 870 | layout.setOrientation(d->set->property("print-orientation").value().toString() == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape); | ||
871 | QSizeF pageSizePx = po.pixelSize(); | 871 | QSize pageSizePx = layout.fullRectPixels(KReportDpi::dpiX()).size(); | ||
staniek: Better no abbreviations like this... | |||||
872 | 872 | | |||
873 | int width = pageSizePx.width(); | 873 | int width = pageSizePx.width(); | ||
874 | width = width - POINT_TO_INCH(d->set->property("margin-left").value().toDouble()) * KReportDpi::dpiX(); | 874 | width = width - POINT_TO_INCH(d->set->property("margin-left").value().toDouble()) * KReportDpi::dpiX(); | ||
875 | width = width - POINT_TO_INCH(d->set->property("margin-right").value().toDouble()) * KReportDpi::dpiX(); | 875 | width = width - POINT_TO_INCH(d->set->property("margin-right").value().toDouble()) * KReportDpi::dpiX(); | ||
876 | 876 | | |||
877 | return width; | 877 | return width; | ||
878 | } | 878 | } | ||
879 | 879 | | |||
▲ Show 20 Lines • Show All 674 Lines • Show Last 20 Lines |
Better no abbreviations like this...