diff --git a/core/document.cpp b/core/document.cpp index ea133864b..a174bcd11 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -936,7 +936,9 @@ bool DocumentPrivate::openDocumentInternal( const KService::Ptr& offer, bool iss QApplication::setOverrideCursor( Qt::WaitCursor ); - m_generator->setDPI(Utils::realDpi(m_widget)); + const QSizeF dpi = Utils::realDpi(m_widget); + kDebug() << "Output DPI:" << dpi; + m_generator->setDPI(dpi); bool openOk = false; if ( !isstdin ) diff --git a/core/utils.cpp b/core/utils.cpp index 369c235f3..71442f0e6 100644 --- a/core/utils.cpp +++ b/core/utils.cpp @@ -79,6 +79,7 @@ double Utils::realDpiX() { const QDesktopWidget* w = QApplication::desktop(); if (w->width() > 0 && w->widthMM() > 0) { + kDebug() << "Pix:" << w->width() << "MM:" << w->widthMM(); return (double(w->width()) * 25.4) / double(w->widthMM()); } else { return dpiX(); @@ -89,6 +90,7 @@ double Utils::realDpiY() { const QDesktopWidget* w = QApplication::desktop(); if (w->height() > 0 && w->heightMM() > 0) { + kDebug() << "Pix:" << w->height() << "MM:" << w->heightMM(); return (double(w->height()) * 25.4) / double(w->heightMM()); } else { return dpiY(); @@ -148,10 +150,17 @@ QSizeF Utils::realDpi(QWidget* widgetOnScreen) kDebug() << "Output is vertical, transposing DPI rect"; res.transpose(); } - kDebug() << "Output DPI is " << res; return res; } } + else + { + kDebug() << "Didn't find a KScreen selectedOutput to calculate DPI. Falling back"; + } + } + else + { + kDebug() << "Didn't find a KScreen config to calculate DPI. Falling back"; } #endif }