Changeset 561 for trunk/src/gui/inputmethod/qinputcontext.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
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/qinputcontext.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 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 37 ** @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 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. n 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 ng 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 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 180 181 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 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() : 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 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 462 497 QT_END_NAMESPACE 463 498
Note:
See TracChangeset
for help on using the changeset viewer.