summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-07-22 14:53:49 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-07-23 08:40:24 (GMT)
commit9377881d6d6f5c07aa134c8f1708d0afd0d06e86 (patch)
tree0f3f6b4d0b0b678eee141193716a65cb8f882590 /src/gui/kernel/qcocoaview_mac.mm
parent350f857f116a734ea25f91887999eeb17e064350 (diff)
downloadQt-9377881d6d6f5c07aa134c8f1708d0afd0d06e86.zip
Qt-9377881d6d6f5c07aa134c8f1708d0afd0d06e86.tar.gz
Qt-9377881d6d6f5c07aa134c8f1708d0afd0d06e86.tar.bz2
"Emacs" style keyboard shortcuts don't work on Cocoa.
Mac supports only single key shortcuts as key equivalent for menu items. So if a multiple key QKeySequence is set, use Qt's shortcut mechanism instead of the native menu shortcut mechanism. Task-number: 258438 Reviewed-by: Norwegian Rock Cat
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index 3e5bfb6..3bc348c 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -1039,7 +1039,7 @@ extern "C" {
- (void) insertText:(id)aString
{
- if ([aString length]) {
+ if ([aString length] && composing) {
// Send the commit string to the widget.
QString commitText;
if ([aString isKindOfClass:[NSAttributedString class]]) {
@@ -1052,7 +1052,14 @@ extern "C" {
QInputMethodEvent e;
e.setCommitString(commitText);
qt_sendSpontaneousEvent(qwidget, &e);
+ } else {
+ // The key sequence "`q" on a French Keyboard will generate two calls to insertText before
+ // it returns from interpretKeyEvents. The first call will turn off 'composing' and accept
+ // the "`" key. The last keyDown event needs to be processed by the widget to get the
+ // character "q". The string parameter is ignored for the second call.
+ sendKeyEvents = true;
}
+
composingText->clear();
}