summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-11-03 14:09:09 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-11-03 14:38:02 (GMT)
commit9bd330756bc8e0fac9919da0b1068096ee91cb24 (patch)
treed258725a5659e196eb38b780e957059020157a0a /src/gui/widgets/qlinecontrol.cpp
parenta3b84f683e0baae34dc37c85a40dcae3e5306419 (diff)
downloadQt-9bd330756bc8e0fac9919da0b1068096ee91cb24.zip
Qt-9bd330756bc8e0fac9919da0b1068096ee91cb24.tar.gz
Qt-9bd330756bc8e0fac9919da0b1068096ee91cb24.tar.bz2
Pressing return in a QWizard would erase the active password entry.
When echo mode was set to PasswordEchoOnEdit in a QLineEdit, and its text selected, pressing the return key would erase the text and start editing it instead of validating the password. Auto-test included. Reviewed-by: Olivier Task-number: QTBUG-4401
Diffstat (limited to 'src/gui/widgets/qlinecontrol.cpp')
-rw-r--r--src/gui/widgets/qlinecontrol.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 7f9ff82..26b9c95 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -1509,6 +1509,18 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
}
#endif // QT_NO_COMPLETER
+ if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
+ if (hasAcceptableInput() || fixup()) {
+ emit accepted();
+ emit editingFinished();
+ }
+ if (inlineCompletionAccepted)
+ event->accept();
+ else
+ event->ignore();
+ return;
+ }
+
if (echoMode() == QLineEdit::PasswordEchoOnEdit
&& !passwordEchoEditing()
&& !isReadOnly()
@@ -1529,17 +1541,6 @@ void QLineControl::processKeyEvent(QKeyEvent* event)
clear();
}
- if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
- if (hasAcceptableInput() || fixup()) {
- emit accepted();
- emit editingFinished();
- }
- if (inlineCompletionAccepted)
- event->accept();
- else
- event->ignore();
- return;
- }
bool unknown = false;
if (false) {