diff options
Diffstat (limited to 'vcl/qt5/QtSvpGraphics.cxx')
-rw-r--r-- | vcl/qt5/QtSvpGraphics.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vcl/qt5/QtSvpGraphics.cxx b/vcl/qt5/QtSvpGraphics.cxx index b6018a95e299..3632c8990706 100644 --- a/vcl/qt5/QtSvpGraphics.cxx +++ b/vcl/qt5/QtSvpGraphics.cxx @@ -102,10 +102,17 @@ void QtSvpGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) return; } - if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle()) + if (!m_pFrame) + return; + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + QScreen* pScreen = m_pFrame->GetQWidget()->screen(); +#else + if (!m_pFrame->GetQWidget()->window()->windowHandle()) return; QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen(); +#endif rDPIX = pScreen->logicalDotsPerInchX() * pScreen->devicePixelRatio() + 0.5; rDPIY = pScreen->logicalDotsPerInchY() * pScreen->devicePixelRatio() + 0.5; } |