Commit 91524134 authored by Liang Qi's avatar Liang Qi
Browse files

Merge remote-tracking branch 'origin/5.6' into 5.7

Change-Id: Idd177eb0d33d08a1556858c8dc594c6ac38cbc18
Showing with 11 additions and 9 deletions
TARGET = QtWinExtras
load(qt_module)
QT += gui-private core-private
SOURCES += \
......@@ -59,3 +57,5 @@ OTHER_FILES += \
doc/snippets/code/use-qtwinextras.cpp \
doc/snippets/code/thumbbar.cpp \
doc/snippets/code/thumbbar.qml
load(qt_module)
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment