summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-06-18 04:53:03 (GMT)
committerStian Sandvik Thomassen <stian.thomassen@nokia.com>2009-06-18 04:53:03 (GMT)
commit75e8aaae5e8a0cbaa62fd4cd2a8235544f974a73 (patch)
tree717950251fdea94664532ed1a8304544068ddd53 /src
parent688454f4fa508e5262786070a149f604156d5197 (diff)
downloadQt-75e8aaae5e8a0cbaa62fd4cd2a8235544f974a73.zip
Qt-75e8aaae5e8a0cbaa62fd4cd2a8235544f974a73.tar.gz
Qt-75e8aaae5e8a0cbaa62fd4cd2a8235544f974a73.tar.bz2
Made QInputDialog::getText() return null QString when rejected
This reverts a behavior change introduced with Qt 4.5.0 where QInputDialog::getText() returned the line edit's text when the dialog was rejected. However, the behavior since Qt 4.0 has been to return a null QString when the dialog is rejected. Task-number: 256299 Reviewed-by: Andy Shaw
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qinputdialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/dialogs/qinputdialog.cpp b/src/gui/dialogs/qinputdialog.cpp
index 7f21d3d..d94d8fe 100644
--- a/src/gui/dialogs/qinputdialog.cpp
+++ b/src/gui/dialogs/qinputdialog.cpp
@@ -1129,8 +1129,8 @@ void QInputDialog::done(int result)
is \a parent. The dialog will be modal and uses the specified widget
\a flags.
- This function returns the text which has been entered in the line
- edit. It will not return an empty string.
+ If the dialog is accepted, this function returns the text in the dialog's
+ line edit. If the dialog is rejected, a null QString is returned.
Use this static function like this:
@@ -1159,7 +1159,7 @@ QString QInputDialog::getText(QWidget *parent, const QString &title, const QStri
if (ret) {
return dialog.textValue();
} else {
- return text;
+ return QString();
}
}