12#include <Carbon/Carbon.h>
14#include <QtCore/QRect>
15#include <QtGui/QGuiApplication>
16#include <QtGui/QWindow>
50 NSTextInputContextKeyboardSelectionDidChangeNotification, [&]() {
51 qCDebug(lcQpaInputMethods) <<
"Text input source changed";
69 qCDebug(lcQpaInputMethods) <<
"Committing composition";
74 auto *platformWindow = m_focusWindow->handle();
78 auto *cocoaWindow =
static_cast<QCocoaWindow *
>(platformWindow);
85 [
view.inputContext discardMarkedText];
86 if (
view.inputContext != NSTextInputContext.currentInputContext) {
91 [NSTextInputContext.currentInputContext activate];
101 qCDebug(lcQpaInputMethods) <<
"Resetting input method";
111 if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) {
112 [ctxt discardMarkedText];
119 qCDebug(lcQpaInputMethods) <<
"Focus object changed to" << focusObject;
132 if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) {
133 [ctxt discardMarkedText];
134 [
view cancelComposingText];
144 NSArray *languages =
static_cast<NSArray*
>(TISGetInputSourceProperty(
source,
145 kTISPropertyInputSourceLanguages));
147 qCDebug(lcQpaInputMethods) <<
"Input source supports" << languages;
148 if (!languages.count)
154 qCDebug(lcQpaInputMethods) <<
"Reporting new locale" <<
locale;
void reset() override
Cancels a composition.
QLocale locale() const override
void setFocusObject(QObject *object) override
This virtual method gets called to notify updated focus to object.
void commit() override
Commits the current composition if there is one, by "unmarking" the text in the edit buffer,...
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
The QPlatformInputContext class abstracts the input method dependent data and composing state.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
QNSView * qnsview_cast(NSView *view)
Returns the view cast to a QNSview if possible.
#define qCDebug(category,...)
GLsizei GLsizei GLchar * source