diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-06-29 08:35:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-06-30 07:06:30 +0000 |
commit | 596ce989b5efff9d062540544e9c024dabe14e05 (patch) | |
tree | b8e0935d07de1f2ae39b578783b1d40acfea21b4 /src/plugins/platforms/windows | |
parent | be6921e8605ef3951ff8e8f2528c4c2e4f8d9b71 (diff) |
Windows QPA: Improve warning about SetProcessDpiAwareness() failure
Silence warning in case DPI awareness was set externally unless
debug is enabled.
Task-number: QTBUG-54416
Change-Id: Id48769e3d4be3047f582e331633905c640930f21
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 09c2f7df2e..39054b6a64 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -409,7 +409,9 @@ void QWindowsContext::setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiA qCDebug(lcQpaWindows) << __FUNCTION__ << dpiAwareness; if (QWindowsContext::shcoredll.isValid()) { const HRESULT hr = QWindowsContext::shcoredll.setProcessDpiAwareness(dpiAwareness); - if (FAILED(hr)) { + // E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin). + // Silence warning in that case unless debug is enabled. + if (FAILED(hr) && (hr != E_ACCESSDENIED || lcQpaWindows().isDebugEnabled())) { qWarning().noquote().nospace() << "SetProcessDpiAwareness(" << dpiAwareness << ") failed: " << QWindowsContext::comErrorString(hr) << ", using " << QWindowsContext::processDpiAwareness(); @@ -843,6 +845,9 @@ QByteArray QWindowsContext::comErrorString(HRESULT hr) case E_UNEXPECTED: result += QByteArrayLiteral("E_UNEXPECTED"); break; + case E_ACCESSDENIED: + result += QByteArrayLiteral("E_ACCESSDENIED"); + break; case CO_E_ALREADYINITIALIZED: result += QByteArrayLiteral("CO_E_ALREADYINITIALIZED"); break; |