Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QInputContext::sendEvent ( const QInputMethodEvent event  ) 

Sends an input method event specified by event to the current focus widget. Implementations of QInputContext should call this method to send the generated input method events and not QApplication::sendEvent(), as the events might have to get dispatched to a different application on some platforms.

Some complex input methods route the handling to several child contexts (e.g. to enable language switching). To account for this, QInputContext will check if the parent object is a QInputContext. If yes, it will call the parents sendEvent() implementation instead of sending the event directly.

See also:
QInputMethodEvent

Definition at line 236 of file qinputcontext.cpp.

References focusWidget(), QObject::parent(), QObject::qobject_cast(), and sendEvent().

Referenced by sendEvent().

{
    // route events over input context parents to make chaining possible.
    QInputContext *p = qobject_cast<QInputContext *>(parent());
    if (p) {
        p->sendEvent(event);
        return;
    }

    QWidget *focus = focusWidget();
    if (!focus)
      return;

    QInputMethodEvent e(event);
    qApp->sendEvent(focus, &e);
}


Generated by  Doxygen 1.6.0   Back to index