#include <QtGui/qpixmapcache.h>
#include <QtWidgets/qstyleoption.h>
#include <QtGui/qevent.h>
-#include <QtWidgets/qinputcontext.h>
+#include <QtGui/qinputpanel.h>
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
if (!hasFocus())
return;
d->scene->d_func()->updateInputMethodSensitivityInViews();
-#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN))
QWidget *fw = QApplication::focusWidget();
if (!fw)
return;
- for (int i = 0 ; i < scene()->views().count() ; ++i)
- if (scene()->views().at(i) == fw)
- if (QInputContext *inputContext = fw->inputContext())
- inputContext->update();
-#endif
+ qApp->inputPanel()->update(Qt::ImHints);
}
/*!
if (scene()) {
for (int i = 0 ; i < scene()->views().count() ; ++i) {
if (scene()->views().at(i) == fw) {
- if (QInputContext *inputContext = fw->inputContext()) {
- inputContext->update();
+ if (qApp)
+ qApp->inputPanel()->update(Qt::ImQueryAll);
+
#ifndef QT_NO_ACCESSIBILITY
- // ##### is this correct
- if (toGraphicsObject())
- QAccessible::updateAccessibility(toGraphicsObject(), 0, QAccessible::StateChanged);
+ // ##### is this correct
+ if (toGraphicsObject())
+ QAccessible::updateAccessibility(toGraphicsObject(), 0, QAccessible::StateChanged);
#endif
- break;
+ break;
}
}
}
case QEvent::KeyRelease:
// Reset the focus widget's input context, regardless
// of how this item gained or lost focus.
- if (QWidget *fw = qApp->focusWidget()) {
-#ifndef QT_NO_IM
- if (QInputContext *qic = fw->inputContext()) {
- if (event->type() == QEvent::FocusIn || event->type() == QEvent::FocusOut)
- qic->reset();
- else
- qic->update();
- }
-#endif //QT_NO_IM
+ if (event->type() == QEvent::FocusIn) {
+ qApp->inputPanel()->reset();
+ } else if (event->type() == QEvent::FocusOut) {
+ qApp->inputPanel()->commit();
+ } else {
+ qApp->inputPanel()->update(Qt::ImQueryInput);
}
break;
case QEvent::ShortcutOverride:
#include <QtWidgets/qstyleoption.h>
#include <QtWidgets/qtooltip.h>
#include <QtGui/qtransform.h>
-#include <QtWidgets/qinputcontext.h>
+#include <QtGui/qinputpanel.h>
#include <QtWidgets/qgraphicseffect.h>
#ifndef QT_NO_ACCESSIBILITY
# include <QtWidgets/qaccessible.h>
// automatically by removing WA_InputMethodEnabled on
// the views, but if we are changing focus, we have to
// do it ourselves.
- for (int i = 0; i < views.size(); ++i)
- if (views.at(i)->inputContext())
- views.at(i)->inputContext()->reset();
+ if (qApp)
+ qApp->inputPanel()->commit();
}
focusItem = 0;