Docs: Fix the snippet lookup for QFileDialog::getOpenFileContent
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 <morten.sorvig@qt.io>bb10
parent
41f77a6179
commit
fb703aea69
|
|
@ -2376,10 +2376,10 @@ QList<QUrl> 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<void(const QString &, const QByteArray &)> &fileOpenCompleted)
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in New Issue