diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-10-05 23:26:08 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-12 13:01:20 +0000 |
commit | 178bc49ac2b80b80f75829f3add5d7e66fd08240 (patch) | |
tree | 861597661ebe0d8e290068c32945e9ba33289f71 /src/gui/image | |
parent | 104200d688650db02f1447f73a499784115d897d (diff) |
QImageWriter: improve documentation regarding use of resources
QImageWriter's plugin can open devices while operating and only free
them on destruction which means that if one wants to act on the file
written if must first destroy the writer's instance. This patch adds
the suggestion to use a scope to avoid that problem.
Change-Id: I239157ea86c4a93faab237fe1860312a3c7ac7a2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qimagewriter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 5ce7e309bb..d3f9a9b881 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -71,6 +71,16 @@ formats, in addition to any image format plugins that support writing. + \note QImageWriter assumes exclusive control over the file or + device that is assigned. Any attempts to modify the assigned file + or device during the lifetime of the QImageWriter object will + yield undefined results. If immediate access to a resource is + desired, the use of a scope is the recommended method. + + For example: + + \snippet qimagewriter/main.cpp 0 + \sa QImageReader, QImageIOHandler, QImageIOPlugin */ |