Windows: Avoid accidentally copying QWindowsScreenManager
Pick-to: 6.2 6.3 6.4 Change-Id: I60b219e9a3ea62a96c369ee910eacf06d61f4f71 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
91fd8bdb11
commit
7d2488280e
@ -92,6 +92,7 @@ private:
|
||||
|
||||
class QWindowsScreenManager
|
||||
{
|
||||
Q_DISABLE_COPY_MOVE(QWindowsScreenManager)
|
||||
public:
|
||||
using WindowsScreenList = QList<QWindowsScreen *>;
|
||||
|
||||
|
@ -571,7 +571,7 @@ void QWindowsTheme::refreshFonts()
|
||||
if (!QGuiApplication::desktopSettingsAware())
|
||||
return;
|
||||
NONCLIENTMETRICS ncm;
|
||||
auto screenManager = QWindowsContext::instance()->screenManager();
|
||||
auto &screenManager = QWindowsContext::instance()->screenManager();
|
||||
QWindowsContext::nonClientMetricsForScreen(&ncm, screenManager.screens().value(0));
|
||||
qCDebug(lcQpaWindows) << __FUNCTION__ << ncm;
|
||||
const QFont menuFont = QWindowsFontDatabase::LOGFONT_to_QFont(ncm.lfMenuFont);
|
||||
|
@ -1059,7 +1059,7 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, HWND hwnd, DWORD style, D
|
||||
return {};
|
||||
if (QWindowsScreenManager::isSingleScreen())
|
||||
return frameOnPrimaryScreen(w, style, exStyle);
|
||||
auto screenManager = QWindowsContext::instance()->screenManager();
|
||||
auto &screenManager = QWindowsContext::instance()->screenManager();
|
||||
auto screen = screenManager.screenForHwnd(hwnd);
|
||||
if (!screen)
|
||||
screen = screenManager.screens().value(0);
|
||||
@ -1086,7 +1086,7 @@ QMargins QWindowsGeometryHint::frame(const QWindow *w, const QRect &geometry,
|
||||
return frameOnPrimaryScreen(w, style, exStyle);
|
||||
}
|
||||
qreal dpi = 96;
|
||||
auto screenManager = QWindowsContext::instance()->screenManager();
|
||||
auto &screenManager = QWindowsContext::instance()->screenManager();
|
||||
auto screen = screenManager.screenAtDp(geometry.center());
|
||||
if (!screen)
|
||||
screen = screenManager.screens().value(0);
|
||||
|
Loading…
Reference in New Issue
Block a user