Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/inputmethod/qinputcontext.cpp

    r2 r561  
    22**
    33** 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])
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7979    \ingroup i18n
    8080
    81     An input method is responsible to input complex text that cannot
     81    An input method is responsible complex text that cannot
    8282    be inputted via simple keymap. It converts a sequence of input
    8383    events (typically key events) into a text string through the input
     
    9090    information, Qt offers the QInputContext as base class. The
    9191    concept is well known as 'input context' in the input method
    92     domain. an input context is created for a text widget in response
     92    domain. n input context is created for a text widget in response
    9393    to a demand. It is ensured that an input context is prepared for
    9494    an input method before input to a text widget.
    9595
    96     Multiple input contexts that is belonging to a single input method
     96    Multiple input contexts that ng to a single input method
    9797    may concurrently coexist. Suppose multi-window text editor. Each
    9898    text widget of window A and B holds different QInputContext
     
    106106
    107107    \row \o Receiving information \o
    108         x11FilterEvent(),
    109         filterEvent(),
    110         mouseHandler()
     108x11FilterEvent(),
     109filterEvent(),
     110mouseHandler()
    111111
    112112    \row \o Sending back composed text \o
    113         sendEvent()
     113sendEvent()
    114114
    115115    \row \o State change notification \o
    116         setFocusWidget(),
    117         reset()
     116setFocusWidget(),
     117reset()
    118118
    119119    \row \o Context information \o
    120         identifierName(),
    121         language(),
    122         font(),
    123         isComposing()
     120identifierName(),
     121language(),
     122font(),
     123isComposing()
    124124
    125125    \endtable
     126
     127
    126128
    127129    \legalese
     
    155157
    156158/*!
    157     \internal
    158159    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.
    162161
    163162    The return value may differ from holderWidget() if the input
    164163    context is shared between several text widgets.
    165164
    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()
    167170*/
    168171QWidget *QInputContext::focusWidget() const
     
    174177
    175178/*!
    176     \internal
    177     Sets the widget that has an input focus for this input
    178     context. Ordinary input methods must not call this function
     179   
     180
     181    Ordinary input methods must not call this function
    179182    directly.
    180183
     
    210213    methods, leave it untouched.
    211214
    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.
    215230
    216231    The filtering opportunity is always given to the input context as
     
    263278
    264279    QInputMethodEvent e(event);
    265     qApp->sendEvent(focus, &e);
     280    sendEvent(focus, &e);
    266281}
    267282
     
    281296    widget. The event type is QEvent::MouseButtonPress,
    282297    QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick or
    283     QEvent::MouseButtonMove. The event's button and state indicate
     298    QEvent::MouseMove. The event's button and state indicate
    284299    the kind of operation that was performed.
    285300*/
     
    409424{
    410425    QWidget *focus = focusWidget();
    411     const QPalette &pal = focus ? focus->palette() : qApp->palette();
     426    const QPalette &pal = focus ? focus->palette() : palette();
    412427
    413428    QTextCharFormat fmt;
     
    416431    case QInputContext::PreeditFormat: {
    417432        fmt.setUnderlineStyle(QTextCharFormat::DashUnderline);
    418 #ifndef Q_WS_WIN
    419         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 #endif
    425433        break;
    426434    }
     
    460468#endif // Q_WS_X11
    461469
     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
    462497QT_END_NAMESPACE
    463498
Note: See TracChangeset for help on using the changeset viewer.