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;
QCocoaAutoReleasePool pool;
NSInputManager *currentIManager = [NSInputManager currentInputManager];
if (currentIManager) {
[currentIManager markedTextAbandoned:view];
if (NSTextInputContext *ctxt = [NSTextInputContext currentInputContext]) {
[ctxt discardMarkedText];
[view unmarkText];
}
}

View File

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