From fb703aea697b12de4810deec9f8605fd062208bd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Tue, 23 Jul 2019 14:47:07 +0200 Subject: Docs: Fix the snippet lookup for QFileDialog::getOpenFileContent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src_gui_dialogs_qfiledialog.cpp had two snippets labeled "14". This change bumps one of them to "15" and fixes the the snippet lookup for QFileDialog::getOpenFileContent accordingly. Also, fix two typos: "QSting" -> "QString" and "contents has" -> "contents have". Change-Id: Ic018c23b6ca585f30c116b8a6eb29293560c7a35 Reviewed-by: Morten Johan Sørvig --- src/widgets/dialogs/qfiledialog.cpp | 4 ++-- src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index f772eb1241..2c2d209226 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2376,10 +2376,10 @@ QList QFileDialog::getOpenFileUrls(QWidget *parent, It can also be used on other platforms, where it will fall back to using QFileDialog. The function is asynchronous and returns immediately. The \a fileOpenCompleted - callback will be called when a file has been selected and its contents has been + callback will be called when a file has been selected and its contents have been read into memory. - \snippet code/src_gui_dialogs_qfiledialog.cpp 14 + \snippet code/src_gui_dialogs_qfiledialog.cpp 15 \since 5.13 */ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::function &fileOpenCompleted) diff --git a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp index 1e9daf824b..39aca459db 100644 --- a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp +++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp @@ -145,8 +145,8 @@ dialog.exec(); "Images (*.png *.xpm *.jpg);;Text files (*.txt);;XML files (*.xml)" //! [14] -//! [14] -auto fileOpenCompleted = [](const QSting &fileName, const QByteArray &fileContent) { +//! [15] +auto fileOpenCompleted = [](const QString &fileName, const QByteArray &fileContent) { if (fileName.isEmpty()) { // No file was selected } else { @@ -154,4 +154,4 @@ auto fileOpenCompleted = [](const QSting &fileName, const QByteArray &fileConten } } QFileDialog::getOpenFileContent("Images (*.png *.xpm *.jpg)", fileContentReady); -//! [14] +//! [15] -- cgit v1.2.3