summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2012-09-04 19:40:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-09-05 03:02:23 +0200
commit3fe5715b9a46ba13137b21d5ea8288ac8b538268 (patch)
treee094c29d55d40a03a8df2250c769a9297e577202
parent90e4a5b5f00f1b9402ea35754eefe25bfbc0d1d3 (diff)
Fix Windows platform plugin narrowing conversion compile errors
Implicit conversions from int to BYTE (unsigned char) result in compile errors when compiling with the GCC -std=c++0x option. Change-Id: Iaf8190426207bf15ab4b337300510596d70659ed Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index c30d566e2b..4349b45d99 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -99,7 +99,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
SIZE size = {r.width(), r.height()};
POINT ptDst = {r.x(), r.y()};
POINT ptSrc = {0, 0};
- BLENDFUNCTION blend = {AC_SRC_OVER, 0, (int)(255.0 * rw->opacity()), AC_SRC_ALPHA};
+ BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * rw->opacity()), AC_SRC_ALPHA};
RECT dirty = {dirtyRect.x(), dirtyRect.y(),
dirtyRect.x() + dirtyRect.width(), dirtyRect.y() + dirtyRect.height()};
UPDATELAYEREDWINDOWINFO info = {sizeof(info), NULL, &ptDst, &size, m_image->hdc(), &ptSrc, 0, &blend, ULW_ALPHA, &dirty};
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 7e79e1c819..b43032dc1a 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -223,7 +223,7 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, qreal level)
if ((wl & WS_EX_LAYERED) == 0)
SetWindowLong(hwnd, GWL_EXSTYLE, wl | WS_EX_LAYERED);
if (flags & Qt::FramelessWindowHint) {
- BLENDFUNCTION blend = {AC_SRC_OVER, 0, (int)(255.0 * level), AC_SRC_ALPHA};
+ BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * level), AC_SRC_ALPHA};
QWindowsContext::user32dll.updateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA);
} else {
QWindowsContext::user32dll.setLayeredWindowAttributes(hwnd, 0, (int)(level * 255), LWA_ALPHA);