From 78b2719b04f1177b5af0f52fce98316505f9000b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 22 Sep 2015 12:21:29 +0200 Subject: Windows: Add checks to usages of QWindow::screen(). Default to primary screen and handle situations where the screen is null consistently. Remove unused QWindowsScreen::screenOf() method. Task-number: QTBUG-48288 Change-Id: I91b3c2331521d9d3be8ac77606ee820cd35ebb0f Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowsscreen.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowsscreen.cpp') diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 391735a035..e6abfb2403 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -276,18 +276,6 @@ QWindow *QWindowsScreen::windowAt(const QPoint &screenPoint, unsigned flags) return result; } -QWindowsScreen *QWindowsScreen::screenOf(const QWindow *w) -{ - if (w) - if (const QScreen *s = w->screen()) - if (QPlatformScreen *pscr = s->handle()) - return static_cast(pscr); - if (const QScreen *ps = QGuiApplication::primaryScreen()) - if (QPlatformScreen *ppscr = ps->handle()) - return static_cast(ppscr); - return 0; -} - qreal QWindowsScreen::pixelDensity() const { const qreal physicalDpi = m_data.geometry.width() / m_data.physicalSizeMM.width() * qreal(25.4); -- cgit v1.2.3