summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimage.h3
-rw-r--r--src/gui/image/qimagewriter.cpp14
2 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 02f0c18243..bc7f3729ad 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -327,6 +327,7 @@ inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(Q_CC_MSVC)
+# pragma warning(push)
# pragma warning(disable: 4996)
#endif
@@ -403,7 +404,7 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# pragma GCC diagnostic pop
#elif defined(Q_CC_MSVC)
-# pragma warning(default: 4996)
+# pragma warning(pop)
#endif
inline int QImage::numColors() const
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 8dd5fdd111..c12dbb6544 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -279,7 +279,7 @@ QImageWriterPrivate::QImageWriterPrivate(QImageWriter *qq)
compression = 0;
gamma = 0.0;
imageWriterError = QImageWriter::UnknownError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter, QLatin1String("Unknown error"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unknown error"));
q = qq;
}
@@ -288,22 +288,19 @@ bool QImageWriterPrivate::canWriteHelper()
{
if (!device) {
imageWriterError = QImageWriter::DeviceError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Device is not set"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Device is not set"));
return false;
}
if (!device->isOpen())
device->open(QIODevice::WriteOnly);
if (!device->isWritable()) {
imageWriterError = QImageWriter::DeviceError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Device not writable"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Device not writable"));
return false;
}
if (!handler && (handler = createWriteHandlerHelper(device, format)) == 0) {
imageWriterError = QImageWriter::UnsupportedFormatError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Unsupported image format"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unsupported image format"));
return false;
}
return true;
@@ -670,8 +667,7 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
{
if (!d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0) {
d->imageWriterError = QImageWriter::UnsupportedFormatError;
- d->errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Unsupported image format"));
+ d->errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unsupported image format"));
return false;
}