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:
16 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/inputmethod/inputmethod.pri

    r2 r561  
    2424    SOURCES += inputmethod/qmacinputcontext_mac.cpp
    2525}
     26symbian:contains(QT_CONFIG, s60) {
     27    HEADERS += inputmethod/qcoefepinputcontext_p.h
     28    SOURCES += inputmethod/qcoefepinputcontext_s60.cpp
     29    LIBS += -lfepbase
     30}
    2631
  • 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 (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@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 for inputting 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. An 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 belong 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()
     108        x11FilterEvent(),
     109        filterEvent(),
     110        mouseHandler()
    111111
    112112    \row \o Sending back composed text \o
    113         sendEvent()
     113        sendEvent()
    114114
    115115    \row \o State change notification \o
    116         setFocusWidget(),
    117         reset()
     116        setFocusWidget(),
     117        reset()
    118118
    119119    \row \o Context information \o
    120         identifierName(),
    121         language(),
    122         font(),
    123         isComposing()
     120        identifierName(),
     121        language(),
     122        font(),
     123        isComposing()
    124124
    125125    \endtable
     126
     127    \section1 Licensing Information
    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    Sets the \a widget that has an input focus for this input context.
     180
     181    \warning 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    QApplication::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() : QApplication::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#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*/
     491bool QInputContext::symbianFilterEvent(QWidget * /*keywidget*/, const QSymbianEvent * /*event*/)
     492{
     493    return false;
     494}
     495#endif // Q_OS_SYMBIAN
     496
    462497QT_END_NAMESPACE
    463498
  • trunk/src/gui/inputmethod/qinputcontext.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7676class QPopupMenu;
    7777class QInputContextPrivate;
    78 
     78#ifdef Q_OS_SYMBIAN
     79class QSymbianEvent;
     80#endif
    7981
    8082class Q_GUI_EXPORT QInputContext : public QObject
     
    106108    virtual bool x11FilterEvent( QWidget *keywidget, XEvent *event );
    107109#endif // Q_WS_X11
     110#if defined(Q_OS_SYMBIAN)
     111    virtual bool symbianFilterEvent( QWidget *keywidget, const QSymbianEvent *event );
     112#endif // Q_OS_SYMBIAN
    108113    virtual bool filterEvent( const QEvent *event );
    109114
  • trunk/src/gui/inputmethod/qinputcontext_p.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    8585
    8686    QWidget *focusWidget;
    87 
    88 #if defined(Q_WS_WIN) || defined(Q_WS_QWS)
    89     static void updateImeStatus(QWidget *w, bool hasFocus);
    90 #endif
    9187};
    9288
  • trunk/src/gui/inputmethod/qinputcontextfactory.cpp

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7272#include "qmacinputcontext_p.h"
    7373#endif
     74#ifdef Q_WS_S60
     75#include "qcoefepinputcontext_p.h"
     76#endif
    7477
    7578#include "private/qfactoryloader_p.h"
     
    8790    \brief The QInputContextFactory class creates QInputContext objects.
    8891
    89     \ingroup appearance
    9092
    9193    The input context factory creates a QInputContext object for a
     
    146148    }
    147149#endif
     150#if defined(Q_WS_S60)
     151    if (key == QLatin1String("coefep")) {
     152        result = new QCoeFepInputContext;
     153    }
     154#endif
    148155#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
    149156    Q_UNUSED(key);
     
    183190    result << QLatin1String("mac");
    184191#endif
     192#if defined(Q_WS_S60)
     193    result << QLatin1String("coefep");
     194#endif
    185195#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
    186196    result += loader()->keys();
     
    216226#if defined(Q_WS_MAC)
    217227    if (key == QLatin1String("mac"))
     228        return QStringList(QString());
     229#endif
     230#if defined(Q_WS_S60)
     231    if (key == QLatin1String("coefep"))
    218232        return QStringList(QString());
    219233#endif
     
    242256        return QInputContext::tr( "XIM" );
    243257#endif
     258#ifdef Q_WS_S60
     259    if (key == QLatin1String("coefep"))
     260        return QInputContext::tr( "FEP" );
     261#endif
    244262#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
    245263    Q_UNUSED(key);
     
    273291        return QInputContext::tr( "Mac OS X input method" );
    274292#endif
     293#if defined(Q_WS_S60)
     294    if (key == QLatin1String("coefep"))
     295        return QInputContext::tr( "S60 FEP input method" );
     296#endif
    275297#if defined(QT_NO_LIBRARY) || defined(QT_NO_SETTINGS)
    276298    Q_UNUSED(key);
  • trunk/src/gui/inputmethod/qinputcontextfactory.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/inputmethod/qinputcontextplugin.cpp

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/inputmethod/qinputcontextplugin.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    6767QT_MODULE(Gui)
    6868
    69 #if !defined(QT_NO_IM) && !defined(QT_NO_LIBRARY)
     69#if !defined(QT_NO_IM)
    7070
    7171class QInputContext;
  • trunk/src/gui/inputmethod/qmacinputcontext_mac.cpp

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4646#include <qdebug.h>
    4747#include <private/qapplication_p.h>
     48#include <private/qkeymapper_p.h>
    4849
    4950QT_BEGIN_NAMESPACE
     
    5657#endif
    5758
    58 static QTextFormat qt_mac_compose_format()
    59 {
    60     QTextCharFormat ret;
    61     ret.setFontUnderline(true);
    62     return ret;
    63 }
    64 
    6559QMacInputContext::QMacInputContext(QObject *parent)
    66     : QInputContext(parent), composing(false), recursionGuard(false), textDocument(0)
     60    : QInputContext(parent), composing(false), recursionGuard(false), textDocument(0),
     61      keydownEvent(0)
    6762{
    6863//    createTextDocument();
     
    7166QMacInputContext::~QMacInputContext()
    7267{
    73 #ifdef Q_WS_MAC32
     68#ifndef QT_MAC_USE_COCOA
    7469    if(textDocument)
    7570        DeleteTSMDocument(textDocument);
     
    8075QMacInputContext::createTextDocument()
    8176{
    82 #ifdef Q_WS_MAC32
     77#ifndef QT_MAC_USE_COCOA
    8378    if(!textDocument) {
    8479        InterfaceTypeList itl = { kUnicodeDocument };
     
    9792void QMacInputContext::mouseHandler(int pos, QMouseEvent *e)
    9893{
    99 #ifdef Q_WS_MAC32
     94#ifndef QT_MAC_USE_COCOA
    10095    if(e->type() != QEvent::MouseButtonPress)
    10196        return;
     
    106101        reset();
    107102    // ##### handle mouse position
     103#else
     104    Q_UNUSED(pos);
     105    Q_UNUSED(e);
    108106#endif
    109107}
    110108
    111109#if !defined QT_MAC_USE_COCOA
     110
     111static QTextFormat qt_mac_compose_format()
     112{
     113    QTextCharFormat ret;
     114    ret.setFontUnderline(true);
     115    return ret;
     116}
    112117
    113118void QMacInputContext::reset()
     
    133138    return composing;
    134139}
    135 #endif 
     140#endif
    136141
    137142void QMacInputContext::setFocusWidget(QWidget *w)
    138143{
    139144    createTextDocument();
    140 #ifdef Q_WS_MAC32
     145#ifndef QT_MAC_USE_COCOA
    141146    if(w)
    142147        ActivateTSMDocument(textDocument);
     
    148153
    149154
     155#ifndef QT_MAC_USE_COCOA
    150156static EventTypeSpec input_events[] = {
    151157    { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent },
     
    155161static EventHandlerUPP input_proc_handlerUPP = 0;
    156162static EventHandlerRef input_proc_handler = 0;
     163#endif
    157164
    158165void
    159166QMacInputContext::initialize()
    160167{
    161 #ifdef Q_WS_MAC32
     168#ifndef QT_MAC_USE_COCOA
    162169    if(!input_proc_handler) {
    163170        input_proc_handlerUPP = NewEventHandlerUPP(QMacInputContext::globalEventProcessor);
     
    172179QMacInputContext::cleanup()
    173180{
    174 #ifdef Q_WS_MAC32
     181#ifndef QT_MAC_USE_COCOA
    175182    if(input_proc_handler) {
    176183        RemoveEventHandler(input_proc_handler);
     
    184191}
    185192
     193void 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
    186203OSStatus
    187204QMacInputContext::globalEventProcessor(EventHandlerCallRef, EventRef event, void *)
    188205{
    189 #ifdef Q_WS_MAC32
     206#ifndef QT_MAC_USE_COCOA
    190207    QScopedLoopLevelCounter loopLevelCounter(QApplicationPrivate::instance()->threadData);
    191208
     
    201218        handled_event = false;
    202219        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) {
    204225            handled_event = false;
    205226        } else if(ekind == kEventTextInputOffsetToPos) {
     
    336357            if(!chr || chr >= 128 || (text.length() > 0 && (text.length() > 1 || text.at(0) != QLatin1Char(chr))))
    337358                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            }
    338365        }
    339366        break; }
     
    343370    if(!handled_event) //let the event go through
    344371        return eventNotHandledErr;
     372#else
     373    Q_UNUSED(event);
    345374#endif
    346375    return noErr; //we eat the event
  • trunk/src/gui/inputmethod/qmacinputcontext_p.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    7979    static void initialize();
    8080    static void cleanup();
     81
     82    EventRef lastKeydownEvent() { return keydownEvent; }
     83    void setLastKeydownEvent(EventRef);
     84
    8185protected:
    8286    void mouseHandler(int pos, QMouseEvent *);
     
    8690    TSMDocumentID textDocument;
    8791    QString currentText;
     92    EventRef keydownEvent;
    8893};
    8994
  • trunk/src/gui/inputmethod/qwininputcontext_p.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5656#include "QtGui/qinputcontext.h"
    5757#include "QtCore/qt_windows.h"
     58
     59#if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING)
     60typedef 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
    5871
    5972QT_BEGIN_NAMESPACE
     
    8093    bool endComposition();
    8194    bool composition(LPARAM lparam);
     95    int reconvertString(RECONVERTSTRING *reconv);
    8296
    8397    static void TranslateMessage(const MSG *msg);
    8498    static LRESULT DefWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
    8599
     100    static void updateImeStatus(QWidget *w, bool hasFocus);
    86101    static void enablePopupChild(QWidget *w, bool e);
    87102    static void enable(QWidget *w, bool e);
  • trunk/src/gui/inputmethod/qwininputcontext_win.cpp

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4646#include "qwidget.h"
    4747#include "qapplication.h"
    48 #include "qlibrary.h"
    4948#include "qevent.h"
    5049#include "qtextformat.h"
     50#include "qtextboundaryfinder.h"
    5151
    5252//#define Q_IME_DEBUG
    53 
    54 /* Active Input method support on Win95/98/NT */
    55 #include <objbase.h>
    56 #include <initguid.h>
    5753
    5854#ifdef Q_IME_DEBUG
     
    6056#endif
    6157
    62 #if defined(Q_OS_WINCE)
     58#if defined(Q_WS_WINCE)
    6359extern void qt_wince_show_SIP(bool show);   // defined in qguifunctions_wince.cpp
    6460#endif
     
    219215    : QInputContext(parent), recursionGuard(false)
    220216{
    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
    241218    QSysInfo::WinVersion ver = QSysInfo::windowsVersion();
    242219    if (ver & QSysInfo::WV_NT_based  && ver >= QSysInfo::WV_VISTA) {
     
    263240        }
    264241    } 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)
    274247#ifdef LANG_SYRIAC
    275                               || IsValidLocale(MAKELCID(MAKELANGID(LANG_SYRIAC, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED)
    276 #endif
    277                                   || IsValidLocale(MAKELCID(MAKELANGID(LANG_FARSI, SUBLANG_DEFAULT), SORT_DEFAULT), LCID_INSTALLED);
     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);
    278251    }
    279252#else
     
    281254#endif
    282255
    283     WM_MSIME_MOUSE = QT_WA_INLINE(RegisterWindowMessage(L"MSIMEMouseOperation"), RegisterWindowMessageA("MSIMEMouseOperation"));
     256    WM_MSIME_MOUSE = RegisterWindowMessage(L"MSIMEMouseOperation");
    284257}
    285258
     
    338311}
    339312
    340 static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen, bool *unicode = 0)
     313static LONG getCompositionString(HIMC himc, DWORD dwIndex, LPVOID lpbuf, DWORD dBufLen)
    341314{
    342315    LONG len = 0;
    343     if (unicode)
    344         *unicode = true;
    345316    if (aimm)
    346317        aimm->GetCompositionStringW(himc, dwIndex, dBufLen, &len, lpbuf);
    347318    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);
    360320    return len;
    361321}
     
    368328static QString getString(HIMC himc, DWORD dwindex, int *selStart = 0, int *selLength = 0)
    369329{
    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));
    382333
    383334    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);
    393337        *selStart = attrlen+1;
    394338        *selLength = -1;
     
    404348    if (len <= 0)
    405349        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));
    418352}
    419353
     
    429363    if (!aimm || aimm->OnDefWindowProc(hwnd, msg, wParam, lParam, &retval) != S_OK)
    430364    {
    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);
    436366    }
    437367    return retval;
     
    455385    hf = f.handle();
    456386
    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    }
    472394
    473395    QRect r = w->inputMethodQuery(Qt::ImMicroFocus).toRect();
     
    540462
    541463    if (!fw)
    542         fw = qApp->focusWidget();
     464        fw = QApplication::focusWidget();
    543465
    544466    if (fw) {
     
    638560        return true;
    639561
    640     QWidget *fw = qApp->focusWidget();
     562    QWidget *fw = QApplication::focusWidget();
    641563    if (fw) {
    642564        Q_ASSERT(fw->testAttribute(Qt::WA_WState_Created));
     
    739661        if (defaultContext)
    740662            ImmAssociateContext(w->effectiveWinId(), defaultContext);
    741 #ifdef Q_OS_WINCE
     663#ifdef Q_WS_WINCE
    742664        if (qApp->autoSipEnabled())
    743665            qt_wince_show_SIP(true);
     
    748670        if (!defaultContext)
    749671            defaultContext = oldimc;
    750 #ifdef Q_OS_WINCE
     672#ifdef Q_WS_WINCE
    751673        if (qApp->autoSipEnabled())
    752674            qt_wince_show_SIP(false);
     
    756678
    757679
    758 void QInputContextPrivate::updateImeStatus(QWidget *w, bool hasFocus)
     680void QWinInputContext::updateImeStatus(QWidget *w, bool hasFocus)
    759681{
    760682    if (!w)
    761683        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));
    763690    bool hasIme = e && hasFocus;
    764691#ifdef Q_IME_DEBUG
     
    825752void QWinInputContext::setFocusWidget(QWidget *w)
    826753{
     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    }
    827763    QInputContext::setFocusWidget(w);
    828764    update();
     
    861797}
    862798
     799int 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
    863847QT_END_NAMESPACE
  • trunk/src/gui/inputmethod/qwsinputcontext_p.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    8888    static bool translateIMQueryEvent(QWidget *w, const QWSIMQueryEvent *e);
    8989    static bool translateIMInitEvent(const QWSIMInitEvent *e);
     90    static void updateImeStatus(QWidget *w, bool hasFocus);
    9091};
    9192
  • trunk/src/gui/inputmethod/qximinputcontext_p.h

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/src/gui/inputmethod/qximinputcontext_x11.cpp

    r2 r561  
    22**
    33** 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)
    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 have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5454****************************************************************************/
    5555
     56#include "qplatformdefs.h"
    5657#include "qdebug.h"
    5758#include "qximinputcontext_p.h"
     
    439440                // requiring the user to manually switch focus.
    440441                if (focusWidget->testAttribute(Qt::WA_InputMethodEnabled)
    441                     && focusWidget->testAttribute(Qt::WA_WState_Created))
     442                    && focusWidget->testAttribute(Qt::WA_WState_Created)
     443                    && focusWidget->isEnabled())
    442444                    setFocusWidget(focusWidget);
    443445            }
     
    611613    QInputContext::setFocusWidget(w);
    612614
    613     if (!w)
     615    if (!w || w->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText))
    614616        return;
    615617
Note: See TracChangeset for help on using the changeset viewer.