aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qpixmap/tst_qpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qpixmap/tst_qpixmap.cpp')
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 8383194..2791cd2 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -87,7 +87,7 @@ void tst_QPixmap::toHBITMAP()
const HBITMAP bitmap = QtWin::toHBITMAP(pm);
- QVERIFY(bitmap != 0);
+ QVERIFY(bitmap != nullptr);
// Verify size
BITMAP bitmapInfo;
@@ -98,10 +98,10 @@ void tst_QPixmap::toHBITMAP()
QCOMPARE(LONG(100), bitmapInfo.bmWidth);
QCOMPARE(LONG(100), bitmapInfo.bmHeight);
- const HDC displayDc = GetDC(0);
+ const HDC displayDc = GetDC(nullptr);
const HDC bitmapDc = CreateCompatibleDC(displayDc);
- const HBITMAP nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap));
+ const auto nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap));
const COLORREF pixel = GetPixel(bitmapDc, 0, 0);
QCOMPARE(int(GetRValue(pixel)), red);
@@ -112,7 +112,7 @@ void tst_QPixmap::toHBITMAP()
SelectObject(bitmapDc, nullBitmap);
DeleteObject(bitmap);
DeleteDC(bitmapDc);
- ReleaseDC(0, displayDc);
+ ReleaseDC(nullptr, displayDc);
}
void tst_QPixmap::fromHBITMAP_data()
@@ -126,7 +126,7 @@ void tst_QPixmap::fromHBITMAP()
QFETCH(int, green);
QFETCH(int, blue);
- const HDC displayDc = GetDC(0);
+ const HDC displayDc = GetDC(nullptr);
const HDC bitmapDc = CreateCompatibleDC(displayDc);
const HBITMAP bitmap = CreateCompatibleBitmap(displayDc, 100, 100);
SelectObject(bitmapDc, bitmap);
@@ -148,7 +148,7 @@ void tst_QPixmap::fromHBITMAP()
DeleteObject(SelectObject(bitmapDc, oldBrush));
DeleteObject(SelectObject(bitmapDc, bitmap));
DeleteDC(bitmapDc);
- ReleaseDC(0, displayDc);
+ ReleaseDC(nullptr, displayDc);
}
static bool compareImages(const QImage &actual, const QImage &expected,
@@ -221,20 +221,20 @@ void tst_QPixmap::toHICON()
QPixmap empty(width, height);
empty.fill(Qt::transparent);
- const HDC displayDc = GetDC(0);
+ const HDC displayDc = GetDC(nullptr);
const HDC bitmapDc = CreateCompatibleDC(displayDc);
const HBITMAP bitmap = QtWin::toHBITMAP(empty, QtWin::HBitmapAlpha);
SelectObject(bitmapDc, bitmap);
const QString imageFileName = pngFileName(image, width, height);
- QVERIFY2(QFileInfo(imageFileName).exists(), qPrintable(imageFileName));
+ QVERIFY2(QFileInfo::exists(imageFileName), qPrintable(imageFileName));
const QImage imageFromFile = QImage(imageFileName).convertToFormat(QImage::Format_ARGB32_Premultiplied);
QVERIFY(!imageFromFile.isNull());
const HICON icon = QtWin::toHICON(QPixmap::fromImage(imageFromFile));
- DrawIconEx(bitmapDc, 0, 0, icon, width, height, 0, 0, DI_NORMAL);
+ DrawIconEx(bitmapDc, 0, 0, icon, width, height, 0, nullptr, DI_NORMAL);
DestroyIcon(icon);
DeleteDC(bitmapDc);
@@ -242,7 +242,7 @@ void tst_QPixmap::toHICON()
const QImage imageFromHICON = QtWin::fromHBITMAP(bitmap, QtWin::HBitmapAlpha).toImage();
QVERIFY(!imageFromHICON.isNull());
- ReleaseDC(0, displayDc);
+ ReleaseDC(nullptr, displayDc);
// fuzzy comparison must be used, as the pixel values change slightly during conversion
// between QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied, or elsewhere
@@ -262,16 +262,16 @@ void tst_QPixmap::fromHICON()
QFETCH(QString, image);
const QString iconFileName = image + QStringLiteral(".ico");
- QVERIFY2(QFileInfo(iconFileName).exists(), qPrintable(iconFileName));
+ QVERIFY2(QFileInfo::exists(iconFileName), qPrintable(iconFileName));
- const HICON icon =
- static_cast<HICON>(LoadImage(0, reinterpret_cast<const wchar_t *>(iconFileName.utf16()),
+ const auto icon =
+ static_cast<HICON>(LoadImage(nullptr, reinterpret_cast<const wchar_t *>(iconFileName.utf16()),
IMAGE_ICON, width, height, LR_LOADFROMFILE));
const QImage imageFromHICON = QtWin::fromHICON(icon).toImage();
DestroyIcon(icon);
const QString imageFileName = pngFileName(image, width, height);
- QVERIFY2(QFileInfo(imageFileName).exists(), qPrintable(imageFileName));
+ QVERIFY2(QFileInfo::exists(imageFileName), qPrintable(imageFileName));
const QImage imageFromFile = QImage(imageFileName).convertToFormat(QImage::Format_ARGB32_Premultiplied);
QVERIFY(!imageFromFile.isNull());