summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-06-13 16:14:40 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-20 03:17:49 +0200
commite4505acd12435f1b7d0dabe79823ccb7e26011e9 (patch)
treef516faf0b74411f965d0f60f06210365347b3e00 /src
parentf681e99e29e6d3b211d74ef27355b0c1962fd555 (diff)
Windows: Fix MinGW warnings.
- Missing initializers for structs - Missing enumeration value - Mixing enumeration/ints in operator ? Change-Id: I149ab01ad2ebd04f89e5c699905d5ba724828e0f Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp15
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp1
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsmime.cpp3
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp16
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
6 files changed, 26 insertions, 21 deletions
diff --git a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
index 56952dfb3e..64877d71ea 100644
--- a/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
+++ b/src/plugins/platforms/windows/qwindowsguieventdispatcher.cpp
@@ -152,7 +152,6 @@ messageDebugEntries[] = {
{WM_KILLFOCUS, "WM_KILLFOCUS", true},
{WM_ENABLE, "WM_ENABLE", true},
{WM_SHOWWINDOW, "WM_SHOWWINDOW", true},
- {WM_GETMINMAXINFO, "WM_GETMINMAXINFO"},
{WM_WINDOWPOSCHANGING, "WM_WINDOWPOSCHANGING", true},
{WM_WINDOWPOSCHANGED, "WM_WINDOWPOSCHANGED", true},
{WM_SETCURSOR, "WM_SETCURSOR", false},
@@ -199,13 +198,13 @@ messageDebugEntries[] = {
{WM_RENDERALLFORMATS, "WM_RENDERALLFORMATS", true},
{WM_DESTROYCLIPBOARD, "WM_DESTROYCLIPBOARD", true},
{WM_CAPTURECHANGED, "WM_CAPTURECHANGED", true},
- {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION"},
- {WM_IME_COMPOSITION, "WM_IME_COMPOSITION"},
- {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION"},
- {WM_IME_NOTIFY, "WM_IME_NOTIFY"},
- {WM_IME_REQUEST, "WM_IME_REQUEST"},
- {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE"},
- {WM_THEMECHANGED , "WM_THEMECHANGED"}
+ {WM_IME_STARTCOMPOSITION, "WM_IME_STARTCOMPOSITION", true},
+ {WM_IME_COMPOSITION, "WM_IME_COMPOSITION", true},
+ {WM_IME_ENDCOMPOSITION, "WM_IME_ENDCOMPOSITION", true},
+ {WM_IME_NOTIFY, "WM_IME_NOTIFY", true},
+ {WM_IME_REQUEST, "WM_IME_REQUEST", true},
+ {WM_DISPLAYCHANGE, "WM_DISPLAYCHANGE", true},
+ {WM_THEMECHANGED, "WM_THEMECHANGED", true}
};
static inline const MessageDebugEntry *messageDebugEntry(UINT msg)
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index d31b059445..52950ecde5 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -398,6 +398,7 @@ QVariant QWindowsIntegration::styleHint(QPlatformIntegration::StyleHint hint) co
case QPlatformIntegration::KeyboardInputInterval:
case QPlatformIntegration::ShowIsFullScreen:
case QPlatformIntegration::PasswordMaskDelay:
+ case QPlatformIntegration::StartDragVelocity:
break; // Not implemented
case QPlatformIntegration::FontSmoothingGamma:
return QVariant(QWindowsFontDatabase::fontSmoothingGamma());
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index ec37c4bbef..d3a3468037 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -796,10 +796,10 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
// Get the modifier states (may be altered later, depending on key code)
int state = 0;
- state |= (nModifiers & ShiftAny ? Qt::ShiftModifier : 0);
- state |= (nModifiers & ControlAny ? Qt::ControlModifier : 0);
- state |= (nModifiers & AltAny ? Qt::AltModifier : 0);
- state |= (nModifiers & MetaAny ? Qt::MetaModifier : 0);
+ state |= (nModifiers & ShiftAny ? int(Qt::ShiftModifier) : 0);
+ state |= (nModifiers & ControlAny ? int(Qt::ControlModifier) : 0);
+ state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0);
+ state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0);
// Now we know enough to either have MapVirtualKey or our own keymap tell us if it's a deadkey
const bool isDeadKey = isADeadKey(msg.wParam, state)
@@ -920,7 +920,7 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms
case Qt::Key_9:
state |= ((msg.wParam >= '0' && msg.wParam <= '9')
|| (msg.wParam >= VK_OEM_PLUS && msg.wParam <= VK_OEM_3))
- ? 0 : Qt::KeypadModifier;
+ ? 0 : int(Qt::KeypadModifier);
default:
if ((uint)msg.lParam == 0x004c0001 || (uint)msg.lParam == 0xc04c0001)
state |= Qt::KeypadModifier;
diff --git a/src/plugins/platforms/windows/qwindowsmime.cpp b/src/plugins/platforms/windows/qwindowsmime.cpp
index 963ee88423..3c87a3a18d 100644
--- a/src/plugins/platforms/windows/qwindowsmime.cpp
+++ b/src/plugins/platforms/windows/qwindowsmime.cpp
@@ -150,7 +150,8 @@ static bool qt_write_dibv5(QDataStream &s, QImage image)
//depth will be always 32
int bpl_bmp = image.width()*4;
- BMP_BITMAPV5HEADER bi ={0};
+ BMP_BITMAPV5HEADER bi;
+ ZeroMemory(&bi, sizeof(bi));
bi.bV5Size = sizeof(BMP_BITMAPV5HEADER);
bi.bV5Width = image.width();
bi.bV5Height = image.height();
diff --git a/src/widgets/dialogs/qwizard_win.cpp b/src/widgets/dialogs/qwizard_win.cpp
index 6359ebfb09..4a4f109a82 100644
--- a/src/widgets/dialogs/qwizard_win.cpp
+++ b/src/widgets/dialogs/qwizard_win.cpp
@@ -306,7 +306,7 @@ bool QVistaHelper::setDWMTitleBar(TitleBarChangeType type)
{
bool value = false;
if (vistaState() == VistaAero) {
- WIZ_MARGINS mar = {0};
+ WIZ_MARGINS mar = {0, 0, 0, 0};
if (type == NormalTitleBar)
mar.cyTopHeight = 0;
else
@@ -639,13 +639,14 @@ bool QVistaHelper::eventFilter(QObject *obj, QEvent *event)
HFONT QVistaHelper::getCaptionFont(HANDLE hTheme)
{
- LOGFONT lf = {0};
+ LOGFONT lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, { 0 } };
if (!hTheme)
pGetThemeSysFont(hTheme, WIZ_TMT_CAPTIONFONT, &lf);
else
{
- NONCLIENTMETRICS ncm = {sizeof(NONCLIENTMETRICS)};
+ NONCLIENTMETRICS ncm;
+ ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false);
lf = ncm.lfMessageFont;
}
@@ -662,7 +663,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
// Set up a memory DC and bitmap that we'll draw into
HDC dcMem;
HBITMAP bmp;
- BITMAPINFO dib = {{0}};
+ BITMAPINFO dib;
+ ZeroMemory(&dib, sizeof(dib));
dcMem = CreateCompatibleDC(hdc);
dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -680,7 +682,8 @@ bool QVistaHelper::drawTitleText(QPainter *painter, const QString &text, const Q
HFONT hOldFont = (HFONT)SelectObject(dcMem, (HGDIOBJ) hCaptionFont);
// Draw the text!
- WIZ_DTTOPTS dto = { sizeof(WIZ_DTTOPTS) };
+ WIZ_DTTOPTS dto;
+ dto.dwSize = sizeof(WIZ_DTTOPTS);
const UINT uFormat = WIZ_DT_SINGLELINE|WIZ_DT_CENTER|WIZ_DT_VCENTER|WIZ_DT_NOPREFIX;
RECT rctext ={0,0, rect.width(), rect.height()};
@@ -708,7 +711,8 @@ bool QVistaHelper::drawBlackRect(const QRect &rect, HDC hdc)
// Set up a memory DC and bitmap that we'll draw into
HDC dcMem;
HBITMAP bmp;
- BITMAPINFO dib = {{0}};
+ BITMAPINFO dib;
+ ZeroMemory(&dib, sizeof(dib));
dcMem = CreateCompatibleDC(hdc);
dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/src/widgets/util/qsystemtrayicon_win.cpp b/src/widgets/util/qsystemtrayicon_win.cpp
index 731b547e2a..e81a8eee93 100644
--- a/src/widgets/util/qsystemtrayicon_win.cpp
+++ b/src/widgets/util/qsystemtrayicon_win.cpp
@@ -466,7 +466,7 @@ QRect QSystemTrayIconSys::findIconGeometry(const int iconId)
if (currentIconHandle == m_hwnd &&
currentIconId == iconId && !isHidden) {
SendMessage(trayHandle, TB_GETITEMRECT, toolbarButton , (LPARAM)data);
- RECT iconRect = {0, 0};
+ RECT iconRect = {0, 0, 0, 0};
if(ReadProcessMemory(trayProcess, data, &iconRect, sizeof(RECT), &numBytes)) {
MapWindowPoints(trayHandle, NULL, (LPPOINT)&iconRect, 2);
QRect geometry(iconRect.left + 1, iconRect.top + 1,