diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index f61e40ef77..17420d271d 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -362,7 +362,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) style = CS_DBLCLKS; if (w->inherits("QTipLabel") || w->inherits("QAlphaWidget")) { if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { style |= CS_DROPSHADOW; } cname += QStringLiteral("QToolTip"); @@ -375,7 +375,7 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) cname += QStringLiteral("QPopup"); style = CS_DBLCLKS|CS_SAVEBITS; if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) style |= CS_DROPSHADOW; icon = false; } else { diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 8a75353c86..ac19ec8d22 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -573,7 +573,7 @@ public: } #if !defined(QT_NO_STYLE_WINDOWSVISTA) if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) vistaInitPending = true; #endif } diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 88c41a5fba..9d3493dc8a 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -291,7 +291,7 @@ void QWhatsThat::paintEvent(QPaintEvent*) bool drawShadow = true; #if defined(Q_WS_WIN) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { BOOL shadow; SystemParametersInfo(SPI_GETDROPSHADOW, 0, &shadow, 0); diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp index ef555fbdb1..9ed452b516 100644 --- a/src/widgets/styles/qstylefactory.cpp +++ b/src/widgets/styles/qstylefactory.cpp @@ -218,12 +218,12 @@ QStringList QStyleFactory::keys() #endif #ifndef QT_NO_STYLE_WINDOWSXP if (!list.contains(QLatin1String("WindowsXP")) && - (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) list << QLatin1String("WindowsXP"); #endif #ifndef QT_NO_STYLE_WINDOWSVISTA if (!list.contains(QLatin1String("WindowsVista")) && - (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) + (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) list << QLatin1String("WindowsVista"); #endif #ifndef QT_NO_STYLE_MOTIF diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 99a78520d5..1cd53c8073 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -121,7 +121,7 @@ QWindowsStylePrivate::QWindowsStylePrivate() { #if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { QSystemLibrary shellLib(QLatin1String("shell32")); pSHGetStockIconInfo = (PtrSHGetStockIconInfo)shellLib.resolve("SHGetStockIconInfo"); } @@ -1045,7 +1045,7 @@ QPixmap QWindowsStyle::standardPixmap(StandardPixmap standardPixmap, const QStyl case SP_VistaShield: { if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) && pSHGetStockIconInfo) { QPixmap pixmap; @@ -1187,7 +1187,7 @@ int QWindowsStyle::styleHint(StyleHint hint, const QStyleOption *opt, const QWid case SH_LineEdit_PasswordCharacter: { #ifdef Q_OS_WIN - if (widget && (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { + if (widget && (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { const QFontMetrics &fm = widget->fontMetrics(); if (fm.inFont(QChar(0x25CF))) ret = 0x25CF; @@ -3190,7 +3190,7 @@ QIcon QWindowsStyle::standardIconImplementation(StandardPixmap standardIcon, con case SP_VistaShield: { if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA - && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based + && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) && pSHGetStockIconInfo) { icon.addPixmap(proxy()->standardPixmap(SP_VistaShield, option, widget)); //fetches small icon diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index c18b2266b8..78d4e7b9ce 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -138,7 +138,7 @@ bool QWindowsVistaStylePrivate::useVista() { return (QWindowsVistaStylePrivate::useXP() && (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && - QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)); + (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))); } /*! diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 8b745ba114..f40bd22fca 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -866,7 +866,7 @@ void QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(XPThemeData &themeDa inspectData = (tmt_transparentcolor != 0 || tmt_borderonly || proporigin == PO_PART || proporigin == PO_STATE); // ### This is a vista-specific workaround for broken alpha in titlebar pixmaps - if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) { + if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based))) { if (themeData.partId == WP_CAPTION || themeData.partId == WP_SMALLCAPTION) inspectData = false; } diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index b96d3f7095..d9862affed 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -213,10 +213,10 @@ void tst_QStyle::testStyleFactory() #endif #ifdef Q_WS_WIN if (QSysInfo::WindowsVersion >= QSysInfo::WV_XP && - QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) QVERIFY(keys.contains("WindowsXP")); if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && - QSysInfo::WindowsVersion < QSysInfo::WV_NT_based) + (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) QVERIFY(keys.contains("WindowsVista")); #endif