summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/qnx
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-17 09:39:01 +0200
commitd6588d20518e6e33fdd5433d8af733657060b11e (patch)
treeffb5bcde2eec08a9cb0e4a3122c2efdcf362e822 /src/plugins/platforms/qnx
parentc5b766638ac8cef1acebb97d5952485f5dc846ad (diff)
QPlatformWindow: change API for QPlatformWindow::setWindowState
The current implementation requests the platform window to set the window state if it can, and return the actual window state back. The problem with this approach is that the platform window is created as late as possible, so a call to QWindow::setWindowState would in many (most?) cases never be forwarded to the platform window (instead, the platform window is responsible to check the current window state upon creation). As such, the window state might be left unsynched with the platform window. This patch suggests removing the return value from QPlatformWindow::setWindowState. This will at least be consistent, so that setting/getting state 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/actual window state. Change-Id: Ie43f56169656854a765ce88b47a808f8f3d51bb4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/qnx')
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp7
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index 9dd8ad7a71..097b5788f6 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -580,13 +580,13 @@ void QQnxWindow::requestActivateWindow()
}
-Qt::WindowState QQnxWindow::setWindowState(Qt::WindowState state)
+void QQnxWindow::setWindowState(Qt::WindowState state)
{
qWindowDebug() << Q_FUNC_INFO << "state =" << state;
// Prevent two calls with Qt::WindowFullScreen from changing m_unmaximizedGeometry
if (m_windowState == state)
- return state;
+ return;
switch (state) {
@@ -594,7 +594,7 @@ Qt::WindowState QQnxWindow::setWindowState(Qt::WindowState state)
// WindowActive is not an accepted parameter according to the docs
case Qt::WindowMinimized:
case Qt::WindowActive:
- return m_windowState;
+ return;
case Qt::WindowMaximized:
case Qt::WindowFullScreen:
@@ -609,7 +609,6 @@ Qt::WindowState QQnxWindow::setWindowState(Qt::WindowState state)
}
m_windowState = state;
- return state;
}
void QQnxWindow::gainedFocus()
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index d79c6785dd..90226bb9a4 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -101,7 +101,7 @@ public:
void raise();
void lower();
void requestActivateWindow();
- Qt::WindowState setWindowState(Qt::WindowState state);
+ void setWindowState(Qt::WindowState state);
void gainedFocus();