From 0d81316dcca0324b343def07a4a2bd5792c27fd5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Sun, 12 Jul 2015 23:47:20 +0200 Subject: Use QImageReader::setAutoTransform() in examples. Change-Id: If80616d680f1aa6c9d5cd1a4080710e5ad67d603 Reviewed-by: Rainer Keller Reviewed-by: Allan Sandfeld Jensen --- examples/widgets/doc/src/imageviewer.qdoc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'examples/widgets/doc/src/imageviewer.qdoc') diff --git a/examples/widgets/doc/src/imageviewer.qdoc b/examples/widgets/doc/src/imageviewer.qdoc index 901d6fe76e..91ae56b5d7 100644 --- a/examples/widgets/doc/src/imageviewer.qdoc +++ b/examples/widgets/doc/src/imageviewer.qdoc @@ -124,10 +124,16 @@ \snippet widgets/imageviewer/imageviewer.cpp 2 - In the \c loadFile() function, we check if the file's - format is an image format by constructing a QImage which tries to - load the image from the file. If the constructor returns a null - image, we use a QMessageBox to alert the user. + In the \c loadFile() function, we instantiate a QImageReader + and enable automatic transformations by calling + QImageReader::setAutoTransform(). For files in JPEG format, + this ensures that portrait mode images of digital cameras are shown + correctly by applying the appropriate orientation read from the + EXIF meta data stored in the image file. + + We then load the image using QImageReader::read(). If this returns + a null image, indicating that the file is not an image file, + we use a QMessageBox to alert the user. The QMessageBox class provides a modal dialog with a short message, an icon, and some buttons. As with QFileDialog the -- cgit v1.2.3