Windows XP style: Fix warnings wrt retrieving HANDLE from 0-window.
Exclude invisible top level dialogs for whom a native dialog is being shown from top-level search. Change-Id: Ia94599905457d81d342c14d09ad0b0fc89ec4ab1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
1d18fd0164
commit
3282b060d1
@ -337,10 +337,11 @@ HWND QWindowsXPStylePrivate::winId(const QWidget *widget)
|
||||
if (const HWND hwnd = QApplicationPrivate::getHWNDForWidget(const_cast<QWidget *>(widget)))
|
||||
return hwnd;
|
||||
|
||||
const QWidgetList toplevels = QApplication::topLevelWidgets();
|
||||
if (!toplevels.isEmpty())
|
||||
if (const HWND topLevelHwnd = QApplicationPrivate::getHWNDForWidget(toplevels.front()))
|
||||
return topLevelHwnd;
|
||||
// Find top level with native window (there might be dialogs that do not have one).
|
||||
foreach (const QWidget *toplevel, QApplication::topLevelWidgets())
|
||||
if (toplevel->windowHandle())
|
||||
if (const HWND topLevelHwnd = QApplicationPrivate::getHWNDForWidget(toplevel))
|
||||
return topLevelHwnd;
|
||||
|
||||
if (QDesktopWidget *desktop = qApp->desktop())
|
||||
if (const HWND desktopHwnd = QApplicationPrivate::getHWNDForWidget(desktop))
|
||||
|
Loading…
Reference in New Issue
Block a user