summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Sorvig <msorvig@trolltech.com>2009-09-03 12:17:39 +0200
committerMorten Sorvig <msorvig@trolltech.com>2009-09-03 12:17:39 +0200
commit0dcf114697309f3f23f9717b608fa2be1813fe94 (patch)
tree3f8702e3e58f3c1a40fff7f05d4ad7dfe167f8c9
parent992a3cb734cae82a4df6c3481138379b90bdc404 (diff)
Revert ed00fff3cb.
This caused dublicate key events in come cases, for example in the Qt Creator quick serach line edit. RevBy: TrustMe
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm11
-rw-r--r--src/gui/kernel/qcocoaview_mac_p.h1
2 files changed, 1 insertions, 11 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index bc320784a9..59494a7d2a 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -201,7 +201,6 @@ extern "C" {
composingText = new QString();
composing = false;
sendKeyEvents = true;
- inKeyDown = false;
currentCustomTypes = 0;
[self setHidden:YES];
return self;
@@ -1037,7 +1036,6 @@ extern "C" {
- (void)keyDown:(NSEvent *)theEvent
{
- inKeyDown = true;
sendKeyEvents = true;
QWidget *widgetToGetKey = qwidget;
@@ -1057,7 +1055,6 @@ extern "C" {
if (!keyOK && !sendToPopup)
[super keyDown:theEvent];
}
- inKeyDown = false;
}
@@ -1104,13 +1101,7 @@ extern "C" {
};
}
- if ([aString length] && !inKeyDown) {
- // Handle the case where insertText is called from somewhere else than the keyDown
- // implementation, for example when inserting text from the character palette.
- QInputMethodEvent e;
- e.setCommitString(commitText);
- qt_sendSpontaneousEvent(qwidget, &e);
- } else if ([aString length] && composing) {
+ if ([aString length] && composing) {
// Send the commit string to the widget.
composing = false;
sendKeyEvents = false;
diff --git a/src/gui/kernel/qcocoaview_mac_p.h b/src/gui/kernel/qcocoaview_mac_p.h
index 9d4e3d0545..3810a2bf41 100644
--- a/src/gui/kernel/qcocoaview_mac_p.h
+++ b/src/gui/kernel/qcocoaview_mac_p.h
@@ -86,7 +86,6 @@ Q_GUI_EXPORT
bool composing;
int composingLength;
bool sendKeyEvents;
- bool inKeyDown;
QString *composingText;
QStringList *currentCustomTypes;
NSInteger dragEnterSequence;