diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.cpp | 2 | ||||
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 5f86b511f7..0ee8e8b4aa 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -495,6 +495,8 @@ QStringList QFileDialogOptions::nameFilters() const void QFileDialogOptions::setDefaultSuffix(const QString &suffix) { d->defaultSuffix = suffix; + if (d->defaultSuffix.size() > 1 && d->defaultSuffix.startsWith(QLatin1Char('.'))) + d->defaultSuffix.remove(0, 1); // Silently change ".txt" -> "txt". } QString QFileDialogOptions::defaultSuffix() const diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 657c8cc7c2..ff8303bca4 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1552,6 +1552,8 @@ bool QFileDialog::confirmOverwrite() const filename if it has no suffix already. The suffix is typically used to indicate the file type (e.g. "txt" indicates a text file). + + If the first character is a dot ('.'), it is removed. */ void QFileDialog::setDefaultSuffix(const QString &suffix) { |