aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltest
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@theqtcompany.com>2016-03-23 12:50:01 +0100
committerAndy Shaw <andy.shaw@theqtcompany.com>2016-03-24 19:35:08 +0000
commitd30aad9e66e10fc511ce51aaca3b28aa221d1da8 (patch)
tree565dd265dee089a039af37b09edf95b4f5c60c26 /src/qmltest
parent86383253fdb03fcec6ec09e4969857372c6bb177 (diff)
Use pixel() instead of scanLine() to check the color
For some image formats it is not possible to rely on scanLine() so it is best to use pixel() for this check as it will take into account the format of the image correctly. Change-Id: Iee753b79291f210d243a5aed9d61359c67a78931 Reviewed-by: aavit <eirik.aavitsland@theqtcompany.com>
Diffstat (limited to 'src/qmltest')
-rw-r--r--src/qmltest/quicktestresult.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qmltest/quicktestresult.cpp b/src/qmltest/quicktestresult.cpp
index 57ba65e588..9cecb0e2ff 100644
--- a/src/qmltest/quicktestresult.cpp
+++ b/src/qmltest/quicktestresult.cpp
@@ -105,9 +105,7 @@ public Q_SLOTS:
|| x * y >= m_image.width() * m_image.height())
return QVariant();
- const QRgb* pixel = reinterpret_cast<const QRgb*>(m_image.constScanLine(y));
- pixel += x;
- return QColor::fromRgba(*pixel);
+ return QColor::fromRgba(m_image.pixel(QPoint(x, y)));
}
bool equals(QuickTestImageObject *other) const