aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:33:27 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:33:27 +0100
commit91524134d4884beb9ee2695e9de27b211068d973 (patch)
treee05580a4892ffbe52e0c95abbb2748816cbfe70a /tests
parente5b35c47f3bbb23800a50cfc1c34c9a99b2c6d7b (diff)
parent1ed9193c43fae147d9df56b144b9bcf18590ebe8 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 5020cf9..8a63e25 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -92,18 +92,18 @@ void tst_QPixmap::toHBITMAP()
QVERIFY(GetObject(bitmap, sizeof(BITMAP), &bitmapInfo));
- QCOMPARE(100, (int) bitmapInfo.bmWidth);
- QCOMPARE(100, (int) bitmapInfo.bmHeight);
+ QCOMPARE(LONG(100), bitmapInfo.bmWidth);
+ QCOMPARE(LONG(100), bitmapInfo.bmHeight);
const HDC displayDc = GetDC(0);
const HDC bitmapDc = CreateCompatibleDC(displayDc);
- const HBITMAP nullBitmap = (HBITMAP) SelectObject(bitmapDc, bitmap);
+ const HBITMAP nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap));
const COLORREF pixel = GetPixel(bitmapDc, 0, 0);
- QCOMPARE((int)GetRValue(pixel), red);
- QCOMPARE((int)GetGValue(pixel), green);
- QCOMPARE((int)GetBValue(pixel), blue);
+ QCOMPARE(int(GetRValue(pixel)), red);
+ QCOMPARE(int(GetGValue(pixel)), green);
+ QCOMPARE(int(GetBValue(pixel)), blue);
// Clean up
SelectObject(bitmapDc, nullBitmap);
@@ -261,7 +261,9 @@ void tst_QPixmap::fromHICON()
const QString iconFileName = image + QStringLiteral(".ico");
QVERIFY2(QFileInfo(iconFileName).exists(), qPrintable(iconFileName));
- const HICON icon = (HICON)LoadImage(0, (wchar_t*)(iconFileName).utf16(), IMAGE_ICON, width, height, LR_LOADFROMFILE);
+ const HICON icon =
+ static_cast<HICON>(LoadImage(0, reinterpret_cast<const wchar_t *>(iconFileName.utf16()),
+ IMAGE_ICON, width, height, LR_LOADFROMFILE));
const QImage imageFromHICON = QtWin::fromHICON(icon).toImage();
DestroyIcon(icon);