summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimagewriter.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-05-04 11:45:27 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-05-09 19:47:53 +0000
commita213011a53f12f101d08a04afc8fdacd2d54a232 (patch)
treed4db99fdee7b9e3a62a5b3f5219726ac06fb70fa /src/gui/image/qimagewriter.cpp
parente8995de22a0ccca932e24994c6e1861ef062983b (diff)
QtGui: Introduce delegating constructors.
Reduce code duplication by chaining constructors. Change-Id: Ida25105e33cc3ef870f416931212e2216e9c6dfb Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/image/qimagewriter.cpp')
-rw-r--r--src/gui/image/qimagewriter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index ddf9f2dda9..1a0bb4d6ff 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -326,12 +326,9 @@ QImageWriter::QImageWriter(QIODevice *device, const QByteArray &format)
by inspecting the extension of \a fileName.
*/
QImageWriter::QImageWriter(const QString &fileName, const QByteArray &format)
- : d(new QImageWriterPrivate(this))
+ : QImageWriter(new QFile(fileName), format)
{
- QFile *file = new QFile(fileName);
- d->device = file;
d->deleteDevice = true;
- d->format = format;
}
/*!