QWindowsInputContext::QWindowsInputContext() : m_WM_MSIME_MOUSE(RegisterWindowMessage(L"MSIMEMouseOperation")), m_endCompositionRecursionGuard(false) { connect(qApp->inputMethod(), SIGNAL(cursorRectangleChanged()), this, SLOT(cursorRectChanged())); }
/*! Sets the transformation from input item coordinates to window coordinates to be \a transform. Item transform needs to be updated by the focused window like QQuickCanvas whenever item is moved inside the scene. */ void QInputMethod::setInputItemTransform(const QTransform &transform) { Q_D(QInputMethod); if (d->inputItemTransform == transform) return; d->inputItemTransform = transform; emit cursorRectangleChanged(); }
/*! Called by the input item to inform the platform input methods when there has been state changes in editor's input method query attributes. When calling the function \a queries parameter has to be used to tell what has changes, which input method can use to make queries for attributes it's interested with QInputMethodQueryEvent. In particular calling update whenever the cursor position changes is important as that often causes other query attributes like surrounding text and text selection to change as well. The attributes that often change together with cursor position have been grouped in Qt::ImQueryInput value for convenience. */ void QInputMethod::update(Qt::InputMethodQueries queries) { Q_D(QInputMethod); if (queries & Qt::ImEnabled) { QObject *focus = qApp->focusObject(); bool enabled = d->objectAcceptsInputMethod(focus); QPlatformInputContextPrivate::setInputMethodAccepted(enabled); } QPlatformInputContext *ic = d->platformInputContext(); if (ic) ic->update(queries); if (queries & Qt::ImCursorRectangle) emit cursorRectangleChanged(); }
QIBusInputContextProxy *context; bool valid; QString predit; }; QIBusPlatformInputContext::QIBusPlatformInputContext () : d(new QIBusPlatformInputContextPrivate()) { if (d->context) { connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant))); connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool))); } QInputMethod *p = qApp->inputMethod(); connect(p, SIGNAL(cursorRectangleChanged()), this, SLOT(cursorRectChanged())); } QIBusPlatformInputContext::~QIBusPlatformInputContext (void) { delete d; } bool QIBusPlatformInputContext::isValid() const { return d->valid; } void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int) { if (!d->valid)