Cocoa: stop using the deprecated NSInputManager.

Replaced by NSTextInputContext.

Change-Id: I694b28b766f8bf1d37e0ee87ff503e33d205f8ab
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
Erik Verbruggen 2015-04-21 11:27:07 +02:00
parent 5350ee7ad5
commit 1fe2349762
2 changed files with 3 additions and 7 deletions

View File

@ -99,9 +99,8 @@ void QCocoaInputContext::reset()
return; return;
QCocoaAutoReleasePool pool; QCocoaAutoReleasePool pool;
NSInputManager *currentIManager = [NSInputManager currentInputManager]; if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) {
if (currentIManager) { [ctxt discardMarkedText];
[currentIManager markedTextAbandoned:view];
[view unmarkText]; [view unmarkText];
} }
} }

View File

@ -804,10 +804,7 @@ QT_WARNING_POP
} }
if ([self hasMarkedText]) { if ([self hasMarkedText]) {
NSInputManager* inputManager = [NSInputManager currentInputManager]; [[NSTextInputContext currentInputContext] handleEvent:theEvent];
if ([inputManager wantsToHandleMouseEvents]) {
[inputManager handleMouseEvent:theEvent];
}
} else { } else {
if ([QNSView convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) { if ([QNSView convertKeyModifiers:[theEvent modifierFlags]] & Qt::MetaModifier) {
m_buttons |= Qt::RightButton; m_buttons |= Qt::RightButton;