QPlatformWindow: change API for QPlatformWindow::setWindowFlags
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>
Tue, 9 Oct 2012 08:52:44 +0000 (10:52 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 15 Oct 2012 08:18:31 +0000 (10:18 +0200)
commit58add50eb010daeb7427f76b90b3ecae7ab75a59
tree8fbd047a184a75f46f50c1c60d2602eff44d5aa2
parent6343a46bc5160baf9e7dd79e43419ee1be52d505
QPlatformWindow: change API for QPlatformWindow::setWindowFlags

The current implementation requests the platform window to set
as many of the flags it can, and return the same flags with the
unsupported flags removed.

The problem with this approach is that the platform window is created
as late as possible, so a call to QWindow::setWindowFlags would in
many (most?) cases never be forwarded to the platform window (instead,
the platform window is responsible to check the current window flags
upon creation). As such, the filtering would never be done.
Looking at the current set of plugins, most of them also seems to
ignore this protocol, returning the flags unfiltered.

This patch suggests removing the return value from
QPlatformWindow::setWindowFlags. This will at least be consistent, so
that setting/getting flags would produce the same result independent of
delayed window creation. If needed, we can later add new API to
QPlatformIntegration or QPlatformWindow for querying supported window
flags.

Change-Id: I9c759b5f9fab5ebed764a982f77fe19881118875
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
13 files changed:
src/gui/kernel/qplatformwindow.cpp
src/gui/kernel/qplatformwindow.h
src/gui/kernel/qwindow.cpp
src/platformsupport/fbconvenience/qfbwindow.cpp
src/platformsupport/fbconvenience/qfbwindow_p.h
src/plugins/platforms/cocoa/qcocoawindow.h
src/plugins/platforms/cocoa/qcocoawindow.mm
src/plugins/platforms/directfb/qdirectfbwindow.cpp
src/plugins/platforms/directfb/qdirectfbwindow.h
src/plugins/platforms/windows/qwindowswindow.cpp
src/plugins/platforms/windows/qwindowswindow.h
src/plugins/platforms/xcb/qxcbwindow.cpp
src/plugins/platforms/xcb/qxcbwindow.h