Changeset 561 for trunk/src/gui/inputmethod
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/inputmethod/inputmethod.pri
r2 r561 24 24 SOURCES += inputmethod/qmacinputcontext_mac.cpp 25 25 } 26 symbian:contains(QT_CONFIG, s60) { 27 HEADERS += inputmethod/qcoefepinputcontext_p.h 28 SOURCES += inputmethod/qcoefepinputcontext_s60.cpp 29 LIBS += -lfepbase 30 } 26 31 -
trunk/src/gui/inputmethod/qinputcontext.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 79 79 \ingroup i18n 80 80 81 An input method is responsible to inputcomplex text that cannot81 An input method is responsible for inputting complex text that cannot 82 82 be inputted via simple keymap. It converts a sequence of input 83 83 events (typically key events) into a text string through the input … … 90 90 information, Qt offers the QInputContext as base class. The 91 91 concept is well known as 'input context' in the input method 92 domain. an input context is created for a text widget in response92 domain. An input context is created for a text widget in response 93 93 to a demand. It is ensured that an input context is prepared for 94 94 an input method before input to a text widget. 95 95 96 Multiple input contexts that is belonging to a single input method96 Multiple input contexts that belong to a single input method 97 97 may concurrently coexist. Suppose multi-window text editor. Each 98 98 text widget of window A and B holds different QInputContext … … 106 106 107 107 \row \o Receiving information \o 108 109 110 108 x11FilterEvent(), 109 filterEvent(), 110 mouseHandler() 111 111 112 112 \row \o Sending back composed text \o 113 113 sendEvent() 114 114 115 115 \row \o State change notification \o 116 117 116 setFocusWidget(), 117 reset() 118 118 119 119 \row \o Context information \o 120 121 122 123 120 identifierName(), 121 language(), 122 font(), 123 isComposing() 124 124 125 125 \endtable 126 127 \section1 Licensing Information 126 128 127 129 \legalese … … 155 157 156 158 /*! 157 \internal158 159 Returns the widget that has an input focus for this input 159 context. Ordinary input methods should not call this function 160 directly to keep platform independence and flexible configuration 161 possibility. 160 context. 162 161 163 162 The return value may differ from holderWidget() if the input 164 163 context is shared between several text widgets. 165 164 166 \sa setFocusWidget(), holderWidget() 165 \warning To ensure platform independence and support flexible 166 configuration of widgets, ordinary input methods should not call 167 this function directly. 168 169 \sa setFocusWidget() 167 170 */ 168 171 QWidget *QInputContext::focusWidget() const … … 174 177 175 178 /*! 176 \internal177 Sets the widget that has an input focus for this input 178 context.Ordinary input methods must not call this function179 Sets the \a widget that has an input focus for this input context. 180 181 \warning Ordinary input methods must not call this function 179 182 directly. 180 183 … … 210 213 methods, leave it untouched. 211 214 212 \a event is currently restricted to QKeyEvent. But some input 213 method related events such as QWheelEvent or QTabletEvent may be 214 added in future. 215 \a event is currently restricted to events of these types: 216 217 \list 218 \i CloseSoftwareInputPanel 219 \i KeyPress 220 \i KeyRelease 221 \i MouseButtonDblClick 222 \i MouseButtonPress 223 \i MouseButtonRelease 224 \i MouseMove 225 \i RequestSoftwareInputPanel 226 \endlist 227 228 But some input method related events such as QWheelEvent or 229 QTabletEvent may be added in future. 215 230 216 231 The filtering opportunity is always given to the input context as … … 263 278 264 279 QInputMethodEvent e(event); 265 qApp->sendEvent(focus, &e);280 QApplication::sendEvent(focus, &e); 266 281 } 267 282 … … 281 296 widget. The event type is QEvent::MouseButtonPress, 282 297 QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick or 283 QEvent::Mouse ButtonMove. The event's button and state indicate298 QEvent::MouseMove. The event's button and state indicate 284 299 the kind of operation that was performed. 285 300 */ … … 409 424 { 410 425 QWidget *focus = focusWidget(); 411 const QPalette &pal = focus ? focus->palette() : qApp->palette();426 const QPalette &pal = focus ? focus->palette() : QApplication::palette(); 412 427 413 428 QTextCharFormat fmt; … … 416 431 case QInputContext::PreeditFormat: { 417 432 fmt.setUnderlineStyle(QTextCharFormat::DashUnderline); 418 #ifndef Q_WS_WIN419 int h1, s1, v1, h2, s2, v2;420 pal.color(QPalette::Base).getHsv(&h1, &s1, &v1);421 pal.color(QPalette::Background).getHsv(&h2, &s2, &v2);422 bg.setHsv(h1, s1, (v1 + v2) / 2);423 fmt.setBackground(QBrush(bg));424 #endif425 433 break; 426 434 } … … 460 468 #endif // Q_WS_X11 461 469 470 #ifdef Q_OS_SYMBIAN 471 /*! 472 \since 4.6 473 474 This function may be overridden only if input method is depending 475 on Symbian and you need raw Symbian events. Otherwise, this function must not. 476 477 This function is designed to filter raw key events on Symbian, but 478 other input methods may use this to implement some special 479 features. 480 481 Return true if the \a event has been consumed. Otherwise, the 482 unfiltered \a event will be translated into QEvent and forwarded 483 to filterEvent(). Filtering at both symbianFilterEvent() and 484 filterEvent() in single input method is allowed. 485 486 \a keywidget is a client widget into which a text is inputted. \a 487 event is inputted QSymbianEvent. 488 489 \sa filterEvent() 490 */ 491 bool QInputContext::symbianFilterEvent(QWidget * /*keywidget*/, const QSymbianEvent * /*event*/) 492 { 493 return false; 494 } 495 #endif // Q_OS_SYMBIAN 496 462 497 QT_END_NAMESPACE 463 498 -
trunk/src/gui/inputmethod/qinputcontext.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 76 76 class QPopupMenu; 77 77 class QInputContextPrivate; 78 78 #ifdef Q_OS_SYMBIAN 79 class QSymbianEvent; 80 #endif 79 81 80 82 class Q_GUI_EXPORT QInputContext : public QObject … … 106 108 virtual bool x11FilterEvent( QWidget *keywidget, XEvent *event ); 107 109 #endif // Q_WS_X11 110 #if defined(Q_OS_SYMBIAN) 111 virtual bool symbianFilterEvent( QWidget *keywidget, const QSymbianEvent *event ); 112 #endif // Q_OS_SYMBIAN 108 113 virtual bool filterEvent( const QEvent *event ); 109 114 -
trunk/src/gui/inputmethod/qinputcontext_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 85 85 86 86 QWidget *focusWidget; 87 88 #if defined(Q_WS_WIN) || defined(Q_WS_QWS)89 static void updateImeStatus(QWidget *w, bool hasFocus);90 #endif91 87 }; 92 88 -
trunk/src/gui/inputmethod/qinputcontextfactory.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 72 72 #include "qmacinputcontext_p.h" 73 73 #endif 74 #ifdef Q_WS_S60 75 #include "qcoefepinputcontext_p.h" 76 #endif 74 77 75 78 #include "private/qfactoryloader_p.h" … … 87 90 \brief The QInputContextFactory class creates QInputContext objects. 88 91 89 \ingroup appearance90 92 91 93 The input context factory creates a QInputContext object for a … … 146 148 } 147 149 #endif 150 #if defined(Q_WS_S60) 151 if (key == QLatin1String("coefep")) { 152 result = new QCoeFepInputContext; 153 } 154 #endif 148 155 #if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) 149 156 Q_UNUSED(key); … … 183 190 result << QLatin1String("mac"); 184 191 #endif 192 #if defined(Q_WS_S60) 193 result << QLatin1String("coefep"); 194 #endif 185 195 #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) 186 196 result += loader()->keys(); … … 216 226 #if defined(Q_WS_MAC) 217 227 if (key == QLatin1String("mac")) 228 return QStringList(QString()); 229 #endif 230 #if defined(Q_WS_S60) 231 if (key == QLatin1String("coefep")) 218 232 return QStringList(QString()); 219 233 #endif … … 242 256 return QInputContext::tr( "XIM" ); 243 257 #endif 258 #ifdef Q_WS_S60 259 if (key == QLatin1String("coefep")) 260 return QInputContext::tr( "FEP" ); 261 #endif 244 262 #if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) 245 263 Q_UNUSED(key); … … 273 291 return QInputContext::tr( "Mac OS X input method" ); 274 292 #endif 293 #if defined(Q_WS_S60) 294 if (key == QLatin1String("coefep")) 295 return QInputContext::tr( "S60 FEP input method" ); 296 #endif 275 297 #if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS) 276 298 Q_UNUSED(key); -
trunk/src/gui/inputmethod/qinputcontextfactory.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/inputmethod/qinputcontextplugin.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/inputmethod/qinputcontextplugin.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 67 67 QT_MODULE(Gui) 68 68 69 #if !defined(QT_NO_IM) && !defined(QT_NO_LIBRARY)69 #if !defined(QT_NO_IM) 70 70 71 71 class QInputContext; -
trunk/src/gui/inputmethod/qmacinputcontext_mac.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 46 46 #include <qdebug.h> 47 47 #include <private/qapplication_p.h> 48 #include <private/qkeymapper_p.h> 48 49 49 50 QT_BEGIN_NAMESPACE … … 56 57 #endif 57 58 58 static QTextFormat qt_mac_compose_format()59 {60 QTextCharFormat ret;61 ret.setFontUnderline(true);62 return ret;63 }64 65 59 QMacInputContext::QMacInputContext(QObject *parent) 66 : QInputContext(parent), composing(false), recursionGuard(false), textDocument(0) 60 : QInputContext(parent), composing(false), recursionGuard(false), textDocument(0), 61 keydownEvent(0) 67 62 { 68 63 // createTextDocument(); … … 71 66 QMacInputContext::~QMacInputContext() 72 67 { 73 #if def Q_WS_MAC3268 #ifndef QT_MAC_USE_COCOA 74 69 if(textDocument) 75 70 DeleteTSMDocument(textDocument); … … 80 75 QMacInputContext::createTextDocument() 81 76 { 82 #if def Q_WS_MAC3277 #ifndef QT_MAC_USE_COCOA 83 78 if(!textDocument) { 84 79 InterfaceTypeList itl = { kUnicodeDocument }; … … 97 92 void QMacInputContext::mouseHandler(int pos, QMouseEvent *e) 98 93 { 99 #if def Q_WS_MAC3294 #ifndef QT_MAC_USE_COCOA 100 95 if(e->type() != QEvent::MouseButtonPress) 101 96 return; … … 106 101 reset(); 107 102 // ##### handle mouse position 103 #else 104 Q_UNUSED(pos); 105 Q_UNUSED(e); 108 106 #endif 109 107 } 110 108 111 109 #if !defined QT_MAC_USE_COCOA 110 111 static QTextFormat qt_mac_compose_format() 112 { 113 QTextCharFormat ret; 114 ret.setFontUnderline(true); 115 return ret; 116 } 112 117 113 118 void QMacInputContext::reset() … … 133 138 return composing; 134 139 } 135 #endif 140 #endif 136 141 137 142 void QMacInputContext::setFocusWidget(QWidget *w) 138 143 { 139 144 createTextDocument(); 140 #if def Q_WS_MAC32145 #ifndef QT_MAC_USE_COCOA 141 146 if(w) 142 147 ActivateTSMDocument(textDocument); … … 148 153 149 154 155 #ifndef QT_MAC_USE_COCOA 150 156 static EventTypeSpec input_events[] = { 151 157 { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent }, … … 155 161 static EventHandlerUPP input_proc_handlerUPP = 0; 156 162 static EventHandlerRef input_proc_handler = 0; 163 #endif 157 164 158 165 void 159 166 QMacInputContext::initialize() 160 167 { 161 #if def Q_WS_MAC32168 #ifndef QT_MAC_USE_COCOA 162 169 if(!input_proc_handler) { 163 170 input_proc_handlerUPP = NewEventHandlerUPP(QMacInputContext::globalEventProcessor); … … 172 179 QMacInputContext::cleanup() 173 180 { 174 #if def Q_WS_MAC32181 #ifndef QT_MAC_USE_COCOA 175 182 if(input_proc_handler) { 176 183 RemoveEventHandler(input_proc_handler); … … 184 191 } 185 192 193 void QMacInputContext::setLastKeydownEvent(EventRef event) 194 { 195 EventRef tmpEvent = keydownEvent; 196 keydownEvent = event; 197 if (keydownEvent) 198 RetainEvent(keydownEvent); 199 if (tmpEvent) 200 ReleaseEvent(tmpEvent); 201 } 202 186 203 OSStatus 187 204 QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void *) 188 205 { 189 #if def Q_WS_MAC32206 #ifndef QT_MAC_USE_COCOA 190 207 QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData); 191 208 … … 201 218 handled_event = false; 202 219 QWidget *widget = QApplicationPrivate::focus_widget; 203 if(!widget || (context && widget->inputContext() != context)) { 220 bool canCompose = widget && (!context || widget->inputContext() == context) 221 && !(widget->inputMethodHints() & Qt::ImhDigitsOnly 222 || widget->inputMethodHints() & Qt::ImhFormattedNumbersOnly 223 || widget->inputMethodHints() & Qt::ImhHiddenText); 224 if(!canCompose) { 204 225 handled_event = false; 205 226 } else if(ekind == kEventTextInputOffsetToPos) { … … 336 357 if(!chr || chr >= 128 || (text.length() > 0 && (text.length() > 1 || text.at(0) != QLatin1Char(chr)))) 337 358 handled_event = !widget->testAttribute(Qt::WA_InputMethodEnabled); 359 QMacInputContext *context = qobject_cast<QMacInputContext*>(qApp->inputContext()); 360 if (context && context->lastKeydownEvent()) { 361 qt_keymapper_private()->translateKeyEvent(widget, 0, context->lastKeydownEvent(), 362 0, false); 363 context->setLastKeydownEvent(0); 364 } 338 365 } 339 366 break; } … … 343 370 if(!handled_event) //let the event go through 344 371 return eventNotHandledErr; 372 #else 373 Q_UNUSED(event); 345 374 #endif 346 375 return noErr; //we eat the event -
trunk/src/gui/inputmethod/qmacinputcontext_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 79 79 static void initialize(); 80 80 static void cleanup(); 81 82 EventRef lastKeydownEvent() { return keydownEvent; } 83 void setLastKeydownEvent(EventRef); 84 81 85 protected: 82 86 void mouseHandler(int pos, QMouseEvent *); … … 86 90 TSMDocumentID textDocument; 87 91 QString currentText; 92 EventRef keydownEvent; 88 93 }; 89 94 -
trunk/src/gui/inputmethod/qwininputcontext_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 56 56 #include "QtGui/qinputcontext.h" 57 57 #include "QtCore/qt_windows.h" 58 59 #if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING) 60 typedef struct tagRECONVERTSTRING { 61 DWORD dwSize; 62 DWORD dwVersion; 63 DWORD dwStrLen; 64 DWORD dwStrOffset; 65 DWORD dwCompStrLen; 66 DWORD dwCompStrOffset; 67 DWORD dwTargetStrLen; 68 DWORD dwTargetStrOffset; 69 } RECONVERTSTRING, *PRECONVERTSTRING; 70 #endif 58 71 59 72 QT_BEGIN_NAMESPACE … … 80 93 bool endComposition(); 81 94 bool composition(LPARAM lparam); 95 int reconvertString(RECONVERTSTRING *reconv); 82 96 83 97 static void TranslateMessage(const MSG *msg); 84 98 static LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 85 99 100 static void updateImeStatus(QWidget *w, bool hasFocus); 86 101 static void enablePopupChild(QWidget *w, bool e); 87 102 static void enable(QWidget *w, bool e); -
trunk/src/gui/inputmethod/qwininputcontext_win.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 46 46 #include "qwidget.h" 47 47 #include "qapplication.h" 48 #include "qlibrary.h"49 48 #include "qevent.h" 50 49 #include "qtextformat.h" 50 #include "qtextboundaryfinder.h" 51 51 52 52 //#define Q_IME_DEBUG 53 54 /* Active Input method support on Win95/98/NT */55 #include <objbase.h>56 #include <initguid.h>57 53 58 54 #ifdef Q_IME_DEBUG … … 60 56 #endif 61 57 62 #if defined(Q_ OS_WINCE)58 #if defined(Q_WS_WINCE) 63 59 extern void qt_wince_show_SIP(bool show); // defined in qguifunctions_wince.cpp 64 60 #endif … … 219 215 : QInputContext(parent), recursionGuard(false) 220 216 { 221 if (QSysInfo::WindowsVersion < QSysInfo::WV_2000) { 222 // try to get the Active IMM COM object on Win95/98/NT, where english versions don't 223 // support the regular Windows input methods. 224 if (CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER, 225 IID_IActiveIMMApp, (LPVOID *)&aimm) != S_OK) { 226 aimm = 0; 227 } 228 if (aimm && (aimm->QueryInterface(IID_IActiveIMMMessagePumpOwner, (LPVOID *)&aimmpump) != S_OK || 229 aimm->Activate(true) != S_OK)) { 230 aimm->Release(); 231 aimm = 0; 232 if (aimmpump) 233 aimmpump->Release(); 234 aimmpump = 0; 235 } 236 if (aimmpump) 237 aimmpump->Start(); 238 } 239 240 #ifndef Q_OS_WINCE 217 #ifndef Q_WS_WINCE 241 218 QSysInfo::WinVersion ver = QSysInfo::windowsVersion(); 242 219 if (ver & QSysInfo::WV_NT_based && ver >= QSysInfo::WV_VISTA) { … … 263 240 } 264 241 } else { 265 // figure out whether a RTL language is installed 266 typedef BOOL(WINAPI *PtrIsValidLanguageGroup)(DWORD,DWORD); 267 PtrIsValidLanguageGroup isValidLanguageGroup = (PtrIsValidLanguageGroup)QLibrary::resolve(QLatin1String("kernel32"), "IsValidLanguageGroup"); 268 if (isValidLanguageGroup) { 269 qt_use_rtl_extensions = isValidLanguageGroup(LGRPID_ARABIC, LGRPID_INSTALLED) 270 || isValidLanguageGroup(LGRPID_HEBREW, LGRPID_INSTALLED); 271 } 272 qt_use_rtl_extensions |= IsValidLocale(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED) 273 || IsValidLocale(MAKELCID(MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED) 242 // figure out whether a RTL language is installed 243 qt_use_rtl_extensions = IsValidLanguageGroup(LGRPID_ARABIC, LGRPID_INSTALLED) 244 || IsValidLanguageGroup(LGRPID_HEBREW, LGRPID_INSTALLED) 245 || IsValidLocale(MAKELCID(MAKELANGID(LANG_ARABIC, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED) 246 || IsValidLocale(MAKELCID(MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED) 274 247 #ifdef LANG_SYRIAC 275 276 #endif 277 248 || IsValidLocale(MAKELCID(MAKELANGID(LANG_SYRIAC, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED) 249 #endif 250 || IsValidLocale(MAKELCID(MAKELANGID(LANG_FARSI, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED); 278 251 } 279 252 #else … … 281 254 #endif 282 255 283 WM_MSIME_MOUSE = QT_WA_INLINE(RegisterWindowMessage(L"MSIMEMouseOperation"), RegisterWindowMessageA("MSIMEMouseOperation"));256 WM_MSIME_MOUSE = RegisterWindowMessage(L"MSIMEMouseOperation"); 284 257 } 285 258 … … 338 311 } 339 312 340 static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen , bool *unicode = 0)313 static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen) 341 314 { 342 315 LONG len = 0; 343 if (unicode)344 *unicode = true;345 316 if (aimm) 346 317 aimm->GetCompositionStringW(himc, dwIndex, dBufLen, &len, lpbuf); 347 318 else 348 { 349 if(QSysInfo::WindowsVersion != QSysInfo::WV_95) { 350 len = ImmGetCompositionStringW(himc, dwIndex, lpbuf, dBufLen); 351 } 352 #if !defined(Q_OS_WINCE) 353 else { 354 len = ImmGetCompositionStringA(himc, dwIndex, lpbuf, dBufLen); 355 if (unicode) 356 *unicode = false; 357 } 358 #endif 359 } 319 len = ImmGetCompositionString(himc, dwIndex, lpbuf, dBufLen); 360 320 return len; 361 321 } … … 368 328 static QString getString(HIMC himc, DWORD dwindex, int *selStart = 0, int *selLength = 0) 369 329 { 370 static char *buffer = 0; 371 static int buflen = 0; 372 373 int len = getCompositionString(himc, dwindex, 0, 0) + 1; 374 if (!buffer || len > buflen) { 375 delete [] buffer; 376 buflen = qMin(len, 256); 377 buffer = new char[buflen]; 378 } 379 380 bool unicode = true; 381 len = getCompositionString(himc, dwindex, buffer, buflen, &unicode); 330 const int bufferSize = 256; 331 wchar_t buffer[bufferSize]; 332 int len = getCompositionString(himc, dwindex, buffer, bufferSize * sizeof(wchar_t)); 382 333 383 334 if (selStart) { 384 static char *attrbuffer = 0; 385 static int attrbuflen = 0; 386 int attrlen = getCompositionString(himc, dwindex, 0, 0) + 1; 387 if (!attrbuffer || attrlen> attrbuflen) { 388 delete [] attrbuffer; 389 attrbuflen = qMin(attrlen, 256); 390 attrbuffer = new char[attrbuflen]; 391 } 392 attrlen = getCompositionString(himc, GCS_COMPATTR, attrbuffer, attrbuflen); 335 char attrbuffer[bufferSize]; 336 int attrlen = getCompositionString(himc, GCS_COMPATTR, attrbuffer, bufferSize); 393 337 *selStart = attrlen+1; 394 338 *selLength = -1; … … 404 348 if (len <= 0) 405 349 return QString(); 406 if (unicode) { 407 return QString((QChar *)buffer, len/sizeof(QChar)); 408 } 409 else { 410 buffer[len] = 0; 411 WCHAR *wc = new WCHAR[len+1]; 412 int l = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, 413 buffer, len, wc, len+1); 414 QString res = QString((QChar *)wc, l); 415 delete [] wc; 416 return res; 417 } 350 351 return QString((QChar*)buffer, len / sizeof(QChar)); 418 352 } 419 353 … … 429 363 if (!aimm || aimm->OnDefWindowProc(hwnd, msg, wParam, lParam, &retval) != S_OK) 430 364 { 431 QT_WA({ 432 retval = ::DefWindowProc(hwnd, msg, wParam, lParam); 433 } , { 434 retval = ::DefWindowProcA(hwnd,msg, wParam, lParam); 435 }); 365 retval = ::DefWindowProc(hwnd, msg, wParam, lParam); 436 366 } 437 367 return retval; … … 455 385 hf = f.handle(); 456 386 457 QT_WA({ 458 LOGFONT lf; 459 if (GetObject(hf, sizeof(lf), &lf)) 460 if (aimm) 461 aimm->SetCompositionFontW(imc, &lf); 462 else 463 ImmSetCompositionFont(imc, &lf); 464 } , { 465 LOGFONTA lf; 466 if (GetObjectA(hf, sizeof(lf), &lf)) 467 if (aimm) 468 aimm->SetCompositionFontA(imc, &lf); 469 else 470 ImmSetCompositionFontA(imc, &lf); 471 }); 387 LOGFONT lf; 388 if (GetObject(hf, sizeof(lf), &lf)) { 389 if (aimm) 390 aimm->SetCompositionFontW(imc, &lf); 391 else 392 ImmSetCompositionFont(imc, &lf); 393 } 472 394 473 395 QRect r = w->inputMethodQuery(Qt::ImMicroFocus).toRect(); … … 540 462 541 463 if (!fw) 542 fw = qApp->focusWidget();464 fw = QApplication::focusWidget(); 543 465 544 466 if (fw) { … … 638 560 return true; 639 561 640 QWidget *fw = qApp->focusWidget();562 QWidget *fw = QApplication::focusWidget(); 641 563 if (fw) { 642 564 Q_ASSERT(fw->testAttribute(Qt::WA_WState_Created)); … … 739 661 if (defaultContext) 740 662 ImmAssociateContext(w->effectiveWinId(), defaultContext); 741 #ifdef Q_ OS_WINCE663 #ifdef Q_WS_WINCE 742 664 if (qApp->autoSipEnabled()) 743 665 qt_wince_show_SIP(true); … … 748 670 if (!defaultContext) 749 671 defaultContext = oldimc; 750 #ifdef Q_ OS_WINCE672 #ifdef Q_WS_WINCE 751 673 if (qApp->autoSipEnabled()) 752 674 qt_wince_show_SIP(false); … … 756 678 757 679 758 void Q InputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus)680 void QWinInputContext::updateImeStatus(QWidget *w, bool hasFocus) 759 681 { 760 682 if (!w) 761 683 return; 762 bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled(); 684 // It's always the proxy that carries the hints. 685 QWidget *focusProxyWidget = w->focusProxy(); 686 if (!focusProxyWidget) 687 focusProxyWidget = w; 688 bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled() 689 && !(focusProxyWidget->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText)); 763 690 bool hasIme = e && hasFocus; 764 691 #ifdef Q_IME_DEBUG … … 825 752 void QWinInputContext::setFocusWidget(QWidget *w) 826 753 { 754 QWidget *oldFocus = focusWidget(); 755 if (oldFocus == w) 756 return; 757 if (w) { 758 QWinInputContext::updateImeStatus(w, true); 759 } else { 760 if (oldFocus) 761 QWinInputContext::updateImeStatus(oldFocus , false); 762 } 827 763 QInputContext::setFocusWidget(w); 828 764 update(); … … 861 797 } 862 798 799 int QWinInputContext::reconvertString(RECONVERTSTRING *reconv) 800 { 801 QWidget *w = focusWidget(); 802 if(!w) 803 return -1; 804 805 Q_ASSERT(w->testAttribute(Qt::WA_WState_Created)); 806 QString surroundingText = qvariant_cast<QString>(w->inputMethodQuery(Qt::ImSurroundingText)); 807 int memSize = sizeof(RECONVERTSTRING)+(surroundingText.length()+1)*sizeof(ushort); 808 // If memory is not allocated, return the required size. 809 if (!reconv) { 810 if (surroundingText.isEmpty()) 811 return -1; 812 else 813 return memSize; 814 } 815 int pos = qvariant_cast<int>(w->inputMethodQuery(Qt::ImCursorPosition)); 816 // find the word in the surrounding text. 817 QTextBoundaryFinder bounds(QTextBoundaryFinder::Word, surroundingText); 818 bounds.setPosition(pos); 819 if (bounds.isAtBoundary()) { 820 if (QTextBoundaryFinder::EndWord == bounds.boundaryReasons()) 821 bounds.toPreviousBoundary(); 822 } else { 823 bounds.toPreviousBoundary(); 824 } 825 int startPos = bounds.position(); 826 bounds.toNextBoundary(); 827 int endPos = bounds.position(); 828 // select the text, this will be overwritten by following ime events. 829 QList<QInputMethodEvent::Attribute> attrs; 830 attrs << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, startPos, endPos-startPos, QVariant()); 831 QInputMethodEvent e(QString(), attrs); 832 qt_sendSpontaneousEvent(w, &e); 833 834 reconv->dwSize = memSize; 835 reconv->dwVersion = 0; 836 837 reconv->dwStrLen = surroundingText.length(); 838 reconv->dwStrOffset = sizeof(RECONVERTSTRING); 839 reconv->dwCompStrLen = endPos-startPos; 840 reconv->dwCompStrOffset = startPos*sizeof(ushort); 841 reconv->dwTargetStrLen = reconv->dwCompStrLen; 842 reconv->dwTargetStrOffset = reconv->dwCompStrOffset; 843 memcpy((char*)(reconv+1), surroundingText.utf16(), surroundingText.length()*sizeof(ushort)); 844 return memSize; 845 } 846 863 847 QT_END_NAMESPACE -
trunk/src/gui/inputmethod/qwsinputcontext_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 88 88 static bool translateIMQueryEvent(QWidget *w, const QWSIMQueryEvent *e); 89 89 static bool translateIMInitEvent(const QWSIMInitEvent *e); 90 static void updateImeStatus(QWidget *w, bool hasFocus); 90 91 }; 91 92 -
trunk/src/gui/inputmethod/qximinputcontext_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/src/gui/inputmethod/qximinputcontext_x11.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 54 54 ****************************************************************************/ 55 55 56 #include "qplatformdefs.h" 56 57 #include "qdebug.h" 57 58 #include "qximinputcontext_p.h" … … 439 440 // requiring the user to manually switch focus. 440 441 if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled) 441 && focusWidget->testAttribute(Qt::WA_WState_Created)) 442 && focusWidget->testAttribute(Qt::WA_WState_Created) 443 && focusWidget->isEnabled()) 442 444 setFocusWidget(focusWidget); 443 445 } … … 611 613 QInputContext::setFocusWidget(w); 612 614 613 if (!w )615 if (!w || w->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText)) 614 616 return; 615 617
Note:
See TracChangeset
for help on using the changeset viewer.