diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index e84e1c6abd..977142be7c 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -133,9 +133,10 @@ int wxQtDCImpl::GetDepth() const wxSize wxQtDCImpl::GetPPI() const { QScreen *srn = QApplication::screens().at(0); - qreal dotsPerInch = (qreal)srn->logicalDotsPerInch(); + if (!srn) + return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY()); + qreal dotsPerInch = srn->logicalDotsPerInch(); return wxSize(round(dotsPerInch), round(dotsPerInch)); -// return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY()); } void wxQtDCImpl::SetFont(const wxFont& font)