summaryrefslogtreecommitdiffstats
path: root/src/widgets
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/widgets
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/widgets')
-rw-r--r--src/widgets/dialogs/qwizard_win.cpp16
-rw-r--r--src/widgets/util/qsystemtrayicon_win.cpp2
2 files changed, 11 insertions, 7 deletions
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,