From 58add50eb010daeb7427f76b90b3ecae7ab75a59 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 9 Oct 2012 10:52:44 +0200 Subject: 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 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/windows/qwindowswindow.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2335870ea7..f3830eb962 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1178,7 +1178,7 @@ void QWindowsWindow::setWindowTitle(const QString &title) SetWindowText(m_data.hwnd, (const wchar_t*)title.utf16()); } -Qt::WindowFlags QWindowsWindow::setWindowFlags(Qt::WindowFlags flags) +void QWindowsWindow::setWindowFlags(Qt::WindowFlags flags) { if (QWindowsContext::verboseWindows) qDebug() << '>' << __FUNCTION__ << this << window() << "\n from: " @@ -1202,7 +1202,6 @@ Qt::WindowFlags QWindowsWindow::setWindowFlags(Qt::WindowFlags flags) qDebug() << '<' << __FUNCTION__ << "\n returns: " << QWindowsWindow::debugWindowFlags(m_data.flags) << " geometry " << oldGeometry << "->" << newGeometry; - return m_data.flags; } QWindowsWindow::WindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt, -- cgit v1.2.3