diff options
author | Kevin Krammer <kevin.krammer.qnx@kdab.com> | 2012-02-29 14:31:09 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-05 21:39:45 (GMT) |
commit | c6bda755a2d0cad93520dbd75dc2880a1c9409e2 (patch) | |
tree | 10d662cf52a1214611ced484329379cd4559f129 /src/plugins | |
parent | 8ced172dd250277f38cc3d2753692cda0fa183da (diff) | |
download | Qt-c6bda755a2d0cad93520dbd75dc2880a1c9409e2.zip Qt-c6bda755a2d0cad93520dbd75dc2880a1c9409e2.tar.gz Qt-c6bda755a2d0cad93520dbd75dc2880a1c9409e2.tar.bz2 |
React to changes of focus widget
Needed to automatically show/hide virtual keyboard when focus changes
in or out of an input widget
Change-Id: I21325452938e1d551bcc4421721f3bc5d85c5fbf
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Nick Ratelle <nratelle@qnx.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp | 13 | ||||
-rw-r--r-- | src/plugins/platforms/blackberry/qbbinputcontext_noimf.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp b/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp index 8894098..a5b959b 100644 --- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp +++ b/src/plugins/platforms/blackberry/qbbinputcontext_noimf.cpp @@ -99,3 +99,16 @@ bool QBBInputContext::handleKeyboardEvent(int flags, int sym, int mod, int scan, return false; } +void QBBInputContext::setFocusWidget(QWidget *w) +{ +#if defined(QBBINPUTCONTEXT_DEBUG) + qDebug() << Q_FUNC_INFO << (w ? "requesting" : "hiding") << "virtual keyboard"; +#endif + QInputContext::setFocusWidget(w); + + if (w) + QBBVirtualKeyboard::instance().showKeyboard(); + else + QBBVirtualKeyboard::instance().hideKeyboard(); +} + diff --git a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h b/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h index d7f3cc5..6332ee7 100644 --- a/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h +++ b/src/plugins/platforms/blackberry/qbbinputcontext_noimf.h @@ -58,6 +58,8 @@ public: virtual bool filterEvent( const QEvent *event ); bool handleKeyboardEvent(int flags, int sym, int mod, int scan, int cap); + void setFocusWidget(QWidget *w); + private: bool hasPhysicalKeyboard(); |