From 8c9e41cc7803929aafb200c44276f4059b6ead6c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Jun 2019 14:20:20 +0200 Subject: Use QSaveFile in MainWindow examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QSaveFile should preferably be used by editor applications to catch write errors. Task-number: QTBUG-60635 Change-Id: Ia609435871b56b45714c3dd3d32bbc85b5cb4dd5 Reviewed-by: Paul Wicking Reviewed-by: MÃ¥rten Nordheim --- examples/widgets/doc/src/application.qdoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'examples/widgets/doc/src') diff --git a/examples/widgets/doc/src/application.qdoc b/examples/widgets/doc/src/application.qdoc index 040aa171b79..6c37fa67bb3 100644 --- a/examples/widgets/doc/src/application.qdoc +++ b/examples/widgets/doc/src/application.qdoc @@ -327,9 +327,12 @@ \snippet mainwindows/application/mainwindow.cpp 44 \snippet mainwindows/application/mainwindow.cpp 45 - Saving a file is very similar to loading one. Here, the - QFile::Text flag ensures that on Windows, "\\n" is converted into - "\\r\\n" to conform to the Windows convension. + Saving a file is similar to loading one. We use QSaveFile to ensure + all data are safely written and existing files are not damaged + should writing fail. + We use the QFile::Text flag to make sure that on Windows, "\\n" + is converted into "\\r\\n" to conform to the Windows convention. + \snippet mainwindows/application/mainwindow.cpp 46 \snippet mainwindows/application/mainwindow.cpp 47 -- cgit v1.2.3