diff options
author | Kevin Krammer <kevin.krammer.qnx@kdab.com> | 2012-03-23 12:50:22 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-28 19:34:42 +0200 |
commit | 5d117fd427e3e727df5d3f417a2b91366f2a31c1 (patch) | |
tree | 7ab2f4bffabd8af212e481c3563c2b8ecb48d12a /src/plugins/platforms/qnx/qqnxscreen.cpp | |
parent | a80a2c6da241dac77f533bc702a1c7d94349a812 (diff) |
Refactoring virtual keyboard class into non-singleton
Getting rid of the singleton gives us better control over when the
virtual keyboard handling class is instantiated and configured.
Also notify screens about keyboard height changes and let them
notify through QWindowSystemInterface instead of "guessing" the
screen in QQnxVirtualKeyboard.
Change-Id: I71a7f6b5e9d5455563404f6abe7a0daec567a12d
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxscreen.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreen.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index cd77c3088a..1fef0bc0a7 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ #include "qqnxscreen.h" -#include "qqnxvirtualkeyboard.h" #include "qqnxwindow.h" #include <QtCore/QDebug> #include <QtCore/QUuid> +#include <QtGui/QWindowSystemInterface> #include <errno.h> @@ -59,6 +59,7 @@ QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, m_rootWindow(), m_primaryScreen(primaryScreen), m_posted(false), + m_keyboardHeight(0), m_platformContext(0) { #if defined(QQNXSCREEN_DEBUG) @@ -182,9 +183,8 @@ QRect QQnxScreen::availableGeometry() const qDebug() << Q_FUNC_INFO; #endif // available geometry = total geometry - keyboard - int keyboardHeight = QQnxVirtualKeyboard::instance().height(); return QRect(m_currentGeometry.x(), m_currentGeometry.y(), - m_currentGeometry.width(), m_currentGeometry.height() - keyboardHeight); + m_currentGeometry.width(), m_currentGeometry.height() - m_keyboardHeight); } /*! @@ -312,4 +312,15 @@ void QQnxScreen::onWindowPost(QQnxWindow *window) } } +void QQnxScreen::keyboardHeightChanged(int height) +{ + if (height == m_keyboardHeight) + return; + + m_keyboardHeight = height; + + QWindowSystemInterface::handleScreenAvailableGeometryChange(screen(), availableGeometry()); +} + + QT_END_NAMESPACE |