From 75ef81a1094465c36c091aa02e3108fb1a884821 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 4 Jul 2019 22:26:53 +0200 Subject: [PATCH] QImage::byteCount -> QImage::sizeInByes --- autotests/pictest.cpp | 4 ++-- autotests/readtest.cpp | 4 ++-- tests/imagedump.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autotests/pictest.cpp b/autotests/pictest.cpp index fc8113c..dcd8211 100644 --- a/autotests/pictest.cpp +++ b/autotests/pictest.cpp @@ -210,11 +210,11 @@ private Q_SLOTS: QFile picDumpFile(fileNameBase + QStringLiteral("-expected.data")); QVERIFY2(picDumpFile.open(QIODevice::WriteOnly), qPrintable(picDumpFile.errorString())); picDumpFile.write(reinterpret_cast(inputImage.bits()), - inputImage.byteCount()); + inputImage.sizeInBytes()); QFile pngDumpFile(fileNameBase + QStringLiteral("-actual.data")); QVERIFY2(pngDumpFile.open(QIODevice::WriteOnly), qPrintable(pngDumpFile.errorString())); pngDumpFile.write(reinterpret_cast(expImage.bits()), - expImage.byteCount()); + expImage.sizeInBytes()); QString msg = QStringLiteral("Read image (") + picDumpFile.fileName() + QStringLiteral(") differed from expected image (") diff --git a/autotests/readtest.cpp b/autotests/readtest.cpp index bbda287..ae00fc3 100644 --- a/autotests/readtest.cpp +++ b/autotests/readtest.cpp @@ -35,8 +35,8 @@ static void writeImageData(const char *name, const QString &filename, const QIma { QFile file(filename); if (file.open(QIODevice::WriteOnly)) { - qint64 written = file.write(reinterpret_cast(image.bits()), image.byteCount()); - if (written == image.byteCount()) { + qint64 written = file.write(reinterpret_cast(image.bits()), image.sizeInBytes()); + if (written == image.sizeInBytes()) { QTextStream(stdout) << " " << name << " written to " << filename << "\n"; } else { diff --git a/tests/imagedump.cpp b/tests/imagedump.cpp index 1ecba11..fec1870 100644 --- a/tests/imagedump.cpp +++ b/tests/imagedump.cpp @@ -116,8 +116,8 @@ int main(int argc, char **argv) } img = img.convertToFormat(qformat); } - qint64 written = output.write(reinterpret_cast(img.bits()), img.byteCount()); - if (written != img.byteCount()) { + qint64 written = output.write(reinterpret_cast(img.bits()), img.sizeInBytes()); + if (written != img.sizeInBytes()) { QTextStream(stderr) << "Could not write image data to " << files.at(1) << ":" << output.errorString() << "\n"; return 5;