diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-12 23:32:44 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2019-08-20 19:34:53 +0200 |
commit | d46415c0af5c84b5924694a090a0cd70fdb18158 (patch) | |
tree | 5cab38003d803c43e24f2e9a4d33a89c162acb85 /src/widgets/doc | |
parent | 9f082b4e03a52ed651e636f765eb076d3e56a2f4 (diff) |
wasm: Add saveFileContent()
Saves a file by file download, where the user can choose
the file name and location using a file dialog.
Change-Id: I4d2ecc76fc33bb65fdf3d7ca3fcd9566c62547dd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/widgets/doc')
-rw-r--r-- | src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 39aca459db..7ccd827a04 100644 --- a/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp +++ b/src/widgets/doc/snippets/code/src_gui_dialogs_qfiledialog.cpp @@ -155,3 +155,8 @@ auto fileOpenCompleted = [](const QString &fileName, const QByteArray &fileConte } QFileDialog::getOpenFileContent("Images (*.png *.xpm *.jpg)", fileContentReady); //! [15] + +//! [16] +QByteArray imageData; // obtained from e.g. QImage::save() +QFileDialog::saveFile("myimage.png", imageData); +//! [16] |