diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-03-20 01:00:08 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-03-20 14:09:30 +0100 |
commit | 6893919b0c4cddfbd82ebf963cc7bebde816b1b3 (patch) | |
tree | 9bfa1b57707fe609f9401c5b3bd5cd85ec1ae777 /src/gui/image/qimage.cpp | |
parent | 3ca05b2a2e80863202bdb6a225f72debbb28b8fe (diff) | |
parent | 2bafd997ee515d3b6a6a8fb030e1265a4713713e (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
src/gui/kernel/qplatformintegration.cpp
src/gui/kernel/qplatformintegration.h
src/plugins/platforms/wasm/qwasmintegration.cpp
src/plugins/platforms/xcb/qxcbconnection_screens.cpp
Change-Id: I15063d42e9a1e226d9d2d2d372f75141b84c5c1b
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 18e94cf256..0463ef6a42 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -124,7 +124,7 @@ QImageData * QImageData::create(const QSize &size, QImage::Format format) int height = size.height(); int depth = qt_depthForFormat(format); auto params = calculateImageParameters(width, height, depth); - if (params.bytesPerLine < 0) + if (!params.isValid()) return nullptr; QScopedPointer<QImageData> d(new QImageData); @@ -783,7 +783,7 @@ QImageData *QImageData::create(uchar *data, int width, int height, int bpl, QIm const int depth = qt_depthForFormat(format); auto params = calculateImageParameters(width, height, depth); - if (params.totalSize < 0) + if (!params.isValid()) return nullptr; if (bpl > 0) { @@ -1488,10 +1488,17 @@ qsizetype QImage::sizeInBytes() const \sa scanLine() */ +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) +qsizetype QImage::bytesPerLine() const +{ + return d ? d->bytes_per_line : 0; +} +#else int QImage::bytesPerLine() const { return d ? d->bytes_per_line : 0; } +#endif /*! |