summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2012-10-09 10:52:44 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-15 10:18:31 +0200
commit58add50eb010daeb7427f76b90b3ecae7ab75a59 (patch)
tree8fbd047a184a75f46f50c1c60d2602eff44d5aa2 /src/gui
parent6343a46bc5160baf9e7dd79e43419ee1be52d505 (diff)
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>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qplatformwindow.cpp9
-rw-r--r--src/gui/kernel/qplatformwindow.h2
-rw-r--r--src/gui/kernel/qwindow.cpp5
3 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 755fd8a652..27dfd7cf40 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -142,17 +142,16 @@ void QPlatformWindow::setVisible(bool visible)
QWindowSystemInterface::handleExposeEvent(window(), rect);
QWindowSystemInterface::flushWindowSystemEvents();
}
+
/*!
Requests setting the window flags of this surface
- to \a type. Returns the actual flags set.
+ to \a flags.
*/
-Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
+void QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
{
- return flags;
+ Q_UNUSED(flags);
}
-
-
/*!
Returns if this window is exposed in the windowing system.
diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h
index 7ea17d05aa..2b2d227fcf 100644
--- a/src/gui/kernel/qplatformwindow.h
+++ b/src/gui/kernel/qplatformwindow.h
@@ -90,7 +90,7 @@ public:
virtual QMargins frameMargins() const;
virtual void setVisible(bool visible);
- virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+ virtual void setWindowFlags(Qt::WindowFlags flags);
virtual Qt::WindowState setWindowState(Qt::WindowState state);
virtual WId winId() const;
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 79927cbc71..27e1571184 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -514,9 +514,8 @@ void QWindow::setWindowFlags(Qt::WindowFlags flags)
{
Q_D(QWindow);
if (d->platformWindow)
- d->windowFlags = d->platformWindow->setWindowFlags(flags);
- else
- d->windowFlags = flags;
+ d->platformWindow->setWindowFlags(flags);
+ d->windowFlags = flags;
}
/*!