diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-07-02 09:46:42 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-07-02 15:16:06 (GMT) |
commit | 099a32d121cbc80a1a234c3146f4be9b5237e7e8 (patch) | |
tree | 29caea381f62dd460a303c30b06d87be9c6333ae /src/gui/text | |
parent | 27360dd89f0ea72610cf2cd725c62f7a7dd2ea91 (diff) | |
download | Qt-099a32d121cbc80a1a234c3146f4be9b5237e7e8.zip Qt-099a32d121cbc80a1a234c3146f4be9b5237e7e8.tar.gz Qt-099a32d121cbc80a1a234c3146f4be9b5237e7e8.tar.bz2 |
Don't insert text into a text widget when a modifier is pressed.
For example when an unhandled key sequence (i.e. that has now shortcut
assosiated with it) like Alt-L is pressed, we shouldn't insert the 'L'
text from the QKeyEvent::text() into the text widget.
Reviewed-by: Thomas Zander
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextcontrol.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp index b2ad686..2a590fd 100644 --- a/src/gui/text/qtextcontrol.cpp +++ b/src/gui/text/qtextcontrol.cpp @@ -1245,7 +1245,8 @@ void QTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { QString text = e->text(); - if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) { + if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t')) && + ((e->modifiers() & (Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier)) == Qt::NoModifier)) { if (overwriteMode // no need to call deleteChar() if we have a selection, insertText // does it already |