summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-10-15 14:18:19 (GMT)
committeraxis <qt-info@nokia.com>2009-10-19 08:07:09 (GMT)
commit10a437f02966ad0963b66585cc2ff6210b995f18 (patch)
tree2a99a5d785bef413fca8059ca175e2ace15867a4 /src
parent511adbc60fdd7fbfe95f2a1cf9cf2d31aba9b7ea (diff)
downloadQt-10a437f02966ad0963b66585cc2ff6210b995f18.zip
Qt-10a437f02966ad0963b66585cc2ff6210b995f18.tar.gz
Qt-10a437f02966ad0963b66585cc2ff6210b995f18.tar.bz2
Made Mac Carbon use the input method hints when deciding on IM.
New behavior is to turn them off when inputting numbers or hidden text, which is the way it was in Qt 4.5. Task: QT-1938 Task: QT-2257 RevBy: Prasanth Ullattil
Diffstat (limited to 'src')
-rw-r--r--src/gui/inputmethod/qmacinputcontext_mac.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/inputmethod/qmacinputcontext_mac.cpp b/src/gui/inputmethod/qmacinputcontext_mac.cpp
index 116d233..994edb9 100644
--- a/src/gui/inputmethod/qmacinputcontext_mac.cpp
+++ b/src/gui/inputmethod/qmacinputcontext_mac.cpp
@@ -217,7 +217,11 @@ QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void
case kEventClassTextInput: {
handled_event = false;
QWidget *widget = QApplicationPrivate::focus_widget;
- if(!widget || (context && widget->inputContext() != context)) {
+ bool canCompose = widget && (!context || widget->inputContext() == context)
+ && !(widget->inputMethodHints() & Qt::ImhDigitsOnly
+ || widget->inputMethodHints() & Qt::ImhFormattedNumbersOnly
+ || widget->inputMethodHints() & Qt::ImhHiddenText);
+ if(!canCompose) {
handled_event = false;
} else if(ekind == kEventTextInputOffsetToPos) {
if(!widget->testAttribute(Qt::WA_InputMethodEnabled)) {